Re: [CMake] pkg-config file format versus CMake packages

2018-05-31 Thread paul via CMake
On Thu, 2018-05-31 at 10:12 -0400, Brad King wrote: > On 05/25/2018 07:52 PM, Paul Fultz II wrote: > > What else is missing? > > The `.pc` format focuses on flat command-line strings that drop much > of the information used to generate them. For example, if library > A depends on library B then

Re: [CMake] Change compiler for certain files in the project

2017-10-31 Thread paul via CMake
On Mon, 2017-10-30 at 21:34 -0400, Aaron Boxer wrote: > > > On Sat, Oct 28, 2017 at 11:22 AM, P F wrote: > > > > > On Oct 28, 2017, at 9:50 AM, Aaron Boxer wrote: > > > > > > Hello, > > > > > > I have a cmake project on linux, and I would like to change the compiler > > > for certain files fro

Re: [CMake] Boost's CMAKE approach and the BUILD_INTERFACE generator expression

2017-10-27 Thread paul via CMake
On Fri, 2017-10-27 at 12:22 -0700, Wesley Smith wrote: > Boost's CMAKE page (http://bcm.readthedocs.io/en/latest/src/Building.html)  > says: > > So this will build the library named boost_filesystem, however, we need to > supply the dependencies to boost_filesystem and add the include directories.

Re: [CMake] About structuring cmake for big project?

2017-10-25 Thread paul via CMake
Daniel Pfeifer's Effective CMake talk is a really great resource: https://www.youtube.com/watch?v=bsXLMQ6WgIk There is also this wiki that goes over best practices and guidelines based on two of Daniel's cmake talks: https://github.com/boost-cmake/bcm/wiki/Cmake-best-practices-and-guidelines Al

Re: [CMake] conda recipe generator

2017-10-19 Thread paul via CMake
I am not sure it makes sense to generate a conda-recipe. You could have it a generate the meta.yaml file, but whats the point as you already got the source code and running cmake? Also, for the `build.sh` scripts, it should always be the same for every cmake project, something like: mkdir build c

Re: [CMake] [CMAKE] Checking if a file exist at the installing process

2017-10-18 Thread paul via CMake
You can use install(CODE) or install(SCRIPT) to run custom cmake code at install time. The only caveat is the install location is actually `$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}` instead of just `${CMAKE_INSTALL_PREFIX}`. This can happen when the user calls `make DESTDIR=` or during cpack. On Wed,

Re: [CMake] Building Boost as an ExternalProject

2017-10-02 Thread paul via CMake
For building boost with cmake you can use this cmake script: https://github.com/pfultz2/cget/blob/master/cget/cmake/boost.cmake You can drop it in at the top of the boost tree and it will build Boost.Build and then build boost with b2. This will map the cmake toolchain to the boost toolchain so t

Re: [CMake] Transitive dependencies of header libraries

2017-09-29 Thread paul via CMake
You need to do add the dependencies in the config.cmake file, which means you need to seperate the config and export file. So in your CMakeLists.txt, you would do: install(TARGETS myheaderonlylib EXPORT myheaderonlylib-targets DESTINATION include) install(EXPORT myheaderonlylib-targets DESTINATION

Re: [CMake] CMake tutorial on Github

2017-09-21 Thread paul via CMake
On Thu, 2017-09-21 at 16:23 +0200, Nagy-Egri Máté Ferenc via CMake wrote: > Hi Paul! >   > I do not quite understand your comments. >   > Are you referring to the SFML distribution model? I am aware that > deliberately forcing my end-users to ship a FindModule script sucks and I > was not trying to

Re: [CMake] CMake tutorial on Github

2017-09-20 Thread paul via CMake
This looks good, a couple of comments: - A common misconception for libraries is to generate a Find module for downstream users. You don't suggest that in the tutorial, but in the section "Shipping Find Module scripts" it would be a good idea to emphasize that is for upstream libraries not downstr

Re: [CMake] Adding compile and build type tests to CMake/CTest

2017-09-07 Thread paul via CMake
On Thu, 2017-09-07 at 02:58 -0400, Edward Diener wrote: > On 9/6/2017 11:39 PM, P F via CMake wrote: > > > > The `add_test` function can run whatever command you want it to, including > > compiling a target: > > > > add_library(foo_compile_test STATIC EXCLUDE_FROM_ALL foo_compile_test.cpp) > > ad

[CMake] Interest in adding to CMake the CMakeGet module to get dependencies

2017-08-04 Thread paul via CMake
Hi, I have a written a cmake module to get dependencies using the cget protocol here: https://github.com/pfultz2/cmake-get This is different than `ExternelProject`: * `ExternelProject` happens only during build, which allows this module to work in both in config and script mode.  * In config m

Re: [CMake] "Modern" approach to optional/multiple configurations?

2017-07-31 Thread paul via CMake
On Mon, 2017-07-24 at 10:46 +0100, Nicholas Devenish wrote: > Seen in the boost discussions on the CMake announcements: >   > > > The rest can be implemented straightforwardly as cache options so that > > > you can run cmake with options like > > > > > >   -Dvalgrind=OFF -Dtransactional-memory=ON -

Re: [CMake] Evaluate generator expressions with install interface

2017-05-31 Thread paul via CMake
So if I do something like this: function(auto_pkgconfig TARGET) get_target_property(INCLUDE_DIRS ${TARGET} INTERFACE_INCLUDE_DIRECTORIES) string(REPLACE "$" "${CMAKE_INSTALL_PREFIX}" INCLUDE_DIRS "${INCLUDE_DIRS}") file(GENERATE OUTPUT ${TARGET}.pc CONTENT " Name: ${TARGET} Cflags: