diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-06-09 17:29:16 +0000 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-06-09 17:29:16 +0000 |
commit | 744dceaffe4f79293b6bdd9eefe64ca83c701876 (patch) | |
tree | 6613db6d276ab8502e3073ad9a5ce144302afbef /src/CMakeLists.txt | |
parent | 8740d147c943f6d76194cb8c4e1e509c405722c6 (diff) | |
download | curl-744dceaffe4f79293b6bdd9eefe64ca83c701876.tar.gz |
ENH: lower case cmake functions and remove tabs and re-indent cmake code
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e636eb1c3..c6871787c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,39 +1,39 @@ -SET(EXE_NAME curl) +set(EXE_NAME curl) # First try to locate hugehelp.c to see if it has already been created # 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. -FIND_FILE(HUGEHELP_C_FILE hugehelp.c PATHS . NO_DEFAULT_PATH) -IF (NOT HUGEHELP_C_FILE) - MESSAGE(STATUS "Warning: hugehelp.c file was not generated before. Generating an 'empty' file...") - FILE(WRITE hugehelp.c "/* built-in manual is disabled, blank function */\n#include \"hugehelp.h\"\nvoid hugehelp(void) {}\n\n") -ENDIF() +find_file(HUGEHELP_C_FILE hugehelp.c PATHS . NO_DEFAULT_PATH) +if (NOT HUGEHELP_C_FILE) + message(STATUS "Warning: hugehelp.c file was not generated before. Generating an 'empty' file...") + file(WRITE hugehelp.c "/* built-in manual is disabled, blank function */\n#include \"hugehelp.h\"\nvoid hugehelp(void) {}\n\n") +endif() -TRANSFORM_MAKEFILE_INC("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake) +transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") +include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake) -IF(MSVC) - LIST(APPEND CURL_SOURCE curl.rc) -ENDIF() +if(MSVC) + list(APPEND CURL_SOURCE curl.rc) +endif() -ADD_EXECUTABLE( - ${EXE_NAME} - ${curl_SOURCES} -) +add_executable( + ${EXE_NAME} + ${curl_SOURCES} + ) -SOURCE_GROUP("cURLX source files" FILES ${CURLX_ONES}) -SOURCE_GROUP("cURL source files" FILES ${CURL_SOURCES}) -SOURCE_GROUP("cURL header files" FILES ${CURL_HFILES}) +source_group("cURLX source files" FILES ${CURLX_ONES}) +source_group("cURL source files" FILES ${CURL_SOURCES}) +source_group("cURL header files" FILES ${CURL_HFILES}) -INCLUDE_DIRECTORIES( - ${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h" - ${CURL_BINARY_DIR}/lib # To be able to reach "config.h" - ${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h" -) +include_directories( + ${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h" + ${CURL_BINARY_DIR}/lib # To be able to reach "config.h" + ${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h" + ) # Setup dependencies -SETUP_CURL_DEPENDENCIES(${EXE_NAME}) -TARGET_LINK_LIBRARIES( ${EXE_NAME} libcurl ) +setup_curl_dependencies(${EXE_NAME}) +target_link_libraries( ${EXE_NAME} libcurl ) ################################################################################ @@ -43,13 +43,14 @@ TARGET_LINK_LIBRARIES( ${EXE_NAME} libcurl ) #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 -SET_TARGET_PROPERTIES(${EXE_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}") - -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() +set_target_properties(${EXE_NAME} PROPERTIES + DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}") + +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() #INCLUDE(ModuleInstall OPTIONAL) |