Re: [cmake-developers] Android variables

2016-11-11 Thread Ruslan Baratov via cmake-developers
On 12-Nov-16 08:21, Florent Castelli wrote:
> On 10/11/2016 16:05, Ruslan Baratov via cmake-developers wrote:
>> Hi,
>>
>> I wonder if it's possible to introduce next variables describing Android
>> tools:
>> * C preprocessor. Similar to CMAKE_CXX_COMPILER the variable that will
>> contain the path to preprocessor. Example:
>>   * CMAKE_CXX_COMPILER =
>> /toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++
>>
>>   * CMAKE_C_PREPROCESSOR =
>> /toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-cpp
>>
>> * ANDROID_TOOLCHAIN_MACHINE_NAME. In fact I'm not sure what this
>> variable mean but it's an important part of move from taka-no-me
>> toolchain to CMake 3.7. I guess it's like
>>   * CMAKE_CXX_COMPILER =
>> /toolchains/${ANDROID_TOOLCHAIN_MACHINE_NAME}-4.9/prebuilt/linux-x86_64/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++
>>
>>
>> Of course if I'm not missing something and they are not already
>> somewhere :)
>>
>> Ruslo
>
> How about ${CMAKE_C/CXX_COMPILER} -E to call the preprocessor?
I have no idea and not planning to test it because the old code was
using `cpp` preprocessor and I see no point of changing it.

> Calling it directly is kind of dangerous though since you will
> probably be missing the proper language information and other options
> that might affect the predefined preprocessor defines.
I'm not calling it directly, it was used by `configure` script of 3rd party.

> gcc has different binaries for different target archs and has some
> defines baked in, but this won't apply to Clang that uses only one
> binary and a target triple.
For clang based android toolchain the CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX
variable points to the directory with gcc, so it will find `cpp`
preprocessor too. I don't know if it's good or bad :)

Ruslo

> You'll also lose the c/c++ language definition (unless you pass -x
> c++), language standard in use...

-- 

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-developers


Re: [cmake-developers] Android variables

2016-11-11 Thread Florent Castelli

On 10/11/2016 16:05, Ruslan Baratov via cmake-developers wrote:

Hi,

I wonder if it's possible to introduce next variables describing Android
tools:
* C preprocessor. Similar to CMAKE_CXX_COMPILER the variable that will
contain the path to preprocessor. Example:
  * CMAKE_CXX_COMPILER =
/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++
  * CMAKE_C_PREPROCESSOR =
/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-cpp
* ANDROID_TOOLCHAIN_MACHINE_NAME. In fact I'm not sure what this
variable mean but it's an important part of move from taka-no-me
toolchain to CMake 3.7. I guess it's like
  * CMAKE_CXX_COMPILER =
/toolchains/${ANDROID_TOOLCHAIN_MACHINE_NAME}-4.9/prebuilt/linux-x86_64/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++

Of course if I'm not missing something and they are not already somewhere :)

Ruslo


How about ${CMAKE_C/CXX_COMPILER} -E to call the preprocessor? Calling 
it directly is kind of dangerous though since you will probably be 
missing the proper language information and other options that might 
affect the predefined preprocessor defines. gcc has different binaries 
for different target archs and has some defines baked in, but this won't 
apply to Clang that uses only one binary and a target triple. You'll 
also lose the c/c++ language definition (unless you pass -x c++), 
language standard in use...


gcc (or clang) are just "drivers". They will call the proper programs 
automatically. Either the preprocessor, the compiler (cc1) or the 
linker, so you should be able to do everything with it directly!


As for the ANDROID_TOOLCHAIN_MACHINE_NAME that is used for gcc prefix, 
it shouldn't be needed. If you rely on gcc, you should investigate on 
using Clang which is the supported compiler now in the NDK. What is your 
exact usage of the variable?



/Florent

--

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-developers


[cmake-developers] [ANNOUNCE] CMake 3.7.0 available for download

2016-11-11 Thread Robert Maynard
I am proud to announce that CMake 3.7.0 is now available for download at:
  https://cmake.org/download/

Documentation is available at:
  https://cmake.org/cmake/help/v3.7

Release notes appear below and are also published at
  https://cmake.org/cmake/help/v3.7/release/3.7.html

Some of the more significant changes in CMake 3.7 are:

* CMake now supports Cross Compiling for Android with simple
  toolchain files.

* The "Ninja" generator learned to conditionally support Fortran
  when using a "ninja" tool that has the necessary features. See
  generator documentation for details.

* The "if()" command gained new boolean comparison operations
  "LESS_EQUAL", "GREATER_EQUAL", "STRLESS_EQUAL", "STRGREATER_EQUAL",
  "VERSION_LESS_EQUAL", and "VERSION_GREATER_EQUAL".

* The "try_compile()" command source file signature now honors
  configuration-specific flags (e.g. "CMAKE__FLAGS_DEBUG") in
  the generated test project.  Previously only the default such flags
  for the current toolchain were used.  See policy "CMP0066".

* "Toolchain files" may now set "CMAKE_EXE_LINKER_FLAGS_INIT",
  "CMAKE_SHARED_LINKER_FLAGS_INIT", and
  "CMAKE_MODULE_LINKER_FLAGS_INIT" variables to initialize the
  "CMAKE_EXE_LINKER_FLAGS", "CMAKE_SHARED_LINKER_FLAGS", and
  "CMAKE_MODULE_LINKER_FLAGS" cache entries the first time a language
  is enabled in a build tree.

* CTest now supports test fixtures through the new "FIXTURES_SETUP",
  "FIXTURES_CLEANUP" and "FIXTURES_REQUIRED" test properties. When
  using regular expressions or "--rerun-failed" to limit the tests to
  be run, a fixture's setup and cleanup tests will automatically be
  added to the execution set if any test requires that fixture.

* We no longer provide Linux i386 binaries for download from
  "cmake.org" for new versions of CMake.

* Vim support files "cmake-indent.vim", "cmake-syntax.vim", and
  "cmake-help.vim" have been removed in favor of the files now
  provided from the vim-cmake-syntax project.

* Support for building CMake itself with some compilers was dropped:

  * Visual Studio 7.1 and 2005 -- superseded by VS 2008 and above

  * MinGW.org mingw32 -- superseded by MSYS2 mingw32 and mingw64

  CMake still supports generating build systems for other projects
  using these compilers.





CMake 3.7 Release Notes
***

Changes made since CMake 3.6 include the following.


New Features



Platforms
-

* CMake now supports Cross Compiling for Android with simple
  toolchain files.

* The Clang compiler is now supported on AIX.


Generators
--

* The "Ninja" generator learned to conditionally support Fortran
  when using a "ninja" tool that has the necessary features. See
  generator documentation for details.

* The "Ninja" generator learned to produce phony targets of the form
  "sub/dir/{test,install,package}" to drive the build of a
  subdirectory installation, test or packaging target. This is
  equivalent to "cd sub/dir; make {test,install,package}" with
  Makefile Generators.

* The "Visual Studio 15" generator was added.  This is experimental
  and based on Preview 4 because this version of VS has not been
  released.

* Visual Studio Generators for VS 2010 and above learned to place
  ".natvis" source files into VS project files properly.

* The "Xcode" generator's rudimentary Swift language support learned
  to honor a new "CMAKE_Swift_LANGUAGE_VERSION" variable to tell Xcode
  what version of Swift is used by the source.

* The "CodeLite" generator gained a new "CMAKE_CODELITE_USE_TARGETS"
  option to change project creation from projects to targets.


Commands


* The "add_custom_command()" command gained a new "DEPFILE" option
  that works with the "Ninja" generator to provide implicit dependency
  information to the build tool.

* The "cmake_parse_arguments()" command gained a new "PARSE_ARGV"
  mode to read arguments directly from "ARGC" and "ARGV#" variables
  inside a "function()" body.

* The "export()" command gained an "ANDROID_MK" option to generate
  "Android.mk" files referencing CMake-built libraries as prebuilts
  for the Android NDK build system.

* The "file(DOWNLOAD)" and "file(UPLOAD)" commands gained
  "HTTPHEADER " and "USERPWD :"
  options.

* The "find_library()" and "find_package()" commands learned to
  search in "lib32/" directories when the build targets a 32-bit
  architecture.  See the "FIND_LIBRARY_USE_LIB32_PATHS" global
  property.

* The "find_package()" command gained the possibility of sorting
  compatible libraries by "NAME" or by "NATURAL" sorting by setting
  the two new variables "CMAKE_FIND_PACKAGE_SORT_ORDER" and
  "CMAKE_FIND_PACKAGE_SORT_DIRECTION".

* The "if()" command gained new boolean comparison operations
  "LESS_EQUAL", "GREATER_EQUAL", "STRLESS_EQUAL", "STRGREATER_EQUAL",
  "VERSION_LESS_EQUAL", and "VERSION_GREATER_EQUAL".

* The "install()" command gained an "EXPORT_ANDROID_MK" subcommand
  to install "Android.mk" files referencing installed 

Re: [cmake-developers] Android variables

2016-11-11 Thread Brad King
On 11/11/2016 08:28 AM, Ruslan Baratov wrote:
> Even if they may not be needed in regular CMake code such variables can be 
> useful "outside".

Okay, thanks.  I'll investigate how to properly expose this information.

-Brad

-- 

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-developers


Re: [cmake-developers] Android variables

2016-11-11 Thread Ruslan Baratov via cmake-developers
On 11-Nov-16 21:09, Brad King wrote:
> On 11/10/2016 10:46 PM, Ruslan Baratov wrote:
>> the value 
>> "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}cpp${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
> This expression is the documented way to get the paths to the Android tools.
> I see no reason to add a pre-evaluated copy for every tool.
Reason is the same as with CMAKE_GDBSERVER variable. Instead of forcing
users to redefine (probably with different names) this variable each
time we can do it once in CMake.

>
>> ANDROID_TOOLCHAIN_MACHINE_NAME?
> In your original message it looked like you needed this only to construct
> the path above.
Nope, this one needed too.

>
>> get_filename_component(ANDROID_TOOLCHAIN_MACHINE_NAME 
>> "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}" NAME)
>> string(REGEX REPLACE "-$" "" ANDROID_TOOLCHAIN_MACHINE_NAME 
>> "${ANDROID_TOOLCHAIN_MACHINE_NAME}")
> AFAICT the only meaning this value has is exactly what that code expresses.
>
> What is your use case for getting this value and why is it needed separately?
Even if they may not be needed in regular CMake code such variables can
be useful "outside". Autotools based projects use
ANDROID_TOOLCHAIN_MACHINE_NAME variable: `./configure
--host=${ANDROID_TOOLCHAIN_MACHINE_NAME}`. Preprocessor is required too:
`CPP=${CMAKE_C_PREPROCESSOR} ./configure`. Variables
ANDROID_NDK_HOST_SYSTEM_NAME and ANDROID_COMPILER_VERSION is used in
tool `androiddeployqt` which do build Qt application for Android.

Ruslo

-- 

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-developers

Re: [cmake-developers] Android variables

2016-11-11 Thread Brad King
On 11/11/2016 08:11 AM, Ruslan Baratov wrote:
> What about making it public?

Please explain your use case for each piece of information you request.
Maybe there is already a way to do it.

-Brad

-- 

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-developers


Re: [cmake-developers] Android variables

2016-11-11 Thread Ruslan Baratov via cmake-developers
On 10-Nov-16 23:05, Ruslan Baratov via cmake-developers wrote:
>  * CMAKE_CXX_COMPILER =
> /toolchains/${ANDROID_TOOLCHAIN_MACHINE_NAME}-4.9/prebuilt/linux-x86_64/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++
Actually there are more variables here, ANDROID_COMPILER_VERSION and
ANDROID_NDK_HOST_SYSTEM_NAME:
 
/toolchains/${ANDROID_TOOLCHAIN_MACHINE_NAME}-${ANDROID_COMPILER_VERSION}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++

ANDROID_COMPILER_VERSION is similar to
CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION. However
CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION is designed to be set by user as far
as I understand. It is empty by default.
ANDROID_NDK_HOST_SYSTEM_NAME called _ANDROID_HOST_DIR in CMake 3.7 and
used only internally. What about making it public?

Ruslo
-- 

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-developers


Re: [cmake-developers] Android variables

2016-11-11 Thread Brad King
On 11/10/2016 10:46 PM, Ruslan Baratov wrote:
> the value 
> "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}cpp${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"

This expression is the documented way to get the paths to the Android tools.
I see no reason to add a pre-evaluated copy for every tool.

> ANDROID_TOOLCHAIN_MACHINE_NAME?

In your original message it looked like you needed this only to construct
the path above.

> get_filename_component(ANDROID_TOOLCHAIN_MACHINE_NAME 
> "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}" NAME)
> string(REGEX REPLACE "-$" "" ANDROID_TOOLCHAIN_MACHINE_NAME 
> "${ANDROID_TOOLCHAIN_MACHINE_NAME}")

AFAICT the only meaning this value has is exactly what that code expresses.

What is your use case for getting this value and why is it needed separately?

-Brad

-- 

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-developers