diff options
author | Wil Stark <wil_stark@keysight.com> | 2018-12-07 00:31:20 (GMT) |
---|---|---|
committer | Wil Stark <wil_stark@keysight.com> | 2019-01-11 17:08:55 (GMT) |
commit | 5b1364a2e39cd799d663c597bafa4222be888088 (patch) | |
tree | 3d12a94ee706d67045a81113fdad74fa261574f0 /Tests/RunCMake | |
parent | 5a283b79e5fe1739142cc513a9a701855849b2f8 (diff) | |
download | CMake-5b1364a2e39cd799d663c597bafa4222be888088.zip CMake-5b1364a2e39cd799d663c597bafa4222be888088.tar.gz CMake-5b1364a2e39cd799d663c597bafa4222be888088.tar.bz2 |
cmVisualStudio10TargetGenerator: Fix .NET Compact Framework projects.
Fixes: #18672
Diffstat (limited to 'Tests/RunCMake')
3 files changed, 63 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10ProjectWinCE/RunCMakeTest.cmake b/Tests/RunCMake/VS10ProjectWinCE/RunCMakeTest.cmake index b35ee90..2c9067f 100644 --- a/Tests/RunCMake/VS10ProjectWinCE/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10ProjectWinCE/RunCMakeTest.cmake @@ -6,3 +6,4 @@ set(RunCMake_GENERATOR_INSTANCE "") set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=WindowsCE ) run_cmake(VsCEDebuggerDeploy) +run_cmake(VSCSharpCFProject) diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject-check.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject-check.cmake new file mode 100644 index 0000000..618896e --- /dev/null +++ b/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject-check.cmake @@ -0,0 +1,54 @@ +# +# Check C# Compact Framework project for required elements. +# +set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj") +if(NOT EXISTS "${csProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.") + return() +endif() + +if( NOT ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsCE" ) + set(RunCMake_TEST_FAILED "Test only valid for WindowsCE") + return() +endif() + +set(FoundTargetFrameworkTargetsVersion FALSE) +set(FoundDotNetFrameworkVersion FALSE) +set(FoundTargetFrameworkIdentifier FALSE) +set(FoundCFTargetsImport FALSE) + + +file(STRINGS "${csProjectFile}" lines) +foreach(line IN LISTS lines) + #message(STATUS ${line}) + if(line MATCHES "^ *<TargetFrameworkIdentifier>WindowsEmbeddedCompact</TargetFrameworkIdentifier> *$") + set(FoundTargetFrameworkIdentifier TRUE) + elseif(line MATCHES " *<TargetFrameworkVersion>v3.9</TargetFrameworkVersion> *$") + set(FoundDotNetFrameworkVersion TRUE) + elseif(line MATCHES " *<TargetFrameworkTargetsVersion>v8.0</TargetFrameworkTargetsVersion> *$") + set(FoundTargetFrameworkTargetsVersion TRUE) + elseif( line MATCHES " *<Import Project=\"\\$\\(MSBuildExtensionsPath\\)\\\\Microsoft\\\\\\$\\(TargetFrameworkIdentifier\\)\\\\\\$\\(TargetFrameworkTargetsVersion\\)\\\\Microsoft\\.\\$\\(TargetFrameworkIdentifier\\)\\.CSharp\\.targets\" */> *" ) + set(FoundCFTargetsImport TRUE) + endif() +endforeach() + + +if(NOT FoundTargetFrameworkTargetsVersion) + set(RunCMake_TEST_FAILED "TargetFrameworkIdentifier not found or not set correctly.") + return() +endif() + +if(NOT FoundDotNetFrameworkVersion) + set(RunCMake_TEST_FAILED "TargetFrameworkVersion not found or not set correctly.") + return() +endif() + +if(NOT FoundTargetFrameworkIdentifier) + set(RunCMake_TEST_FAILED "TargetFrameworkTargetsVersion not found or not set correctly.") + return() +endif() + +if(NOT FoundCFTargetsImport) + set(RunCMake_TEST_FAILED "Import of Compact Framework targets file not found or not set correctly.") + return() +endif() diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject.cmake new file mode 100644 index 0000000..fb2acbb --- /dev/null +++ b/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject.cmake @@ -0,0 +1,8 @@ +enable_language(CSharp) + +add_library(foo SHARED foo.cs ) + +set_target_properties(foo + PROPERTIES + DOTNET_TARGET_FRAMEWORK_VERSION "v3.9" +) |