Re: [CMake] ExternalProject + PREFIX + CPACK - cannot get the good path

2017-07-18 Thread Eric Noulard
2017-07-17 22:54 GMT+02:00 Alfred Sawaya : > Hello folks, > > I am trying to create a package with CPack from an External Project using > the autotools. The make install part try to copy files to /usr/local/lib, > but I do not want to package as root, so it fails. The cpack works because > (I thin

Re: [CMake] ExternalProject + PREFIX + CPACK - cannot get the good path

2017-07-18 Thread Alfred Sawaya
Bonjour Eric, Thank you for you answer. > e.g. note that with your current setup if you do: > DESTDIR=/tmp make package > > you get what you want in the DEB file. > Yes, it works. > >> I see only one solution to this issue: actually set a prefix on the >> external project and implement a boo

[CMake] how to specify static library dependency on current project in CMakeLists.txt

2017-07-18 Thread Zahid Iqbal
Hi List, Previously, I posted a question, I will rephrase it here. I am building a simple project "my_application". I have all source (.c, and .h files) under "my_application". My CMakeLists.txt file is under "my_application". In this project, I need to link to a static library called "example_li

Re: [CMake] Append to property COMPILE_DEFINITIONS

2017-07-18 Thread Craig Scott
It might be easier if you showed the whole CMakeLists.txt file so we can see the full picture. Is it available somewhere you can link to, or even better if it's small enough, just post it inline here. On Tue, Jul 18, 2017 at 1:21 PM, Florian Lindner wrote: > Am 18.07.2017 um 10:59 schrieb Craig

Re: [CMake] Append to property COMPILE_DEFINITIONS

2017-07-18 Thread Craig Scott
On Tue, Jul 18, 2017 at 1:21 PM, Florian Lindner wrote: > Am 18.07.2017 um 10:59 schrieb Craig Scott: > > You appear to be setting a GLOBAL property where you probably meant > DIRECTORY. You could also consider setting the > > target property instead rather than applying it to all targets (unless

Re: [CMake] Append to property COMPILE_DEFINITIONS

2017-07-18 Thread Florian Lindner
Am 18.07.2017 um 18:08 schrieb Craig Scott: > It might be easier if you showed the whole CMakeLists.txt file so we can see > the full picture. Is it available somewhere > you can link to, or even better if it's small enough, just post it inline > here. Sure! It's not too long, so I'll paste it h

Re: [CMake] How to get list of generated object-files of OBJECT-library?

2017-07-18 Thread Deniz Bahadir
Am 17.07.2017 um 18:41 schrieb Deniz Bahadir: Am 17.07.2017 um 17:15 schrieb Nils Gladitz: On 17.07.2017 17:13, Deniz Bahadir wrote: Am 17.07.2017 um 16:47 schrieb Nils Gladitz: On 7/17/2017 3:52 PM, Deniz Bahadir wrote: This works just fine. However, now I want to add an additional build-s

Re: [CMake] ExternalProject + PREFIX + CPACK - cannot get the good path

2017-07-18 Thread Eric Noulard
> > >> Which makes me think, if you primary goal is to package an external >> project, wouldn't it be simpler to add support for a "PACKAGE" step to >> ExternalProject ? Or is this external project meant to be packaged in the >> same package as the project using it? >> > > I cannot add a package st

[CMake] Copying target output file to another directory

2017-07-18 Thread Robert Dailey
So I need to copy the output *.so from a target to an arbitrary directory outside the CMAKE_BINARY_DIR. I tried doing this as a post build event using generator expressions: add_custom_command( TARGET ${target} POST_BUILD VERBATIM COMMAND ${CMAKE_COMMAND} -E copy "$" ${dir} ) This fails b

Re: [CMake] ExternalProject + PREFIX + CPACK - cannot get the good path

2017-07-18 Thread Alfred Sawaya
> > May be you can do that with ExternalProject_Add_Step in your own > CMakeLists.txt ? > > Something like (untested): > > ExternalProject_Add_Step(sqlcipher package > COMMAND "cpack" > WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} > COMMENT "Package with cpack" > DEPENDEES "install

Re: [CMake] Copying target output file to another directory

2017-07-18 Thread Robert Maynard
Question: Is there a specific reason why you don't want to do this as part of the install step? If this can't be done at install time, you can look at using add_custom_command Generating File signature with a target dependency on ${target} On Tue, Jul 18, 2017 at 10:44 AM, Robert Dailey wrote: >

Re: [CMake] Transitive behavior of target_link_libraries between shared/static

2017-07-18 Thread Eric Noulard
2017-07-17 17:31 GMT+02:00 Robert Dailey : > Suppose I have the following: > > ``` > add_library( A STATIC ${files} ) > > add_library( B SHARED ${more_files} ) > target_link_libraries( B PUBLIC A ) > > add_library( C STATIC ${even_more_files} ) > target_link_libraries( C PUBLIC B ) > > > add_execu

Re: [CMake] Transitive behavior of target_link_libraries between shared/static

2017-07-18 Thread Hendrik Sattler
Am 18. Juli 2017 18:02:40 MESZ schrieb Eric Noulard : >2017-07-17 17:31 GMT+02:00 Robert Dailey : > >> Suppose I have the following: >> >> ``` >> add_library( A STATIC ${files} ) >> >> add_library( B SHARED ${more_files} ) >> target_link_libraries( B PUBLIC A ) >> >> add_library( C STATIC ${even_

Re: [CMake] Copying target output file to another directory

2017-07-18 Thread Robert Dailey
This is part of a lot of complex logic to integrate ANT into CMake as transparently as possible to assist in integrating Android support (building Java and APK). So I do not use INSTALL targets. This is an implementation detail since the libs are required in a specific directory so that ANT can pac

[CMake] Boost moves to CMake

2017-07-18 Thread Gonzalo Garramuño
Just posted in the boost mailing list. Congratulations to both teams! -- Gonzalo Garramuño -- 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 in

[CMake] [ANNOUNCE] CMake 3.9.0 available for download

2017-07-18 Thread Robert Maynard
I am proud to announce that CMake 3.9.0 is now available for download at: https://cmake.org/download/ Documentation is available at: https://cmake.org/cmake/help/v3.9 Release notes appear below and are also published at https://cmake.org/cmake/help/v3.9/release/3.9.html Some of the more si

Re: [CMake] Transitive behavior of target_link_libraries between shared/static

2017-07-18 Thread Robert Dailey
Maybe I'm missing something here, but that linked article doesn't really address my specific case. And his definition is technically correct, as long as CMake is smart enough to handle the case where (again in my example) A does not need to be explicitly linked to D because they were already linked

Re: [CMake] Boost moves to CMake

2017-07-18 Thread Konstantin Podsvirov
Hello all! 18.07.2017, 20:48, "Gonzalo Garramuño" :> Just posted in the boost mailing list. Congratulations to both teams!> It seems that we are talking about this thread: https://lists.boost.org/Archives/boost/2017/07/237248.php > --> Gonzalo Garramuño>> -->> Powered by www.kitware.com>> Please ke

[CMake] Best way to append "--no-undefined" to shared link flags?

2017-07-18 Thread Robert Dailey
For only compilers that support it (I guess any clang/gcc compiler?), I want my shared libs to link with "--no-undefined". What is the best (most modern) way using CMake 3.9.0 and forward to do this? Is it still to explicitly set CMAKE_SHARED_LINKER_FLAGS? How does this impact using toolchain files

[CMake] How to make a Fortran file dependent on #inclde files

2017-07-18 Thread T.Sariyski
Hi, I have a Fortran project with numerous #include files. When a #include file is changed, CMake does not detect the change, and does not rebuild the objects using this include file. In order to reflect the change, currently I ‘make clean; make’, which rebuilds the entire project. Is ther

Re: [CMake] Best way to append "--no-undefined" to shared link flags?

2017-07-18 Thread Robert Dailey
+CMake dev list After googling I came up with this: set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) After talking more with the NDK devs on github though, they seem to indicate this should happen by default (or at least, it does with the CMake that ships w

Re: [CMake] Transitive behavior of target_link_libraries between shared/static

2017-07-18 Thread Eric Noulard
2017-07-18 19:15 GMT+02:00 Hendrik Sattler : > > > Am 18. Juli 2017 18:02:40 MESZ schrieb Eric Noulard < > eric.noul...@gmail.com>: > >2017-07-17 17:31 GMT+02:00 Robert Dailey : > > > >> Suppose I have the following: > >> > >> ``` > >> add_library( A STATIC ${files} ) > >> > >> add_library( B SHAR