Re: [cmake-developers] [CMake] dependencies of cross compiliations

2018-12-03 Thread Torsten Robitzki
> Am 27.11.2018 um 19:55 schrieb Eric Noulard :
> 
> However from my point of view and my cross-compiling experience when you 
> cross-compile you have:
> 
> 1) the host compiler which is used to compile "host tools"
> 2) the target compiler (may be several of them) to "cross-compile"
> 
> My assumption are:
>  a) when you cross-compile your build is a "whole" and you shouldn't have to 
> setup some superbuild
>structure for building host tools ht_exe and another for target1 tool 
> t1t_exe and another one for target2 tool t2t_exe.
> 
>  b) what you want is to build:
>  ht_exe for the host
>  possibly use ht_exe during the build to generate some [source] file
>  t1t_exe for the [cross]target1
>  t2t_exe for the [cross]target2
> 
>  c)  you seldomly compile the same source for the host AND the target, but it 
> may happen.

In case, you are doing unit tests, it’s normal to have the same code running in 
a test on the host platform and in the final binary on the target.

I think, having more than 1 target platform becomes more and more normal as it 
becomes more usual to have multiple microcontrollers in a project.

Previously, I have encoded this in the build type. So instead of just having 
Debug and Release, I had HOST_Debug, HOST_Release NRF51_Debug, NRF51_Release, 
STM8_Debug, STM8_Release and so on. It doesn’t annoy me very much, that I have 
to run CMake 3 times to get all the binaries for a release build. The problem 
that I have, are dependencies between this builds. If I write a tool that (for 
example) generates source files for one of the target platforms, the build for 
the host platform must run before the build for that target platform. And when 
I make changes to that tool, I want the build to regenerate the generated 
source files.

Keeping track of this dependencies to solve this kind of ordering issues and to 
allow minimum rebuilds, is the main purpose of any build system. To solve this 
with CMake, I think we need a way to define the dependencies between build 
types (in the example above, from the generator from the host build to the 
generated source file in one of the target builds) and CMake needs to know the 
build directory for all build types (not only the current).

> The wish-season is coming up, so that's sort of what I would like to
> have. Now it's your turn. No bikeshedding please, only deliveries ;)

How about ``add_dependencies()`` allowing me to define dependencies between 
different build types? :-)

best regards,
Torsten


signature.asc
Description: Message signed with OpenPGP
-- 

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:
https://cmake.org/mailman/listinfo/cmake-developers


Re: [CMake] dependencies of cross compiliations

2018-12-03 Thread Torsten Robitzki
> Am 27.11.2018 um 19:55 schrieb Eric Noulard :
> 
> However from my point of view and my cross-compiling experience when you 
> cross-compile you have:
> 
> 1) the host compiler which is used to compile "host tools"
> 2) the target compiler (may be several of them) to "cross-compile"
> 
> My assumption are:
>  a) when you cross-compile your build is a "whole" and you shouldn't have to 
> setup some superbuild
>structure for building host tools ht_exe and another for target1 tool 
> t1t_exe and another one for target2 tool t2t_exe.
> 
>  b) what you want is to build:
>  ht_exe for the host
>  possibly use ht_exe during the build to generate some [source] file
>  t1t_exe for the [cross]target1
>  t2t_exe for the [cross]target2
> 
>  c)  you seldomly compile the same source for the host AND the target, but it 
> may happen.

In case, you are doing unit tests, it’s normal to have the same code running in 
a test on the host platform and in the final binary on the target.

I think, having more than 1 target platform becomes more and more normal as it 
becomes more usual to have multiple microcontrollers in a project.

Previously, I have encoded this in the build type. So instead of just having 
Debug and Release, I had HOST_Debug, HOST_Release NRF51_Debug, NRF51_Release, 
STM8_Debug, STM8_Release and so on. It doesn’t annoy me very much, that I have 
to run CMake 3 times to get all the binaries for a release build. The problem 
that I have, are dependencies between this builds. If I write a tool that (for 
example) generates source files for one of the target platforms, the build for 
the host platform must run before the build for that target platform. And when 
I make changes to that tool, I want the build to regenerate the generated 
source files.

Keeping track of this dependencies to solve this kind of ordering issues and to 
allow minimum rebuilds, is the main purpose of any build system. To solve this 
with CMake, I think we need a way to define the dependencies between build 
types (in the example above, from the generator from the host build to the 
generated source file in one of the target builds) and CMake needs to know the 
build directory for all build types (not only the current).

> The wish-season is coming up, so that's sort of what I would like to
> have. Now it's your turn. No bikeshedding please, only deliveries ;)

How about ``add_dependencies()`` allowing me to define dependencies between 
different build types? :-)

best regards,
Torsten


signature.asc
Description: Message signed with OpenPGP
-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Build and run an external project

2018-12-03 Thread Eric Noulard
Le mar. 4 déc. 2018 à 06:11, James Bigler  a écrit :

> Unfortunately I don't think your suggestion will work.
>
> I need to invoke a custom executable to build my project and not a
> msproject.  I also need to copy the executable into the build directory.
>

Sorry I miss the fact that you moved the executable around and was not a
"regular" compile.
I've read your message too fast, obviously, sorry.

I'm not much a Visual Studio user and it has been a long time since I need
to compile something on windows.

You basically require that an executable not built by VS appears as a
"runnable/debuggable" target in VS?
Are you able to do that from VS "manually" ?

Again I'm no VS/Windows specialist so others may have more valuable remark
on that.

-- 
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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] linked dependencies in exported cmake package

2018-12-03 Thread Sergei Nikulov
вт, 4 дек. 2018 г. в 10:13, Stéphane Ancelot :
>
> Hi,
>
> I made an exported package for a library that needs linking qt5.
>
> find_package() works to find my library , however, I don't know how to
> handle the linking of external libs needed by this package.
>
> I suppose that must be managed inside the exported package, by which way ?

I use the following way
set_target_properties( PROPERTIES
INTERFACE_LINK_LIBRARIES )

Ref here 
https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_LINK_LIBRARIES.html

> Regards,
>
> S.Ancelot
>
> --
>
> 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:
> https://cmake.org/mailman/listinfo/cmake



-- 
Best Regards,
Sergei Nikulov
-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] linked dependencies in exported cmake package

2018-12-03 Thread Stéphane Ancelot

Hi,

I made an exported package for a library that needs linking qt5.

find_package() works to find my library , however, I don't know how to 
handle the linking of external libs needed by this package.


I suppose that must be managed inside the exported package, by which way ?

Regards,

S.Ancelot

--

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Build and run an external project

2018-12-03 Thread James Bigler
Unfortunately I don't think your suggestion will work.

I need to invoke a custom executable to build my project and not a
msproject.  I also need to copy the executable into the build directory.


On Mon, Dec 3, 2018 at 9:55 PM Eric Noulard  wrote:

> Did you check whether if
> https://cmake.org/cmake/help/latest/command/include_external_msproject.html
>
> wouldn't be better in your case?
>
>
> Le mar. 4 déc. 2018 01:43, James Bigler  a écrit :
>
>> I have an external project that I would like to compile using their build
>> system, and be able to set the VS_COMMAND to the result of the project so I
>> can run it.
>>
>>   add_custom_target(${cmake_target}
>> COMMAND make mytarget ${BUILD_ARGS}
>> COMMAND ${CMAKE_COMMAND} -E copy_if_different
>> ${PATH_TO_EXTERNAL}/mytarget.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$
>> WORKING_DIRECTORY ${PATH_TO_EXTERNAL}
>> )
>>   set_property( TARGET ${cmake_target} PROPERTY VS_DEBUGGER_COMMAND
>> "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/mytarget.exe" )
>>
>> The VS_DEBUGGER_COMMAND works for targets such as add_executable, but not
>> for add_custom_target.
>>
>> Is there a way to get what I want?
>>
>> Note that this is part of a larger CMake project that builds most of the
>> other stuff using CMake, but I have a few external projects that I would
>> like as part of the main solution.
>>
>> Thanks,
>> James
>> --
>>
>> 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:
>> https://cmake.org/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:
https://cmake.org/mailman/listinfo/cmake


[Cmake-commits] CMake branch, master, updated. v3.13.1-562-gb8db797

2018-12-03 Thread Kitware Robot via Cmake-commits
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  b8db797ae3762af3d3877119ff64f0121f2650f3 (commit)
  from  985a57a1c1ca6989524805bb3e91a222906f88ca (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=b8db797ae3762af3d3877119ff64f0121f2650f3
commit b8db797ae3762af3d3877119ff64f0121f2650f3
Author: Kitware Robot 
AuthorDate: Tue Dec 4 00:01:05 2018 -0500
Commit: Kitware Robot 
CommitDate: Tue Dec 4 00:01:05 2018 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 8e39b95..9d65885 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 13)
-set(CMake_VERSION_PATCH 20181203)
+set(CMake_VERSION_PATCH 20181204)
 #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
https://cmake.org/mailman/listinfo/cmake-commits


Re: [CMake] Build and run an external project

2018-12-03 Thread Eric Noulard
Did you check whether if
https://cmake.org/cmake/help/latest/command/include_external_msproject.html

wouldn't be better in your case?


Le mar. 4 déc. 2018 01:43, James Bigler  a écrit :

> I have an external project that I would like to compile using their build
> system, and be able to set the VS_COMMAND to the result of the project so I
> can run it.
>
>   add_custom_target(${cmake_target}
> COMMAND make mytarget ${BUILD_ARGS}
> COMMAND ${CMAKE_COMMAND} -E copy_if_different
> ${PATH_TO_EXTERNAL}/mytarget.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$
> WORKING_DIRECTORY ${PATH_TO_EXTERNAL}
> )
>   set_property( TARGET ${cmake_target} PROPERTY VS_DEBUGGER_COMMAND
> "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/mytarget.exe" )
>
> The VS_DEBUGGER_COMMAND works for targets such as add_executable, but not
> for add_custom_target.
>
> Is there a way to get what I want?
>
> Note that this is part of a larger CMake project that builds most of the
> other stuff using CMake, but I have a few external projects that I would
> like as part of the main solution.
>
> Thanks,
> James
> --
>
> 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:
> https://cmake.org/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:
https://cmake.org/mailman/listinfo/cmake


[CMake] Build and run an external project

2018-12-03 Thread James Bigler
I have an external project that I would like to compile using their build
system, and be able to set the VS_COMMAND to the result of the project so I
can run it.

  add_custom_target(${cmake_target}
COMMAND make mytarget ${BUILD_ARGS}
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${PATH_TO_EXTERNAL}/mytarget.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$
WORKING_DIRECTORY ${PATH_TO_EXTERNAL}
)
  set_property( TARGET ${cmake_target} PROPERTY VS_DEBUGGER_COMMAND
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/mytarget.exe" )

The VS_DEBUGGER_COMMAND works for targets such as add_executable, but not
for add_custom_target.

Is there a way to get what I want?

Note that this is part of a larger CMake project that builds most of the
other stuff using CMake, but I have a few external projects that I would
like as part of the main solution.

Thanks,
James
-- 

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:
https://cmake.org/mailman/listinfo/cmake