]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: set -d postfix for debug builds if not specified
authorSergei Nikulov <sergey.nikulov@gmail.com>
Wed, 23 May 2018 21:37:53 +0000 (00:37 +0300)
committerSergei Nikulov <snikulov@users.noreply.github.com>
Thu, 24 May 2018 14:25:41 +0000 (17:25 +0300)
       using -DCMAKE_DEBUG_POSTFIX explicitly

       fixes #2121, obsoletes #2384

CMakeLists.txt
lib/CMakeLists.txt
src/CMakeLists.txt
tests/libtest/CMakeLists.txt
tests/server/CMakeLists.txt

index bf25b1f792ff20569fc0c8ec2abdb4ba911f3381..b8c79f88a634ed88b0548dc3b57899082e11e766 100644 (file)
@@ -118,7 +118,9 @@ if (ENABLE_CURLDEBUG)
 endif()
 
 # For debug libs and exes, add "-d" postfix
-set(CMAKE_DEBUG_POSTFIX "-d" CACHE STRING "Set debug library postfix")
+if(NOT DEFINED CMAKE_DEBUG_POSTFIX)
+  set(CMAKE_DEBUG_POSTFIX "-d")
+endif()
 
 # initialize CURL_LIBS
 set(CURL_LIBS "")
index 1fabdba908e5e950f9291c1585c59a12af90d247..6653d555f8da9f181fd251dc121e258e5dd89d1b 100644 (file)
@@ -98,13 +98,6 @@ 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")
-
-    set_target_properties (${LIB_NAME} PROPERTIES
-       DEBUG_POSTFIX "-d"
-       # Note: no postfix for release variants, let user choose what style of release he wants
-       # MINSIZEREL_POSTFIX "-z"
-       # RELWITHDEBINFO_POSTFIX "-g"
-       )
   endif()
 endif()
 
index 30c525c44a69692e0d6e47cf1c77b99093a11fb2..7e87f75e6ff07c918e13855ebc63ded0fa853945 100644 (file)
@@ -70,10 +70,6 @@ target_link_libraries( ${EXE_NAME} libcurl ${CURL_LIBS})
 #SET_TARGET_PROPERTIES(${EXE_NAME} RUNTIME_OUTPUT_DIRECTORY "blah blah blah")
 #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}")
-
 #INCLUDE(ModuleInstall OPTIONAL)
 
 install(TARGETS ${EXE_NAME} EXPORT curl-target DESTINATION bin)
index 4d42aa513c394ec8e01e617e3070063b20090321..6211aaae4cbcdfba7549506bae671683c1f81d5a 100644 (file)
@@ -20,12 +20,6 @@ function(SETUP_TEST TEST_NAME)          # ARGN are the files in the test
     PROPERTIES COMPILE_DEFINITIONS ${UPPER_TEST_NAME})
   set_target_properties(${TEST_NAME}
     PROPERTIES PROJECT_LABEL "${TARGET_LABEL_PREFIX}${TEST_NAME}")
-
-  # Add the postfix to the executable since it is
-  # not added automatically as for modules and shared libraries
-  set_target_properties(${TEST_NAME}
-    PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
-
 endfunction()
 
 
index 73841027b54eca0e336b47473007be284840692a..59716fbb35f9ddb3bc579abd6b8ba6455362d7b9 100644 (file)
@@ -31,12 +31,6 @@ function(SETUP_EXECUTABLE TEST_NAME)    # ARGN are the files in the test
   endif()
   set_target_properties(${TEST_NAME} PROPERTIES
     PROJECT_LABEL "${TARGET_LABEL_PREFIX}${TEST_NAME}")
-
-  # Add the postfix to the executable since it is not added
-  # automatically as for modules and shared libraries
-  set_target_properties(${TEST_NAME} PROPERTIES
-    DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
-
 endfunction()