]> granicus.if.org Git - curl/commitdiff
cmake: offer CMAKE_DEBUG_POSTFIX when building with MSVC
authorPaul Harris <paulharris@computer.org>
Thu, 6 Jul 2017 15:53:41 +0000 (23:53 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 7 Jul 2017 12:29:26 +0000 (14:29 +0200)
Removes BUILD_RELEASE_DEBUG_DIRS since it wasn't used anywhere.

Closes #1649

CMakeLists.txt
lib/CMakeLists.txt

index 25d8fd8f0f998258f7159030f8b7debd6029226a..8646c6adc4664ccd80835faad41bafb50b5fb834 100644 (file)
@@ -104,6 +104,9 @@ if (ENABLE_CURLDEBUG)
   set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS CURLDEBUG)
 endif()
 
+# For debug libs and exes, add "-d" postfix
+set(CMAKE_DEBUG_POSTFIX "-d" CACHE STRING "Set debug library postfix" FORCE)
+
 # initialize CURL_LIBS
 set(CURL_LIBS "")
 
@@ -118,11 +121,6 @@ if(ENABLE_ARES)
   set(CURL_LIBS ${CURL_LIBS} ${CARES_LIBRARY})
 endif()
 
-if(MSVC)
-  option(BUILD_RELEASE_DEBUG_DIRS "Set OFF to build each configuration to a separate directory" OFF)
-  mark_as_advanced(BUILD_RELEASE_DEBUG_DIRS)
-endif()
-
 include(CurlSymbolHiding)
 
 option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
index f6dcbbc31343caef24e2314d5e1ade0874dc61e1..667754480205a42baedfbcde9aba503deb9d9436 100644 (file)
@@ -97,6 +97,13 @@ 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()