From 22ecbd5bdaec83f9714d21b1510ddc29d8596bc6 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 9 Dec 2019 05:11:48 +0300 Subject: common.cmake: user switches may be set in CMakeLists.txt --- common.cmake | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'common.cmake') 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}") -- cgit v1.2.3