From: Ralph Langendam Date: Thu, 15 Apr 2021 14:54:23 +0000 (+0200) Subject: cmake: make libcurl library output name configurable X-Git-Tag: curl-7_77_0~165 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1cba36d2166c396f987eea587cf92671b27acb92;p=thirdparty%2Fcurl.git cmake: make libcurl library output name configurable Closes #6899 --- diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index a58b47b865..37ce1c8e27 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -19,7 +19,7 @@ # KIND, either express or implied. # ########################################################################### -set(LIB_NAME libcurl) +set(LIB_NAME libcurl CACHE STRING "Basename of the curl library") if(BUILD_SHARED_LIBS) set(CURL_STATICLIB NO) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0982cfe6e4..3804c26b17 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -97,7 +97,7 @@ include_directories( ) #Build curl executable -target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS}) +target_link_libraries(${EXE_NAME} ${LIB_NAME} ${CURL_LIBS}) ################################################################################ diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt index 2bcf77874f..43a6c41a74 100644 --- a/tests/libtest/CMakeLists.txt +++ b/tests/libtest/CMakeLists.txt @@ -36,7 +36,7 @@ function(setup_test TEST_NAME) # ARGN are the files in the test include_directories(${CARES_INCLUDE_DIR}) endif() - target_link_libraries(${TEST_NAME} libcurl ${CURL_LIBS}) + target_link_libraries(${TEST_NAME} ${LIB_NAME} ${CURL_LIBS}) set_target_properties(${TEST_NAME} PROPERTIES COMPILE_DEFINITIONS ${UPPER_TEST_NAME}) diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index a680c53089..889c792d36 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -63,7 +63,7 @@ foreach(_testfile ${UT_SRC}) get_filename_component(_testname ${_testfile} NAME_WE) add_executable(${_testname} EXCLUDE_FROM_ALL ${_testfile} ${UT_COMMON_FILES}) #add_dependencies(testdeps ${_testname}) - target_link_libraries(${_testname} libcurl ${CURL_LIBS}) + target_link_libraries(${_testname} ${LIB_NAME} ${CURL_LIBS}) set_target_properties(${_testname} PROPERTIES COMPILE_DEFINITIONS "UNITTESTS") endforeach()