MantisBT - CMake
View Issue Details
0015276CMakeCMakepublic2014-12-02 12:072015-05-04 09:05
deathicon 
Brad King 
normaltextalways
closedfixed 
AndroidWindows8.1
 
CMake 3.1CMake 3.1 
0015276: Document NVIDIA Nsight Tegra configuration settings
When generating Visual Studio projects for Tegra-Android using the latest CMake 3.1-rc2, there is no options to allow us to set the following project properties:
 
 - Project Defaults -> Toolchain Version
 - Ant Build -> Ant Build Root Path
 - Ant Build -> Android Manifest Location
 - Ant Build -> Java Source Directory

The Toolchain Version would allow us to specify 'Default Clang' or 'Default GCC', which is very useful to have. The Ant Build options are currently guessed by CMake to point to the ${PROJECT_SOURCE_DIR}, which is annoying if we want to put these files somewhere else... especially the Java Source Directory.

In the target properties, we currently have ANDROID_API and ANDROID_GUI. Can we add the missing properties? Thanks.
Generate any simple Tegra-Android projects for Visual Studio, see we can't control these properties.
No tags attached.
Issue History
2014-12-02 12:07deathiconNew Issue
2014-12-02 13:14Brad KingNote Added: 0037359
2014-12-02 13:28deathiconNote Added: 0037360
2014-12-02 13:37deathiconNote Added: 0037361
2014-12-02 13:50deathiconNote Added: 0037362
2014-12-02 13:59Brad KingNote Added: 0037363
2014-12-02 14:25deathiconNote Added: 0037364
2014-12-02 15:14Brad KingNote Added: 0037365
2014-12-02 15:15Brad KingAssigned To => Brad King
2014-12-02 15:15Brad KingSeveritymajor => text
2014-12-02 15:15Brad KingStatusnew => resolved
2014-12-02 15:15Brad KingResolutionopen => fixed
2014-12-02 15:15Brad KingFixed in Version => CMake 3.1
2014-12-02 15:15Brad KingTarget Version => CMake 3.1
2014-12-02 15:15Brad KingSummaryCannot set Toolchain Version, Ant Build Root Path, Android Manifest Location and Java Source Directory in Android VS project => Document NVIDIA Nsight Tegra configuration settings
2015-05-04 09:05Robert MaynardNote Added: 0038688
2015-05-04 09:05Robert MaynardStatusresolved => closed

Notes
(0037359)
Brad King   
2014-12-02 13:14   
The CMAKE_GENERATOR_TOOLSET variable may be set in the toolchain file to select the NdkToolchainVersion:

 http://www.cmake.org/cmake/help/v3.1/variable/CMAKE_GENERATOR_TOOLSET.html [^]

The AndroidManifestLocation may be set simply by adding an AndroidManifest.xml source file to the target. The same directory will also be the AntBuildPath.

See the source code here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVisualStudio10TargetGenerator.cxx;hb=v3.1.0-rc2#l2073 [^]
(0037360)
deathicon   
2014-12-02 13:28   
When I try to set CMAKE_GENERATOR_TOOLSET to 'Default Clang' it just errors out saying:

CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_CXX_COMPILER could be found.

But if I change it in Visual Studio to 'Default Clang' instead, it works. What did I not understand?
(0037361)
deathicon   
2014-12-02 13:37   
Nevermind my previous comment, I needed to set it to 'DefaultClang' (no space) to make it works. Thanks.
(0037362)
deathicon   
2014-12-02 13:50   
Just wondering...

Any particuliar reason why the generator expression <TARGET_FILE:...> refers to the .so file instead of the .apk file?
(0037363)
Brad King   
2014-12-02 13:59   
Re 0015276:0037362: I don't think an explicit choice was ever made for that. The current behavior is a consequence of the way the existing infrastructure was used. However, I think it makes sense. The .so is the actual file produced by the linker, which is what TARGET_FILE means in general.

The .apk is a separate packaged result that can hold other things too. There are already other generator expressions like TARGET_PDB_FILE and TARGET_SONAME_FILE that reference different files associated with a target. If necessary a new one could be added for this. However, such work is better discussed on the mailing list:

 http://www.cmake.org/mailman/listinfo/cmake-developers [^]

if you'd like to bring it up there.
(0037364)
deathicon   
2014-12-02 14:25   
Thanks a lot Brad. I guess we can close this bug report. Cheers!
(0037365)
Brad King   
2014-12-02 15:14   
Thanks for trying out these features!

I've updated the documentation with information discussed here about the settings:

 Help: Document Nsight Tegra toolchain configuration
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23e2bd7e [^]
(0038688)
Robert Maynard   
2015-05-04 09:05   
Closing resolved issues that have not been updated in more than 4 months.