[Cmake-commits] CMake branch, next, updated. v2.8.9-1201-g8f903ca
Rolf Eike Beer
eike at sf-mail.de
Wed Oct 24 14:19:29 EDT 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 8f903ca241e6e538243ade69dddba1b228841b68 (commit)
via 3c347a92736e7fbb677758313d287cface7697fc (commit)
via f551fa62450379b41b510054948e097582538357 (commit)
from 52f669adb298c1584871e2de61e5dc5faef9e8d5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f903ca241e6e538243ade69dddba1b228841b68
commit 8f903ca241e6e538243ade69dddba1b228841b68
Merge: 52f669a 3c347a9
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Wed Oct 24 14:19:26 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Oct 24 14:19:26 2012 -0400
Merge topic 'test-major-version' into next
3c347a9 Tests: add MajorVersionSelection tests
f551fa6 CMake Nightly Date Stamp
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c347a92736e7fbb677758313d287cface7697fc
commit 3c347a92736e7fbb677758313d287cface7697fc
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Wed Oct 24 19:55:14 2012 +0200
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Wed Oct 24 20:19:06 2012 +0200
Tests: add MajorVersionSelection tests
For things where we may have 2 major versions of the same software installed in
parallel (think of Qt and Python) make sure our version selection gets this
right.
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index 51a630f..44dc5c0 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -38,3 +38,21 @@ add_test(CMakeOnly.ProjectInclude ${CMAKE_CMAKE_COMMAND}
-DCMAKE_ARGS=-DCMAKE_PROJECT_ProjectInclude_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectInclude/include.cmake
-P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake
)
+
+include(CMakeParseArguments)
+
+function(add_major_test module)
+ cmake_parse_arguments(MAJOR_TEST "NOLANG" "VERSION_VAR" "VERSIONS" ${ARGN})
+ foreach (_version IN LISTS MAJOR_TEST_VERSIONS)
+ add_test(CMakeOnly.MajorVersionSelection-${module}_${_version}
+ ${CMAKE_CMAKE_COMMAND}
+ -DTEST=MajorVersionSelection-${module}_${_version}
+ -DTEST_SOURCE=MajorVersionSelection
+ "-DCMAKE_ARGS=-DMAJOR_TEST_MODULE=${module};-DMAJOR_TEST_VERSION=${_version};-DMAJOR_TEST_NO_LANGUAGES=${MAJOR_TEST_NOLANG};-DMAJOR_TEST_VERSION_VAR=${MAJOR_TEST_VERSION_VAR}"
+ -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake
+ )
+ endforeach ()
+endfunction()
+
+add_major_test(PythonLibs VERSIONS 2 3 VERSION_VAR PYTHONLIBS_VERSION_STRING)
+add_major_test(PythonInterp NOLANG VERSIONS 2 3 VERSION_VAR PYTHON_VERSION_STRING)
diff --git a/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt b/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt
new file mode 100644
index 0000000..74f5451
--- /dev/null
+++ b/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt
@@ -0,0 +1,46 @@
+cmake_minimum_required(VERSION 2.8)
+
+if (NOT MAJOR_TEST_MODULE OR NOT MAJOR_TEST_VERSION)
+ message(FATAL_ERROR "test selection variables not set up")
+endif ()
+
+if (MAJOR_TEST_NO_LANGUAGES)
+ project(major_detect_${MAJOR_TEST_MODULE}_${MAJOR_TEST_VERSION} NONE)
+else ()
+ project(major_detect_${MAJOR_TEST_MODULE}_${MAJOR_TEST_VERSION})
+endif ()
+
+find_package(${MAJOR_TEST_MODULE} ${MAJOR_TEST_VERSION})
+
+if (MAJOR_TEST_VERSION_VAR)
+ set(VERSION_VAR "${MAJOR_TEST_VERSION_VAR}")
+else ()
+ set(VERSION_VAR "${MAJOR_TEST_MODULE}_VERSION_STRING")
+endif ()
+
+string(TOUPPER "${MAJOR_TEST_MODULE}" MODULE_UPPER)
+
+if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND "${VERSION_VAR}")
+ message(STATUS "${VERSION_VAR} is '${${VERSION_VAR}}'")
+ if ("${VERSION_VAR}" VERSION_LESS MAJOR_TEST_VERSION)
+ message(SEND_ERROR "Found version ${${VERSION_VAR}} is less than requested major version ${MAJOR_TEST_VERSION}")
+ endif ()
+ math(EXPR V_PLUS_ONE "${MAJOR_TEST_VERSION} + 1")
+ if ("${VERSION_VAR}" VERSION_GREATER V_PLUS_ONE)
+ message(SEND_ERROR "Found version ${${VERSION_VAR}} is greater than requested major version ${MAJOR_TEST_VERSION}")
+ endif ()
+endif ()
+
+if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND ${MAJOR_TEST_MODULE}_VERSION_MAJOR)
+ message(STATUS "${MAJOR_TEST_MODULE}_VERSION_MAJOR is '${${MAJOR_TEST_MODULE}_VERSION_MAJOR}'")
+ if (NOT ${MAJOR_TEST_VERSION} EQUAL ${MAJOR_TEST_MODULE}_VERSION_MAJOR)
+ message(SEND_ERROR "We requested major version ${MAJOR_TEST_VERSION} but ${MAJOR_TEST_MODULE} set ${MAJOR_TEST_MODULE}_VERSION_MAJOR to ${${MAJOR_TEST_MODULE}_VERSION_MAJOR}")
+ endif ()
+endif ()
+
+if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND ${MODULE_UPPER}_VERSION_MAJOR)
+ message(STATUS "${MODULE_UPPER}_VERSION_MAJOR is '${${MODULE_UPPER}_VERSION_MAJOR}'")
+ if (NOT ${MAJOR_TEST_VERSION} EQUAL ${MODULE_UPPER}_VERSION_MAJOR)
+ message(SEND_ERROR "We requested major version ${MAJOR_TEST_VERSION} but ${MAJOR_TEST_MODULE} set ${MODULE_UPPER}_VERSION_MAJOR to ${${MODULE_UPPER}_VERSION_MAJOR}")
+ endif ()
+endif ()
diff --git a/Tests/CMakeOnly/Test.cmake.in b/Tests/CMakeOnly/Test.cmake.in
index 42af068..f76db1d 100644
--- a/Tests/CMakeOnly/Test.cmake.in
+++ b/Tests/CMakeOnly/Test.cmake.in
@@ -1,4 +1,8 @@
-set(source_dir "@CMAKE_CURRENT_SOURCE_DIR@/${TEST}")
+if (NOT TEST_SOURCE)
+ set(TEST_SOURCE "${TEST}")
+endif ()
+
+set(source_dir "@CMAKE_CURRENT_SOURCE_DIR@/${TEST_SOURCE}")
set(binary_dir "@CMAKE_CURRENT_BINARY_DIR@/${TEST}-build")
file(REMOVE_RECURSE "${binary_dir}")
file(MAKE_DIRECTORY "${binary_dir}")
-----------------------------------------------------------------------
Summary of changes:
Source/CMakeVersion.cmake | 2 +-
Tests/CMakeOnly/CMakeLists.txt | 18 ++++++++
.../CMakeOnly/MajorVersionSelection/CMakeLists.txt | 46 ++++++++++++++++++++
Tests/CMakeOnly/Test.cmake.in | 6 ++-
4 files changed, 70 insertions(+), 2 deletions(-)
create mode 100644 Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list