diff options
Diffstat (limited to 'Tests/RunCMake/VS10Project')
-rw-r--r-- | Tests/RunCMake/VS10Project/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake | 24 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsConfigurationType.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/foo.cpp | 1 |
5 files changed, 33 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/CMakeLists.txt b/Tests/RunCMake/VS10Project/CMakeLists.txt new file mode 100644 index 0000000..91baae7 --- /dev/null +++ b/Tests/RunCMake/VS10Project/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.5.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake new file mode 100644 index 0000000..cc2cc2e --- /dev/null +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -0,0 +1,2 @@ +include(RunCMake) +run_cmake(VsConfigurationType) diff --git a/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake b/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake new file mode 100644 index 0000000..4690970 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake @@ -0,0 +1,24 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() + +set(propertyFound FALSE) +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "^ *<ConfigurationType>(.*)</ConfigurationType>$") + set(propertyFound TRUE) + set(expectedValue "MyValue") + set(actualValue ${CMAKE_MATCH_1}) + if(NOT (${actualValue} STREQUAL ${expectedValue})) + set(RunCMake_TEST_FAILED "ConfigurationType \"${actualValue}\" differs from expected value \"${expectedValue}\".") + return() + endif() + endif() +endforeach() + +if(NOT propertyFound) + set(RunCMake_TEST_FAILED "Property ConfigurationType not found in project file.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsConfigurationType.cmake b/Tests/RunCMake/VS10Project/VsConfigurationType.cmake new file mode 100644 index 0000000..a73dfe8 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsConfigurationType.cmake @@ -0,0 +1,3 @@ +enable_language(CXX) +add_library(foo foo.cpp) +set_target_properties(foo PROPERTIES VS_CONFIGURATION_TYPE "MyValue") diff --git a/Tests/RunCMake/VS10Project/foo.cpp b/Tests/RunCMake/VS10Project/foo.cpp new file mode 100644 index 0000000..2fb55ee --- /dev/null +++ b/Tests/RunCMake/VS10Project/foo.cpp @@ -0,0 +1 @@ +void foo() { } |