This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 240356877edd2ec55024b51bd0b862fcef002ee1 (commit) via c6a636b2b6ef74102c4d4ecc83f4d9180fc957a0 (commit) via 112ea4f784f68851eb1eea0a241cc4b9f7203faf (commit) via 984ff1fcd8f6818895837e6f36d065aca76653e7 (commit) via 1215dc6c9e69d90b166ff214e5f21e0e0e02ac24 (commit) via 1fe64b70ba9f1f31746a8ed1fc6474a369cbb732 (commit) via cc66e15fc744eba27f4bc8b2fd41372fe1defd35 (commit) via 530fb6be34176cfb90363a3e3811904614256579 (commit) via 8280502531995332ca612d2eda2b1939f10265ed (commit) via 30ca6cfb246a09dbdec03731ede7dabb38ca53b1 (commit) from 38a4c3e7376e207f09c559a7a14590d6060ae9e5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=240356877edd2ec55024b51bd0b862fcef002ee1 commit 240356877edd2ec55024b51bd0b862fcef002ee1 Merge: 38a4c3e c6a636b Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Sep 16 09:56:34 2014 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Tue Sep 16 09:56:34 2014 -0400 Merge topic 'vs-nsight-tegra-generator' into next c6a636b2 Tests: Add test for VS Nsight Tegra generator support 112ea4f7 Tests: Always detect VS and SDK availability on Windows 984ff1fc VS: Generate ANDROID_GUI executables as app packages 1215dc6c Add 'ANDROID_API' target property to set Android Target API 1fe64b70 Add 'ANDROID_GUI' target property to mark Android applications cc66e15f cmTarget: Track internally whether platform is Android 530fb6be VS: Teach vcxproj generation about the Tegra-Android platform 82805025 VS: Detect compiler id of Nsight Tegra-Android toolchains 30ca6cfb VS: Teach VS >= 10 to recognize CMAKE_SYSTEM_NAME 'Android' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6a636b2b6ef74102c4d4ecc83f4d9180fc957a0 commit c6a636b2b6ef74102c4d4ecc83f4d9180fc957a0 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Sep 16 09:48:38 2014 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Sep 16 09:48:38 2014 -0400 Tests: Add test for VS Nsight Tegra generator support Create a VSNsightTegra test based on the "two-libs" example from the Android NDK. Add it whenever testing on a machine with VS 11 or 12 and the NVIDIA Nsight Tegra Visual Studio Edition installed. Exclude it when there is a space in the path to the source or build tree because the tools do not seem to support it. diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2b70f56..f80446d 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1787,7 +1787,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]") set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]") set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]") - foreach(reg vs11 vs12 ws80 ws81 wp80 wp81) + set(reg_tegra "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;sdkRoot]") + foreach(reg vs11 vs12 ws80 ws81 wp80 wp81 tegra) get_filename_component(r "${reg_${reg}}" ABSOLUTE) if(IS_DIRECTORY "${r}") set(${reg} 1) @@ -1833,6 +1834,27 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() endif() + if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ") + macro(add_test_VSNsightTegra name generator) + add_test(NAME VSNsightTegra.${name} COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSNsightTegra" + "${CMake_BINARY_DIR}/Tests/VSNsightTegra/${name}" + --build-generator "${generator}" + --build-project VSNsightTegra + --build-config $<CONFIGURATION> + --build-options -DCMAKE_SYSTEM_NAME=Android + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSNsightTegra/${name}") + endmacro() + if(vs11) + add_test_VSNsightTegra(vs11 "Visual Studio 11 2012") + endif() + if(vs12) + add_test_VSNsightTegra(vs12 "Visual Studio 12 2013") + endif() + endif() + if (APPLE) if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(BundleTestInstallDir diff --git a/Tests/VSNsightTegra/AndroidManifest.xml b/Tests/VSNsightTegra/AndroidManifest.xml new file mode 100644 index 0000000..951e8f3 --- /dev/null +++ b/Tests/VSNsightTegra/AndroidManifest.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.example.twolibs" + android:versionCode="1" + android:versionName="1.0"> + <uses-sdk android:minSdkVersion="3" /> + <application android:label="@string/app_name"> + <activity android:name=".TwoLibs" + android:label="@string/app_name"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> +</manifest> diff --git a/Tests/VSNsightTegra/CMakeLists.txt b/Tests/VSNsightTegra/CMakeLists.txt new file mode 100644 index 0000000..e011cac --- /dev/null +++ b/Tests/VSNsightTegra/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required(VERSION 3.0) +project(VSNsightTegra C CXX) + +set(CMAKE_ANDROID_API 15) +set(CMAKE_ANDROID_GUI 1) + +set(FIRST_C_FILES + jni/first.c + jni/first.h + ) + +source_group(jni FILES ${FIRST_C_FILES}) +add_library(twolib-first ${FIRST_C_FILES}) + +set(SECOND_C_FILES + jni/second.c + ) +set(SECOND_JAVA_FILES + src/com/example/twolibs/TwoLibs.java + ) +set(SECOND_RES_FILES + res/values/strings.xml + ) +set(SECOND_ANDROID_FILES + AndroidManifest.xml + ) + +source_group(jni FILES ${SECOND_C_FILES}) +source_group(res\\values FILES ${SECOND_RES_FILES}) +source_group(src\\com\\example\\twolibs FILES ${SECOND_JAVA_FILES}) +add_executable(twolib-second + ${SECOND_C_FILES} + ${SECOND_JAVA_FILES} + ${SECOND_RES_FILES} + ${SECOND_ANDROID_FILES} + ) +target_include_directories(twolib-second PUBLIC jni) +target_link_libraries(twolib-second twolib-first) diff --git a/Tests/VSNsightTegra/build.xml b/Tests/VSNsightTegra/build.xml new file mode 100644 index 0000000..17a2cc0 --- /dev/null +++ b/Tests/VSNsightTegra/build.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="TwoLibs" default="help"> + <import file="${sdk.dir}/tools/ant/build.xml" /> +</project> diff --git a/Tests/VSNsightTegra/jni/first.c b/Tests/VSNsightTegra/jni/first.c new file mode 100644 index 0000000..f09e376 --- /dev/null +++ b/Tests/VSNsightTegra/jni/first.c @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "first.h" + +int first(int x, int y) +{ + return x + y; +} diff --git a/Tests/VSNsightTegra/jni/first.h b/Tests/VSNsightTegra/jni/first.h new file mode 100644 index 0000000..d893480 --- /dev/null +++ b/Tests/VSNsightTegra/jni/first.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef FIRST_H +#define FIRST_H + +extern int first(int x, int y); + +#endif /* FIRST_H */ diff --git a/Tests/VSNsightTegra/jni/second.c b/Tests/VSNsightTegra/jni/second.c new file mode 100644 index 0000000..4631848 --- /dev/null +++ b/Tests/VSNsightTegra/jni/second.c @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "first.h" +#include <jni.h> + +jint +Java_com_example_twolibs_TwoLibs_add( JNIEnv* env, + jobject this, + jint x, + jint y ) +{ + return first(x, y); +} diff --git a/Tests/VSNsightTegra/res/values/strings.xml b/Tests/VSNsightTegra/res/values/strings.xml new file mode 100644 index 0000000..858cdb4 --- /dev/null +++ b/Tests/VSNsightTegra/res/values/strings.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="app_name">TwoLibs</string> +</resources> diff --git a/Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java b/Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java new file mode 100644 index 0000000..ef9da01 --- /dev/null +++ b/Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.twolibs; + +import android.app.Activity; +import android.widget.TextView; +import android.os.Bundle; + +public class TwoLibs extends Activity +{ + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + TextView tv = new TextView(this); + int x = 1000; + int y = 42; + + // here, we dynamically load the library at runtime + // before calling the native method. + // + System.loadLibrary("twolib-second"); + + int z = add(x, y); + + tv.setText( "The sum of " + x + " and " + y + " is " + z ); + setContentView(tv); + } + + public native int add(int x, int y); +} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=112ea4f784f68851eb1eea0a241cc4b9f7203faf commit 112ea4f784f68851eb1eea0a241cc4b9f7203faf Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Sep 16 09:35:56 2014 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Sep 16 09:36:53 2014 -0400 Tests: Always detect VS and SDK availability on Windows Move the detection block out of the Windows >= 8 conditional so it can be used on other versions. diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5b336ce..2b70f56 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1780,6 +1780,23 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() endif() + if(WIN32) + set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]") + set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]") + set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]") + set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]") + set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]") + set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]") + foreach(reg vs11 vs12 ws80 ws81 wp80 wp81) + get_filename_component(r "${reg_${reg}}" ABSOLUTE) + if(IS_DIRECTORY "${r}") + set(${reg} 1) + else() + set(${reg} 0) + endif() + endforeach() + endif() + get_filename_component(ntver "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion;CurrentVersion]" NAME) if(WIN32 AND ntver VERSION_GREATER 6.1) # Windows >= 8.0 macro(add_test_VSWinStorePhone name generator systemName systemVersion) @@ -1796,20 +1813,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSWinStorePhone/${name}") endmacro() - set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]") - set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]") - set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]") - set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]") - set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]") - set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]") - foreach(reg vs11 vs12 ws80 ws81 wp80 wp81) - get_filename_component(r "${reg_${reg}}" ABSOLUTE) - if(IS_DIRECTORY "${r}") - set(${reg} 1) - else() - set(${reg} 0) - endif() - endforeach() if(vs11 AND ws80) add_test_VSWinStorePhone(vs11-store80-X86 "Visual Studio 11 2012" WindowsStore 8.0) add_test_VSWinStorePhone(vs11-store80-ARM "Visual Studio 11 2012 ARM" WindowsStore 8.0) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=984ff1fcd8f6818895837e6f36d065aca76653e7 commit 984ff1fcd8f6818895837e6f36d065aca76653e7 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Sep 2 14:33:17 2014 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Sep 16 09:18:52 2014 -0400 VS: Generate ANDROID_GUI executables as app packages When an executable is marked with ANDROID_GUI, generate an AntBuild step in the .vcxproj file and point it at the directory found to contain AndroidManifest.xml. Assume it also contains build.xml. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 9b56dcd..69b0848 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -615,7 +615,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() configType += "StaticLibrary"; break; case cmTarget::EXECUTABLE: - if(this->NsightTegra) + if(this->NsightTegra && + !this->Target->GetPropertyAsBool("ANDROID_GUI")) { // Android executables are .so too. configType += "DynamicLibrary"; @@ -2015,6 +2016,50 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config) } } + +//---------------------------------------------------------------------------- +void cmVisualStudio10TargetGenerator::WriteAntBuildOptions( + std::string const& config) +{ + // Look through the sources for AndroidManifest.xml and use + // its location as the root source directory. + std::string rootDir = this->Makefile->GetCurrentDirectory(); + { + std::vector<cmSourceFile const*> extraSources; + this->GeneratorTarget->GetExtraSources(extraSources, ""); + for(std::vector<cmSourceFile const*>::const_iterator si = + extraSources.begin(); si != extraSources.end(); ++si) + { + if("androidmanifest.xml" == cmSystemTools::LowerCase( + (*si)->GetLocation().GetName())) + { + rootDir = (*si)->GetLocation().GetDirectory(); + break; + } + } + } + + // Tell MSBuild to launch Ant. + { + std::string antBuildPath = rootDir; + this->WriteString("<AntBuild>\n", 2); + this->WriteString("<AntBuildPath>", 3); + this->ConvertToWindowsSlash(antBuildPath); + (*this->BuildFileStream) << + cmVS10EscapeXML(antBuildPath) << "</AntBuildPath>\n"; + } + + { + std::string manifest_xml = rootDir + "/AndroidManifest.xml"; + this->ConvertToWindowsSlash(manifest_xml); + this->WriteString("<AndroidManifestLocation>", 3); + (*this->BuildFileStream) << + cmVS10EscapeXML(manifest_xml) << "</AndroidManifestLocation>\n"; + } + + this->WriteString("</AntBuild>\n", 2); +} + //---------------------------------------------------------------------------- bool cmVisualStudio10TargetGenerator::ComputeLinkOptions() { @@ -2386,6 +2431,12 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() this->WriteLinkOptions(*i); // output lib flags <Lib></Lib> this->WriteLibOptions(*i); + if(this->NsightTegra && + this->Target->GetType() == cmTarget::EXECUTABLE && + this->Target->GetPropertyAsBool("ANDROID_GUI")) + { + this->WriteAntBuildOptions(*i); + } this->WriteString("</ItemDefinitionGroup>\n", 1); } } diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 8887d14..36155f9 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -97,6 +97,7 @@ private: void WriteLinkOptions(std::string const& config); void WriteMidlOptions(std::string const& config, std::vector<std::string> const & includes); + void WriteAntBuildOptions(std::string const& config); void OutputLinkIncremental(std::string const& configName); void WriteCustomRule(cmSourceFile const* source, cmCustomCommand const & command); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1215dc6c9e69d90b166ff214e5f21e0e0e02ac24 commit 1215dc6c9e69d90b166ff214e5f21e0e0e02ac24 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Sep 2 13:53:26 2014 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Sep 16 09:18:48 2014 -0400 Add 'ANDROID_API' target property to set Android Target API Also add a 'CMAKE_ANDROID_API' variable to set the property default. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index d17ea15..38bcd04 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -79,6 +79,7 @@ Properties on Targets :maxdepth: 1 /prop_tgt/ALIASED_TARGET + /prop_tgt/ANDROID_API /prop_tgt/ANDROID_GUI /prop_tgt/ARCHIVE_OUTPUT_DIRECTORY_CONFIG /prop_tgt/ARCHIVE_OUTPUT_DIRECTORY diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 8017b43..3f92ec5 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -204,6 +204,7 @@ Variables that Control the Build .. toctree:: :maxdepth: 1 + /variable/CMAKE_ANDROID_API /variable/CMAKE_ANDROID_GUI /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY /variable/CMAKE_AUTOMOC_MOC_OPTIONS diff --git a/Help/prop_tgt/ANDROID_API.rst b/Help/prop_tgt/ANDROID_API.rst new file mode 100644 index 0000000..82edb4e --- /dev/null +++ b/Help/prop_tgt/ANDROID_API.rst @@ -0,0 +1,6 @@ +ANDROID_API +----------- + +Set the Android Target API version (e.g. ``15``). This property is +initialized by the value of the :variable:`CMAKE_ANDROID_API` variable +if it is set when a target is created. diff --git a/Help/variable/CMAKE_ANDROID_API.rst b/Help/variable/CMAKE_ANDROID_API.rst new file mode 100644 index 0000000..c8264e0 --- /dev/null +++ b/Help/variable/CMAKE_ANDROID_API.rst @@ -0,0 +1,5 @@ +CMAKE_ANDROID_API +----------------- + +Default value for the :prop_tgt:`ANDROID_API` target property. +See that target property for additional information. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 1e2f75c..85bf087 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -324,6 +324,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) // 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"); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index f40573c..9b56dcd 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -724,6 +724,12 @@ void cmVisualStudio10TargetGenerator ntv += toolset? toolset : "Default"; ntv += "</NdkToolchainVersion>\n"; this->WriteString(ntv.c_str(), 2); + if(const char* api = this->Target->GetProperty("ANDROID_API")) + { + this->WriteString("<AndroidTargetAPI>", 2); + (*this->BuildFileStream ) << + "android-" << cmVS10EscapeXML(api) << "</AndroidTargetAPI>\n"; + } } void cmVisualStudio10TargetGenerator::WriteCustomCommands() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1fe64b70ba9f1f31746a8ed1fc6474a369cbb732 commit 1fe64b70ba9f1f31746a8ed1fc6474a369cbb732 Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Jul 24 14:49:56 2014 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Sep 16 09:18:44 2014 -0400 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). diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index d28229a..d17ea15 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -79,6 +79,7 @@ Properties on Targets :maxdepth: 1 /prop_tgt/ALIASED_TARGET + /prop_tgt/ANDROID_GUI /prop_tgt/ARCHIVE_OUTPUT_DIRECTORY_CONFIG /prop_tgt/ARCHIVE_OUTPUT_DIRECTORY /prop_tgt/ARCHIVE_OUTPUT_NAME_CONFIG diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 097eba3..8017b43 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -204,6 +204,7 @@ Variables that Control the Build .. toctree:: :maxdepth: 1 + /variable/CMAKE_ANDROID_GUI /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY /variable/CMAKE_AUTOMOC_MOC_OPTIONS /variable/CMAKE_AUTOMOC diff --git a/Help/prop_tgt/ANDROID_GUI.rst b/Help/prop_tgt/ANDROID_GUI.rst new file mode 100644 index 0000000..90d2428 --- /dev/null +++ b/Help/prop_tgt/ANDROID_GUI.rst @@ -0,0 +1,9 @@ +ANDROID_GUI +----------- + +Build an executable as an application package on Android. + +When this property is set to true the executable when built for Android +will be created as an application package. This property is initialized +by the value of the :variable:`CMAKE_ANDROID_GUI` variable if it is set +when a target is created. diff --git a/Help/variable/CMAKE_ANDROID_GUI.rst b/Help/variable/CMAKE_ANDROID_GUI.rst new file mode 100644 index 0000000..1755375 --- /dev/null +++ b/Help/variable/CMAKE_ANDROID_GUI.rst @@ -0,0 +1,5 @@ +CMAKE_ANDROID_GUI +----------------- + +Default value for the :prop_tgt:`ANDROID_GUI` target property of +executables. See that target property for additional information. 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; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cc66e15fc744eba27f4bc8b2fd41372fe1defd35 commit cc66e15fc744eba27f4bc8b2fd41372fe1defd35 Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Jul 24 15:03:04 2014 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Sep 16 09:18:39 2014 -0400 cmTarget: Track internally whether platform is Android Add an IsAndroid member to save whether CMAKE_SYSTEM_NAME is "Android". diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index acae0b3..80c0020 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,6 +313,11 @@ 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"); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 333e2ae..a3ecca0 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -755,6 +755,7 @@ private: mutable cmPropertyMap Properties; LinkLibraryVectorType OriginalLinkLibraries; bool DLLPlatform; + bool IsAndroid; bool IsApple; bool IsImportedTarget; mutable bool DebugIncludesDone; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=530fb6be34176cfb90363a3e3811904614256579 commit 530fb6be34176cfb90363a3e3811904614256579 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jun 10 11:33:19 2014 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Sep 16 09:18:35 2014 -0400 VS: Teach vcxproj generation about the Tegra-Android platform Complete the basic implementation of the VS Tegra-Android generators by replacing parts of vcxproj files that are specific to MS tools with settings defined for the NVIDIA Nsight Tegra tools. Current limitations include: * We have no "flag table" so flags will be passed in the additional options fields instead of mapped to the vcxproj elements defined by Nsight Tegra msbuild platform definition files. * We have no interface to set the AndroidArch, AndroidStlType, or AndroidTargetAPI fields so defaults will be used. * The Nsight Tegra msbuild platform definition files do not provide a working "Utility" target type so for add_custom_target we need to use a "StaticLibrary" target type and leave out ClCompile rules. * There is also no target type for plain command-line executables so for add_executable we need to use a "DynamicLibrary" target. Full application bundles will likely require new CMake target properties (like WIN32_EXECUTABLE for Windows GUI executables). diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 4b5c83f..f40573c 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -180,7 +180,8 @@ cmVisualStudio10TargetGenerator(cmTarget* target, this->GlobalGenerator->CreateGUID(this->Name.c_str()); this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str()); this->Platform = gg->GetPlatformName(); - this->MSTools = true; + this->NsightTegra = gg->IsNsightTegra(); + this->MSTools = !this->NsightTegra; this->TargetCompileAsWinRT = false; this->BuildFileStream = 0; this->IsMissingFiles = false; @@ -312,6 +313,15 @@ void cmVisualStudio10TargetGenerator::Generate() "xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"); this->WriteString(project_defaults.c_str(),0); + if(this->NsightTegra) + { + this->WriteString("<PropertyGroup Label=\"NsightTegraProject\">\n", 1); + this->WriteString("<NsightTegraProjectRevisionNumber>" + "6" + "</NsightTegraProjectRevisionNumber>\n", 2); + this->WriteString("</PropertyGroup>\n", 1); + } + this->WriteProjectConfigurations(); this->WriteString("<PropertyGroup Label=\"Globals\">\n", 1); this->WriteString("<ProjectGUID>", 2); @@ -605,11 +615,27 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() configType += "StaticLibrary"; break; case cmTarget::EXECUTABLE: - configType += "Application"; + if(this->NsightTegra) + { + // Android executables are .so too. + configType += "DynamicLibrary"; + } + else + { + configType += "Application"; + } break; case cmTarget::UTILITY: case cmTarget::GLOBAL_TARGET: - configType += "Utility"; + if(this->NsightTegra) + { + // Tegra-Android platform does not understand "Utility". + configType += "StaticLibrary"; + } + else + { + configType += "Utility"; + } break; case cmTarget::UNKNOWN_LIBRARY: case cmTarget::INTERFACE_LIBRARY: @@ -622,6 +648,10 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() { this->WriteMSToolConfigurationValues(*i); } + else if(this->NsightTegra) + { + this->WriteNsightTegraConfigurationValues(*i); + } this->WriteString("</PropertyGroup>\n", 1); } @@ -683,6 +713,19 @@ void cmVisualStudio10TargetGenerator } } +//---------------------------------------------------------------------------- +void cmVisualStudio10TargetGenerator +::WriteNsightTegraConfigurationValues(std::string const&) +{ + cmGlobalVisualStudio10Generator* gg = + static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator); + const char* toolset = gg->GetPlatformToolset(); + std::string ntv = "<NdkToolchainVersion>"; + ntv += toolset? toolset : "Default"; + ntv += "</NdkToolchainVersion>\n"; + this->WriteString(ntv.c_str(), 2); +} + void cmVisualStudio10TargetGenerator::WriteCustomCommands() { this->SourcesVisited.clear(); @@ -2184,6 +2227,10 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) linkOptions.AppendFlag("IgnoreSpecificDefaultLibraries", "ole32.lib"); } } + else if(this->NsightTegra) + { + linkOptions.AddFlag("SoName", targetNameSO.c_str()); + } linkOptions.Parse(flags.c_str()); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index d6db18a..8887d14 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -59,6 +59,7 @@ private: void WriteMSToolConfigurationValues(std::string const& config); void WriteHeaderSource(cmSourceFile const* sf); void WriteExtraSource(cmSourceFile const* sf); + void WriteNsightTegraConfigurationValues(std::string const& config); void WriteSource(std::string const& tool, cmSourceFile const* sf, const char* end = 0); void WriteSources(std::string const& tool, @@ -139,6 +140,7 @@ private: std::string GUID; std::string Name; bool MSTools; + bool NsightTegra; bool TargetCompileAsWinRT; cmGlobalVisualStudio10Generator* GlobalGenerator; cmGeneratedFileStream* BuildFileStream; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8280502531995332ca612d2eda2b1939f10265ed commit 8280502531995332ca612d2eda2b1939f10265ed Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jun 10 11:30:28 2014 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Sep 16 09:18:31 2014 -0400 VS: Detect compiler id of Nsight Tegra-Android toolchains Teach CMakeDetermineCompilerId to recognize the Tegra-Android platform and generate a test project for Nsight Tegra tools. Locate the full path to CMAKE_<LANG>_COMPILER by computing it within the test project build environment. Also teach CMakeFindBinUtils that this variant of the Visual Studio generator uses UNIX-like instead of MS-like archiving and linking tools. diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index e00f22a..a7b5760 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -142,7 +142,17 @@ Id flags: ${testflags} set(id_platform ${CMAKE_VS_PLATFORM_NAME}) set(id_lang "${lang}") set(id_cl cl.exe) - if(lang STREQUAL Fortran) + if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android") + set(v NsightTegra) + set(ext vcxproj) + if(lang STREQUAL CXX) + set(id_gcc g++) + set(id_clang clang++) + else() + set(id_gcc gcc) + set(id_clang clang) + endif() + elseif(lang STREQUAL Fortran) set(v Intel) set(ext vfproj) set(id_cl ifort.exe) @@ -161,9 +171,13 @@ Id flags: ${testflags} set(id_platform ia64) endif() if(CMAKE_VS_PLATFORM_TOOLSET) - set(id_toolset "<PlatformToolset>${CMAKE_VS_PLATFORM_TOOLSET}</PlatformToolset>") - if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "Intel") - set(id_cl icl.exe) + if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android") + set(id_toolset "<NdkToolchainVersion>${CMAKE_VS_PLATFORM_TOOLSET}</NdkToolchainVersion>") + else() + set(id_toolset "<PlatformToolset>${CMAKE_VS_PLATFORM_TOOLSET}</PlatformToolset>") + if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "Intel") + set(id_cl icl.exe) + endif() endif() else() set(id_toolset "") diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index dda28bd..e0ba131 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -35,7 +35,8 @@ if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC" OR "${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "MSVC" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" - OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") + OR ("${CMAKE_GENERATOR}" MATCHES "Visual Studio" + AND NOT CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")) find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) diff --git a/Modules/CompilerId/VS-NsightTegra.vcxproj.in b/Modules/CompilerId/VS-NsightTegra.vcxproj.in new file mode 100644 index 0000000..b7389eb --- /dev/null +++ b/Modules/CompilerId/VS-NsightTegra.vcxproj.in @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup Label="NsightTegraProject"> + <NsightTegraProjectRevisionNumber>6</NsightTegraProjectRevisionNumber> + </PropertyGroup> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|@id_platform@"> + <Configuration>Debug</Configuration> + <Platform>@id_platform@</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{CAE07175-D007-4FC3-BFE8-47B392814159}</ProjectGuid> + <RootNamespace>CompilerId@id_lang@</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + @id_toolset@ + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'">.\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'">false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'"> + <ClCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + </Link> + <PostBuildEvent> + <Command> +if "$(ToolchainName)"=="gcc" ( + for %%i in ($(ToolchainPrebuiltRoot)\bin\*@id_gcc@.exe) do ( + @echo CMAKE_@id_lang@_COMPILER=%%i + goto :done + ) +) +if "$(ToolchainName)"=="clang" ( + for %%i in ($(ToolchainPrebuiltRoot)\bin\*@id_clang@.exe) do ( + @echo CMAKE_@id_lang@_COMPILER=%%i + goto :done + ) +) +:done +</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="@id_src@" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> +</Project> http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=30ca6cfb246a09dbdec03731ede7dabb38ca53b1 commit 30ca6cfb246a09dbdec03731ede7dabb38ca53b1 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Jul 18 11:12:11 2014 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Sep 16 09:18:19 2014 -0400 VS: Teach VS >= 10 to recognize CMAKE_SYSTEM_NAME 'Android' When CMAKE_SYSTEM_NAME is 'Android', check for an installation of 'NVIDIA Nsight Tegra Visual Studio Edition' and generate .vcxproj files for the "Tegra-Android" platform. Also make the installed version available in a CMAKE_VS_NsightTegra_VERSION variable. diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index b00c16e..097eba3 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -74,6 +74,7 @@ Variables that Provide Information /variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION /variable/CMAKE_VS_MSBUILD_COMMAND /variable/CMAKE_VS_MSDEV_COMMAND + /variable/CMAKE_VS_NsightTegra_VERSION /variable/CMAKE_VS_PLATFORM_NAME /variable/CMAKE_VS_PLATFORM_TOOLSET /variable/CMAKE_XCODE_PLATFORM_TOOLSET diff --git a/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst b/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst new file mode 100644 index 0000000..386c3a9 --- /dev/null +++ b/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst @@ -0,0 +1,7 @@ +CMAKE_VS_NsightTegra_VERSION +---------------------------- + +When using a Visual Studio generator with the +:variable:`CMAKE_SYSTEM_NAME` variable set to ``Android``, +this variable contains the version number of the +installed NVIDIA Nsight Tegra Visual Studio Edition. diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index e947c54..21d1f34 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -198,6 +198,31 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf) return false; } } + else if(this->SystemName == "Android") + { + if(this->DefaultPlatformName != "Win32") + { + cmOStringStream e; + e << "CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR " + << "specifies a platform too: '" << this->GetName() << "'"; + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + return false; + } + std::string v = this->GetInstalledNsightTegraVersion(); + if(v.empty()) + { + mf->IssueMessage(cmake::FATAL_ERROR, + "CMAKE_SYSTEM_NAME is 'Android' but " + "'NVIDIA Nsight Tegra Visual Studio Edition' " + "is not installed."); + return false; + } + this->DefaultPlatformName = "Tegra-Android"; + this->DefaultPlatformToolset = "Default"; + this->NsightTegraVersion = v; + mf->AddDefinition("CMAKE_VS_NsightTegra_VERSION", v.c_str()); + } + return true; } @@ -587,3 +612,19 @@ bool cmGlobalVisualStudio10Generator::UseFolderProperty() { return IsExpressEdition() ? false : cmGlobalGenerator::UseFolderProperty(); } + +//---------------------------------------------------------------------------- +bool cmGlobalVisualStudio10Generator::IsNsightTegra() const +{ + return !this->NsightTegraVersion.empty(); +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio10Generator::GetInstalledNsightTegraVersion() +{ + std::string version; + cmSystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;" + "Version", version, cmSystemTools::KeyWOW64_32); + return version; +} diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index c02d204..1df98e3 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -59,6 +59,9 @@ public: /** Is the installed VS an Express edition? */ bool IsExpressEdition() const { return this->ExpressEdition; } + /** Generating for Nsight Tegra VS plugin? */ + bool IsNsightTegra() const; + /** The toolset name for the target platform. */ const char* GetPlatformToolset() const; @@ -106,6 +109,8 @@ public: virtual void FindMakeProgram(cmMakefile*); + static std::string GetInstalledNsightTegraVersion(); + protected: virtual void Generate(); virtual bool InitializeSystem(cmMakefile* mf); @@ -124,6 +129,7 @@ protected: std::string DefaultPlatformToolset; std::string SystemName; std::string SystemVersion; + std::string NsightTegraVersion; bool SystemIsWindowsCE; bool SystemIsWindowsPhone; bool SystemIsWindowsStore; ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 2 + Help/manual/cmake-variables.7.rst | 3 + Help/prop_tgt/ANDROID_API.rst | 6 ++ Help/prop_tgt/ANDROID_GUI.rst | 9 ++ Help/variable/CMAKE_ANDROID_API.rst | 5 + Help/variable/CMAKE_ANDROID_GUI.rst | 5 + Help/variable/CMAKE_VS_NsightTegra_VERSION.rst | 7 ++ Modules/CMakeDetermineCompilerId.cmake | 22 +++- Modules/CMakeFindBinUtils.cmake | 3 +- ...{VS-10.vcxproj.in => VS-NsightTegra.vcxproj.in} | 37 +++---- Source/cmGlobalVisualStudio10Generator.cxx | 41 ++++++++ Source/cmGlobalVisualStudio10Generator.h | 6 ++ Source/cmTarget.cxx | 23 +++- Source/cmTarget.h | 1 + Source/cmVisualStudio10TargetGenerator.cxx | 110 +++++++++++++++++++- Source/cmVisualStudio10TargetGenerator.h | 3 + Tests/CMakeLists.txt | 53 +++++++--- Tests/VSNsightTegra/AndroidManifest.xml | 16 +++ Tests/VSNsightTegra/CMakeLists.txt | 38 +++++++ Tests/VSNsightTegra/build.xml | 4 + Tests/VSNsightTegra/jni/first.c | 22 ++++ Tests/VSNsightTegra/jni/first.h | 22 ++++ Tests/VSNsightTegra/jni/second.c | 27 +++++ Tests/VSNsightTegra/res/values/strings.xml | 4 + .../src/com/example/twolibs/TwoLibs.java | 46 ++++++++ 25 files changed, 473 insertions(+), 42 deletions(-) create mode 100644 Help/prop_tgt/ANDROID_API.rst create mode 100644 Help/prop_tgt/ANDROID_GUI.rst create mode 100644 Help/variable/CMAKE_ANDROID_API.rst create mode 100644 Help/variable/CMAKE_ANDROID_GUI.rst create mode 100644 Help/variable/CMAKE_VS_NsightTegra_VERSION.rst copy Modules/CompilerId/{VS-10.vcxproj.in => VS-NsightTegra.vcxproj.in} (67%) create mode 100644 Tests/VSNsightTegra/AndroidManifest.xml create mode 100644 Tests/VSNsightTegra/CMakeLists.txt create mode 100644 Tests/VSNsightTegra/build.xml create mode 100644 Tests/VSNsightTegra/jni/first.c create mode 100644 Tests/VSNsightTegra/jni/first.h create mode 100644 Tests/VSNsightTegra/jni/second.c create mode 100644 Tests/VSNsightTegra/res/values/strings.xml create mode 100644 Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits