diff options
author | Brad King <brad.king@kitware.com> | 2017-06-28 12:53:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-06-28 12:53:30 (GMT) |
commit | 0552747b58799afd6cb23db1cc5296a605cfde18 (patch) | |
tree | 4d8765b3cbc64a3e0ad40d5dcfecf836ec2bb99d /Tests/RunCMake/include_guard/Scripts | |
parent | 45ca0403ac11a78550997a38d9d55a06439220c9 (diff) | |
parent | c96f43b7dd1d41379fe63b4e8b508b2b034520b6 (diff) | |
download | CMake-0552747b58799afd6cb23db1cc5296a605cfde18.zip CMake-0552747b58799afd6cb23db1cc5296a605cfde18.tar.gz CMake-0552747b58799afd6cb23db1cc5296a605cfde18.tar.bz2 |
Merge topic 'feature/include_guard'
c96f43b7 include_guard: add tests for the feature
80f1221f include_guard: add doc pages and a release note
85b52a04 include_guard: add vim syntax highlighting rules
d44bd1c2 include_guard: implement new command
Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !928
Diffstat (limited to 'Tests/RunCMake/include_guard/Scripts')
-rw-r--r-- | Tests/RunCMake/include_guard/Scripts/DirScript.cmake | 12 | ||||
-rw-r--r-- | Tests/RunCMake/include_guard/Scripts/GlobScript.cmake | 12 | ||||
-rw-r--r-- | Tests/RunCMake/include_guard/Scripts/VarScript.cmake | 12 |
3 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RunCMake/include_guard/Scripts/DirScript.cmake b/Tests/RunCMake/include_guard/Scripts/DirScript.cmake new file mode 100644 index 0000000..e61d180 --- /dev/null +++ b/Tests/RunCMake/include_guard/Scripts/DirScript.cmake @@ -0,0 +1,12 @@ +include_guard(DIRECTORY) + +set(prop_name DIR_SCRIPT_COUNT) +get_property(count_is_set GLOBAL PROPERTY ${prop_name} SET) + +if(NOT count_is_set) + set_property(GLOBAL PROPERTY ${prop_name} 1) +else() + get_property(count GLOBAL PROPERTY ${prop_name}) + math(EXPR count "${count} + 1") + set_property(GLOBAL PROPERTY ${prop_name} ${count}) +endif() diff --git a/Tests/RunCMake/include_guard/Scripts/GlobScript.cmake b/Tests/RunCMake/include_guard/Scripts/GlobScript.cmake new file mode 100644 index 0000000..c26bf40 --- /dev/null +++ b/Tests/RunCMake/include_guard/Scripts/GlobScript.cmake @@ -0,0 +1,12 @@ +include_guard(GLOBAL) + +set(prop_name GLOB_SCRIPT_COUNT) +get_property(count_is_set GLOBAL PROPERTY ${prop_name} SET) + +if(NOT count_is_set) + set_property(GLOBAL PROPERTY ${prop_name} 1) +else() + get_property(count GLOBAL PROPERTY ${prop_name}) + math(EXPR count "${count} + 1") + set_property(GLOBAL PROPERTY ${prop_name} ${count}) +endif() diff --git a/Tests/RunCMake/include_guard/Scripts/VarScript.cmake b/Tests/RunCMake/include_guard/Scripts/VarScript.cmake new file mode 100644 index 0000000..3080377 --- /dev/null +++ b/Tests/RunCMake/include_guard/Scripts/VarScript.cmake @@ -0,0 +1,12 @@ +include_guard() + +set(prop_name VAR_SCRIPT_COUNT) +get_property(count_is_set GLOBAL PROPERTY ${prop_name} SET) + +if(NOT count_is_set) + set_property(GLOBAL PROPERTY ${prop_name} 1) +else() + get_property(count GLOBAL PROPERTY ${prop_name}) + math(EXPR count "${count} + 1") + set_property(GLOBAL PROPERTY ${prop_name} ${count}) +endif() |