summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-24 18:49:56 (GMT)
committerBrad King <brad.king@kitware.com>2014-09-29 20:05:53 (GMT)
commit9a4df52aa1f6736c2eceebd109240441bc3a4d6e (patch)
treed76e11572ae37e3d319c3f0a2fdb8bfdf91cc4bd /Source
parent16569abfa83ce231b1270282f03aae0b4542c42d (diff)
downloadCMake-9a4df52aa1f6736c2eceebd109240441bc3a4d6e.zip
CMake-9a4df52aa1f6736c2eceebd109240441bc3a4d6e.tar.gz
CMake-9a4df52aa1f6736c2eceebd109240441bc3a4d6e.tar.bz2
Add 'ANDROID_GUI' target property to mark Android applications
Also add a 'CMAKE_ANDROID_GUI' variable to set the property default so a project can easily make all executables Android applications. An Android application executable file has the same extension as a shared library (.so).
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 80c0020..1e2f75c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -446,6 +446,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)
{
@@ -3504,7 +3508,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;
}
@@ -3528,7 +3535,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;
}