Re: [CMake] CMake integration in Gradle (Android Studio)

2016-11-01 Thread Cong Monkey
I have got many compliant that cmake support is not work with even the new
Android Studio, but it is really works for me.

I try ldd on cmake which Android SDK provided, all the so is resolved
correct, which break before.

So, I can imagine that maybe something related to my host environment , I
use DEBIAN Stretch which updates very frequently.

For debian Stretched, the libssl is 1.0.2
For debian Jessie, the libssl is 1.0.0

Is this the source problem? So why minor version change break it?

As the upstream like cmake release fast, I really advice release static
linked version to escape the library break problem which  jetbrains product
followed.

Hope this help!

2016年10月31日 22:13,"Robert Dailey" 写道:

> I'm sorry but that doesn't really answer my questions.
>
> On Mon, Oct 31, 2016 at 8:55 AM, Cong Monkey 
> wrote:
> > Try to update your Android SDK from android studio?
> >
> >
> > 2016年10月31日 21:31,"Robert Dailey" 写道:
> >
> > Which version of Android Studio? Latest stable is 2.2 IIRC. Are you
> > talking about dev/beta builds?
> >
> > On Sun, Oct 30, 2016 at 9:04 AM, Cong Monkey 
> wrote:
> >> The latest release of android studio work with CMAKE well.
> >>
> >> you can create a new project with c++ support to test CMAKE support!
> >>
> >> You can follow https://code.google.com/p/android/issues/detail?id=
> 212007
> >> to get the details.
> >>
> >> 2016-10-28 5:48 GMT+08:00 Robert Dailey :
> >>> I'm at a bit of a loss on finding more information. Can anyone at
> >>> least confirm that this isn't a reliable place to find the answers I'm
> >>> looking for? Does anyone have real experience with android + gradle +
> >>> cmake integration and can provide some pointers?
> >>>
> >>> On Tue, Oct 25, 2016 at 8:48 AM, Robert Dailey <
> rcdailey.li...@gmail.com>
> >>> wrote:
>  I'm not sure if the CMake mailing lists are the right place to ask
>  this question but I thought I'd ask just in case someone has gone down
>  this path or has experience with what Google/Gradle is actually trying
>  to accomplish with what seems to be a hand-built version of CMake with
>  custom patches that are not in upstream repositories.
> 
>  Prior to switching to Android Studio / Gradle, I was using Eclipse /
>  Ant. The way I did CMake integration was not really integration at
>  all: I generated Ninja build scripts using CMake and implemented
>  custom targets to run "ant release" after all the C++ projects were
>  built. I made sure that CMake copied relevant *.so files to
>  appropriate directories in the Ant structure so they are packaged with
>  built APKs. That's how I did my Android development.
> 
>  Now that I'm integrating CMake into Gradle, first annoyance I noticed
>  is that I can't use CMake 3.7 (or any external installation of CMake)
>  with Android Studio. It requires a version of CMake installed through
>  SDK Manager. This means I can't use the new Android toolchain
>  functionality built into CMake 3.7 (sad face). But this is something I
>  can work around...
> 
>  Next I found out that stuff I'm setting in my CMake scripts, such as
>  CPP flags like `-std=c++14` and `-fexceptions` was not being applied.
>  For whatever reason, Gradle is overriding these from the command line
>  (I'm guessing?). So this requires me to duplicate the toolchain /
>  compiler flag setup I already do in my CMake scripts now in the Gradle
>  build scripts. This seems completely unnecessary and a maintenance
>  burden.
> 
>  What I was expecting Gradle to do was essentially provide me some
>  toolchain file so that CMake can find the compiler and linker to use
>  and then the rest would be determined by CMake itself.
> 
>  Is there a way I can tell Gradle to not take so much control over
>  compiler flags? I want my CMake scripts to do this. I can't imagine
>  they had a good reason to do this. What have others done in this
>  situation with their own Gradle + CMake integration? Looking for
>  advice here, since information is sparse, especially since the Android
>  Studio 2.2 CMake integration is relatively new stuff.
> >>> --
> >>>
> >>> Powered by www.kitware.com
> >>>
> >>> Please keep messages on-topic and check the CMake FAQ at:
> >>> http://www.cmake.org/Wiki/CMake_FAQ
> >>>
> >>> Kitware offers various services to support the CMake community. For
> more
> >>> information on each offering, please visit:
> >>>
> >>> CMake Support: http://cmake.org/cmake/help/support.html
> >>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> >>> CMake Training Courses: http://cmake.org/cmake/help/training.html
> >>>
> >>> Visit other Kitware open-source projects at
> >>> http://www.kitware.com/opensource/opensource.html
> >>>
> >>> Follow this link to 

Re: [CMake] CMake integration in Gradle (Android Studio)

2016-11-01 Thread Cong Monkey
My Android Studio Version Info:

Android Studio 2.2.1
Build #AI-145.3330264, built on October 6, 2016

May be the more import part is cmake version, I have two which all works:

~/Android/Sdk/cmake/3.6.3155560
~/Android/Sdk/cmake/3.6.3133135

hope this will be help:)



2016-10-31 22:13 GMT+08:00 Robert Dailey :
> I'm sorry but that doesn't really answer my questions.
>
> On Mon, Oct 31, 2016 at 8:55 AM, Cong Monkey  wrote:
>> Try to update your Android SDK from android studio?
>>
>>
>> 2016年10月31日 21:31,"Robert Dailey" 写道:
>>
>> Which version of Android Studio? Latest stable is 2.2 IIRC. Are you
>> talking about dev/beta builds?
>>
>> On Sun, Oct 30, 2016 at 9:04 AM, Cong Monkey  wrote:
>>> The latest release of android studio work with CMAKE well.
>>>
>>> you can create a new project with c++ support to test CMAKE support!
>>>
>>> You can follow https://code.google.com/p/android/issues/detail?id=212007
>>> to get the details.
>>>
>>> 2016-10-28 5:48 GMT+08:00 Robert Dailey :
 I'm at a bit of a loss on finding more information. Can anyone at
 least confirm that this isn't a reliable place to find the answers I'm
 looking for? Does anyone have real experience with android + gradle +
 cmake integration and can provide some pointers?

 On Tue, Oct 25, 2016 at 8:48 AM, Robert Dailey 
 wrote:
> I'm not sure if the CMake mailing lists are the right place to ask
> this question but I thought I'd ask just in case someone has gone down
> this path or has experience with what Google/Gradle is actually trying
> to accomplish with what seems to be a hand-built version of CMake with
> custom patches that are not in upstream repositories.
>
> Prior to switching to Android Studio / Gradle, I was using Eclipse /
> Ant. The way I did CMake integration was not really integration at
> all: I generated Ninja build scripts using CMake and implemented
> custom targets to run "ant release" after all the C++ projects were
> built. I made sure that CMake copied relevant *.so files to
> appropriate directories in the Ant structure so they are packaged with
> built APKs. That's how I did my Android development.
>
> Now that I'm integrating CMake into Gradle, first annoyance I noticed
> is that I can't use CMake 3.7 (or any external installation of CMake)
> with Android Studio. It requires a version of CMake installed through
> SDK Manager. This means I can't use the new Android toolchain
> functionality built into CMake 3.7 (sad face). But this is something I
> can work around...
>
> Next I found out that stuff I'm setting in my CMake scripts, such as
> CPP flags like `-std=c++14` and `-fexceptions` was not being applied.
> For whatever reason, Gradle is overriding these from the command line
> (I'm guessing?). So this requires me to duplicate the toolchain /
> compiler flag setup I already do in my CMake scripts now in the Gradle
> build scripts. This seems completely unnecessary and a maintenance
> burden.
>
> What I was expecting Gradle to do was essentially provide me some
> toolchain file so that CMake can find the compiler and linker to use
> and then the rest would be determined by CMake itself.
>
> Is there a way I can tell Gradle to not take so much control over
> compiler flags? I want my CMake scripts to do this. I can't imagine
> they had a good reason to do this. What have others done in this
> situation with their own Gradle + CMake integration? Looking for
> advice here, since information is sparse, especially since the Android
> Studio 2.2 CMake integration is relatively new stuff.
 --

 Powered by www.kitware.com

 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/CMake_FAQ

 Kitware offers various services to support the CMake community. For more
 information on each offering, please visit:

 CMake Support: http://cmake.org/cmake/help/support.html
 CMake Consulting: http://cmake.org/cmake/help/consulting.html
 CMake Training Courses: http://cmake.org/cmake/help/training.html

 Visit other Kitware open-source projects at
 http://www.kitware.com/opensource/opensource.html

 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/mailman/listinfo/cmake
>>
>>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: 

Re: [CMake] CMake integration in Gradle (Android Studio)

2016-10-31 Thread Eric Wing
So I have been using (a custom) CMake + Android Studio/Gradle for some
years now. I only recently saw that both official CMake is adding
Android support, and that the official Android tools are supporting
CMake. I’m actually still confused on the differences between the two
and what each offers in terms of features.

My custom/jury-rigged CMake is derived from the OpenCV Android
toolchain which has forked around for many years. Currently, I have a
combination of custom shell scripts + modified toolchain + modified
CMake to make things work.


My cross-platform requirements have been:

- Must generate be able to generate a new Android Studio/Gradle
project, like how Xcode, Visual Studio, etc. are generated.

- Must handle multiple Android architectures (armv5, armv7, x86, arm64, x86_64)

- Must be able to handle both the native code stuff, and the annoying
Android specific Java code in order to build a complete/working
Android application that can be installed/run through the normal
Android Studio/Gradle user interface.

- Should work on Mac, Linux, and Android



The way it currently works is:

- I have a front end scripts you must run which ultimately invoke
cmake -G “Unix Makefiles” for the Android NDK. These scripts feed my
android toolchain as well as provide the locations to the Android NDK
and SDK. Also, these scripts will generate Gradle and Android Studio
projects. (I basically brute force stripped down a real Gradle/Studio
project and figured out what values I need to inject into it to use as
a template. Many of the injected values are provided from CMake
variables I define in my project CMakeLists.txt)

- The Gradle/Studio project generated has a custom Groovy script phase
that when building, invokes an external shell script as part of the
build process. This external script ultimately calls CMake to build
the native components of the project.

- Because CMake doesn’t handle multiple architectures for Android, my
script actually generates multiple CMake projects, one for each
architecture, separated into directory structures that try to mimic
the official names of the different Android architectures. (This is
kind of brute force, and is not currently easy to opt-out of different
architectures.)

- At the end of the script phase, I use a CMake “install” to copy the
build products for each architecture to the correct location in the
Gradle/Studio Java layout, so the Java part of the build will continue
on doing the right thing.

- The rest of the Gradle/Studio build will continue on and build the
Android Java parts of the project. (I have a specific convention for
where the Android/Java files go in my project structure. Unlike the
annoying thing that Google forced us to do with ndk-build, the Java
stuff is no longer at the root of the source tree, but parked in a
special Android subdirectory. The former was a stupid/evil requirement
for every pre-existing cross-platform project out there, and an
arrogant presumption for new projects, so I did away with it.)



Here are a few videos that show the workflow (in my SDK called Blurrr)

"Workflow" in Swift: The Android Addendum (shows just the Android part)
https://www.youtube.com/watch?v=w6FY_qSi8yY


Workflow": Cross-platform Dev in Swift
(This shows the same project as above, but for the non-Android
platforms, showing it is indeed a single, unified CMake project that
can drive Linux, OS X, iOS, Windows, and Raspberry Pi (and Android).
https://www.youtube.com/watch?v=w8ftI9mpGdY


Blurrr Introduction Part 3 (Shows the different build platforms in a
little more detail. This video is the oldest, so things have improved
a bit.)
https://www.youtube.com/watch?v=exPtM-02YRY



So my wish list for the new CMake versions is that is handles all of
this. (Multi-arch and Gradle/Studio generation especially.)

I have not yet investigated how hard it will be to migrate to one of
the two other versions of CMake. Since Swift is one of my supported
languages, this currently requires me to use a forked CMake I’ve been
working on. However, I am happy to work with people who want to try to
integrate some of my features directly into CMake if they are still
missing (such as the Gradle/Studio generation).

Thanks,
Eric
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] CMake integration in Gradle (Android Studio)

2016-10-31 Thread Robert Dailey
I'm sorry but that doesn't really answer my questions.

On Mon, Oct 31, 2016 at 8:55 AM, Cong Monkey  wrote:
> Try to update your Android SDK from android studio?
>
>
> 2016年10月31日 21:31,"Robert Dailey" 写道:
>
> Which version of Android Studio? Latest stable is 2.2 IIRC. Are you
> talking about dev/beta builds?
>
> On Sun, Oct 30, 2016 at 9:04 AM, Cong Monkey  wrote:
>> The latest release of android studio work with CMAKE well.
>>
>> you can create a new project with c++ support to test CMAKE support!
>>
>> You can follow https://code.google.com/p/android/issues/detail?id=212007
>> to get the details.
>>
>> 2016-10-28 5:48 GMT+08:00 Robert Dailey :
>>> I'm at a bit of a loss on finding more information. Can anyone at
>>> least confirm that this isn't a reliable place to find the answers I'm
>>> looking for? Does anyone have real experience with android + gradle +
>>> cmake integration and can provide some pointers?
>>>
>>> On Tue, Oct 25, 2016 at 8:48 AM, Robert Dailey 
>>> wrote:
 I'm not sure if the CMake mailing lists are the right place to ask
 this question but I thought I'd ask just in case someone has gone down
 this path or has experience with what Google/Gradle is actually trying
 to accomplish with what seems to be a hand-built version of CMake with
 custom patches that are not in upstream repositories.

 Prior to switching to Android Studio / Gradle, I was using Eclipse /
 Ant. The way I did CMake integration was not really integration at
 all: I generated Ninja build scripts using CMake and implemented
 custom targets to run "ant release" after all the C++ projects were
 built. I made sure that CMake copied relevant *.so files to
 appropriate directories in the Ant structure so they are packaged with
 built APKs. That's how I did my Android development.

 Now that I'm integrating CMake into Gradle, first annoyance I noticed
 is that I can't use CMake 3.7 (or any external installation of CMake)
 with Android Studio. It requires a version of CMake installed through
 SDK Manager. This means I can't use the new Android toolchain
 functionality built into CMake 3.7 (sad face). But this is something I
 can work around...

 Next I found out that stuff I'm setting in my CMake scripts, such as
 CPP flags like `-std=c++14` and `-fexceptions` was not being applied.
 For whatever reason, Gradle is overriding these from the command line
 (I'm guessing?). So this requires me to duplicate the toolchain /
 compiler flag setup I already do in my CMake scripts now in the Gradle
 build scripts. This seems completely unnecessary and a maintenance
 burden.

 What I was expecting Gradle to do was essentially provide me some
 toolchain file so that CMake can find the compiler and linker to use
 and then the rest would be determined by CMake itself.

 Is there a way I can tell Gradle to not take so much control over
 compiler flags? I want my CMake scripts to do this. I can't imagine
 they had a good reason to do this. What have others done in this
 situation with their own Gradle + CMake integration? Looking for
 advice here, since information is sparse, especially since the Android
 Studio 2.2 CMake integration is relatively new stuff.
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/cmake
>
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] CMake integration in Gradle (Android Studio)

2016-10-31 Thread Cong Monkey
Try to update your Android SDK from android studio?

2016年10月31日 21:31,"Robert Dailey" 写道:

Which version of Android Studio? Latest stable is 2.2 IIRC. Are you
talking about dev/beta builds?

On Sun, Oct 30, 2016 at 9:04 AM, Cong Monkey  wrote:
> The latest release of android studio work with CMAKE well.
>
> you can create a new project with c++ support to test CMAKE support!
>
> You can follow https://code.google.com/p/android/issues/detail?id=212007
> to get the details.
>
> 2016-10-28 5:48 GMT+08:00 Robert Dailey :
>> I'm at a bit of a loss on finding more information. Can anyone at
>> least confirm that this isn't a reliable place to find the answers I'm
>> looking for? Does anyone have real experience with android + gradle +
>> cmake integration and can provide some pointers?
>>
>> On Tue, Oct 25, 2016 at 8:48 AM, Robert Dailey 
wrote:
>>> I'm not sure if the CMake mailing lists are the right place to ask
>>> this question but I thought I'd ask just in case someone has gone down
>>> this path or has experience with what Google/Gradle is actually trying
>>> to accomplish with what seems to be a hand-built version of CMake with
>>> custom patches that are not in upstream repositories.
>>>
>>> Prior to switching to Android Studio / Gradle, I was using Eclipse /
>>> Ant. The way I did CMake integration was not really integration at
>>> all: I generated Ninja build scripts using CMake and implemented
>>> custom targets to run "ant release" after all the C++ projects were
>>> built. I made sure that CMake copied relevant *.so files to
>>> appropriate directories in the Ant structure so they are packaged with
>>> built APKs. That's how I did my Android development.
>>>
>>> Now that I'm integrating CMake into Gradle, first annoyance I noticed
>>> is that I can't use CMake 3.7 (or any external installation of CMake)
>>> with Android Studio. It requires a version of CMake installed through
>>> SDK Manager. This means I can't use the new Android toolchain
>>> functionality built into CMake 3.7 (sad face). But this is something I
>>> can work around...
>>>
>>> Next I found out that stuff I'm setting in my CMake scripts, such as
>>> CPP flags like `-std=c++14` and `-fexceptions` was not being applied.
>>> For whatever reason, Gradle is overriding these from the command line
>>> (I'm guessing?). So this requires me to duplicate the toolchain /
>>> compiler flag setup I already do in my CMake scripts now in the Gradle
>>> build scripts. This seems completely unnecessary and a maintenance
>>> burden.
>>>
>>> What I was expecting Gradle to do was essentially provide me some
>>> toolchain file so that CMake can find the compiler and linker to use
>>> and then the rest would be determined by CMake itself.
>>>
>>> Is there a way I can tell Gradle to not take so much control over
>>> compiler flags? I want my CMake scripts to do this. I can't imagine
>>> they had a good reason to do this. What have others done in this
>>> situation with their own Gradle + CMake integration? Looking for
>>> advice here, since information is sparse, especially since the Android
>>> Studio 2.2 CMake integration is relatively new stuff.
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/
opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] CMake integration in Gradle (Android Studio)

2016-10-31 Thread Robert Dailey
Which version of Android Studio? Latest stable is 2.2 IIRC. Are you
talking about dev/beta builds?

On Sun, Oct 30, 2016 at 9:04 AM, Cong Monkey  wrote:
> The latest release of android studio work with CMAKE well.
>
> you can create a new project with c++ support to test CMAKE support!
>
> You can follow https://code.google.com/p/android/issues/detail?id=212007
> to get the details.
>
> 2016-10-28 5:48 GMT+08:00 Robert Dailey :
>> I'm at a bit of a loss on finding more information. Can anyone at
>> least confirm that this isn't a reliable place to find the answers I'm
>> looking for? Does anyone have real experience with android + gradle +
>> cmake integration and can provide some pointers?
>>
>> On Tue, Oct 25, 2016 at 8:48 AM, Robert Dailey  
>> wrote:
>>> I'm not sure if the CMake mailing lists are the right place to ask
>>> this question but I thought I'd ask just in case someone has gone down
>>> this path or has experience with what Google/Gradle is actually trying
>>> to accomplish with what seems to be a hand-built version of CMake with
>>> custom patches that are not in upstream repositories.
>>>
>>> Prior to switching to Android Studio / Gradle, I was using Eclipse /
>>> Ant. The way I did CMake integration was not really integration at
>>> all: I generated Ninja build scripts using CMake and implemented
>>> custom targets to run "ant release" after all the C++ projects were
>>> built. I made sure that CMake copied relevant *.so files to
>>> appropriate directories in the Ant structure so they are packaged with
>>> built APKs. That's how I did my Android development.
>>>
>>> Now that I'm integrating CMake into Gradle, first annoyance I noticed
>>> is that I can't use CMake 3.7 (or any external installation of CMake)
>>> with Android Studio. It requires a version of CMake installed through
>>> SDK Manager. This means I can't use the new Android toolchain
>>> functionality built into CMake 3.7 (sad face). But this is something I
>>> can work around...
>>>
>>> Next I found out that stuff I'm setting in my CMake scripts, such as
>>> CPP flags like `-std=c++14` and `-fexceptions` was not being applied.
>>> For whatever reason, Gradle is overriding these from the command line
>>> (I'm guessing?). So this requires me to duplicate the toolchain /
>>> compiler flag setup I already do in my CMake scripts now in the Gradle
>>> build scripts. This seems completely unnecessary and a maintenance
>>> burden.
>>>
>>> What I was expecting Gradle to do was essentially provide me some
>>> toolchain file so that CMake can find the compiler and linker to use
>>> and then the rest would be determined by CMake itself.
>>>
>>> Is there a way I can tell Gradle to not take so much control over
>>> compiler flags? I want my CMake scripts to do this. I can't imagine
>>> they had a good reason to do this. What have others done in this
>>> situation with their own Gradle + CMake integration? Looking for
>>> advice here, since information is sparse, especially since the Android
>>> Studio 2.2 CMake integration is relatively new stuff.
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at: 
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more 
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake integration in Gradle (Android Studio)

2016-10-30 Thread Cong Monkey
The latest release of android studio work with CMAKE well.

you can create a new project with c++ support to test CMAKE support!

You can follow https://code.google.com/p/android/issues/detail?id=212007
to get the details.

2016-10-28 5:48 GMT+08:00 Robert Dailey :
> I'm at a bit of a loss on finding more information. Can anyone at
> least confirm that this isn't a reliable place to find the answers I'm
> looking for? Does anyone have real experience with android + gradle +
> cmake integration and can provide some pointers?
>
> On Tue, Oct 25, 2016 at 8:48 AM, Robert Dailey  
> wrote:
>> I'm not sure if the CMake mailing lists are the right place to ask
>> this question but I thought I'd ask just in case someone has gone down
>> this path or has experience with what Google/Gradle is actually trying
>> to accomplish with what seems to be a hand-built version of CMake with
>> custom patches that are not in upstream repositories.
>>
>> Prior to switching to Android Studio / Gradle, I was using Eclipse /
>> Ant. The way I did CMake integration was not really integration at
>> all: I generated Ninja build scripts using CMake and implemented
>> custom targets to run "ant release" after all the C++ projects were
>> built. I made sure that CMake copied relevant *.so files to
>> appropriate directories in the Ant structure so they are packaged with
>> built APKs. That's how I did my Android development.
>>
>> Now that I'm integrating CMake into Gradle, first annoyance I noticed
>> is that I can't use CMake 3.7 (or any external installation of CMake)
>> with Android Studio. It requires a version of CMake installed through
>> SDK Manager. This means I can't use the new Android toolchain
>> functionality built into CMake 3.7 (sad face). But this is something I
>> can work around...
>>
>> Next I found out that stuff I'm setting in my CMake scripts, such as
>> CPP flags like `-std=c++14` and `-fexceptions` was not being applied.
>> For whatever reason, Gradle is overriding these from the command line
>> (I'm guessing?). So this requires me to duplicate the toolchain /
>> compiler flag setup I already do in my CMake scripts now in the Gradle
>> build scripts. This seems completely unnecessary and a maintenance
>> burden.
>>
>> What I was expecting Gradle to do was essentially provide me some
>> toolchain file so that CMake can find the compiler and linker to use
>> and then the rest would be determined by CMake itself.
>>
>> Is there a way I can tell Gradle to not take so much control over
>> compiler flags? I want my CMake scripts to do this. I can't imagine
>> they had a good reason to do this. What have others done in this
>> situation with their own Gradle + CMake integration? Looking for
>> advice here, since information is sparse, especially since the Android
>> Studio 2.2 CMake integration is relatively new stuff.
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake integration in Gradle (Android Studio)

2016-10-27 Thread Robert Dailey
I'm at a bit of a loss on finding more information. Can anyone at
least confirm that this isn't a reliable place to find the answers I'm
looking for? Does anyone have real experience with android + gradle +
cmake integration and can provide some pointers?

On Tue, Oct 25, 2016 at 8:48 AM, Robert Dailey  wrote:
> I'm not sure if the CMake mailing lists are the right place to ask
> this question but I thought I'd ask just in case someone has gone down
> this path or has experience with what Google/Gradle is actually trying
> to accomplish with what seems to be a hand-built version of CMake with
> custom patches that are not in upstream repositories.
>
> Prior to switching to Android Studio / Gradle, I was using Eclipse /
> Ant. The way I did CMake integration was not really integration at
> all: I generated Ninja build scripts using CMake and implemented
> custom targets to run "ant release" after all the C++ projects were
> built. I made sure that CMake copied relevant *.so files to
> appropriate directories in the Ant structure so they are packaged with
> built APKs. That's how I did my Android development.
>
> Now that I'm integrating CMake into Gradle, first annoyance I noticed
> is that I can't use CMake 3.7 (or any external installation of CMake)
> with Android Studio. It requires a version of CMake installed through
> SDK Manager. This means I can't use the new Android toolchain
> functionality built into CMake 3.7 (sad face). But this is something I
> can work around...
>
> Next I found out that stuff I'm setting in my CMake scripts, such as
> CPP flags like `-std=c++14` and `-fexceptions` was not being applied.
> For whatever reason, Gradle is overriding these from the command line
> (I'm guessing?). So this requires me to duplicate the toolchain /
> compiler flag setup I already do in my CMake scripts now in the Gradle
> build scripts. This seems completely unnecessary and a maintenance
> burden.
>
> What I was expecting Gradle to do was essentially provide me some
> toolchain file so that CMake can find the compiler and linker to use
> and then the rest would be determined by CMake itself.
>
> Is there a way I can tell Gradle to not take so much control over
> compiler flags? I want my CMake scripts to do this. I can't imagine
> they had a good reason to do this. What have others done in this
> situation with their own Gradle + CMake integration? Looking for
> advice here, since information is sparse, especially since the Android
> Studio 2.2 CMake integration is relatively new stuff.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake