diff options
author | Craig Scott <craig.scott@crascit.com> | 2018-05-03 21:17:33 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-05-03 21:18:38 (GMT) |
commit | 7de29da7c49da68aee421c646a676422f3b9d563 (patch) | |
tree | 558f2d71fa4ca4a208b130bc12773baca2941763 /Tests | |
parent | f1aedbf99acf21bbe9f2d766be8d159bd397cc89 (diff) | |
parent | af1c48871cedc29eb0dc773556c606c670df55ee (diff) | |
download | CMake-7de29da7c49da68aee421c646a676422f3b9d563.zip CMake-7de29da7c49da68aee421c646a676422f3b9d563.tar.gz CMake-7de29da7c49da68aee421c646a676422f3b9d563.tar.bz2 |
Merge topic 'feature/cpack-default-package-version'
af1c48871c CPack: Use project version as default for `CPACK_PACKAGE_VERSION`
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Harry Mallon <hjmallon@gmail.com>
Merge-request: !2020
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 38 | ||||
-rw-r--r-- | Tests/CPackUseDefaultVersion/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/CPackUseProjectVersion/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/CPackUseShortProjectVersion/CMakeLists.txt | 6 |
4 files changed, 56 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index b11cf03..ea64646 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -951,6 +951,44 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() endif() + if(CTEST_TEST_CPACK) + add_test(CPackUseDefaultVersion ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/CPackUseDefaultVersion" + "${CMake_BINARY_DIR}/Tests/CPackUseDefaultVersion" + ${build_generator_args} + --build-project CPackUseDefaultVersion + --build-two-config + --build-options ${build_options} + ${CPackUseDefaultVersion_BUILD_OPTIONS}) + set_tests_properties(CPackUseDefaultVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=0\\.1\\.1") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseDefaultVersion") + + add_test(CPackUseProjectVersion ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/CPackUseProjectVersion" + "${CMake_BINARY_DIR}/Tests/CPackUseProjectVersion" + ${build_generator_args} + --build-project CPackUseProjectVersion + --build-two-config + --build-options ${build_options} + ${CPackUseProjectVersion_BUILD_OPTIONS}) + set_tests_properties(CPackUseProjectVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=1\\.2\\.3") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseProjectVersion") + + add_test(CPackUseShortProjectVersion ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/CPackUseShortProjectVersion" + "${CMake_BINARY_DIR}/Tests/CPackUseShortProjectVersion" + ${build_generator_args} + --build-project CPackUseShortProjectVersion + --build-two-config + --build-options ${build_options} + ${CPackUseProjectVersion_BUILD_OPTIONS}) + set_tests_properties(CPackUseShortProjectVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=2") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseShortProjectVersion") + endif() + if(CTEST_RUN_CPackComponents) set(CPackComponents_BUILD_OPTIONS) if(APPLE) diff --git a/Tests/CPackUseDefaultVersion/CMakeLists.txt b/Tests/CPackUseDefaultVersion/CMakeLists.txt new file mode 100644 index 0000000..9f21f3a --- /dev/null +++ b/Tests/CPackUseDefaultVersion/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.2) +project(CPackUseProjectVersion NONE) + +include(CPack) + +message("CPACK_PACKAGE_VERSION=${CPACK_PACKAGE_VERSION}") diff --git a/Tests/CPackUseProjectVersion/CMakeLists.txt b/Tests/CPackUseProjectVersion/CMakeLists.txt new file mode 100644 index 0000000..d4770ae --- /dev/null +++ b/Tests/CPackUseProjectVersion/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.2) +project(CPackUseProjectVersion VERSION 1.2.3 LANGUAGES NONE) + +include(CPack) + +message("CPACK_PACKAGE_VERSION=${CPACK_PACKAGE_VERSION}") diff --git a/Tests/CPackUseShortProjectVersion/CMakeLists.txt b/Tests/CPackUseShortProjectVersion/CMakeLists.txt new file mode 100644 index 0000000..855bc64 --- /dev/null +++ b/Tests/CPackUseShortProjectVersion/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.2) +project(CPackUseProjectVersion VERSION 2 LANGUAGES NONE) + +include(CPack) + +message("CPACK_PACKAGE_VERSION=${CPACK_PACKAGE_VERSION}") |