Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CMAKE_* variable to set default properties for issue #15
- Loading branch information
Showing
4 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
cmake_minimum_required (VERSION 3.5) | ||
project(checkprop) | ||
|
||
find_package(BCM) | ||
|
||
include(BCMProperties) | ||
|
||
get_property(CURRENT_PROP_VAL GLOBAL PROPERTY ${PROP_NAME}) | ||
|
||
if(NOT "${CURRENT_PROP_VAL}" STREQUAL "${PROP_VALUE}") | ||
message(FATAL_ERROR "Property ${PROP_NAME} set to ${CURRENT_PROP_VAL}, expected ${PROP_VALUE}") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
macro(check_prop PROP_NAME VAR_NAME PROP_VALUE) | ||
build_dir(${TEST_DIR}/checkprop CMAKE_ARGS | ||
-D${VAR_NAME}=${PROP_VALUE} | ||
-DPROP_NAME=${PROP_NAME} | ||
-DPROP_VALUE=${PROP_VALUE}) | ||
endmacro() | ||
|
||
foreach(VALUE On Off 1 0) | ||
check_prop(CXX_EXCEPTIONS CMAKE_CXX_EXCEPTIONS ${VALUE}) | ||
check_prop(CXX_RTTI CMAKE_CXX_RTTI ${VALUE}) | ||
check_prop(CXX_STATIC_RUNTIME CMAKE_CXX_STATIC_RUNTIME ${VALUE}) | ||
check_prop(CXX_WARNINGS CMAKE_CXX_WARNINGS ${VALUE}) | ||
check_prop(CXX_WARNINGS_AS_ERRORS CMAKE_CXX_WARNINGS_AS_ERRORS ${VALUE}) | ||
endforeach() | ||
check_prop(CXX_WARNINGS CMAKE_CXX_WARNINGS ALL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters