diff options
author | Sergei Nikulov <sergey.nikulov@gmail.com> | 2015-03-03 02:15:38 +0300 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-03-05 09:26:08 +0100 |
commit | 1a62b6e68c08c7e471ff22dd92932aba7e026817 (patch) | |
tree | 72b478acb99964bed99d18ed7d11b321dc7bc20a /CMakeLists.txt | |
parent | ae8235571ffd2f6c79631a2dd9cf90c519abe3a6 (diff) | |
download | curl-1a62b6e68c08c7e471ff22dd92932aba7e026817.tar.gz |
cmake: handle build definitions CURLDEBUG/DEBUGBUILD
Acked-by: Brad King
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a5226d4e..1e0f86848 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,24 @@ option(BUILD_CURL_TESTS "Set to ON to build cURL tests." ON) option(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF) option(ENABLE_ARES "Set to ON to enable c-ares support" OFF) option(ENABLE_THREADED_RESOLVER "Set to ON to enable POSIX threaded DNS lookup" OFF) + +option(ENABLE_DEBUG "Set to ON to enable curl debug features" OFF) +option(ENABLE_CURLDEBUG "Set to ON to build with TrackMemory feature enabled" OFF) + +if (ENABLE_DEBUG) + # DEBUGBUILD will be defined only for Debug builds + if(NOT CMAKE_VERSION VERSION_LESS 3.0) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUGBUILD>) + else() + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUGBUILD) + endif() + set(ENABLE_CURLDEBUG ON) +endif() + +if (ENABLE_CURLDEBUG) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS CURLDEBUG) +endif() + # initialize CURL_LIBS set(CURL_LIBS "") |