diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-10-26 14:28:41 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-10-26 14:28:41 +0300 |
commit | 1bd6e78c041627e51cba3420eade552721da8816 (patch) | |
tree | abb77468dfa2bc3e3ef74440afbbf4383cdc4360 | |
parent | refactoring (diff) | |
download | privilege-check-1bd6e78c041627e51cba3420eade552721da8816.tar.gz privilege-check-1bd6e78c041627e51cba3420eade552721da8816.zip |
CMakeLists.txt update
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 21b9071..7f0db31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,20 +10,20 @@ project(privilege_check CXX) if(MSVC) add_compile_options(/MP /W4) -elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +elseif(CMAKE_COMPILER_IS_GNUCXX) add_compile_options(-Wall -Wextra) endif() -get_directory_property(PRIVILEGE_CHECK_PARENT_DIRECTORY PARENT_DIRECTORY) -set(PRIVILEGE_CHECK_IS_ROOT $<NOT:PRIVILEGE_CHECK_PARENT_DIRECTORY>) +get_directory_property(parent_directory PARENT_DIRECTORY) +set(is_root $<NOT:parent_directory>) -function(privilege_check_use_static_runtime target) - if(TARGET ${target} AND PRIVILEGE_CHECK_IS_ROOT) +function(use_static_runtime target) + if(TARGET ${target} AND is_root) if(MSVC) target_compile_options(${target} PRIVATE $<$<CONFIG:Release>:/MT> $<$<CONFIG:Debug>:/MTd>) - elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + elseif(CMAKE_COMPILER_IS_GNUCXX) get_target_property(type ${target} TYPE) if(type STREQUAL EXECUTABLE) target_link_libraries(${target} PRIVATE @@ -37,8 +37,8 @@ endfunction() macro(add_executable target) _add_executable(${ARGV}) if(TARGET ${target}) - privilege_check_use_static_runtime(${target}) - if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + use_static_runtime(${target}) + if(CMAKE_COMPILER_IS_GNUCXX) target_link_libraries(${target} PRIVATE $<$<CONFIG:Release>:-s>) endif() endif() @@ -52,7 +52,7 @@ add_executable(${PROJECT_NAME} WIN32 ${${PROJECT_NAME}_header_files} ${${PROJECT_NAME}_resource_files}) -if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +if(CMAKE_COMPILER_IS_GNUCXX) target_compile_options(${PROJECT_NAME} PRIVATE -std=c++11) endif() |