0b4556f2c8cc09a46e8be4ce71a43decc9b27e0e
[platform/upstream/curl.git] / src / CMakeLists.txt
1 set(EXE_NAME curl)
2
3 # First try to locate tool_hugehelp.c to see if it has already been created
4 # 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.
5 find_file(HUGEHELP_C_FILE tool_hugehelp.c PATHS . NO_DEFAULT_PATH)
6 if (NOT HUGEHELP_C_FILE)
7   message(STATUS "Warning: tool_hugehelp.c file was not generated before. Generating an 'empty' file...")
8   file(WRITE tool_hugehelp.c "/* built-in manual is disabled, blank function */\n#include \"tool_hugehelp.h\"\nvoid hugehelp(void) {}\n\n")
9 endif()
10
11 transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
12 include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake)
13
14 if(MSVC)
15   list(APPEND CURL_SOURCE curl.rc)
16 endif()
17
18 add_executable(
19   ${EXE_NAME}
20   ${curl_SOURCES}
21   )
22
23 source_group("cURLX source files" FILES ${CURLX_ONES})
24 source_group("cURL source files" FILES ${CURL_CFILES})
25 source_group("cURL header files" FILES ${CURL_HFILES})
26
27 include_directories(
28   ${CURL_SOURCE_DIR}/lib        # To be able to reach "curl_setup_once.h"
29   ${CURL_BINARY_DIR}/lib        # To be able to reach "curl_config.h"
30   ${CURL_BINARY_DIR}/include    # To be able to reach "curl/curlbuild.h"
31   )
32
33
34 # Setup dependencies
35 setup_curl_dependencies(${EXE_NAME})
36 target_link_libraries( ${EXE_NAME} libcurl )
37
38
39 ################################################################################
40
41 #SET_TARGET_PROPERTIES(${EXE_NAME} ARCHIVE_OUTPUT_DIRECTORY "blah blah blah")
42 #SET_TARGET_PROPERTIES(${EXE_NAME} RUNTIME_OUTPUT_DIRECTORY "blah blah blah")
43 #SET_TARGET_PROPERTIES(${EXE_NAME} LIBRARY_OUTPUT_DIRECTORY "blah blah blah")
44
45 # Add the postfix to the executable since it is not added automatically as for modules and shared libraries
46 set_target_properties(${EXE_NAME} PROPERTIES
47   DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
48
49 #INCLUDE(ModuleInstall OPTIONAL)
50
51 install(TARGETS ${EXE_NAME} DESTINATION bin)