diff options
author | Donovan Baarda <abo@minkirri.apana.org.au> | 2021-08-10 17:43:37 +1000 |
---|---|---|
committer | Donovan Baarda <abo@minkirri.apana.org.au> | 2021-08-10 17:43:37 +1000 |
commit | 41bd2ba44bcca76ae7fd600e0da182066b9ba13d (patch) | |
tree | 64d645c4d34a3b525ee9a9961fe4ab39d049114c /CMakeLists.txt | |
parent | 5d4a90e34b6cb8912f566993745ed91a3bdd95f4 (diff) | |
download | librsync-41bd2ba44bcca76ae7fd600e0da182066b9ba13d.tar.gz |
Add BuildType.cmake for managing CMAKE_BUILD_TYPE better.
This is an idea taken from the following post;
https://blog.kitware.com/cmake-and-the-default-build-type/
It sets the default build type to Debug for git clone, otherwise the default
is Release. It also sets possible values for the cmake-gui or ccmake. It works
with multi-config generators and respects values set on the cmdline.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d688eb..ed31430 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,10 @@ if (NOT CMAKE_SYSTEM_NAME) message(FATAL_ERROR "No target OS set") endif() +# Set CMAKE_BUILD_TYPE if unset. +include(BuildType) +message (STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") + option(BUILD_SHARED_LIBS "Build librsync as a shared library." ON) # Option ENABLE_TRACE defaults to ON for Debug builds. |