2009-06-09 13:29:16 -04:00
set ( EXE_NAME curl )
2009-04-06 16:44:01 -04:00
2012-12-26 17:30:54 -05:00
# First try to locate tool_hugehelp.c to see if it has already been created
2009-04-06 16:44:01 -04:00
# TODO Find the file WITHOUT adding a cache entry!!! Or else the user can delete the file after the script was first run, and the script won't notice it has gone.
2012-12-26 17:30:54 -05:00
find_file ( HUGEHELP_C_FILE tool_hugehelp.c PATHS . NO_DEFAULT_PATH )
2009-06-09 13:29:16 -04:00
if ( NOT HUGEHELP_C_FILE )
2012-12-26 17:30:54 -05:00
message ( STATUS "Warning: tool_hugehelp.c file was not generated before. Generating an 'empty' file..." )
file ( WRITE tool_hugehelp.c "/* built-in manual is disabled, blank function */\n#include \" tool_hugehelp.h\ "\nvoid hugehelp(void) {}\n\n" )
2009-06-09 13:29:16 -04:00
endif ( )
2009-04-06 16:44:01 -04:00
2009-06-09 13:29:16 -04:00
transform_makefile_inc ( "Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake" )
include ( ${ CMAKE_CURRENT_BINARY_DIR } /Makefile.inc.cmake )
2009-04-06 16:44:01 -04:00
2009-06-09 13:29:16 -04:00
if ( MSVC )
list ( APPEND CURL_SOURCE curl.rc )
endif ( )
2009-04-06 16:44:01 -04:00
2009-06-09 13:29:16 -04:00
add_executable (
$ { E X E _ N A M E }
2010-08-02 06:24:54 -04:00
$ { c u r l _ S O U R C E S }
2009-06-09 13:29:16 -04:00
)
2009-04-06 16:44:01 -04:00
2009-06-09 13:29:16 -04:00
source_group ( "cURLX source files" FILES ${ CURLX_ONES } )
2010-08-02 06:24:54 -04:00
source_group ( "cURL source files" FILES ${ CURL_CFILES } )
2009-06-09 13:29:16 -04:00
source_group ( "cURL header files" FILES ${ CURL_HFILES } )
2009-04-06 16:44:01 -04:00
2009-06-09 13:29:16 -04:00
include_directories (
2013-01-06 13:06:49 -05:00
$ { C U R L _ S O U R C E _ D I R } / l i b # To be able to reach "curl_setup_once.h"
$ { C U R L _ B I N A R Y _ D I R } / l i b # To be able to reach "curl_config.h"
2009-06-09 13:29:16 -04:00
$ { C U R L _ B I N A R Y _ D I R } / i n c l u d e # To be able to reach "curl/curlbuild.h"
)
2009-04-06 16:44:01 -04:00
# Setup dependencies
2009-06-09 13:29:16 -04:00
setup_curl_dependencies ( ${ EXE_NAME } )
target_link_libraries ( ${ EXE_NAME } libcurl )
2009-04-06 16:44:01 -04:00
################################################################################
#SET_TARGET_PROPERTIES(${EXE_NAME} ARCHIVE_OUTPUT_DIRECTORY "blah blah blah")
#SET_TARGET_PROPERTIES(${EXE_NAME} RUNTIME_OUTPUT_DIRECTORY "blah blah blah")
#SET_TARGET_PROPERTIES(${EXE_NAME} LIBRARY_OUTPUT_DIRECTORY "blah blah blah")
# Add the postfix to the executable since it is not added automatically as for modules and shared libraries
2010-02-14 14:40:18 -05:00
set_target_properties ( ${ EXE_NAME } PROPERTIES
2009-06-09 13:29:16 -04:00
D E B U G _ P O S T F I X " $ { C M A K E _ D E B U G _ P O S T F I X } " )
if ( MSVC )
if ( NOT BUILD_RELEASE_DEBUG_DIRS )
# Ugly workaround to remove the "/debug" or "/release" in each output
set_target_properties ( ${ EXE_NAME } PROPERTIES PREFIX "../" )
endif ( )
endif ( )
2009-04-06 16:44:01 -04:00
#INCLUDE(ModuleInstall OPTIONAL)
2011-04-27 16:05:07 -04:00
install ( TARGETS ${ EXE_NAME } DESTINATION bin )