[CMake] Supporting imported targets with and without namespaces

2018-12-06 Thread Wilke, Jeremiah J via CMake
We are cleaning up the cmake in our project. Targets are not currently exported with namespaces, but ideally should be. However, we have enough users based on the old cmake that we don’t want to require people to use the namespaced target (for a while). I couldn’t find recommendations on this i

[CMake] extending clean for Ninja

2018-12-06 Thread Torsten Robitzki
Hi, we have some source file generators, that take a known list of input files and generate an „relatively“ unknown list of output files. The exact list of output files depend on the content of the input files. The „usual“ way to solve this seams to have an add_custom_target() call, and listing

Re: [CMake] What is --build-two-config good for

2018-12-06 Thread Torsten
Hi Robert, > Am 06.12.2018 um 15:26 schrieb Robert Maynard : > > It is possible to have CMake projects where an initial configuration of the > project is insufficient for it to be in a valid state. This is generally > caused by a project which evaluates variables before they exist and saved >

Re: [CMake] What is --build-two-config good for

2018-12-06 Thread Robert Maynard via CMake
It is possible to have CMake projects where an initial configuration of the project is insufficient for it to be in a valid state. This is generally caused by a project which evaluates variables before they exist and saved into the cache. By running CMake a second time for these projects the evalua

[CMake] Export Linker Script

2018-12-06 Thread Andrew Bell
I have a linker script that I'd like to export for dependent projects to use as if it were an actual library. I'm having trouble figuring out how to do this. With a linker script named "libmylib.so" I've tried: set(LIBNAME mylib) add_library(mylib INTERFACE) install(TARGETS mylib EXPORT MyExpo

Re: [CMake] How force cmake debug/release

2018-12-06 Thread Marc CHEVRIER
Have a look at the documentation : https://cmake.org/cmake/help/v3.13/ Le 6 déc. 2018 à 09:51 +0100, Andy , a écrit : > In cmake I have: > if (${CMAKE_BUILD_TYPE} STREQUAL Release) >   message(WARNING "Release") > endif() > > if (${CMAKE_BUILD_TYPE} STREQUAL Debug) >   message(WARNING "Debug") > en

[CMake] How force cmake debug/release

2018-12-06 Thread Andy
In cmake I have: if (${CMAKE_BUILD_TYPE} STREQUAL Release) message(WARNING "Release") endif() if (${CMAKE_BUILD_TYPE} STREQUAL Debug) message(WARNING "Debug") endif() (how write something like elseif?) If I call "cmake ." it write: "Warning:Debug" Debug is default and I must call "cmake . -D