Re: [CMake] How to get message() to go to stdout when executed from -P?

2017-04-10 Thread David Cole via CMake
>From the Windows command line, you would do it with 2>&1 after the command (2 >is stderr, and 1 is stdout). You could write your custom command as a batch >file or bash script (unfortunately platform dependent) which uses this >technique with a single command inside the batch file. HTH, David

[CMake] How to get message() to go to stdout when executed from -P?

2017-04-10 Thread Robert Dailey
When I execute a CMake script as a custom command, message() logs are not shown in stdout from that script. Is there a way to make it pipe out messages? -- 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 v

[CMake] [ANNOUNCE] CMake 3.8.0 available for download

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

Re: [CMake] How to properly handle build version number in CMake script for project

2017-04-10 Thread Robert Dailey
OK weirdly, tested again, this also works and is a little more simplified (although more confusing, since now we're intermixing non-cache and cache variables with the same name; behavior is not exactly clear, or well-defined. if( BUILD_VERSION ) set( BUILD_VERSION ${BUILD_VERSION} ) unset(

Re: [CMake] How to properly handle build version number in CMake script for project

2017-04-10 Thread Robert Dailey
Actually this seems to work: if( BUILD_VERSION ) set( version_override ${BUILD_VERSION} ) unset( BUILD_VERSION CACHE ) set( BUILD_VERSION ${version_override} ) unset( version_override ) else() set( BUILD_VERSION 7.1.1.2 ) endif() It's a bit messy but gets the job done, and

Re: [CMake] How to properly handle build version number in CMake script for project

2017-04-10 Thread Robert Dailey
Sorry you're right, this isn't working because -D creates a cache entry for the variable, which breaks it. So maybe more ideas on the configure_file() solution would be ideal... unsetting the cache variable might work as well, I have to toy around with this. On Mon, Apr 10, 2017 at 12:48 PM, Bruc

Re: [CMake] How to properly handle build version number in CMake script for project

2017-04-10 Thread Bruce Stephens
On Mon, Apr 10, 2017 at 5:04 PM, Robert Dailey wrote: > Actually I think your idea does work. Why do you think it won't? I'm > using it right now and so far it seems OK. I assumed (without testing, admittedly) is that it would fail if someone used -D to set the value, then changed some CMakeLists

Re: [CMake] How to properly handle build version number in CMake script for project

2017-04-10 Thread Hendrik Sattler
Hi, You could make it a non-cache variable and manage the caching yourself. The cache is your version.cmake. Before including it, check if the variable is set and update your version cmake file, possibly with configure_file(). After that, unset() the cache variable and include your cmake file,

Re: [CMake] How to properly handle build version number in CMake script for project

2017-04-10 Thread Robert Dailey
Actually I think your idea does work. Why do you think it won't? I'm using it right now and so far it seems OK. 1. On build server, if it overrides it with -D, then it does not set it by hand. If it doesn't override, it will use the fixed version in the file 2. On work machines, it's never defined

Re: [CMake] How to properly handle build version number in CMake script for project

2017-04-10 Thread Bruce Stephens
On Mon, Apr 10, 2017 at 2:36 PM, Bruce Stephens wrote: > You could do something like > > if(NOT "${BUILD_VERSION}") > set(BUILD_VERSION 1.2.3.4) > endif() That doesn't work at all, come to think of it. I suspect your best bet is to handle the caching yourself (likely using a file in ${CMAKE_BI

Re: [CMake] How to properly handle build version number in CMake script for project

2017-04-10 Thread Bruce Stephens
You could do something like if(NOT "${BUILD_VERSION}") set(BUILD_VERSION 1.2.3.4) endif() On Mon, Apr 10, 2017 at 2:29 PM, Robert Dailey wrote: > I have a file called version.cmake that my root CMakeLists.txt > includes. There is only a single line in this file: > > set( BUILD_VERSION 1.2.3.4

[CMake] How to properly handle build version number in CMake script for project

2017-04-10 Thread Robert Dailey
I have a file called version.cmake that my root CMakeLists.txt includes. There is only a single line in this file: set( BUILD_VERSION 1.2.3.4 CACHE STRING "Version of the product" ) I have two scenarios where this version number setting needs to work slightly differently from a CMake perspective:

Re: [CMake] custom command comments not showing up

2017-04-10 Thread Robert Dailey
Seems like the solution here is to make COMMENT work properly/consistently across all generators. That's the point, after all, right? On Sat, Apr 8, 2017 at 12:33 AM, Hendrik Sattler wrote: > However, this messes up parallel make progress output. > > Am 7. April 2017 22:22:08 MESZ schrieb Craig S

Re: [CMake] Transitive include and link libraries on imported targets ?

2017-04-10 Thread David Jobet
Hello, After googling a bit I found this post which I think describe exactly what I'm facing : https://cmake.org/pipermail/cmake/2016-August/064100.html However I fail to understand the answers. Maybe I'm expecting too much. Basically, I have 2 imported static targets (A and B with B that needs