[cmake-developers] CMake 3.1 Android - generator expressions and output names

Dmitry Polyanitsa dpolyanitsa at nvidia.com
Wed Dec 17 09:22:54 EST 2014


No, you're right - this is an unfortunate shortcoming.

I've attached a patch for CMake as of 0dd9e71 that adds ANDROID_API_MIN/CMAKE_ANDROID_API_MIN which will allow you to set the Min Android API Level in your projects.

Brad, I've used ANDROID_API/CMAKE_ANDROID_API as an example when implementing this change. I've added "MIN" as a postfix, for it seemed to be the preferred way, judging by the other propertiy names. Could you please merge the patch into CMake?

-Dmitry

-----Original Message-----
From: Robert Goulet [mailto:Robert.Goulet at autodesk.com] 
Sent: Tuesday, December 16, 2014 7:36 PM
To: Dmitry Polyanitsa; Brad King
Cc: cmake-developers at cmake.org
Subject: RE: [cmake-developers] CMake 3.1 Android - generator expressions and output names

Yes but in our case, we target API 19 (4.4), and min seems to defaults to 9 (2.3) with CMake, and if we leave the native API to use the min, then it fails to find GLES 3.0 headers. It only works if I set the native API to Target instead of Min. Perhaps I misunderstood something?

-----Original Message-----
From: Dmitry Polyanitsa [mailto:dpolyanitsa at nvidia.com]
Sent: Tuesday, December 16, 2014 11:09 AM
To: Robert Goulet; Brad King
Cc: cmake-developers at cmake.org
Subject: RE: [cmake-developers] CMake 3.1 Android - generator expressions and output names

Native Android API Level really should be the same as Min Android API Level, otherwise you might have problems in runtime. The upgrade action sets this property to Use Target Android API Level only for the sake of compatibility between Nsight Tegra versions, but we strongly encourage our users to switch it back to Use Min. We will show a warning if the Native and Min API Levels are not the same (Google's ndk-build does it as well).

-Dmitry

-----Original Message-----
From: Robert Goulet [mailto:Robert.Goulet at autodesk.com]
Sent: Tuesday, December 16, 2014 6:58 PM
To: Dmitry Polyanitsa; Brad King
Cc: cmake-developers at cmake.org
Subject: RE: [cmake-developers] CMake 3.1 Android - generator expressions and output names

Upgrading to CMake 3.1-rc3 indeed fixed the upgrade popup upon opening generated solution/project files when using NVidia NSight Tegra 3.0r4, however the value of "Native Android API Level" seems to default to "Use Min Android API Level" instead of the expected "Use Target Android API Level". Since we cannot set the Min or the Native API Level explicitly in CMake, this is a regression when upgrading to NVidia NSight Tegra 3.0r4 (from 3.0r3). I guess we will have to stick with NVidia NSight Tegra 3.0r3 for now.


-----Original Message-----
From: Dmitry Polyanitsa [mailto:dpolyanitsa at nvidia.com]
Sent: Tuesday, December 16, 2014 8:46 AM
To: Brad King; Robert Goulet
Cc: cmake-developers at cmake.org
Subject: RE: [cmake-developers] CMake 3.1 Android - generator expressions and output names

Yes, that's the one.

Nsight Tegra will upgrade the projects without a prompt, but only starting with the next version number increase.

-Dmitry

-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: Tuesday, December 16, 2014 4:30 PM
To: Robert Goulet
Cc: Dmitry Polyanitsa; cmake-developers at cmake.org
Subject: Re: [cmake-developers] CMake 3.1 Android - generator expressions and output names

On 12/16/2014 06:58 AM, Dmitry Polyanitsa wrote:
>> 3.0r4 has added a popup when opening the solution in Visual Studio 
>> stating that the project files generated needs to be upgraded.
> 
> I'm sure I've submitted a patch for this - please try updating CMake

IIUC the patch was this one:

 VS: Change Nsight Tegra 2.0 Project Revision Number from 8 to 9
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb3c87f1

and is available in 3.1.0-rc3.

However, CMake cannot predict future version numbers, so it writes a "NsightTegraUpgradeOnceWithoutPrompt" element into the project file.
Nsight Tegra is supposed to upgrade such projects without any popup.

-Brad

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-ANDROID_API_MIN-target-property-and-CMAKE_ANDROI.patch
Type: application/octet-stream
Size: 4998 bytes
Desc: 0001-Add-ANDROID_API_MIN-target-property-and-CMAKE_ANDROI.patch
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20141217/ecdc8d7c/attachment.obj>


More information about the cmake-developers mailing list