diff options
author | Alex Merry <alex.merry@kde.org> | 2014-12-28 16:32:13 +0000 |
---|---|---|
committer | Alex Merry <alex.merry@kde.org> | 2014-12-28 17:30:11 +0000 |
commit | f8af407eba5c5ea45be2c6351cf41a7cb44fed21 (patch) | |
tree | 0c3326caf677883ec00e292312213acefe366877 /tests/ECMSetupVersionTest/new_project_header | |
parent | 351fe45dba7ac04ec2779b7d761ac55a58f89945 (diff) | |
download | extra-cmake-modules-f8af407eba5c5ea45be2c6351cf41a7cb44fed21.tar.gz extra-cmake-modules-f8af407eba5c5ea45be2c6351cf41a7cb44fed21.tar.bz2 |
Improve version file tests.
Mostly just refatoring to have less duplicated code.
Diffstat (limited to 'tests/ECMSetupVersionTest/new_project_header')
-rw-r--r-- | tests/ECMSetupVersionTest/new_project_header/CMakeLists.txt | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/tests/ECMSetupVersionTest/new_project_header/CMakeLists.txt b/tests/ECMSetupVersionTest/new_project_header/CMakeLists.txt index 00e12177..a7ccc18b 100644 --- a/tests/ECMSetupVersionTest/new_project_header/CMakeLists.txt +++ b/tests/ECMSetupVersionTest/new_project_header/CMakeLists.txt @@ -9,29 +9,9 @@ ecm_setup_version(PROJECT VERSION_HEADER "ecm_new_project_header_version.h" ) -macro(strcheck var val) - if(NOT ${var} STREQUAL "${val}") - message(FATAL_ERROR "${var} was ${${var}} instead of ${val}") - endif() -endmacro() -macro(numcheck var val) - if(NOT ${var} EQUAL "${val}") - message(FATAL_ERROR "${var} was ${${var}} instead of ${val}") - endif() -endmacro() - -strcheck(PROJECT_VERSION "2.3.4") -strcheck(PROJECT_VERSION_STRING "2.3.4") -numcheck(PROJECT_VERSION_MAJOR 2) -numcheck(PROJECT_VERSION_MINOR 3) -numcheck(PROJECT_VERSION_PATCH 4) - -strcheck(new_project_header_VERSION "2.3.4") -strcheck(new_project_header_VERSION_STRING "2.3.4") -numcheck(new_project_header_VERSION_MAJOR 2) -numcheck(new_project_header_VERSION_MINOR 3) -numcheck(new_project_header_VERSION_PATCH 4) -numcheck(new_project_header_SOVERSION 2) +include(../version_helpers.cmake) +# NB: name comes from project() command +standard_version_var_checks(new_project_header 2.3.4) add_executable(check_header main.c) target_include_directories(check_header PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") |