diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-09 05:11:48 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-09 05:11:48 +0300 |
commit | 22ecbd5bdaec83f9714d21b1510ddc29d8596bc6 (patch) | |
tree | 73c10c79d8bd21311d9ecdb23c3f8b443047faef | |
parent | split compiler options & Windows macros (diff) | |
download | cmake-common-22ecbd5bdaec83f9714d21b1510ddc29d8596bc6.tar.gz cmake-common-22ecbd5bdaec83f9714d21b1510ddc29d8596bc6.zip |
common.cmake: user switches may be set in CMakeLists.txt
-rw-r--r-- | common.cmake | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/common.cmake b/common.cmake index c2527de..b1ea33e 100644 --- a/common.cmake +++ b/common.cmake @@ -48,11 +48,21 @@ if(parent_directory) set(default_value OFF) endif() -set(CC_CXX_STANDARD "14" CACHE STRING "C++ standard version") -option(CC_BEST_PRACTICES "Set common compiler options" "${default_value}") -option(CC_WINDOWS_DEF "Define useful Windows macros" "${default_value}") -option(CC_STATIC_RUNTIME "Link the runtime statically" "${default_value}") -option(CC_STRIP_SYMBOLS "Strip debug symbols" "${default_value}") +if(NOT DEFINED CC_CXX_STANDARD) + set(CC_CXX_STANDARD "14" CACHE STRING "C++ standard version") +endif() +if(NOT DEFINED CC_BEST_PRACTICES) + option(CC_BEST_PRACTICES "Set common compiler options" "${default_value}") +endif() +if(NOT DEFINED CC_WINDOWS_DEF) + option(CC_WINDOWS_DEF "Define useful Windows macros" "${default_value}") +endif() +if(NOT DEFINED CC_STATIC_RUNTIME) + option(CC_STATIC_RUNTIME "Link the runtime statically" "${default_value}") +endif() +if(NOT DEFINED CC_STRIP_SYMBOLS) + option(CC_STRIP_SYMBOLS "Strip debug symbols" "${default_value}") +endif() option(Boost_USE_STATIC_LIBS "Use the static Boost libraries" "${default_value}") option(Boost_USE_STATIC_RUNTIME "Use Boost libraries linked to the runtime statically" "${CC_STATIC_RUNTIME}") |