summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorRoman Donchenko <dpb@corrigendum.ru>2015-09-09 20:21:07 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2015-09-09 20:21:07 (GMT)
commit2a7772ff4ca88319d65e025a49883ef2f2487aeb (patch)
tree17f4eb42c4c230d9a510f922f831110f5ef32929 /Tests
parentf281c6214ba932e5a5c9d8bae67313fc8bfa8ec9 (diff)
downloadCMake-2a7772ff4ca88319d65e025a49883ef2f2487aeb.zip
CMake-2a7772ff4ca88319d65e025a49883ef2f2487aeb.tar.gz
CMake-2a7772ff4ca88319d65e025a49883ef2f2487aeb.tar.bz2
CPack: don't mangle CMake-special characters when applying default settings
Mangling is prevented by using a function instead of a macro for setting default value of some CPack variables. Function is meant for internal use in CPack.cmake only. Old macro is deprecated but kept for backwards compatibility - was intended for internal use only as it can't be used for CPack after CPack.cmake script is included. Patch removes local workarounds that were required by old macro, fixes default setting of variables that by default inherit value from another variable that already went through old default setting macro (e.g. value of CPACK_PACKAGE_INSTALL_REGISTRY_KEY caused error for wrong escapes if CPACK_PACKAGE_INSTALL_DIRECTORY contained escaped back slashes) and provides a test for correct escaping of characters.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CPackConfig/Default-check.cmake7
-rw-r--r--Tests/RunCMake/CPackConfig/Default.cmake3
-rw-r--r--Tests/RunCMake/CPackConfig/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CPackConfig/check.cmake3
4 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPackConfig/Default-check.cmake b/Tests/RunCMake/CPackConfig/Default-check.cmake
new file mode 100644
index 0000000..b67fe81
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/Default-check.cmake
@@ -0,0 +1,7 @@
+include(${RunCMake_SOURCE_DIR}/check.cmake)
+
+test_variable(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Foo\\Bar")
+test_variable(CPACK_NSIS_PACKAGE_NAME "Bar\\Foo")
+
+test_variable(CPACK_SOURCE_IGNORE_FILES
+ "/CVS/;/\\.svn/;/\\.bzr/;/\\.hg/;/\\.git/;\\.swp$;\\.#;/#")
diff --git a/Tests/RunCMake/CPackConfig/Default.cmake b/Tests/RunCMake/CPackConfig/Default.cmake
new file mode 100644
index 0000000..3b3beb3
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/Default.cmake
@@ -0,0 +1,3 @@
+# two levels of escaping to pass through CPackConfig.cmake
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "Foo\\\\Bar")
+set(CPACK_NSIS_DISPLAY_NAME "Bar\\\\Foo")
diff --git a/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake b/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake
index 6787eb8..ef018b5 100644
--- a/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
include(RunCMake)
run_cmake(Simple)
+run_cmake(Default)
diff --git a/Tests/RunCMake/CPackConfig/check.cmake b/Tests/RunCMake/CPackConfig/check.cmake
index 2fc9f11..ca6229e 100644
--- a/Tests/RunCMake/CPackConfig/check.cmake
+++ b/Tests/RunCMake/CPackConfig/check.cmake
@@ -1,3 +1,5 @@
+cmake_minimum_required(VERSION ${CMAKE_VERSION} FATAL_ERROR)
+
function(test_variable NAME EXPECTED_VALUE)
if(NOT "${${NAME}}" STREQUAL "${EXPECTED_VALUE}")
message(FATAL_ERROR "${NAME}: variable mismatch; expected [${EXPECTED_VALUE}] actual [${${NAME}}]")
@@ -5,3 +7,4 @@ function(test_variable NAME EXPECTED_VALUE)
endfunction()
include(${RunCMake_TEST_BINARY_DIR}/CPackConfig.cmake)
+include(${RunCMake_TEST_BINARY_DIR}/CPackSourceConfig.cmake)