[CMake] CMake Checks Cache

2018-04-23 Thread Cristian Adam
Hi, If you use CMake in a CI you should probably have a look at how to speed up your CMake build: https://github.com/cristianadam/cmake-checks-cache In the case of LLVM + Clang on a Windows box the speed up was either 2.66x or 3.32x, depending on the CMake generator. Even if you don't use CMake

[CMake] UNKNOWN IMPORTED vs INTERFACE IMPORTED for non-CMake library

2018-04-23 Thread Matthew Trescott
Hi, I somewhat recently filed a bug report regarding target_link_libraries favoring target names over library names (https://gitlab.kitware.com/cmake/cmake/issues/17911). Brad King suggested also that I switch to UNKNOWN instead of INTERFACE for the IMPORTed targets created by my find-modules. In

Re: [CMake] Spaces in var=value list in *_command

2018-04-23 Thread Robert Maynard
Are you trying to construct a BUILD_COMMAND line that looks like CXXFLAGS=-g -02 -w && ./configure? If so, you should be able to do that with the CMake -E env command option like this ( Starting in CMake 3.1 ): set(cxx_flags "-g -O2 -w") set(command_to_run ${CMAKE_COMMAND} -E environment) Externa

Re: [CMake] Generating MSVS solution files that can be passed around

2018-04-23 Thread Bill Hoffman
One thing to consider is that MS is now shipping CMake as part of VS.  So, if you can get your project to work with that version of VS, you should be all set. In fact you can have people just open the project and MS VS will run CMake for you. -Bill -- Powered by www.kitware.com Please keep

Re: [CMake] Generator expressions containing spaces

2018-04-23 Thread Yves Frederix
It seems COMMAND_EXPAND_LISTS was indeed the key here. Thanks a lot! Yves On Mon, Apr 23, 2018 at 2:11 PM, CHEVRIER, Marc wrote: > The space is used to separate arguments passed to COMMAND. So your > generator expression is splitted before evaluation and elements are no > longer valid generator

Re: [CMake] Generator expressions containing spaces

2018-04-23 Thread CHEVRIER, Marc
The space is used to separate arguments passed to COMMAND. So your generator expression is splitted before evaluation and elements are no longer valid generator expression. So, to solve your problem, encapsulate the generator expression inside quotes. And apply the following advices for correct

[CMake] Generator expressions containing spaces

2018-04-23 Thread Yves Frederix
Hi, I recently learned that the COMMAND line in a custom command supports generator expressions. In particular, what makes this powerful is that if the expression evaluates to the empty string, no corresponding code will be added to the target (as documented in the docs