diff options
author | dartraiden <wowemuh@gmail.com> | 2018-09-07 00:27:45 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2018-09-07 00:29:12 +0300 |
commit | dc059a02a3d8d1f3f509ba31b7618cee001cba93 (patch) | |
tree | a61572eda5489fcac8a2bbe896a788b297b8257a /libs/libcurl/src/CMakeLists.txt | |
parent | a0fa47ed9d7be66a62f1cd05bc9577588c04a4fe (diff) |
libcurl: update to 7.61.1
Diffstat (limited to 'libs/libcurl/src/CMakeLists.txt')
-rw-r--r-- | libs/libcurl/src/CMakeLists.txt | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/libs/libcurl/src/CMakeLists.txt b/libs/libcurl/src/CMakeLists.txt index 6653d555f8..87cbe8174c 100644 --- a/libs/libcurl/src/CMakeLists.txt +++ b/libs/libcurl/src/CMakeLists.txt @@ -1,5 +1,13 @@ set(LIB_NAME libcurl) +if(BUILD_SHARED_LIBS) + set(CURL_STATICLIB NO) +else() + set(CURL_STATICLIB YES) +endif() + +# Use: +# * CURL_STATICLIB configure_file(curl_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/curl_config.h) @@ -59,28 +67,23 @@ if(USE_ARES) include_directories(${CARES_INCLUDE_DIR}) 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} ) -if(MSVC AND CURL_STATICLIB) +if(MSVC AND NOT BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES STATIC_LIBRARY_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) endif() +if(NOT BUILD_SHARED_LIBS) + set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_COMPILE_DEFINITIONS CURL_STATICLIB) +endif() + target_link_libraries(${LIB_NAME} ${CURL_LIBS}) if(WIN32) - add_definitions( -D_USRDLL ) + add_definitions(-D_USRDLL) endif() set_target_properties(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL) @@ -95,14 +98,14 @@ set_target_properties(${LIB_NAME} PROPERTIES PREFIX "") set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "") if(WIN32) - if(NOT CURL_STATICLIB) + if(BUILD_SHARED_LIBS) # 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() target_include_directories(${LIB_NAME} INTERFACE - $<INSTALL_INTERFACE:include>) + $<INSTALL_INTERFACE:include>) install(TARGETS ${LIB_NAME} EXPORT libcurl-target |