mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 12:49:50 -05:00
VS: Honor WinCE deployment properties in VS 2010+
Previously only VS 2008 was supported.
This commit is contained in:
@@ -623,6 +623,7 @@ void cmVisualStudio10TargetGenerator::Generate()
|
||||
Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros");
|
||||
this->WriteWinRTPackageCertificateKeyFile(e0);
|
||||
this->WritePathAndIncrementalLinkOptions(e0);
|
||||
this->WriteCEDebugProjectConfigurationValues(e0);
|
||||
this->WriteItemDefinitionGroups(e0);
|
||||
this->WriteCustomCommands(e0);
|
||||
this->WriteAllSources(e0);
|
||||
@@ -1071,6 +1072,32 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
|
||||
}
|
||||
}
|
||||
|
||||
void cmVisualStudio10TargetGenerator::WriteCEDebugProjectConfigurationValues(
|
||||
Elem& e0)
|
||||
{
|
||||
if (!this->GlobalGenerator->TargetsWindowsCE()) {
|
||||
return;
|
||||
}
|
||||
const char* additionalFiles =
|
||||
this->GeneratorTarget->GetProperty("DEPLOYMENT_ADDITIONAL_FILES");
|
||||
const char* remoteDirectory =
|
||||
this->GeneratorTarget->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY");
|
||||
if (!(additionalFiles || remoteDirectory)) {
|
||||
return;
|
||||
}
|
||||
for (std::string const& c : this->Configurations) {
|
||||
Elem e1(e0, "PropertyGroup");
|
||||
e1.Attribute("Condition", this->CalcCondition(c));
|
||||
|
||||
if (remoteDirectory) {
|
||||
e1.Element("RemoteDirectory", remoteDirectory);
|
||||
}
|
||||
if (additionalFiles) {
|
||||
e1.Element("CEAdditionalFiles", additionalFiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
|
||||
Elem& e1, std::string const& config)
|
||||
{
|
||||
|
||||
@@ -57,6 +57,7 @@ private:
|
||||
void WriteProjectConfigurations(Elem& e0);
|
||||
void WriteProjectConfigurationValues(Elem& e0);
|
||||
void WriteMSToolConfigurationValues(Elem& e1, std::string const& config);
|
||||
void WriteCEDebugProjectConfigurationValues(Elem& e0);
|
||||
void WriteMSToolConfigurationValuesManaged(Elem& e1,
|
||||
std::string const& config);
|
||||
void WriteHeaderSource(Elem& e1, cmSourceFile const* sf);
|
||||
|
||||
@@ -178,7 +178,6 @@ if(BUILD_TESTING)
|
||||
endif()
|
||||
# Build a key to be used by get_filename_component that is pointing to the SDK directory
|
||||
set(_reg "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs\\${_sdk}]")
|
||||
|
||||
# Set return values
|
||||
set(${selected_reg} ${_reg})
|
||||
set(${selected_sdk} ${_sdk})
|
||||
|
||||
@@ -338,6 +338,9 @@ endif()
|
||||
|
||||
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^9]|9[0-9])")
|
||||
add_RunCMake_test(VS10Project)
|
||||
if( vs12 AND wince )
|
||||
add_RunCMake_test( VS10ProjectWinCE "-DRunCMake_GENERATOR_PLATFORM=${wince_sdk}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(XCODE_VERSION)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.5.0)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
||||
@@ -0,0 +1,8 @@
|
||||
include(RunCMake)
|
||||
|
||||
set(RunCMake_GENERATOR "Visual Studio 12 2013")
|
||||
set(RunCMake_GENERATOR_TOOLSET CE800)
|
||||
set(RunCMake_GENERATOR_INSTANCE "")
|
||||
set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=WindowsCE )
|
||||
|
||||
run_cmake(VsCEDebuggerDeploy)
|
||||
@@ -0,0 +1,34 @@
|
||||
set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
|
||||
if(NOT EXISTS "${vcProjectFile}")
|
||||
set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
if( NOT ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsCE" )
|
||||
set(RunCMake_TEST_FAILED "Test only valid for WindowsCE")
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
set(FoundCEAdditionalFiles FALSE)
|
||||
set(FoundRemoteDirectory FALSE)
|
||||
|
||||
file(STRINGS "${vcProjectFile}" lines)
|
||||
foreach(line IN LISTS lines)
|
||||
if(line MATCHES "^ *<CEAdditionalFiles> *foo\\.dll\\|\\\\foo\\\\src\\\\dir\\\\on\\\\host\\|\\$\\(RemoteDirectory\\)\\|0;bar\\.dll\\|\\\\bar\\\\src\\\\dir\\|\\$\\(RemoteDirectory\\)bardir\\|0.*</CEAdditionalFiles> *$")
|
||||
set(FoundCEAdditionalFiles TRUE)
|
||||
elseif(line MATCHES " *<RemoteDirectory>[A-Za-z0-9\\]+</RemoteDirectory> *$")
|
||||
set(FoundRemoteDirectory TRUE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT FoundCEAdditionalFiles)
|
||||
set(RunCMake_TEST_FAILED "CEAddionalFiles not found or not set correctly.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT FoundRemoteDirectory)
|
||||
set(RunCMake_TEST_FAILED "RemoteDirectory not found or not set correctly.")
|
||||
return()
|
||||
endif()
|
||||
@@ -0,0 +1,13 @@
|
||||
enable_language(CXX)
|
||||
|
||||
set(DEPLOY_DIR
|
||||
"temp\\foodir"
|
||||
)
|
||||
|
||||
add_library(foo foo.cpp)
|
||||
|
||||
set_target_properties(foo
|
||||
PROPERTIES
|
||||
DEPLOYMENT_ADDITIONAL_FILES "foo.dll|\\foo\\src\\dir\\on\\host|$(RemoteDirectory)|0;bar.dll|\\bar\\src\\dir|$(RemoteDirectory)bardir|0"
|
||||
DEPLOYMENT_REMOTE_DIRECTORY ${DEPLOY_DIR}
|
||||
)
|
||||
@@ -0,0 +1,3 @@
|
||||
void foo()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
void foo()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user