diff options
author | Brad King <brad.king@kitware.com> | 2014-09-30 12:46:27 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-09-30 12:46:27 (GMT) |
commit | 34d035e70e3ef3f79212bd8c5b5d36250090d856 (patch) | |
tree | b53d2983bb643e26cc2872e174c09292b6c5ca5c /Source/cmTarget.cxx | |
parent | 026c4a5d1b3ac3297b7a205d779cfcff6f74a67a (diff) | |
parent | df84281d68a715658ce0068c0869dd80831cd4a7 (diff) | |
download | CMake-34d035e70e3ef3f79212bd8c5b5d36250090d856.zip CMake-34d035e70e3ef3f79212bd8c5b5d36250090d856.tar.gz CMake-34d035e70e3ef3f79212bd8c5b5d36250090d856.tar.bz2 |
Merge topic 'vs-nsight-tegra-generator'
df84281d Help: Add notes for topic 'vs-nsight-tegra-generator'
69e198dc VS: Generate Nsight Tegra project revision number
5365c9ac VS: Map Nsight Tegra file types in .vcxproj files
178f56a5 VS: Fix Tegra-Android platform linking of libraries by name
7115702f Tests: Add test for VS Nsight Tegra generator support
a6289499 VS: Generate ANDROID_GUI executables as app packages
c12e4699 Add 'ANDROID_API' target property to set Android Target API
9a4df52a Add 'ANDROID_GUI' target property to mark Android applications
16569abf cmTarget: Track internally whether platform is Android
ef0fd4f0 VS: Teach vcxproj generation about the Tegra-Android platform
d09b60f5 VS: Detect compiler id of Nsight Tegra-Android toolchains
2f071466 VS: Teach VS >= 10 to recognize CMAKE_SYSTEM_NAME 'Android'
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f4714a9..b476a27 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -257,6 +257,7 @@ cmTarget::cmTarget() #endif this->HaveInstallRule = false; this->DLLPlatform = false; + this->IsAndroid = false; this->IsApple = false; this->IsImportedTarget = false; this->BuildInterfaceIncludesAppended = false; @@ -312,12 +313,18 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->Makefile->IsOn("CYGWIN") || this->Makefile->IsOn("MINGW")); + // Check whether we are targeting an Android platform. + this->IsAndroid = + strcmp(this->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME"), + "Android") == 0; + // Check whether we are targeting an Apple platform. this->IsApple = this->Makefile->IsOn("APPLE"); // Setup default property values. if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY) { + this->SetPropertyDefault("ANDROID_API", 0); this->SetPropertyDefault("INSTALL_NAME_DIR", 0); this->SetPropertyDefault("INSTALL_RPATH", ""); this->SetPropertyDefault("INSTALL_RPATH_USE_LINK_PATH", "OFF"); @@ -440,6 +447,10 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", 0); } + if(this->TargetTypeValue == cmTarget::EXECUTABLE) + { + this->SetPropertyDefault("ANDROID_GUI", 0); + } if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY || this->TargetTypeValue == cmTarget::MODULE_LIBRARY) { @@ -3493,7 +3504,10 @@ const char* cmTarget::GetSuffixVariableInternal(bool implib) const case cmTarget::EXECUTABLE: return (implib ? "CMAKE_IMPORT_LIBRARY_SUFFIX" - : "CMAKE_EXECUTABLE_SUFFIX"); + // Android GUI application packages store the native + // binary as a shared library. + : (this->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")? + "CMAKE_SHARED_LIBRARY_SUFFIX" : "CMAKE_EXECUTABLE_SUFFIX")); default: break; } @@ -3517,7 +3531,12 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const ? "CMAKE_IMPORT_LIBRARY_PREFIX" : "CMAKE_SHARED_MODULE_PREFIX"); case cmTarget::EXECUTABLE: - return (implib? "CMAKE_IMPORT_LIBRARY_PREFIX" : ""); + return (implib + ? "CMAKE_IMPORT_LIBRARY_PREFIX" + // Android GUI application packages store the native + // binary as a shared library. + : (this->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")? + "CMAKE_SHARED_LIBRARY_PREFIX" : "")); default: break; } |