diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CMakeLists.txt | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 12b422e5a..699b4f1c1 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,56 +1,56 @@ -SET(LIB_NAME libcurl) +set(LIB_NAME libcurl) -CONFIGURE_FILE(${CURL_SOURCE_DIR}/include/curl/curlbuild.h.cmake +configure_file(${CURL_SOURCE_DIR}/include/curl/curlbuild.h.cmake ${CURL_BINARY_DIR}/include/curl/curlbuild.h) -CONFIGURE_FILE(config.h.cmake +configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) -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) -LIST(APPEND HHEADERS - ${CMAKE_CURRENT_BINARY_DIR}/config.h - ${CURL_BINARY_DIR}/include/curl/curlbuild.h -) +list(APPEND HHEADERS + ${CMAKE_CURRENT_BINARY_DIR}/config.h + ${CURL_BINARY_DIR}/include/curl/curlbuild.h + ) -IF(MSVC) - LIST(APPEND CSOURCES libcurl.rc) -ENDIF() +if(MSVC) + list(APPEND CSOURCES libcurl.rc) +endif() # SET(CSOURCES - # # memdebug.c -not used - # # nwlib.c - Not used - # # strtok.c - specify later - # # strtoofft.c - specify later +# # memdebug.c -not used +# # nwlib.c - Not used +# # strtok.c - specify later +# # strtoofft.c - specify later # ) # # if we have Kerberos 4, right now this is never on # #OPTION(CURL_KRB4 "Use Kerberos 4" OFF) # IF(CURL_KRB4) - # SET(CSOURCES ${CSOURCES} - # krb4.c - # security.c - # ) +# SET(CSOURCES ${CSOURCES} +# krb4.c +# security.c +# ) # ENDIF(CURL_KRB4) # #OPTION(CURL_MALLOC_DEBUG "Debug mallocs in Curl" OFF) # MARK_AS_ADVANCED(CURL_MALLOC_DEBUG) # IF(CURL_MALLOC_DEBUG) - # SET(CSOURCES ${CSOURCES} - # memdebug.c - # ) +# SET(CSOURCES ${CSOURCES} +# memdebug.c +# ) # ENDIF(CURL_MALLOC_DEBUG) # # only build compat strtoofft if we need to # IF(NOT HAVE_STRTOLL AND NOT HAVE__STRTOI64) - # SET(CSOURCES ${CSOURCES} - # strtoofft.c - # ) +# SET(CSOURCES ${CSOURCES} +# strtoofft.c +# ) # ENDIF(NOT HAVE_STRTOLL AND NOT HAVE__STRTOI64) -IF(HAVE_FEATURES_H) - SET_SOURCE_FILES_PROPERTIES( +if(HAVE_FEATURES_H) + set_source_files_properties( cookie.c easy.c formdata.c @@ -65,57 +65,57 @@ IF(HAVE_FEATURES_H) transfer.c url.c COMPILE_FLAGS -D_BSD_SOURCE) -ENDIF(HAVE_FEATURES_H) +endif(HAVE_FEATURES_H) # The rest of the build -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/..) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/../include) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) -IF(CURL_STATICLIB) - # Static lib - SET(CURL_USER_DEFINED_DYNAMIC_OR_STATIC STATIC) -ELSE() - # DLL / so dynamic lib - SET(CURL_USER_DEFINED_DYNAMIC_OR_STATIC SHARED) -ENDIF() +if(CURL_STATICLIB) + # Static lib + set(CURL_USER_DEFINED_DYNAMIC_OR_STATIC STATIC) +else() + # DLL / so dynamic lib + set(CURL_USER_DEFINED_DYNAMIC_OR_STATIC SHARED) +endif() -ADD_LIBRARY( - ${LIB_NAME} - ${CURL_USER_DEFINED_DYNAMIC_OR_STATIC} - ${HHEADERS} ${CSOURCES} -) +add_library( + ${LIB_NAME} + ${CURL_USER_DEFINED_DYNAMIC_OR_STATIC} + ${HHEADERS} ${CSOURCES} + ) -TARGET_LINK_LIBRARIES(${LIB_NAME} ${CURL_LIBS}) +target_link_libraries(${LIB_NAME} ${CURL_LIBS}) -IF(WIN32) - ADD_DEFINITIONS( -D_USRDLL ) -ENDIF() +if(WIN32) + add_definitions( -D_USRDLL ) +endif() -SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL) +set_target_properties(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL) -SETUP_CURL_DEPENDENCIES(${LIB_NAME}) +setup_curl_dependencies(${LIB_NAME}) # Remove the "lib" prefix since the library is already named "libcurl". -SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "") -SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "") - -IF(MSVC) - IF(NOT BUILD_RELEASE_DEBUG_DIRS) - # Ugly workaround to remove the "/debug" or "/release" in each output - SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../") - SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../") - ENDIF() -ENDIF() - -IF(WIN32) - IF(NOT CURL_STATICLIB) - # Add "_imp" as a suffix before the extension to avoid conflicting with the statically linked "libcurl.lib" - SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib") - ENDIF() -ENDIF() +set_target_properties(${LIB_NAME} PROPERTIES PREFIX "") +set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "") + +if(MSVC) + if(NOT BUILD_RELEASE_DEBUG_DIRS) + # Ugly workaround to remove the "/debug" or "/release" in each output + set_target_properties(${LIB_NAME} PROPERTIES PREFIX "../") + set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../") + endif() +endif() + +if(WIN32) + if(NOT CURL_STATICLIB) + # Add "_imp" as a suffix before the extension to avoid conflicting with the statically linked "libcurl.lib" + set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib") + endif() +endif() |