aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMSetupVersionTest/new_project_header
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ECMSetupVersionTest/new_project_header')
-rw-r--r--tests/ECMSetupVersionTest/new_project_header/CMakeLists.txt26
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}")