[CMake] CMAKE custom compiler for Android

2017-11-28 Thread Ramya G via CMake
HI All,

 

We are working towards creating a toolchain file for an ANDROID compiler

 

We understand that the flow in CMAKE, when CMAKE_SYSTEM_NAME is specified in
Android is different when compared to specifying CMAKE_SYSTEM_NAME as IOS or
LINUX

 

Please validate our current understanding when a toolchain file or
command-line option sets CMAKE_SYSTEM_NAME to "Android" 

 

*   CMakeDetermineSystem.cmake loads this file:
Android-Determine.cmake
*   Next is the platform-specific initialization step:
CMakeSystemSpecificInitialize.cmake which loads Android-Initialize.cmake to
select the sysroot.
*   A "determine" step also runs for each language when it is first
enabled in a new build tree:

 

Android-Determine-C.cmake

Android-Determine-CXX.cmake

 

*   The language files go here:

 

Determine-Compiler.cmake

Determine-Compiler-NDK.cmake

 

*   The latter file is where we parse a bunch of information from the
NDK.

The results persist in CMakeFiles/$v/CMake${lang}Compiler.cmake for future
runs.

 

Next is the language-specific initialization step. For  Example - in case
{lang} is C : CMakeCInformation.cmake

 

That loads one of these:

 

Android-GNU-C.cmake

Android-Clang-C.cmake

 

which loads one of these:

 

Android-GNU.cmake

Android-Clang.cmake  

 

Determine-Compiler-NDK.cmake is where cmake looks for versions of clang or
gcc or llvm toolchains and sets the appropriate compiler.

 

 

Our Requirement and Problem statement

When we tried manually setting a c and cxx compiler from a toolchain file,
cmake would not allow us to point to our own compilers. Ideally, we want our
toolchain file to tell cmake the libraries to include/link and the compilers
to use. But once, System has been determined as android, cmake goes through
the above sequence of events and expects toolchains to be specified for
either clang, gcc or llvm compilers.

 

We would probably need to make changes in the following files to accommodate
cmake to use our own compilers.

Determine-Compiler-NDK.cmake  - We would need to add support for an
"NewCompiler Toolchain" which would contain android libraries and compilers.

 

New Android-{NewCompiler}-C.cmake, Android-{ NewCompiler }-CXX.cmake,
Android-{ NewCompiler }.cmake and another appropriate toolchain file to set
target architecture and compiler flags.

 

 

Can you please provide your suggestions and validate the understanding as
well

 

Thanks & Regards,

Ramya

 

 

-- 

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

[Cmake-commits] CMake branch, master, updated. v3.10.0-425-ga4ddc73

2017-11-28 Thread Kitware Robot
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, master has been updated
   via  a4ddc7357ae880b3695dccec44e383cfa77c7572 (commit)
  from  8b5ae1c1d310fc6eb13b2cde5712b4e319f01f3e (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 -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a4ddc7357ae880b3695dccec44e383cfa77c7572
commit a4ddc7357ae880b3695dccec44e383cfa77c7572
Author: Kitware Robot <kwro...@kitware.com>
AuthorDate: Wed Nov 29 00:01:04 2017 -0500
Commit: Kitware Robot <kwro...@kitware.com>
CommitDate: Wed Nov 29 00:01:04 2017 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 500a872..eca7be2 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 10)
-set(CMake_VERSION_PATCH 20171128)
+set(CMake_VERSION_PATCH 20171129)
 #set(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


Re: [CMake] CPack OS X bundle : generator expression for CPACK_BUNDLE_STARTUP_COMMAND

2017-11-28 Thread Oleksii Vilchanskyi
Hi,

`set()` is evaluated at configuration time and as of CMake 3.10 does not
accept genexps. You can refer to this diagram for better understanding
of the general CMake pipeline:


Therefore,

>   SET ( APP_LOCATION "$" )
>   SET ( CPACK_BUNDLE_STARTUP_COMMAND ${APP_LOCATION} )

is interpreted exactly how it's written:

> CPack Error: Error copying $ to...

Due to this limitation your [probably] sole option to introduce genxps
in CPack config would be to use `file(GENERATE)`. Otherwise, use
single-configuration generators and you won't have
configuration-dependent paths.

On 29.11.2017 01:50, Nicholas Yue wrote:
> I am using CMake 3.10
> 
> I can't seems to find a way to tell the OS X bundle where to find the
> compiled binary.
> 
> I get the following errors:
> 
> Run CPack packaging tool...
> CPack: Create package using Bundle
> CPack: Install projects
> CPack: - Run preinstall target for: OSXBundle
> CPack: - Install project: OSXBundle
> CPack: Create package
> CPack Error: Error copying $ to
> /Users/nicholas/projects/OSX_BundleRPath/build/_CPack_Packages/Darwin/Bundle/OSXBundle-0.1.1-Darwin/MyApp.app/Contents/MacOS/MyApp
> CPack Error: Error copying startup command.  Check the value of
> CPACK_BUNDLE_STARTUP_COMMAND.
> CPack Error: Problem compressing the directory
> CPack Error: Error when generating package: OSXBundle
> make: *** [package] Error 1
> 
> 
> I have the following CMakeLists.txt:
> 
> CMAKE_MINIMUM_REQUIRED(VERSION 3.8)
> 
> PROJECT (OSXBundle)
> 
> FIND_PACKAGE (Boost REQUIRED)
> 
> ADD_EXECUTABLE (myapp
>   src/main.cpp
>   )
> 
> INSTALL ( TARGETS
>   myapp
>   DESTINATION
>   ./bin
>   )
> 
> IF (APPLE)
>   # GET_TARGET_PROPERTY ( APP_LOCATION myapp LOCATION )
>   SET ( APP_LOCATION "$" )
>   
>   SET ( CPACK_BUNDLE_NAME "MyApp" )
>   
>   SET ( CPACK_GENERATOR "Bundle" )
>   SET ( CPACK_BUNDLE_PLIST
> ${CMAKE_CURRENT_SOURCE_DIR}/resources/Info.plist )
>   SET ( CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/resources/MyApp.icns )
>   SET ( CPACK_PACKAGE_ICON
> ${CMAKE_CURRENT_SOURCE_DIR}/resources/MyApp.icns )
>   SET ( CPACK_BUNDLE_STARTUP_COMMAND ${APP_LOCATION} )
> ENDIF ()
> 
> INCLUDE ( CPack )
> 
> 
> 

-- 
Regards,
Oleksii Vilchanskyi
PGP:0x8D3A0E046BDE941F2A53867CE3FD952D48C0B338

***
All the world's a pipeline,
And all the men and women merely instructions.



signature.asc
Description: OpenPGP digital signature
-- 

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

[CMake] CPack OS X bundle : generator expression for CPACK_BUNDLE_STARTUP_COMMAND

2017-11-28 Thread Nicholas Yue
I am using CMake 3.10

I can't seems to find a way to tell the OS X bundle where to find the
compiled binary.

I get the following errors:

Run CPack packaging tool...
CPack: Create package using Bundle
CPack: Install projects
CPack: - Run preinstall target for: OSXBundle
CPack: - Install project: OSXBundle
CPack: Create package
CPack Error: Error copying $ to
/Users/nicholas/projects/OSX_BundleRPath/build/_CPack_Packages/Darwin/Bundle/OSXBundle-0.1.1-Darwin/MyApp.app/Contents/MacOS/MyApp
CPack Error: Error copying startup command.  Check the value of
CPACK_BUNDLE_STARTUP_COMMAND.
CPack Error: Problem compressing the directory
CPack Error: Error when generating package: OSXBundle
make: *** [package] Error 1


I have the following CMakeLists.txt:

CMAKE_MINIMUM_REQUIRED(VERSION 3.8)

PROJECT (OSXBundle)

FIND_PACKAGE (Boost REQUIRED)

ADD_EXECUTABLE (myapp
  src/main.cpp
  )

INSTALL ( TARGETS
  myapp
  DESTINATION
  ./bin
  )

IF (APPLE)
  # GET_TARGET_PROPERTY ( APP_LOCATION myapp LOCATION )
  SET ( APP_LOCATION "$" )

  SET ( CPACK_BUNDLE_NAME "MyApp" )

  SET ( CPACK_GENERATOR "Bundle" )
  SET ( CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/Info.plist
)
  SET ( CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/resources/MyApp.icns )
  SET ( CPACK_PACKAGE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/resources/MyApp.icns
)
  SET ( CPACK_BUNDLE_STARTUP_COMMAND ${APP_LOCATION} )
ENDIF ()

INCLUDE ( CPack )
-- 

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] No token in ExternalProject

2017-11-28 Thread cmake
Thanks for the link and the suggestion. The latter is similar to one of the 
things I've tried - splitting the external project into two external projects 
with one just managing the download. It seemed like a workaround for something 
which I expected to be an usual use case. Hence I thought I might be missing 
something. This doesn’t seem to be the case, so I’ll submit a feature request 
to add a token .

Thanks again,
Bjorn

> On 27. Nov 2017, at 13:12, Craig Scott  wrote:
> 
> 
> 
> On Mon, Nov 27, 2017 at 10:22 PM,  wrote:
> Hello all,
>  
> I'm surprised that there is no token  available in 
> ExternalProject.
>  
> As written in the documentation [1] there are tokens , 
> , , , and . But 
>  seems to be missing. 
> 
> The relevant part of the module code is here. It does seem to be an 
> unexpected omission, but I don't know if there's a reason for it or not.
> 
> 
>  
>  
> However if I have an external project with a custom DOWNLOAD_COMMAND it would 
> be handy to be able to use  in the following steps.
>  
> Is there another way to know the download directory without setting it 
> explicitely? 
> 
> You can retrieve it with ExternalProject_Get_Property(myExtProj 
> DOWNLOAD_DIR), which will store the result in a variable also named 
> DOWNLOAD_DIR. That's a bit tricky though, since you can only call that after 
> you've defined the download command in your ExternalProject_Add() call. You 
> could define a custom step in a subsequent call and perhaps set up 
> dependencies between steps to get the behaviour you want, but it does seem 
> unnecessarily fiddly.
> 
> 
> 
> 
> -- 
> Craig Scott
> Melbourne, Australia
> https://crascit.com

-- 

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