aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMSetupVersionTest/new_project_version_file
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ECMSetupVersionTest/new_project_version_file')
-rw-r--r--tests/ECMSetupVersionTest/new_project_version_file/CMakeLists.txt37
1 files changed, 4 insertions, 33 deletions
diff --git a/tests/ECMSetupVersionTest/new_project_version_file/CMakeLists.txt b/tests/ECMSetupVersionTest/new_project_version_file/CMakeLists.txt
index 32cc4d8c..a92c2a0f 100644
--- a/tests/ECMSetupVersionTest/new_project_version_file/CMakeLists.txt
+++ b/tests/ECMSetupVersionTest/new_project_version_file/CMakeLists.txt
@@ -9,38 +9,9 @@ ecm_setup_version(PROJECT
PACKAGE_VERSION_FILE FooVersion.cmake
)
-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_version_file_VERSION "2.3.4")
-strcheck(new_project_version_file_VERSION_STRING "2.3.4")
-numcheck(new_project_version_file_VERSION_MAJOR 2)
-numcheck(new_project_version_file_VERSION_MINOR 3)
-numcheck(new_project_version_file_VERSION_PATCH 4)
-numcheck(new_project_version_file_SOVERSION 2)
-
-set(PACKAGE_FIND_VERSION "2.3.4")
-include("${CMAKE_CURRENT_BINARY_DIR}/FooVersion.cmake")
-strcheck(PACKAGE_VERSION "2.3.4")
-if(NOT PACKAGE_VERSION_COMPATIBLE)
- message(FATAL_ERROR "PACKAGE_VERSION_COMPATIBLE not TRUE")
-endif()
-if(NOT PACKAGE_VERSION_EXACT)
- message(FATAL_ERROR "PACKAGE_VERSION_EXACT not TRUE")
-endif()
+include(../version_helpers.cmake)
+# NB: name comes from project() command
+standard_version_var_checks(new_project_version_file 2.3.4)
+AnyNewer_2_3_4_checks("${CMAKE_CURRENT_BINARY_DIR}/FooVersion.cmake")
add_executable(dummy main.c)