Re: [CMake] Internal error bug in v3.4.2.

2016-01-21 Thread Brad King
On 01/21/2016 07:53 AM, Gonzalo wrote:
> I delved into the cmake 3.4.2 source code and found the offending line 
> in cmTarget.cxx:
> 
>  cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
>config,
>false,
>tgt,
>tgt,
>dagChecker),
>  entrySources);
> 
> This line never ends up calling ExpandListArgument and crashes before.  
> All variables are defined but I am suspicious of the (*it)->ge auto 
> pointer, but cannot comment further.

Thanks.  This is consistent with the call stack shown in your original
post.  That line is always executed so we need to figure out what goes
wrong with it in your particular case.  Since you can reproduce it in
mrViewer's configuration that is a good starting point.  Try removing
sources and libraries from mrViewer/src/CMakeLists.txt to simplify
it while still reproducing the problem.  If you can get rid of most
of the find_package calls at the top and the uses of their results
while still showing the problem then I can likely use that to get
the problem reproduced locally.

Thanks,
-Brad

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake 3.4.2 available for download

2016-01-21 Thread Brad King
On 01/20/2016 04:36 PM, Andrew Maclean wrote:
> "CMake Error at CMakeLists.txt:1 (project):
>   Could not find an appropriate version of the Windows 10 SDK installed on
>   this machine"
>   
> In CMakeOutput.log, there is one line:
> "The system is: Windows - 10.0.10586 - AMD64"

It looks like this has been reported to the issue tracker here:

 https://cmake.org/Bug/view.php?id=15929

Please follow discussion over there for more.

Thanks,
-Brad

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[CMake] Adding definitions to compile one file ?

2016-01-21 Thread Vania Joloboff

Hi

I want to add two definitions to compile one specific files
in addition to the global definitions.
I have the following problem. If I use

set_source_files_properties(source.cpp
PROPERTIES
COMPILE_DEFINITIONS VAR1=${MY_VAR1} VAR2=${MY_VAR2} )

then I get error message incorrect number of arguments for 
set_source_files_properties


If I put
set_source_files_properties(source.cpp
PROPERTIES COMPILE_DEFINITIONS "VAR1=${MY_VAR1} VAR2=${MY_VAR2}" )

then it generates strangely enough the compile command

/usr/bin/c++ -DVAR1="path1 VAR2=path2" ... source.cpp

with the double quotes as above, which gives a weird value to VAR1 and 
no value to VAR2


If I use twice set_source_files_properties
the first one is overwritten by the second
and I only get the definition of VAR2

What am I supposed to do ?

Thankx

PS I am using cmake 3.2.2 on Linux Mint.

--

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] XCode Generation Issue

2016-01-21 Thread David Morsberger
Eric,

I went down a rabbit hole and pulled myself back out. I narrowed it down to the 
following.

We are using cmake to check if the linker supports -Wl,—as-needed. The test 
compile (and link?) command cmake builds using ‘cmake -G Xcode’  does not fail.

The command from ‘cmake -G’ has been narrowed down to the following:

$ 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 \
 -Qunused-arguments \
 -DWS_LD_FLAG_VALID0 \
 -Wl,--as-needed \
 -c src.c \
 -o src.o 
$

The following modified command generates an error:

$ 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 \
 -Qunused-arguments \
 -DWS_LD_FLAG_VALID0 \
 -Wl,--as-needed \
 src.c

ld: unknown option: --as-needed
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$

It appears the linker isn’t called when the -c and the -o options are present. 
The following warning is generated when the ‘-Qunused-arguments’ is removed.

clang: warning: -Wl,--as-needed: 'linker' input unused

The cmake logic in CMakeLists.txt is basically:

   SET(CMAKE_REQUIRED_FLAGS "${_FLAG}")
   CHECK_C_SOURCE_RUNS(“int main() { return 0;}" ${_RESULT})

where _FLAG is set to ‘-DWS_LD_FLAG_VALID0 -Wl,—-as-needed’


So, how/where is the clang compile/link command generated and why isn’t it 
being setup for clang to link?



> On Jan 21, 2016, at 1:51 AM, Eric Wing  wrote:
> 
> On 1/20/16, David Morsberger  wrote:
>> 
>>> On Jan 19, 2016, at 10:11 PM, Eric Wing  wrote:
>>> 
>>> On 1/19/16, David Morsberger  wrote:
 Any help would be appreciated.
 
 In particular I’d like to know how the default compiler arguments are
 set
 when ‘cmake -G Xcode’ is executed. The attached file contains the cmake
 test
 compile extracted and reformatted from CMakeOutput.log that should have
 failed. Again, what is setting all the clang compiler options when this
 is
 executed?
 
 
 
 All help is appreciated
 
> On Jan 18, 2016, at 2:58 PM, David Morsberger 
> wrote:
> 
> I’m having an issue generating and using a XCode project using cmake
> -G.
> 
> cmake —version
>   cmake version 3.4.1
> 
> Xcode Version 7.2 (7C68)
> 
> Mac OS 10.11.
> 
> 
> My CMakeLists.txt has a clang option that fails during the -G Xcode
> pass
> but fails when linking within XCode.
> 
> The compiler / linker option is ‘-Wl,—as-needed’
> 
> The test compile/link step in ‘cmake -G Xcode' creates a long clang
> command with arguments ‘-Wl,—as-needed’ plus ‘—serialize-diagnostics
>  to .dia file>’
> 
> The link step within Xcode after the project created has the
> ‘-Wl,—as-needed’ argument and does not have the ‘—serialize-diagnostics
> ’ argument. The link fails because ‘-Wl,—as-needed’
> isn’t supported.
> 
> If copy and execute the long clang command from the ‘cmake -G Xcode’
> command and remove the ‘—serialize-diagnostics ’
> then
> it successfully fails with ‘-Wl, —as-needed’ isn’t supported.
> 
> Finally, when I use cmake to generate unix makefiles it works meaning
> cmake determines ‘-Wl—as-needed’ isn’t supported and doesn’t add it to
> the
> argument list.
> 
> Questions:
> - Where is the ‘—serialized-diagnostics’ argument coming from when
> executing ‘cmake -G Xcode’?
> 
> - What is a .dia file and how do I read it?
> 
> - What’s the preferred / recommended way of detecting the non-supported
> ‘-Wl,—as-needed’ argument during the ‘cmake -G Xcode’ phase? One option
> might to be to remove the ‘—serialize-diagnostics’ argument during the
> generation phase.
> 
> I can provide more details on request.
> 
> David
> 
> 
> 
>>> 
>>> 
>>> I just spot checked one of my Xcode compile logs. I see the
>>> —serialize-diagnostics flag, but I don't have —as-needed anywhere.
>>> Maybe one of your CMake scripts is adding that in, or you have set
>>> some kind of environment variable that clang or Xcode is picking up?
>>> (This recently happened to me on Linux.)
>> 
>> Ed,
>> 
>> In this case cmake is attempting to determine if ‘—as-needed' is a supported
>> option and the build should fail.
>> 
>> I have searched (grep’d) everything I can think of for the string
>> ’serialize-diagnostics’ with zero hits.
>> 
>> I can easily add an ‘if( Xcode )’ around the setting in CMakeLists.txt
>> however I’m trying to figure out what is exactly going on. The best
>> solutions are chosen when you know what is going on under the hood.
>> 
>> 
>> 
> 
> I believe the serialize-diagnostics flag is added by Xcode itself. I
> see it (along with many other flags) in a native (non-CMake generated)
> Xcode project.
> 
> -Eric

-- 

Powered by 

Re: [CMake] Internal error bug in v3.4.2.

2016-01-21 Thread Gonzalo



El 20/01/16 a las 15:51, Brad King escribió:

It's not gone or even deprecated.  It's just not well tested
and seems to be broken in your particular case in a way not
reproduced by the test.
I delved into the cmake 3.4.2 source code and found the offending line 
in cmTarget.cxx:


cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
  config,
  false,
  tgt,
  tgt,
  dagChecker),
entrySources);

This line never ends up calling ExpandListArgument and crashes before.  
All variables are defined but I am suspicious of the (*it)->ge auto 
pointer, but cannot comment further.

I hope this helps you track it.


--
Gonzalo Garramuño
ggarr...@gmail.com

--

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Customizing output of ctest command

2016-01-21 Thread Nagy-Egri Máté Ferenc via CMake

I would also be very much interested how this could be done. There was a thread 
I started a few months ago on a similar topic. I wanted to see the execution 
times of various tests without the initialization part. If my tests could 
output in some form the useful part of their run times, it would be nice if 
CTest could collect them and print them to console.



Feladó: Andrey Pokrovskiy
Elküldve: 2016. január 20., szerda 21:02
Címzett: CMake ML
Tárgy: [CMake] Customizing output of ctest command

Hi,

One of my tests generates a report table (file in text format). I
would like to see its content after each ctest (or make test)
invocation. Is there any way to achieve that?
I noticed that tests targets have ATTACHED_FILES property, though it
looks like it has no effect on ctest run when dashboard is not
configured. I don't need and don't want to setup dashboard, but I
would like to include information that is important to me in ctest
output.

For example:

[...]
Start 33: run_tests
33/33 Test #33: run_tests .   Passed0.06 sec

100% tests passed, 0 tests failed out of 33

Total Test time (real) =   0.28 sec

/* Attached: results.json */
{
"call_site_size": {
"zf_log": "48",
"easylogging++": "376",
"glog": "144",
"spdlog": "352",
"g3log": "360"
}
}
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread Nicholas Braden
Ah, I ran into this quirk too - the issue is that you have the quotes incorrect:

-DCMAKE_CXX_FLAGS="-march=native"

Should be like this instead:

"-DCMAKE_CXX_FLAGS=-march=native"

Try that and see if it helps, I am pretty sure I ran into the exact
same problem.

On Thu, Jan 21, 2016 at 8:27 AM, fkillus  wrote:
> Thanks for clarifying that external projects are not aware of the project
> they are embedded in.
> The CMAKE_COMPILER_IS_GNUCXX variable should be set automatically by CMake
> as far
> as I understand it (see https://cmake.org/Wiki/CMake_Useful_Variables).
>
> I narrowed down the problem by creating a minimal setup which still
> reproduces the issue.
> In this case the super project is simply a wrapper around an external dummy
> project.
>
> external/CMakeLists.txt:
>
>   cmake_minimum_required( VERSION 3.4 )
>   project( external )
>   message( "External - CMAKE_COMPILER_IS_GNUCXX: "
> ${CMAKE_COMPILER_IS_GNUCXX} )
>   message( "External - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
>   message( "External - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
>
> super/CMakeLists.txt:
>
>   cmake_minimum_required( VERSION 3.4 )
>   project( super )
>   message( "Super - CMAKE_COMPILER_IS_GNUCXX: " ${CMAKE_COMPILER_IS_GNUCXX}
> )
>   message( "Super - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
>   message( "Super - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
>   include( ExternalProject )
>   ExternalProject_Add(
> external
> DOWNLOAD_COMMAND ""
> SOURCE_DIR ${CMAKE_SOURCE_DIR}/../external
> CMAKE_ARGS
>   -DCMAKE_CXX_FLAGS="-march=native"
> INSTALL_COMMAND  ""
>   )
>
> The problem occurs when the CMAKE_CXX_FLAGS variable is set inside the
> ExternalProject_Add
> command using quotes (i.e. "-march=native" in this example). The output
> obtained when configuring
> the super project with 'cmake ../super' is:
>
> -- The C compiler identification is GNU 5.2.0
> -- The CXX compiler identification is GNU 5.2.0
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> Super - CMAKE_COMPILER_IS_GNUCXX: 1
> Super - CMAKE_CXX_COMPILER_ID: GNU
> Super - CMAKE_CXX_FLAGS:
> -- Configuring done
> -- Generating done
>
> Afterwards building with 'make' results in:
>
> [ 12%] Creating directories for 'external'
> [ 25%] No download step for 'external'
> [ 37%] No patch step for 'external'
> [ 50%] No update step for 'external'
> [ 62%] Performing configure step for 'external'
> -- The C compiler identification is GNU 5.2.0
> -- The CXX compiler identification is unknown
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> External - CMAKE_COMPILER_IS_GNUCXX:
> External - CMAKE_CXX_COMPILER_ID:
> External - CMAKE_CXX_FLAGS: "-march=native"
> -- Configuring done
> -- Generating done
>
> This shows the compiler is not correctly identified for the external
> project. Directly configuring
> the external project with 'cmake -DCMAKE_CXX_FLAGS="-march=native"
> ../external' works though:
>
> -- The C compiler identification is GNU 5.2.0
> -- The CXX compiler identification is GNU 5.2.0
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> External - CMAKE_COMPILER_IS_GNUCXX: 1
> External - CMAKE_CXX_COMPILER_ID: GNU
> External - CMAKE_CXX_FLAGS: -march=native
> -- Configuring done
> -- Generating done
>
>
> It also works if the quotations marks in the super project listfile are
> removed. I.e. changing
>   CMAKE_ARGS
>-DCMAKE_CXX_FLAGS="-march=native"
> to
>   CMAKE_ARGS
>-DCMAKE_CXX_FLAGS=-march=native
>
> The question is now, is it still possible to add mutiple compile flags if
> one cannot use quotation marks?
>
>
> On Wed, Jan 20, 2016 at 6:58 PM, 

[CMake] Re : Re: Re : Re: Re : Re: How to pass a configuration file to CMake?

2016-01-21 Thread Cedric Doucet


Thank you Chuck & Petr!
It works fine now! :)

Cédric

- Chuck Atkins  a écrit :
>CMake strongly encourages the use of separate source and build directories 
>(unlike autotools).  So, try something like this:

mkdir build
cd build
cmake -C /path/to/SuperCoolCacheFile.cmake /path/to/source

- Chuck

>
On Thu, Jan 21, 2016 at 10:10 AM, Cedric Doucet  wrote:


Hi Petr,

thank you very much for your answer!

Indeed, comment string arguments seem to be mandatory.
I modified my configuration file like this:

set(ENABLE_DOWNLOAD True CACHE BOOL "Automatic installation of third-party 
libraries")
set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH "Root of GCC")

Now, I get the following error message:

CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is a 
file, not a directory.

I am quite surprised about this message because I thought a file was required 
to the command 'cmake -C'.

Do you have any idea of what I am doing wrong here?

- Petr Kmoch  a écrit :
>Hi Cedric.

I believe the comment string argument is mandatory in a set(... CACHE), so it 
should be something like this:

set(ENABLE_DOWNLOAD True CACHE BOOL "Should download be enabled")
set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH "Path to root directory of 
GCC installation")

Petr


On Thu, Jan 21, 2016 at 3:43 PM, Cedric Doucet  wrote:


Hello,
I do not manage to pass a configuration file to cmake.

I type 'cmake -C ../config.cmake'

where config.cmake belongs to the parent directory and contains these lines:

set(ENABLE_DOWNLOAD True CACHE BOOL)
set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH)

I get the following error message but I don't understand why:

loading initial cache file ../config.cmake
CMake Error at /local/cdoucet/simol/config.cmake:1 (set):
  set given invalid arguments for CACHE mode.


CMake Error at /local/cdoucet/simol/config.cmake:2 (set):
  set given invalid arguments for CACHE mode.


CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is a 
file, not a directory.


Do you know how to solve this problem?
- Cedric Doucet  a écrit :
>
Hi Peter!
Thank you very much!It seems to be exactly what I want. :)I will try to use it.
Cédric
De: "Petr Kmoch" 
À: "Cedric Doucet" 
Cc: cmake@cmake.org
Envoyé: Lundi 21 Décembre 2015 13:25:53
Objet: Re: [CMake] How to pass a configuration file to CMake?

Hi Cedric.

I have never used it myself, but I believe you're looking for CMake's 
command-line option '-C ': 
https://cmake.org/cmake/help/latest/manual/cmake.1.html

Petr

On Mon, Dec 21, 2015 at 1:12 PM, Cedric Doucet  wrote:

Hello,
I would like to know if it's possible to pass a configuration file to CMake.I 
have to pass a lot of information to CMake and the resulting command line is 
very long to type.Would it be possible to create a file containing all needed 
definitions and pass it to CMake?
For exemple, instead of typing
cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=/home/me/there -D 
CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
would it be possible to create a file containing
CMAKE_BUILD_TYPE=DebugCMAKE_INSTALL_PREFIX=/home/me/thereCMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
and pass it to CMake?
Cédric
--

>

> 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 
> information on each offering, please visit:

>

> CMake Support: http://cmake.org/cmake/help/support.html

> CMake Consulting: http://cmake.org/cmake/help/consulting.html

> CMake Training Courses: http://cmake.org/cmake/help/training.html

>

> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html

>

> Follow this link to subscribe/unsubscribe:

>http://public.kitware.com/mailman/listinfo/cmake


>


--

>

> 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 
> information on each offering, please visit:

>

> CMake Support: http://cmake.org/cmake/help/support.html

> CMake Consulting: http://cmake.org/cmake/help/consulting.html

> CMake Training Courses: http://cmake.org/cmake/help/training.html

>

> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html

>

> Follow this link to subscribe/unsubscribe:

>http://public.kitware.com/mailman/listinfo/cmake




--

>

> 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 
> information on each offering, please visit:


Re: [CMake] Adding definitions to compile one file ?

2016-01-21 Thread Vania Joloboff

HI Petr

Thanks for the suggestion.
But this will erase the existing compile definitions, won't it ?
So may be I should do a get_property first,
append my new definitions and reset the property ?
I'll try anyway...

Vania

On 01/21/2016 03:21 PM, Petr Kmoch wrote:

Hi Vania.

For your case, it's best to forget about the 
not-as-convenient-as-they-could-be convenience functions 
set_*_properties, and just invoke set_property:


set_property(
  SOURCE source.cpp
  PROPERTY COMPILE_DEFINITIONS
VAR1=${MY_VAR1} VAR2=${MY_VAR2}
)

Petr

On Thu, Jan 21, 2016 at 3:14 PM, Vania Joloboff 
> wrote:


Hi

I want to add two definitions to compile one specific files
in addition to the global definitions.
I have the following problem. If I use

set_source_files_properties(source.cpp
PROPERTIES
COMPILE_DEFINITIONS VAR1=${MY_VAR1} VAR2=${MY_VAR2} )

then I get error message incorrect number of arguments for
set_source_files_properties

If I put
set_source_files_properties(source.cpp
PROPERTIES COMPILE_DEFINITIONS "VAR1=${MY_VAR1} VAR2=${MY_VAR2}" )

then it generates strangely enough the compile command

/usr/bin/c++ -DVAR1="path1 VAR2=path2" ... source.cpp

with the double quotes as above, which gives a weird value to VAR1
and no value to VAR2

If I use twice set_source_files_properties
the first one is overwritten by the second
and I only get the definition of VAR2

What am I supposed to do ?

Thankx

PS I am using cmake 3.2.2 on Linux Mint.

-- 


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 information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake




--

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread fkillus via CMake
Thanks for clarifying that external projects are not aware of the project
they are embedded in.
The CMAKE_COMPILER_IS_GNUCXX variable should be set automatically by CMake
as far
as I understand it (see https://cmake.org/Wiki/CMake_Useful_Variables).

I narrowed down the problem by creating a minimal setup which still
reproduces the issue.
In this case the super project is simply a wrapper around an external dummy
project.

external/CMakeLists.txt:

  cmake_minimum_required( VERSION 3.4 )
  project( external )
  message( "External - CMAKE_COMPILER_IS_GNUCXX: "
${CMAKE_COMPILER_IS_GNUCXX} )
  message( "External - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
  message( "External - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )

super/CMakeLists.txt:

  cmake_minimum_required( VERSION 3.4 )
  project( super )
  message( "Super - CMAKE_COMPILER_IS_GNUCXX: " ${CMAKE_COMPILER_IS_GNUCXX}
)
  message( "Super - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
  message( "Super - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
  include( ExternalProject )
  ExternalProject_Add(
external
DOWNLOAD_COMMAND ""
SOURCE_DIR ${CMAKE_SOURCE_DIR}/../external
CMAKE_ARGS
  -DCMAKE_CXX_FLAGS="-march=native"
INSTALL_COMMAND  ""
  )

The problem occurs when the CMAKE_CXX_FLAGS variable is set inside the
ExternalProject_Add
command using quotes (i.e. "-march=native" in this example). The output
obtained when configuring
the super project with 'cmake ../super' is:

-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Super - CMAKE_COMPILER_IS_GNUCXX: 1
Super - CMAKE_CXX_COMPILER_ID: GNU
Super - CMAKE_CXX_FLAGS:
-- Configuring done
-- Generating done

Afterwards building with 'make' results in:

[ 12%] Creating directories for 'external'
[ 25%] No download step for 'external'
[ 37%] No patch step for 'external'
[ 50%] No update step for 'external'
[ 62%] Performing configure step for 'external'
-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
External - CMAKE_COMPILER_IS_GNUCXX:
External - CMAKE_CXX_COMPILER_ID:
External - CMAKE_CXX_FLAGS: "-march=native"
-- Configuring done
-- Generating done

This shows the compiler is not correctly identified for the external
project. Directly configuring
the external project with 'cmake -DCMAKE_CXX_FLAGS="-march=native"
../external' works though:

-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
External - CMAKE_COMPILER_IS_GNUCXX: 1
External - CMAKE_CXX_COMPILER_ID: GNU
External - CMAKE_CXX_FLAGS: -march=native
-- Configuring done
-- Generating done


It also works if the quotations marks in the super project listfile are
removed. I.e. changing
  CMAKE_ARGS
   -DCMAKE_CXX_FLAGS="-march=native"
to
  CMAKE_ARGS
   -DCMAKE_CXX_FLAGS=-march=native

The question is now, is it still possible to add mutiple compile flags if
one cannot use quotation marks?


On Wed, Jan 20, 2016 at 6:58 PM, Nicholas Braden  wrote:

> Where/how is that variable normally set? External projects have no
> awareness of the project they are in, they just run CMake as usual the
> same way you would. If the variable is normally set by CMake itself,
> make sure that your containing project and the external project both
> find the same compiler. (They each do their own automatic search for
> compilers)
>
> On Wed, Jan 20, 2016 at 11:41 AM, fkillus via CMake 
> wrote:
> > I have been trying to compile Ogre [1] as external dependency with
> > 

Re: [CMake] Adding definitions to compile one file ?

2016-01-21 Thread Petr Kmoch
On Thu, Jan 21, 2016 at 3:26 PM, Vania Joloboff 
wrote:

> HI Petr
>
> Thanks for the suggestion.
> But this will erase the existing compile definitions, won't it ?
> So may be I should do a get_property first,
> append my new definitions and reset the property ?
> I'll try anyway...
>

This would erase the previous value of the property COMPILE_DEFINITIONS
specified on the source file(s), if you've already provided one for it. But
the globally specified compilation definitions, flags etc. do not get
copied into these per-source properties. Instead, the final command line
used for compiling a source is combined from the global, target, and source
file properties (and relevant variables and other things).

If you really need to append to the property, though, you can use APPEND or
APPEND_STRING arguments before the PROPERTY keyword; refer to CMake docs
for more details.

Petr


>
> Vania
>
> On 01/21/2016 03:21 PM, Petr Kmoch wrote:
>
>> Hi Vania.
>>
>> For your case, it's best to forget about the
>> not-as-convenient-as-they-could-be convenience functions set_*_properties,
>> and just invoke set_property:
>>
>> set_property(
>>   SOURCE source.cpp
>>   PROPERTY COMPILE_DEFINITIONS
>> VAR1=${MY_VAR1} VAR2=${MY_VAR2}
>> )
>>
>> Petr
>>
>> On Thu, Jan 21, 2016 at 3:14 PM, Vania Joloboff > > wrote:
>>
>> Hi
>>
>> I want to add two definitions to compile one specific files
>> in addition to the global definitions.
>> I have the following problem. If I use
>>
>> set_source_files_properties(source.cpp
>> PROPERTIES
>> COMPILE_DEFINITIONS VAR1=${MY_VAR1} VAR2=${MY_VAR2} )
>>
>> then I get error message incorrect number of arguments for
>> set_source_files_properties
>>
>> If I put
>> set_source_files_properties(source.cpp
>> PROPERTIES COMPILE_DEFINITIONS "VAR1=${MY_VAR1} VAR2=${MY_VAR2}" )
>>
>> then it generates strangely enough the compile command
>>
>> /usr/bin/c++ -DVAR1="path1 VAR2=path2" ... source.cpp
>>
>> with the double quotes as above, which gives a weird value to VAR1
>> and no value to VAR2
>>
>> If I use twice set_source_files_properties
>> the first one is overwritten by the second
>> and I only get the definition of VAR2
>>
>> What am I supposed to do ?
>>
>> Thankx
>>
>> PS I am using cmake 3.2.2 on Linux Mint.
>>
>> --
>> 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 information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
>>
>>
>>
>
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] How to pass a configuration file to CMake?

2016-01-21 Thread Chuck Atkins
Hi Cedric,

The option can be a bit confusing.  The cache file you pass is actually a
CMake script that sets cache variables, rather than the cache variables as
seen in CMakeCache.txt.  So you would actually want your cache file to
contain:

set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build")
set(CMAKE_INSTALL_PREFIX /home/me/there CACHE PATH "Install path prefix,
prepended onto install directories.")
set(CMAKE_CXX_COMPILER /usr/local/gcc/4.9.3/g++ CACHE FILEPATH "CXX
Compiler")


- Chuck

On Thu, Jan 21, 2016 at 9:43 AM, Cedric Doucet 
wrote:

>
>
> Hello,
>
> I do not manage to pass a configuration file to cmake.
>
> I type 'cmake -C ../config.cmake'
>
> where config.cmake belongs to the parent directory and contains these
> lines:
>
> set(ENABLE_DOWNLOAD True CACHE BOOL)
> set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH)
>
> I get the following error message but I don't understand why:
>
> loading initial cache file ../config.cmake
> CMake Error at /local/cdoucet/simol/config.cmake:1 (set):
>   set given invalid arguments for CACHE mode.
>
>
> CMake Error at /local/cdoucet/simol/config.cmake:2 (set):
>   set given invalid arguments for CACHE mode.
>
>
> CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is a
> file, not a directory.
>
>
> Do you know how to solve this problem?
>
> - Cedric Doucet  a écrit :
> >
>
> Hi Peter!
>
> Thank you very much!
> It seems to be exactly what I want. :)
> I will try to use it.
>
> Cédric
>
> --
>
> *De: *"Petr Kmoch" 
> *À: *"Cedric Doucet" 
> *Cc: *cmake@cmake.org
> *Envoyé: *Lundi 21 Décembre 2015 13:25:53
> *Objet: *Re: [CMake] How to pass a configuration file to CMake?
>
> Hi Cedric.
>
> I have never used it myself, but I believe you're looking for CMake's
> command-line option '-C ':
> https://cmake.org/cmake/help/latest/manual/cmake.1.html
>
> Petr
>
> On Mon, Dec 21, 2015 at 1:12 PM, Cedric Doucet 
> wrote:
>
>>
>> Hello,
>>
>> I would like to know if it's possible to pass a configuration file to
>> CMake.
>> I have to pass a lot of information to CMake and the resulting command
>> line is very long to type.
>> Would it be possible to create a file containing all needed definitions
>> and pass it to CMake?
>>
>> For exemple, instead of typing
>>
>> cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=/home/me/there -D
>> CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>>
>> would it be possible to create a file containing
>>
>> CMAKE_BUILD_TYPE=Debug
>> CMAKE_INSTALL_PREFIX=/home/me/there
>> CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>>
>> and pass it to CMake?
>>
>> Cédric
>>
>> --
>>
>> >
>>
>> > 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 information on each offering, please visit:
>>
>> >
>>
>> > CMake Support: http://cmake.org/cmake/help/support.html
>>
>> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>
>> > CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> >
>>
>> > Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> >
>>
>> > Follow this link to subscribe/unsubscribe:
>>
>> >http://public.kitware.com/mailman/listinfo/cmake
>>
>
>
> >
>
>
>
>
> --
>
> 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
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread fkillus via CMake
Nice, thank you very much! This solves my problem.

On Thu, Jan 21, 2016 at 3:56 PM, Nicholas Braden  wrote:

> Ah, I ran into this quirk too - the issue is that you have the quotes
> incorrect:
>
> -DCMAKE_CXX_FLAGS="-march=native"
>
> Should be like this instead:
>
> "-DCMAKE_CXX_FLAGS=-march=native"
>
> Try that and see if it helps, I am pretty sure I ran into the exact
> same problem.
>
> On Thu, Jan 21, 2016 at 8:27 AM, fkillus  wrote:
> > Thanks for clarifying that external projects are not aware of the project
> > they are embedded in.
> > The CMAKE_COMPILER_IS_GNUCXX variable should be set automatically by
> CMake
> > as far
> > as I understand it (see https://cmake.org/Wiki/CMake_Useful_Variables).
> >
> > I narrowed down the problem by creating a minimal setup which still
> > reproduces the issue.
> > In this case the super project is simply a wrapper around an external
> dummy
> > project.
> >
> > external/CMakeLists.txt:
> >
> >   cmake_minimum_required( VERSION 3.4 )
> >   project( external )
> >   message( "External - CMAKE_COMPILER_IS_GNUCXX: "
> > ${CMAKE_COMPILER_IS_GNUCXX} )
> >   message( "External - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID}
> )
> >   message( "External - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
> >
> > super/CMakeLists.txt:
> >
> >   cmake_minimum_required( VERSION 3.4 )
> >   project( super )
> >   message( "Super - CMAKE_COMPILER_IS_GNUCXX: "
> ${CMAKE_COMPILER_IS_GNUCXX}
> > )
> >   message( "Super - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
> >   message( "Super - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
> >   include( ExternalProject )
> >   ExternalProject_Add(
> > external
> > DOWNLOAD_COMMAND ""
> > SOURCE_DIR ${CMAKE_SOURCE_DIR}/../external
> > CMAKE_ARGS
> >   -DCMAKE_CXX_FLAGS="-march=native"
> > INSTALL_COMMAND  ""
> >   )
> >
> > The problem occurs when the CMAKE_CXX_FLAGS variable is set inside the
> > ExternalProject_Add
> > command using quotes (i.e. "-march=native" in this example). The output
> > obtained when configuring
> > the super project with 'cmake ../super' is:
> >
> > -- The C compiler identification is GNU 5.2.0
> > -- The CXX compiler identification is GNU 5.2.0
> > -- Check for working C compiler: /usr/bin/cc
> > -- Check for working C compiler: /usr/bin/cc -- works
> > -- Detecting C compiler ABI info
> > -- Detecting C compiler ABI info - done
> > -- Detecting C compile features
> > -- Detecting C compile features - done
> > -- Check for working CXX compiler: /usr/bin/c++
> > -- Check for working CXX compiler: /usr/bin/c++ -- works
> > -- Detecting CXX compiler ABI info
> > -- Detecting CXX compiler ABI info - done
> > -- Detecting CXX compile features
> > -- Detecting CXX compile features - done
> > Super - CMAKE_COMPILER_IS_GNUCXX: 1
> > Super - CMAKE_CXX_COMPILER_ID: GNU
> > Super - CMAKE_CXX_FLAGS:
> > -- Configuring done
> > -- Generating done
> >
> > Afterwards building with 'make' results in:
> >
> > [ 12%] Creating directories for 'external'
> > [ 25%] No download step for 'external'
> > [ 37%] No patch step for 'external'
> > [ 50%] No update step for 'external'
> > [ 62%] Performing configure step for 'external'
> > -- The C compiler identification is GNU 5.2.0
> > -- The CXX compiler identification is unknown
> > -- Check for working C compiler: /usr/bin/cc
> > -- Check for working C compiler: /usr/bin/cc -- works
> > -- Detecting C compiler ABI info
> > -- Detecting C compiler ABI info - done
> > -- Detecting C compile features
> > -- Detecting C compile features - done
> > -- Check for working CXX compiler: /usr/bin/c++
> > -- Check for working CXX compiler: /usr/bin/c++ -- works
> > -- Detecting CXX compiler ABI info
> > -- Detecting CXX compiler ABI info - done
> > External - CMAKE_COMPILER_IS_GNUCXX:
> > External - CMAKE_CXX_COMPILER_ID:
> > External - CMAKE_CXX_FLAGS: "-march=native"
> > -- Configuring done
> > -- Generating done
> >
> > This shows the compiler is not correctly identified for the external
> > project. Directly configuring
> > the external project with 'cmake -DCMAKE_CXX_FLAGS="-march=native"
> > ../external' works though:
> >
> > -- The C compiler identification is GNU 5.2.0
> > -- The CXX compiler identification is GNU 5.2.0
> > -- Check for working C compiler: /usr/bin/cc
> > -- Check for working C compiler: /usr/bin/cc -- works
> > -- Detecting C compiler ABI info
> > -- Detecting C compiler ABI info - done
> > -- Detecting C compile features
> > -- Detecting C compile features - done
> > -- Check for working CXX compiler: /usr/bin/c++
> > -- Check for working CXX compiler: /usr/bin/c++ -- works
> > -- Detecting CXX compiler ABI info
> > -- Detecting CXX compiler ABI info - done
> > -- Detecting CXX compile features
> > -- Detecting CXX compile features - done
> > External - CMAKE_COMPILER_IS_GNUCXX: 1
> > External - CMAKE_CXX_COMPILER_ID: GNU
> > External - CMAKE_CXX_FLAGS: -march=native
> > -- Configuring 

Re: [CMake] Adding definitions to compile one file ?

2016-01-21 Thread Eric Noulard
2016-01-21 15:14 GMT+01:00 Vania Joloboff :

> Hi
>
> I want to add two definitions to compile one specific files
> in addition to the global definitions.
> I have the following problem. If I use
>
> set_source_files_properties(source.cpp
> PROPERTIES
> COMPILE_DEFINITIONS VAR1=${MY_VAR1} VAR2=${MY_VAR2} )
>
> then I get error message incorrect number of arguments for
> set_source_files_properties
>
> If I put
> set_source_files_properties(source.cpp
> PROPERTIES COMPILE_DEFINITIONS "VAR1=${MY_VAR1} VAR2=${MY_VAR2}" )
>
> then it generates strangely enough the compile command
>
> /usr/bin/c++ -DVAR1="path1 VAR2=path2" ... source.cpp
>
> with the double quotes as above, which gives a weird value to VAR1 and no
> value to VAR2
>
> If I use twice set_source_files_properties
> the first one is overwritten by the second
> and I only get the definition of VAR2
>
> What am I supposed to do ?
>

Did you try to separate you VAR1 and VAR2 def suing semicolon as indicated
in the doc:
"The COMPILE_DEFINITIONS property may be set to a semicolon-separated
list of preprocessor definitions using the syntax VAR or VAR=value."

see
cmake --help-property COMPILE_DEFINITIONS

so try:
set_source_files_properties(source.cpp
PROPERTIES COMPILE_DEFINITIONS "VAR1=${MY_VAR1};VAR2=${MY_VAR2}" )


-- 
Eric
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[Cmake-commits] CMake branch, next, updated. v3.4.2-2065-g1ca1451

2016-01-21 Thread Ben Boeckel
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  1ca14513c5df74ec3d4d5b9febbe1627a6a46cb9 (commit)
   via  40249bccdf9c66453433da3608da9cc89cbee675 (commit)
  from  38022559e9947adb274890070499c69738d0deaf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ca14513c5df74ec3d4d5b9febbe1627a6a46cb9
commit 1ca14513c5df74ec3d4d5b9febbe1627a6a46cb9
Merge: 3802255 40249bc
Author: Ben Boeckel 
AuthorDate: Thu Jan 21 10:39:27 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Thu Jan 21 10:39:27 2016 -0500

Merge topic 'fix-pkg_search_module-cache' into next

40249bcc FindPkgConfig: set standard variables in the cache


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=40249bccdf9c66453433da3608da9cc89cbee675
commit 40249bccdf9c66453433da3608da9cc89cbee675
Author: Ben Boeckel 
AuthorDate: Wed Jan 20 14:38:05 2016 -0500
Commit: Ben Boeckel 
CommitDate: Thu Jan 21 10:38:30 2016 -0500

FindPkgConfig: set standard variables in the cache

Fixes a regression introduced when the code was simplified to use the
variable queries.

Fixes #15903.

Reported-by: Bernd Lörwald

diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 177e7b8..4f50e38 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -382,6 +382,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent 
_no_cmake_path _no_cma
 pkg_get_variable("${_pkg_check_prefix}_PREFIX" 
${_pkg_check_modules_pkg} "prefix")
 pkg_get_variable("${_pkg_check_prefix}_INCLUDEDIR" 
${_pkg_check_modules_pkg} "includedir")
 pkg_get_variable("${_pkg_check_prefix}_LIBDIR" 
${_pkg_check_modules_pkg} "libdir")
+foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)
+  _pkgconfig_set("${_pkg_check_modules_pkg}_${variable}" 
"${${_pkg_check_modules_pkg}_${variable}}")
+endforeach ()
 
 if (NOT ${_is_silent})
   message(STATUS "  Found ${_pkg_check_modules_pkg}, version 
${_pkgconfig_VERSION}")
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake 
b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
new file mode 100644
index 000..8d8d000
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
@@ -0,0 +1,16 @@
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(NCURSES QUIET ncurses)
+
+if (NCURSES_FOUND)
+  foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)
+get_property("${variable}"
+  CACHE "NCURSES_${variable}"
+  PROPERTY  TYPE
+  SET)
+if (NOT ${variable})
+  message(FATAL_ERROR "Failed to set cache entry for NCURSES_${variable}")
+endif ()
+  endforeach ()
+else ()
+  message(STATUS "skipping test; ncurses not found")
+endif ()
diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake 
b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
index bb04aa2..24089e0 100644
--- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
@@ -14,4 +14,5 @@ endif()
 find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
   run_cmake(FindPkgConfig_GET_VARIABLE)
+  run_cmake(FindPkgConfig_cache_variables)
 endif ()

---

Summary of changes:
 Modules/FindPkgConfig.cmake|3 +++
 .../FindPkgConfig/FindPkgConfig_cache_variables.cmake  |   16 
 Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake|1 +
 3 files changed, 20 insertions(+)
 create mode 100644 
Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread fkillus via CMake
Thanks for your suggestion! I consider trying it soon.

On Wed, Jan 20, 2016 at 11:44 PM, Craig Scott 
wrote:

>
> From: fkillus 
>> To: cmake@cmake.org
>> Cc:
>> Date: Wed, 20 Jan 2016 18:41:26 +0100
>> Subject: [CMake] ExternalProject_Add() macro does not set
>> CMAKE_COMPILER_IS_GNUCXX
>> I have been trying to compile Ogre [1] as external dependency with
>> ExternalProject_Add(). In theory this should be straightforward since Ogre
>> itself also uses CMake as buildsystem. However, in the process I
>> encountered the following problem:
>>
>
>> Ogre checks the value of the CMAKE_COMPILER_IS_GNUCXX variable in some
>> places (e.g. [2]). I am running Linux and compiling with g++ and everything
>> works fine if I manually configure Ogre with cmake or cmake-gui.
>> Unfortunately, after wrapping everything inside ExternalProject_Add(), the
>> CMAK_COMPILER_IS_GNUCXX variable is no longer being set correctly.
>>
>> A simple workaround is to manually set this variable, i.e.:
>>
>>  ExternalProject_Add(
>> ogre
>> URL https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip
>> CMAKE_ARGS
>>   -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_OUTPUT_DIR}
>>   -DCMAKE_COMPILER_IS_GNUCXX=${CMAKE_COMPILER_IS_GNUCXX}   # workaround
>>   )
>>
>> This works, but I'm uncertain if this should be necessary. Is this a bug
>> or a feature?
>>
>>
>> [1] https://bitbucket.org/sinbad/ogre
>> [2]
>> https://bitbucket.org/sinbad/ogre/src/0d580c7216abe27fafe41cb43e31d8ed86ded591/CMake/Utils/OgreConfigTargets.cmake?at=default=file-view-default#OgreConfigTargets.cmake-277
>>
>>
>
> Since Ogre is a CMake project, you may find the technique described at the
> following link useful. It uses GoogleTest as its example, but it should
> also apply to your situation. The approach uses ExternalProject only to
> download the source at CMake time. It then pulls it into your normal build
> via add_subdirectory(), so it gets all the same compiler details, etc. as
> your main build because it IS part of your main build.
>
> http://crascit.com/2015/07/25/cmake-gtest/
>
> I am not familiar with Ogre's build, so I can't comment on whether it will
> play nice if pulled into a parent build like this, but it's worth a try.
> The article links to a github repo which provides a fully generalised
> implementation you should be able to use out of the box.
>
>
> --
> Craig Scott
> Melbourne, Australia
> http://crascit.com
>
> --
>
> 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
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Adding definitions to compile one file ?

2016-01-21 Thread CHEVRIER, Marc
Use APPEND keyword:
set_property(
   SOURCE source.cpp
APPEND PROPERTY COMPILE_DEFINITIONS
 VAR1=${MY_VAR1} VAR2=${MY_VAR2}
)






On 21/01/16 15:26, "CMake on behalf of Vania Joloboff"  wrote:

>HI Petr
>
>Thanks for the suggestion.
>But this will erase the existing compile definitions, won't it ?
>So may be I should do a get_property first,
>append my new definitions and reset the property ?
>I'll try anyway...
>
>Vania
>
>On 01/21/2016 03:21 PM, Petr Kmoch wrote:
>> Hi Vania.
>>
>> For your case, it's best to forget about the 
>> not-as-convenient-as-they-could-be convenience functions 
>> set_*_properties, and just invoke set_property:
>>
>> set_property(
>>   SOURCE source.cpp
>>   PROPERTY COMPILE_DEFINITIONS
>> VAR1=${MY_VAR1} VAR2=${MY_VAR2}
>> )
>>
>> Petr
>>
>> On Thu, Jan 21, 2016 at 3:14 PM, Vania Joloboff 
>> > wrote:
>>
>> Hi
>>
>> I want to add two definitions to compile one specific files
>> in addition to the global definitions.
>> I have the following problem. If I use
>>
>> set_source_files_properties(source.cpp
>> PROPERTIES
>> COMPILE_DEFINITIONS VAR1=${MY_VAR1} VAR2=${MY_VAR2} )
>>
>> then I get error message incorrect number of arguments for
>> set_source_files_properties
>>
>> If I put
>> set_source_files_properties(source.cpp
>> PROPERTIES COMPILE_DEFINITIONS "VAR1=${MY_VAR1} VAR2=${MY_VAR2}" )
>>
>> then it generates strangely enough the compile command
>>
>> /usr/bin/c++ -DVAR1="path1 VAR2=path2" ... source.cpp
>>
>> with the double quotes as above, which gives a weird value to VAR1
>> and no value to VAR2
>>
>> If I use twice set_source_files_properties
>> the first one is overwritten by the second
>> and I only get the definition of VAR2
>>
>> What am I supposed to do ?
>>
>> Thankx
>>
>> PS I am using cmake 3.2.2 on Linux Mint.
>>
>> -- 
>>
>> 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 information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
>>
>>
>
>-- 
>
>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 
>information on each offering, please visit:
>
>CMake Support: http://cmake.org/cmake/help/support.html
>CMake Consulting: http://cmake.org/cmake/help/consulting.html
>CMake Training Courses: http://cmake.org/cmake/help/training.html
>
>Visit other Kitware open-source projects at 
>http://www.kitware.com/opensource/opensource.html
>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/cmake
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Adding definitions to compile one file ?

2016-01-21 Thread Petr Kmoch
Hi Vania.

For your case, it's best to forget about the
not-as-convenient-as-they-could-be convenience functions set_*_properties,
and just invoke set_property:

set_property(
  SOURCE source.cpp
  PROPERTY COMPILE_DEFINITIONS
VAR1=${MY_VAR1} VAR2=${MY_VAR2}
)

Petr

On Thu, Jan 21, 2016 at 3:14 PM, Vania Joloboff 
wrote:

> Hi
>
> I want to add two definitions to compile one specific files
> in addition to the global definitions.
> I have the following problem. If I use
>
> set_source_files_properties(source.cpp
> PROPERTIES
> COMPILE_DEFINITIONS VAR1=${MY_VAR1} VAR2=${MY_VAR2} )
>
> then I get error message incorrect number of arguments for
> set_source_files_properties
>
> If I put
> set_source_files_properties(source.cpp
> PROPERTIES COMPILE_DEFINITIONS "VAR1=${MY_VAR1} VAR2=${MY_VAR2}" )
>
> then it generates strangely enough the compile command
>
> /usr/bin/c++ -DVAR1="path1 VAR2=path2" ... source.cpp
>
> with the double quotes as above, which gives a weird value to VAR1 and no
> value to VAR2
>
> If I use twice set_source_files_properties
> the first one is overwritten by the second
> and I only get the definition of VAR2
>
> What am I supposed to do ?
>
> Thankx
>
> PS I am using cmake 3.2.2 on Linux Mint.
>
> --
>
> 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
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] Re : Re: How to pass a configuration file to CMake?

2016-01-21 Thread Cedric Doucet


Hello,
I do not manage to pass a configuration file to cmake.

I type 'cmake -C ../config.cmake'

where config.cmake belongs to the parent directory and contains these lines:

set(ENABLE_DOWNLOAD True CACHE BOOL)
set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH)

I get the following error message but I don't understand why:

loading initial cache file ../config.cmake
CMake Error at /local/cdoucet/simol/config.cmake:1 (set):
  set given invalid arguments for CACHE mode.


CMake Error at /local/cdoucet/simol/config.cmake:2 (set):
  set given invalid arguments for CACHE mode.


CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is a 
file, not a directory.


Do you know how to solve this problem?
- Cedric Doucet  a écrit :
>
Hi Peter!
Thank you very much!It seems to be exactly what I want. :)I will try to use it.
Cédric
De: "Petr Kmoch" 
À: "Cedric Doucet" 
Cc: cmake@cmake.org
Envoyé: Lundi 21 Décembre 2015 13:25:53
Objet: Re: [CMake] How to pass a configuration file to CMake?

Hi Cedric.

I have never used it myself, but I believe you're looking for CMake's 
command-line option '-C ': 
https://cmake.org/cmake/help/latest/manual/cmake.1.html

Petr

On Mon, Dec 21, 2015 at 1:12 PM, Cedric Doucet  wrote:

Hello,
I would like to know if it's possible to pass a configuration file to CMake.I 
have to pass a lot of information to CMake and the resulting command line is 
very long to type.Would it be possible to create a file containing all needed 
definitions and pass it to CMake?
For exemple, instead of typing
cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=/home/me/there -D 
CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
would it be possible to create a file containing
CMAKE_BUILD_TYPE=DebugCMAKE_INSTALL_PREFIX=/home/me/thereCMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
and pass it to CMake?
Cédric
--

>

> 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 
> information on each offering, please visit:

>

> CMake Support: http://cmake.org/cmake/help/support.html

> CMake Consulting: http://cmake.org/cmake/help/consulting.html

> CMake Training Courses: http://cmake.org/cmake/help/training.html

>

> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html

>

> Follow this link to subscribe/unsubscribe:

>http://public.kitware.com/mailman/listinfo/cmake


>

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] How to pass a configuration file to CMake?

2016-01-21 Thread Petr Kmoch
Hi Cedric.

I believe the comment string argument is mandatory in a set(... CACHE), so
it should be something like this:

set(ENABLE_DOWNLOAD True CACHE BOOL "Should download be enabled")
set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH "Path to root directory
of GCC installation")

Petr


On Thu, Jan 21, 2016 at 3:43 PM, Cedric Doucet 
wrote:

>
>
> Hello,
>
> I do not manage to pass a configuration file to cmake.
>
> I type 'cmake -C ../config.cmake'
>
> where config.cmake belongs to the parent directory and contains these
> lines:
>
> set(ENABLE_DOWNLOAD True CACHE BOOL)
> set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH)
>
> I get the following error message but I don't understand why:
>
> loading initial cache file ../config.cmake
> CMake Error at /local/cdoucet/simol/config.cmake:1 (set):
>   set given invalid arguments for CACHE mode.
>
>
> CMake Error at /local/cdoucet/simol/config.cmake:2 (set):
>   set given invalid arguments for CACHE mode.
>
>
> CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is a
> file, not a directory.
>
>
> Do you know how to solve this problem?
>
> - Cedric Doucet  a écrit :
> >
>
> Hi Peter!
>
> Thank you very much!
> It seems to be exactly what I want. :)
> I will try to use it.
>
> Cédric
>
> --
>
> *De: *"Petr Kmoch" 
> *À: *"Cedric Doucet" 
> *Cc: *cmake@cmake.org
> *Envoyé: *Lundi 21 Décembre 2015 13:25:53
> *Objet: *Re: [CMake] How to pass a configuration file to CMake?
>
> Hi Cedric.
>
> I have never used it myself, but I believe you're looking for CMake's
> command-line option '-C ':
> https://cmake.org/cmake/help/latest/manual/cmake.1.html
>
> Petr
>
> On Mon, Dec 21, 2015 at 1:12 PM, Cedric Doucet 
> wrote:
>
>>
>> Hello,
>>
>> I would like to know if it's possible to pass a configuration file to
>> CMake.
>> I have to pass a lot of information to CMake and the resulting command
>> line is very long to type.
>> Would it be possible to create a file containing all needed definitions
>> and pass it to CMake?
>>
>> For exemple, instead of typing
>>
>> cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=/home/me/there -D
>> CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>>
>> would it be possible to create a file containing
>>
>> CMAKE_BUILD_TYPE=Debug
>> CMAKE_INSTALL_PREFIX=/home/me/there
>> CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>>
>> and pass it to CMake?
>>
>> Cédric
>>
>> --
>>
>> >
>>
>> > 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 information on each offering, please visit:
>>
>> >
>>
>> > CMake Support: http://cmake.org/cmake/help/support.html
>>
>> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>
>> > CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> >
>>
>> > Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> >
>>
>> > Follow this link to subscribe/unsubscribe:
>>
>> >http://public.kitware.com/mailman/listinfo/cmake
>>
>
>
> >
>
>
>
>
> --
>
> 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
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] Re : Re: Re : Re: How to pass a configuration file to CMake?

2016-01-21 Thread Cedric Doucet


Hi Petr,

thank you very much for your answer!

Indeed, comment string arguments seem to be mandatory.
I modified my configuration file like this:

set(ENABLE_DOWNLOAD True CACHE BOOL "Automatic installation of third-party 
libraries")
set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH "Root of GCC")

Now, I get the following error message:

CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is a 
file, not a directory.

I am quite surprised about this message because I thought a file was required 
to the command 'cmake -C'.

Do you have any idea of what I am doing wrong here?

- Petr Kmoch  a écrit :
>Hi Cedric.

I believe the comment string argument is mandatory in a set(... CACHE), so it 
should be something like this:

set(ENABLE_DOWNLOAD True CACHE BOOL "Should download be enabled")
set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH "Path to root directory of 
GCC installation")

Petr


On Thu, Jan 21, 2016 at 3:43 PM, Cedric Doucet  wrote:


Hello,
I do not manage to pass a configuration file to cmake.

I type 'cmake -C ../config.cmake'

where config.cmake belongs to the parent directory and contains these lines:

set(ENABLE_DOWNLOAD True CACHE BOOL)
set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH)

I get the following error message but I don't understand why:

loading initial cache file ../config.cmake
CMake Error at /local/cdoucet/simol/config.cmake:1 (set):
  set given invalid arguments for CACHE mode.


CMake Error at /local/cdoucet/simol/config.cmake:2 (set):
  set given invalid arguments for CACHE mode.


CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is a 
file, not a directory.


Do you know how to solve this problem?
- Cedric Doucet  a écrit :
>
Hi Peter!
Thank you very much!It seems to be exactly what I want. :)I will try to use it.
Cédric
De: "Petr Kmoch" 
À: "Cedric Doucet" 
Cc: cmake@cmake.org
Envoyé: Lundi 21 Décembre 2015 13:25:53
Objet: Re: [CMake] How to pass a configuration file to CMake?

Hi Cedric.

I have never used it myself, but I believe you're looking for CMake's 
command-line option '-C ': 
https://cmake.org/cmake/help/latest/manual/cmake.1.html

Petr

On Mon, Dec 21, 2015 at 1:12 PM, Cedric Doucet  wrote:

Hello,
I would like to know if it's possible to pass a configuration file to CMake.I 
have to pass a lot of information to CMake and the resulting command line is 
very long to type.Would it be possible to create a file containing all needed 
definitions and pass it to CMake?
For exemple, instead of typing
cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=/home/me/there -D 
CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
would it be possible to create a file containing
CMAKE_BUILD_TYPE=DebugCMAKE_INSTALL_PREFIX=/home/me/thereCMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
and pass it to CMake?
Cédric
--

>

> 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 
> information on each offering, please visit:

>

> CMake Support: http://cmake.org/cmake/help/support.html

> CMake Consulting: http://cmake.org/cmake/help/consulting.html

> CMake Training Courses: http://cmake.org/cmake/help/training.html

>

> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html

>

> Follow this link to subscribe/unsubscribe:

>http://public.kitware.com/mailman/listinfo/cmake


>


--

>

> 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 
> information on each offering, please visit:

>

> CMake Support: http://cmake.org/cmake/help/support.html

> CMake Consulting: http://cmake.org/cmake/help/consulting.html

> CMake Training Courses: http://cmake.org/cmake/help/training.html

>

> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html

>

> Follow this link to subscribe/unsubscribe:

>http://public.kitware.com/mailman/listinfo/cmake



-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] How to pass a configuration file to CMake?

2016-01-21 Thread Chuck Atkins
CMake strongly encourages the use of separate source and build directories
(unlike autotools).  So, try something like this:

mkdir build
cd build
cmake -C /path/to/SuperCoolCacheFile.cmake /path/to/source


- Chuck

On Thu, Jan 21, 2016 at 10:10 AM, Cedric Doucet 
wrote:

>
>
> Hi Petr,
>
> thank you very much for your answer!
>
> Indeed, comment string arguments seem to be mandatory.
> I modified my configuration file like this:
>
> set(ENABLE_DOWNLOAD True CACHE BOOL "Automatic installation of third-party
> libraries")
> set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH "Root of GCC")
>
> Now, I get the following error message:
>
> CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is a
> file, not a directory.
>
> I am quite surprised about this message because I thought a file was
> required to the command 'cmake -C'.
>
> Do you have any idea of what I am doing wrong here?
>
> - Petr Kmoch  a écrit :
> >
> Hi Cedric.
>
> I believe the comment string argument is mandatory in a set(... CACHE), so
> it should be something like this:
>
> set(ENABLE_DOWNLOAD True CACHE BOOL "Should download be enabled")
> set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH "Path to root
> directory of GCC installation")
>
> Petr
>
>
> On Thu, Jan 21, 2016 at 3:43 PM, Cedric Doucet 
> wrote:
>
>>
>>
>> Hello,
>>
>> I do not manage to pass a configuration file to cmake.
>>
>> I type 'cmake -C ../config.cmake'
>>
>> where config.cmake belongs to the parent directory and contains these
>> lines:
>>
>> set(ENABLE_DOWNLOAD True CACHE BOOL)
>> set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH)
>>
>> I get the following error message but I don't understand why:
>>
>> loading initial cache file ../config.cmake
>> CMake Error at /local/cdoucet/simol/config.cmake:1 (set):
>>   set given invalid arguments for CACHE mode.
>>
>>
>> CMake Error at /local/cdoucet/simol/config.cmake:2 (set):
>>   set given invalid arguments for CACHE mode.
>>
>>
>> CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is
>> a file, not a directory.
>>
>>
>> Do you know how to solve this problem?
>>
>> - Cedric Doucet  a écrit :
>> >
>>
>> Hi Peter!
>>
>> Thank you very much!
>> It seems to be exactly what I want. :)
>> I will try to use it.
>>
>> Cédric
>>
>> --
>>
>> *De: *"Petr Kmoch" 
>> *À: *"Cedric Doucet" 
>> *Cc: *cmake@cmake.org
>> *Envoyé: *Lundi 21 Décembre 2015 13:25:53
>> *Objet: *Re: [CMake] How to pass a configuration file to CMake?
>>
>> Hi Cedric.
>>
>> I have never used it myself, but I believe you're looking for CMake's
>> command-line option '-C ':
>> https://cmake.org/cmake/help/latest/manual/cmake.1.html
>>
>> Petr
>>
>> On Mon, Dec 21, 2015 at 1:12 PM, Cedric Doucet 
>> wrote:
>>
>>>
>>> Hello,
>>>
>>> I would like to know if it's possible to pass a configuration file to
>>> CMake.
>>> I have to pass a lot of information to CMake and the resulting command
>>> line is very long to type.
>>> Would it be possible to create a file containing all needed definitions
>>> and pass it to CMake?
>>>
>>> For exemple, instead of typing
>>>
>>> cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=/home/me/there
>>> -D CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>>>
>>> would it be possible to create a file containing
>>>
>>> CMAKE_BUILD_TYPE=Debug
>>> CMAKE_INSTALL_PREFIX=/home/me/there
>>> CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>>>
>>> and pass it to CMake?
>>>
>>> Cédric
>>>
>>> --
>>>
>>> >
>>>
>>> > 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 information on each offering, please visit:
>>>
>>> >
>>>
>>> > CMake Support: http://cmake.org/cmake/help/support.html
>>>
>>> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>>
>>> > CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> >
>>>
>>> > Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> >
>>>
>>> > Follow this link to subscribe/unsubscribe:
>>>
>>> >http://public.kitware.com/mailman/listinfo/cmake
>>>
>>
>>
>> >
>>
>>
>>
>>
>> --
>>
>> >
>>
>> > 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 information on each offering, please visit:
>>
>> >
>>
>> > CMake Support: http://cmake.org/cmake/help/support.html
>>
>> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>
>> > CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> >
>>
>> > Visit other Kitware 

Re: [CMake] Adding definitions to compile one file ?

2016-01-21 Thread Gregor Jasny via CMake

Hi,

On 21/01/16 15:14, Vania Joloboff wrote:

Hi

I want to add two definitions to compile one specific files
in addition to the global definitions.
I have the following problem. If I use

set_source_files_properties(source.cpp
PROPERTIES
COMPILE_DEFINITIONS VAR1=${MY_VAR1} VAR2=${MY_VAR2} )

then I get error message incorrect number of arguments for
set_source_files_properties

If I put
set_source_files_properties(source.cpp
PROPERTIES COMPILE_DEFINITIONS "VAR1=${MY_VAR1} VAR2=${MY_VAR2}" )


Try to delimit the two definitions by a ; to create a list.

Alternatively set property should do the trick:
https://cmake.org/cmake/help/v3.2/command/set_property.html

set_property(SOURCE source.cpp PROPERTY COMPILE_DEFINITIONS 
VAR1=${MY_VAR1} VAR2=${MY_VAR2})


With set_property you also have the option to specify APPEND or 
APPEND_STRING.


Thanks,
Gregor
--

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Creating RPMs from failing projects with CPack

2016-01-21 Thread Attila Krasznahorkay
Hi Domen,

Thanks a lot for the tip! I'll give it a try. (The "monolithic limitation" 
should not be an issue for us. We do build single RPMs for our projects.)

Cheers,
Attila

> On 21 Jan 2016, at 00:49, Domen Vrankar  wrote:
> 
>> I have a slightly unusual question (I guess). Is it possible somehow to 
>> force CPack to produce RPM files from projects that have build problems?
>> 
>> We use CMake in our nightly build system to test the latest changes in our 
>> software. When a build problem occurs we don't want the whole build to fail. 
>> To this end, we run the build with:
>> 
>> make -k
>> make -k install/fast
>> 
>> This second target executes the installation no matter what. (We set all our 
>> build results as "optional installations".) So that at least the "successful 
>> part" of the build would become visible on a shared filesystem.
>> 
>> Now, I'd like to do something similar with CPack. To make it behave like 
>> "install/fast" does. All in all, I'd like to tell it to use this 
>> "install/fast" target while creating the package instead of the "install" 
>> target. Is there any way of making this happen?
> 
> I don't know of any clean way to do this but you could write an
> install script (let's name it install_k.sh):
> 
> #!/bin/bash
> make -k install/fast
> exit 0
> 
> Then your would add two CPACK variables to your CMakeLists.txt:
> 
> #set(CPACK_RPM_COMPONENT_INSTALL "ON") <- I'll explain this commented line 
> later
> set(CPACK_INSTALL_CMAKE_PROJECTS "")
> set(CPACK_INSTALL_COMMANDS "${CMAKE_CURRENT_SOURCE_DIR}/install_k.sh")
> 
> And instead of packaging with "make package" command execute "cpack -G RPM".
> 
> However there is an additional problem that this hack only works for
> monolithic packages (that's why I commented out
> CPACK_RPM_COMPONENT_INSTALL in example above) so you will have to
> disable component packages generation if you are using it.
> 
> Regards,
> Domen
> 
> 2016-01-20 11:26 GMT+01:00 Attila Krasznahorkay
> :
>> Dear All,
>> 
>> I have a slightly unusual question (I guess). Is it possible somehow to 
>> force CPack to produce RPM files from projects that have build problems?
>> 
>> We use CMake in our nightly build system to test the latest changes in our 
>> software. When a build problem occurs we don't want the whole build to fail. 
>> To this end, we run the build with:
>> 
>> make -k
>> make -k install/fast
>> 
>> This second target executes the installation no matter what. (We set all our 
>> build results as "optional installations".) So that at least the "successful 
>> part" of the build would become visible on a shared filesystem.
>> 
>> Now, I'd like to do something similar with CPack. To make it behave like 
>> "install/fast" does. All in all, I'd like to tell it to use this 
>> "install/fast" target while creating the package instead of the "install" 
>> target. Is there any way of making this happen?
>> 
>> Cheers,
>>  Attila
>> --
>> 
>> 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 
>> information on each offering, please visit:
>> 
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>> 
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] How to pass a configuration file to CMake?

2016-01-21 Thread Petr Kmoch
It looks as if CMake was interpreting the path as both the source directory
and the initial cache file. Perhaps you could help it by adding the path to
source explicitly:

cmake -C ../config.cmake whatever/your/path/to/source/is

Petr

On Thu, Jan 21, 2016 at 4:10 PM, Cedric Doucet 
wrote:

>
>
> Hi Petr,
>
> thank you very much for your answer!
>
> Indeed, comment string arguments seem to be mandatory.
> I modified my configuration file like this:
>
> set(ENABLE_DOWNLOAD True CACHE BOOL "Automatic installation of third-party
> libraries")
> set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH "Root of GCC")
>
> Now, I get the following error message:
>
> CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is a
> file, not a directory.
>
> I am quite surprised about this message because I thought a file was
> required to the command 'cmake -C'.
>
> Do you have any idea of what I am doing wrong here?
>
> - Petr Kmoch  a écrit :
> >
> Hi Cedric.
>
> I believe the comment string argument is mandatory in a set(... CACHE), so
> it should be something like this:
>
> set(ENABLE_DOWNLOAD True CACHE BOOL "Should download be enabled")
> set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH "Path to root
> directory of GCC installation")
>
> Petr
>
>
> On Thu, Jan 21, 2016 at 3:43 PM, Cedric Doucet 
> wrote:
>
>>
>>
>> Hello,
>>
>> I do not manage to pass a configuration file to cmake.
>>
>> I type 'cmake -C ../config.cmake'
>>
>> where config.cmake belongs to the parent directory and contains these
>> lines:
>>
>> set(ENABLE_DOWNLOAD True CACHE BOOL)
>> set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH)
>>
>> I get the following error message but I don't understand why:
>>
>> loading initial cache file ../config.cmake
>> CMake Error at /local/cdoucet/simol/config.cmake:1 (set):
>>   set given invalid arguments for CACHE mode.
>>
>>
>> CMake Error at /local/cdoucet/simol/config.cmake:2 (set):
>>   set given invalid arguments for CACHE mode.
>>
>>
>> CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is
>> a file, not a directory.
>>
>>
>> Do you know how to solve this problem?
>>
>> - Cedric Doucet  a écrit :
>> >
>>
>> Hi Peter!
>>
>> Thank you very much!
>> It seems to be exactly what I want. :)
>> I will try to use it.
>>
>> Cédric
>>
>> --
>>
>> *De: *"Petr Kmoch" 
>> *À: *"Cedric Doucet" 
>> *Cc: *cmake@cmake.org
>> *Envoyé: *Lundi 21 Décembre 2015 13:25:53
>> *Objet: *Re: [CMake] How to pass a configuration file to CMake?
>>
>> Hi Cedric.
>>
>> I have never used it myself, but I believe you're looking for CMake's
>> command-line option '-C ':
>> https://cmake.org/cmake/help/latest/manual/cmake.1.html
>>
>> Petr
>>
>> On Mon, Dec 21, 2015 at 1:12 PM, Cedric Doucet 
>> wrote:
>>
>>>
>>> Hello,
>>>
>>> I would like to know if it's possible to pass a configuration file to
>>> CMake.
>>> I have to pass a lot of information to CMake and the resulting command
>>> line is very long to type.
>>> Would it be possible to create a file containing all needed definitions
>>> and pass it to CMake?
>>>
>>> For exemple, instead of typing
>>>
>>> cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=/home/me/there
>>> -D CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>>>
>>> would it be possible to create a file containing
>>>
>>> CMAKE_BUILD_TYPE=Debug
>>> CMAKE_INSTALL_PREFIX=/home/me/there
>>> CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>>>
>>> and pass it to CMake?
>>>
>>> Cédric
>>>
>>> --
>>>
>>> >
>>>
>>> > 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 information on each offering, please visit:
>>>
>>> >
>>>
>>> > CMake Support: http://cmake.org/cmake/help/support.html
>>>
>>> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>>
>>> > CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> >
>>>
>>> > Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> >
>>>
>>> > Follow this link to subscribe/unsubscribe:
>>>
>>> >http://public.kitware.com/mailman/listinfo/cmake
>>>
>>
>>
>> >
>>
>>
>>
>>
>> --
>>
>> >
>>
>> > 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 information on each offering, please visit:
>>
>> >
>>
>> > CMake Support: http://cmake.org/cmake/help/support.html
>>
>> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>
>> > CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> >
>>
>> > 

Re: [cmake-developers] CMake daemon for user tools

2016-01-21 Thread Brad King
On 01/20/2016 04:03 PM, Stephen Kelly wrote:
> FYI I merged a reduce-allocations branch to next for testing. It came from 
> Milian here:
>  
>  https://github.com/steveire/CMake/pull/1

Very nice!

Thanks,
-Brad

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [CMake] Internal error bug in v3.4.2.

2016-01-21 Thread Gonzalo



Thanks.  This is consistent with the call stack shown in your original
post.  That line is always executed so we need to figure out what goes
wrong with it in your particular case.  Since you can reproduce it in
mrViewer's configuration that is a good starting point.  Try removing
sources and libraries from mrViewer/src/CMakeLists.txt to simplify
it while still reproducing the problem.  If you can get rid of most
of the find_package calls at the top and the uses of their results
while still showing the problem then I can likely use that to get
the problem reproduced locally.



Find attached the mrViewer/src/CMakeList.txt file that still fails.

The problem is the dependency on ACESclip library, which is built as 
another library within the project.  Taking that library out makes the 
code parse and start compiling.
Maybe I am setting the two projects wrong, but I wanted to have both 
projects compile from the top CMakeLists.txt file, and also be able to 
compile the library individually.


--
Gonzalo Garramuño
ggarr...@gmail.com





#
# These are the libraries we will depend on
#

# For window management
FIND_PACKAGE( FLTK2   REQUIRED )# for window management




#
# List directories for -I options.
#
INCLUDE_DIRECTORIES(
  ${FLTK2_INCLUDE_DIR}
  )


FLTK_WRAP_UI( mrViewer  
  gui/aviSave.fl
  )




SET( SOURCES 

  ${mrViewer_FLTK_UI_SRCS}

  )



SET( LIBRARIES 
  ${FLTK2_LIBRARIES}
  )


ADD_EXECUTABLE( mrViewer WIN32 ${SOURCES} )
TARGET_LINK_LIBRARIES( mrViewer ${LIBRARIES} ACESclip )

SET_TARGET_PROPERTIES( mrViewer
  PROPERTIES
  LINK_FLAGS "${LINK_FLAGS}"
  )

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[cmake-developers] [CMake 0015930]: MSVC project switched to Windows XP toolset won't compile

2016-01-21 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://public.kitware.com/Bug/view.php?id=15930 
== 
Reported By:Bruce Pascoe
Assigned To:
== 
Project:CMake
Issue ID:   15930
Category:   CMake
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2016-01-21 11:36 EST
Last Modified:  2016-01-21 11:36 EST
== 
Summary:MSVC project switched to Windows XP toolset won't
compile
Description: 
MSVC projects created by CMake explicitly add the detected Windows SDK to the
include paths.  Normally this doesn't cause an issue, however if the project's
Platform Toolset is then switched from "Visual Studio 201x" to "Visual Studio
201x - Windows XP" it will no longer compile.

The cause of this is that the Windows XP toolchain uses a different SDK version,
installed in a different location from the default.

The project can be made to compile at this point by removing the Windows SDK
from the include paths, which allows the IDE (actually MSBuild) to select the
correct SDK on its own.

Steps to Reproduce: 
* Generate a Visual Studio project using CMake
* Open Project Properties -> General in MSVC
* Change the Platform Toolset to the Windows XP version.
* Try to build the project.
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-01-21 11:36 Bruce Pascoe   New Issue
==

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] [PATCH V2] FindPNG: Create an imported PNG::PNG target

2016-01-21 Thread Sam Thursfield
Imported targets are now the recommended way of dealing with external
library dependencies.

The documentation for FindPNG is rewritten slightly.

This commit also adds a test case, you can run it like this:

cmake ... -DCMake_TEST_FindPNG=ON
ctest -R FindPNG --output-on-failure

The testcase requires the libpng library and headers to be installed.

This change is based on the equivalent changes to FindTIFF, found in
commit ebaca6290d2c0be7dec22452389632949a700d28.

https://cmake.org/Bug/view.php?id=15911
---
 Help/release/dev/FindPNG-imported-targets.rst |  4 +++
 Modules/FindPNG.cmake | 50 +++
 Tests/CMakeLists.txt  |  4 +++
 Tests/FindPNG/CMakeLists.txt  | 10 ++
 Tests/FindPNG/Test/CMakeLists.txt | 16 +
 Tests/FindPNG/Test/main.c | 20 +++
 6 files changed, 97 insertions(+), 7 deletions(-)
 create mode 100644 Help/release/dev/FindPNG-imported-targets.rst
 create mode 100644 Tests/FindPNG/CMakeLists.txt
 create mode 100644 Tests/FindPNG/Test/CMakeLists.txt
 create mode 100644 Tests/FindPNG/Test/main.c

diff --git a/Help/release/dev/FindPNG-imported-targets.rst 
b/Help/release/dev/FindPNG-imported-targets.rst
new file mode 100644
index 000..e0d0ab1
--- /dev/null
+++ b/Help/release/dev/FindPNG-imported-targets.rst
@@ -0,0 +1,4 @@
+FindPNG-imported-targets
+
+
+* The :module:`FindPNG` module now provides imported targets.
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 7cf3f22..cae41ac 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -2,13 +2,20 @@
 # FindPNG
 # ---
 #
-# Find the native PNG includes and library
+# Find libpng, the official reference library for the PNG image format.
 #
+# Imported targets
+# 
 #
+# This module defines the following :prop_tgt:`IMPORTED` target:
 #
-# This module searches libpng, the library for working with PNG images.
+# ``PNG::PNG``
+#   The libpng library, if found.
 #
-# It defines the following variables
+# Result variables
+# 
+#
+# This module will set the following variables in your project:
 #
 # ``PNG_INCLUDE_DIRS``
 #   where to find png.h, etc.
@@ -22,19 +29,22 @@
 # ``PNG_VERSION_STRING``
 #   the version of the PNG library found (since CMake 2.8.8)
 #
-# Also defined, but not for general use are
+# Obsolete variables
+# ^^
+#
+# The following variables may also be set, for backwards compatibility:
 #
 # ``PNG_LIBRARY``
 #   where to find the PNG library.
-#
-# For backward compatiblity the variable PNG_INCLUDE_DIR is also set.
-# It has the same value as PNG_INCLUDE_DIRS.
+# ``PNG_INCLUDE_DIR``
+#   where to find the PNG headers (same as PNG_INCLUDE_DIRS)
 #
 # Since PNG depends on the ZLib compression library, none of the above
 # will be defined unless ZLib can be found.
 
 #=
 # Copyright 2002-2009 Kitware, Inc.
+# Copyright 2016 Raumfeld
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -105,6 +115,32 @@ if(ZLIB_FOUND)
 endif()
   endif ()
 
+  if(NOT TARGET PNG::PNG)
+add_library(PNG::PNG UNKNOWN IMPORTED)
+set_target_properties(PNG::PNG PROPERTIES
+  INTERFACE_COMPILE_DEFINITIONS "${PNG_DEFINITIONS}"
+  INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}"
+  INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
+if(EXISTS "${PNG_LIBRARY}")
+  set_target_properties(PNG::PNG PROPERTIES
+IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+IMPORTED_LOCATION "${PNG_LIBRARY}")
+endif()
+if(EXISTS "${PNG_LIBRARY_DEBUG}")
+  set_property(TARGET PNG::PNG APPEND PROPERTY
+IMPORTED_CONFIGURATIONS DEBUG)
+  set_target_properties(PNG::PNG PROPERTIES
+IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
+IMPORTED_LOCATION_DEBUG "${PNG_LIBRARY_DEBUG}")
+endif()
+if(EXISTS "${PNG_LIBRARY_RELEASE}")
+  set_property(TARGET PNG::PNG APPEND PROPERTY
+IMPORTED_CONFIGURATIONS RELEASE)
+  set_target_properties(PNG::PNG PROPERTIES
+IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
+IMPORTED_LOCATION_RELEASE "${PNG_LIBRARY_RELEASE}")
+endif()
+  endif()
   endif ()
 
   if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 043b757..3cca77b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1375,6 +1375,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P 
${CMake_SOURCE_DIR}/Utilities/Release
 add_subdirectory(FindOpenSSL)
   endif()
 
+  if(CMake_TEST_FindPNG)
+add_subdirectory(FindPNG)
+  endif()
+
   if(CMake_TEST_FindTIFF)
 add_subdirectory(FindTIFF)
   endif()
diff --git 

[cmake-developers] [PATCH V2] FindPNG: Create an imported PNG::PNG target

2016-01-21 Thread Sam Thursfield
Updated to refer to ZLIB::ZLIB, and with documentation tweak.

Sam Thursfield (1):
  FindPNG: Create an imported PNG::PNG target

 Help/release/dev/FindPNG-imported-targets.rst |  4 +++
 Modules/FindPNG.cmake | 50 +++
 Tests/CMakeLists.txt  |  4 +++
 Tests/FindPNG/CMakeLists.txt  | 10 ++
 Tests/FindPNG/Test/CMakeLists.txt | 16 +
 Tests/FindPNG/Test/main.c | 20 +++
 6 files changed, 97 insertions(+), 7 deletions(-)
 create mode 100644 Help/release/dev/FindPNG-imported-targets.rst
 create mode 100644 Tests/FindPNG/CMakeLists.txt
 create mode 100644 Tests/FindPNG/Test/CMakeLists.txt
 create mode 100644 Tests/FindPNG/Test/main.c

-- 
2.4.3

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [CMake] Internal error bug in v3.4.2.

2016-01-21 Thread Gonzalo



El 21/01/16 a las 10:28, Brad King escribió:
Thanks. This is consistent with the call stack shown in your original 
post. That line is always executed so we need to figure out what goes 
wrong with it in your particular case. Since you can reproduce it in 

I forgot to mention.  FLTK2.0 is available on SVN only here:

svn co http://seriss.com/public/fltk/fltk/trunk fltk-2.0


--
Gonzalo Garramuño
ggarr...@gmail.com

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] How to pass a configuration file to CMake?

2016-01-21 Thread Xavier Besseron
Hi Cedric,

I believe you should do it this way:

Your config.cmake file should be:

set(ENABLE_DOWNLOAD True CACHE BOOL "")
set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH "")



In the signature of set() for "Set Cache Entry", the *docstring* is
mandatory.
cf https://cmake.org/cmake/help/v3.4/command/set.html#set-cache-entry


And you forgot the path to your source directory in your CMake command line
:

cmake -C ../config.cmake /path/to/your/source




I hope this helps!

Xavier



On Thu, Jan 21, 2016 at 3:43 PM, Cedric Doucet 
wrote:

>
>
> Hello,
>
> I do not manage to pass a configuration file to cmake.
>
> I type 'cmake -C ../config.cmake'
>
> where config.cmake belongs to the parent directory and contains these
> lines:
>
> set(ENABLE_DOWNLOAD True CACHE BOOL)
> set(GCC_ROOT "/local/cdoucet/gcc/4.9.2/" CACHE PATH)
>
> I get the following error message but I don't understand why:
>
> loading initial cache file ../config.cmake
> CMake Error at /local/cdoucet/simol/config.cmake:1 (set):
>   set given invalid arguments for CACHE mode.
>
>
> CMake Error at /local/cdoucet/simol/config.cmake:2 (set):
>   set given invalid arguments for CACHE mode.
>
>
> CMake Error: The source directory "/local/cdoucet/simol/config.cmake" is a
> file, not a directory.
>
>
> Do you know how to solve this problem?
>
> - Cedric Doucet  a écrit :
> >
>
> Hi Peter!
>
> Thank you very much!
> It seems to be exactly what I want. :)
> I will try to use it.
>
> Cédric
>
> --
>
> *De: *"Petr Kmoch" 
> *À: *"Cedric Doucet" 
> *Cc: *cmake@cmake.org
> *Envoyé: *Lundi 21 Décembre 2015 13:25:53
> *Objet: *Re: [CMake] How to pass a configuration file to CMake?
>
> Hi Cedric.
>
> I have never used it myself, but I believe you're looking for CMake's
> command-line option '-C ':
> https://cmake.org/cmake/help/latest/manual/cmake.1.html
>
> Petr
>
> On Mon, Dec 21, 2015 at 1:12 PM, Cedric Doucet 
> wrote:
>
>>
>> Hello,
>>
>> I would like to know if it's possible to pass a configuration file to
>> CMake.
>> I have to pass a lot of information to CMake and the resulting command
>> line is very long to type.
>> Would it be possible to create a file containing all needed definitions
>> and pass it to CMake?
>>
>> For exemple, instead of typing
>>
>> cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=/home/me/there -D
>> CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>>
>> would it be possible to create a file containing
>>
>> CMAKE_BUILD_TYPE=Debug
>> CMAKE_INSTALL_PREFIX=/home/me/there
>> CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>>
>> and pass it to CMake?
>>
>> Cédric
>>
>> --
>>
>> >
>>
>> > 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 information on each offering, please visit:
>>
>> >
>>
>> > CMake Support: http://cmake.org/cmake/help/support.html
>>
>> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>
>> > CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> >
>>
>> > Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> >
>>
>> > Follow this link to subscribe/unsubscribe:
>>
>> >http://public.kitware.com/mailman/listinfo/cmake
>>
>
>
> >
>
>
>
>


-- 
Dr Xavier BESSERON
Research associate
FSTC, University of Luxembourg
Campus Kirchberg, Office E-007
Phone: +352 46 66 44 5418
http://luxdem.uni.lu/
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[Cmake-commits] CMake branch, next, updated. v3.4.2-2070-gaa6eaa6

2016-01-21 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  aa6eaa602a3111415db50cc143534f33f30341cc (commit)
   via  d7e863c1c1f4962f589e53b42a87a66cf5ab00b7 (commit)
  from  8ef9c76b623f3994bcc04c03cacc1f301fb22154 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa6eaa602a3111415db50cc143534f33f30341cc
commit aa6eaa602a3111415db50cc143534f33f30341cc
Merge: 8ef9c76 d7e863c
Author: Brad King 
AuthorDate: Thu Jan 21 12:51:42 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Thu Jan 21 12:51:42 2016 -0500

Merge topic 'vs-win10-sdk' into next

d7e863c1 VS: Do not fail on Windows 10 with VS 2015 if no SDK is available 
(#15929)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7e863c1c1f4962f589e53b42a87a66cf5ab00b7
commit d7e863c1c1f4962f589e53b42a87a66cf5ab00b7
Author: Brad King 
AuthorDate: Thu Jan 21 11:44:17 2016 -0500
Commit: Brad King 
CommitDate: Thu Jan 21 11:50:28 2016 -0500

VS: Do not fail on Windows 10 with VS 2015 if no SDK is available (#15929)

Since commit v3.4.0-rc1~5^2~1 (VS: Add support for selecting the Windows
10 SDK, 2015-09-30) the VS 2015 generator requires a Windows 10 SDK to
be available when CMAKE_SYSTEM_VERSION specifies Windows 10 (e.g.  when
building on a Windows 10 host).  Howewver, it is possible to install VS
2015 without any Windows 10 SDK.  Instead of failing with an error
message about the lack of a Windows 10 SDK, simply tolerate this case
and use the default Windows 8.1 SDK.  Since building for Windows Store
still requires the SDK, retain the diagnostic in that case.

diff --git a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst 
b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst
index 6392849..e0be3a4 100644
--- a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst
+++ b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst
@@ -8,4 +8,5 @@ specification of a target Windows version to select a 
corresponding SDK.
 The :variable:`CMAKE_SYSTEM_VERSION` variable may be set to specify a
 version.  Otherwise CMake computes a default version based on the Windows
 SDK versions available.  The chosen Windows target version number is provided
-in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``.
+in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``.  If no Windows 10 SDK
+is available this value will be empty.
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx 
b/Source/cmGlobalVisualStudio14Generator.cxx
index 83499f1..2f266cd 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -115,7 +115,7 @@ bool 
cmGlobalVisualStudio14Generator::InitializeWindows(cmMakefile* mf)
 {
   if (cmHasLiteralPrefix(this->SystemVersion, "10.0"))
 {
-return this->SelectWindows10SDK(mf);
+return this->SelectWindows10SDK(mf, false);
 }
   return true;
 }
@@ -143,17 +143,18 @@ bool 
cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf)
 }
   if (cmHasLiteralPrefix(this->SystemVersion, "10.0"))
 {
-return this->SelectWindows10SDK(mf);
+return this->SelectWindows10SDK(mf, true);
 }
   return true;
 }
 
 //
-bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf)
+bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf,
+ bool required)
 {
   // Find the default version of the Windows 10 SDK.
   this->WindowsTargetPlatformVersion = this->GetWindows10SDKVersion();
-  if (this->WindowsTargetPlatformVersion.empty())
+  if (required && this->WindowsTargetPlatformVersion.empty())
 {
 std::ostringstream  e;
 e << "Could not find an appropriate version of the Windows 10 SDK"
diff --git a/Source/cmGlobalVisualStudio14Generator.h 
b/Source/cmGlobalVisualStudio14Generator.h
index 76c15d9..57e6284 100644
--- a/Source/cmGlobalVisualStudio14Generator.h
+++ b/Source/cmGlobalVisualStudio14Generator.h
@@ -39,7 +39,7 @@ protected:
   bool IsWindowsStoreToolsetInstalled() const;
 
   virtual const char* GetIDEVersion() { return "14.0"; }
-  virtual bool SelectWindows10SDK(cmMakefile* mf);
+  virtual bool SelectWindows10SDK(cmMakefile* mf, bool required);
 
   // Used to verify that the Desktop toolset for the current generator is
   // installed on the machine.

---

Summary of changes:
 

[cmake-developers] [CMake 0015931]: Change the StartUp-Solution by Value

2016-01-21 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://public.kitware.com/Bug/view.php?id=15931 
== 
Reported By:Luis Roalter
Assigned To:
== 
Project:CMake
Issue ID:   15931
Category:   CMake
Reproducibility:always
Severity:   feature
Priority:   normal
Status: new
== 
Date Submitted: 2016-01-21 13:26 EST
Last Modified:  2016-01-21 13:26 EST
== 
Summary:Change the StartUp-Solution by Value
Description: 
CMake always tries to set ALL_BUILD in Visual Studio Projects as the first
project in the Solution file. This is okay if I want to build all the content.
But sometimes it would be great to change this behavior to a custom project as
well. 

The point is: Pressing F5 in Studio (just run the Application) won't work. Sure,
you can setup the startup project manually. But it would be gread to set it
per-project (means per solution).

I've patched it to use CMAKE_STARTUP_SOLUTION. This exchanges the string
"ALL_BUILD" in the comparison of the project if possible.  It would be even
better to make something like

set_property(GLOBAL PROPERTY STARTUP_APPLICATION MainWindow). This should only
scope till the next project().

Steps to Reproduce: 
Just press F5 on a Studio-runnable application.
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-01-21 13:26 Luis Roalter   New Issue
==

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[Cmake-commits] CMake branch, next, updated. v3.4.2-2072-g92b073f

2016-01-21 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  92b073f950b7cb5e20f138fb685bc2145b0833b8 (commit)
   via  f98ae28e3dd633126e7897a593f2d15ba68a75d9 (commit)
  from  aa6eaa602a3111415db50cc143534f33f30341cc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92b073f950b7cb5e20f138fb685bc2145b0833b8
commit 92b073f950b7cb5e20f138fb685bc2145b0833b8
Merge: aa6eaa6 f98ae28
Author: Brad King 
AuthorDate: Thu Jan 21 13:45:41 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Thu Jan 21 13:45:41 2016 -0500

Merge topic 'test-fltk_wrap_ui' into next

f98ae28e Tests: Cover fltk_wrap_ui on an executable that links libraries


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f98ae28e3dd633126e7897a593f2d15ba68a75d9
commit f98ae28e3dd633126e7897a593f2d15ba68a75d9
Author: Brad King 
AuthorDate: Thu Jan 21 13:42:46 2016 -0500
Commit: Brad King 
CommitDate: Thu Jan 21 13:42:46 2016 -0500

Tests: Cover fltk_wrap_ui on an executable that links libraries

CMake 3.4 may crash on this case.  The problem seems to have been
fixed since then, but keep it working by adding a test case now.

Reported-by: Gonzalo Garramuño 

diff --git a/Tests/Wrapping/CMakeLists.txt b/Tests/Wrapping/CMakeLists.txt
index cbb28a1..aca36bc 100644
--- a/Tests/Wrapping/CMakeLists.txt
+++ b/Tests/Wrapping/CMakeLists.txt
@@ -85,16 +85,18 @@ endif ()
 # Since FLTK_FLUID_EXE is supposed to create a .cxx/.h from a .fl/.fld,
 # create an empty one so that the dependencies can be met.
 #
-set (FLTK_SRCS
-  fltk1.fl
-  )
 add_executable(fakefluid fakefluid.cxx)
 set (FLTK_WRAP_UI "On")
 set (FLTK_FLUID_EXECUTABLE fakefluid)
-fltk_wrap_ui (wraplibFLTK ${FLTK_SRCS})
+fltk_wrap_ui (wraplibFLTK fltk1.fl)
 add_library(wraplibFLTK ${wraplibFLTK_FLTK_UI_SRCS})
 add_dependencies(wraplibFLTK fakefluid)
 add_dependencies(fakefluid Wrap)
+fltk_wrap_ui (wrapFLTK fltk2.fl)
+add_executable(wrapFLTK wrapFLTK.c ${wrapFLTK_FLTK_UI_SRCS})
+target_link_libraries(wrapFLTK wraplibFLTK)
+add_dependencies(wrapFLTK fakefluid)
+
 #
 # Mangled Mesa
 #
diff --git a/Tests/Wrapping/fltk2.fl b/Tests/Wrapping/fltk2.fl
new file mode 100644
index 000..e69de29
diff --git a/Tests/Wrapping/wrapFLTK.c b/Tests/Wrapping/wrapFLTK.c
new file mode 100644
index 000..78f2de1
--- /dev/null
+++ b/Tests/Wrapping/wrapFLTK.c
@@ -0,0 +1 @@
+int main(void) { return 0; }

---

Summary of changes:
 Tests/Wrapping/CMakeLists.txt|   10 ++
 .../IntelVSImplicitPath/hello.f => Tests/Wrapping/fltk2.fl   |0
 .../LinkInterfaceLoop/main.c => Wrapping/wrapFLTK.c} |0
 3 files changed, 6 insertions(+), 4 deletions(-)
 copy Modules/IntelVSImplicitPath/hello.f => Tests/Wrapping/fltk2.fl (100%)
 copy Tests/{CMakeOnly/LinkInterfaceLoop/main.c => Wrapping/wrapFLTK.c} (100%)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


Re: [cmake-developers] [PATCH] Fix crash in cmExportInstallFileGenerator::FindNamespaces()

2016-01-21 Thread Brad King
On 01/20/2016 09:41 PM, Andrey Pokrovskiy wrote:
> Subject: [PATCH] Fix crash in cmExportInstallFileGenerator::FindNamespaces()
> 
> Found it when was building poco library:
> https://github.com/pocoproject/poco.git
> 
> Steps to reproduce:
> 1. Clone poco
> 2. mkdir poco.git/build.make
> 3. cd poco.git/build.make
> 4. cmake ..
> 5. Crash

Thanks.  From that I was able to produce a simpler test case
which I've added to the commit message.  Applied:

 cmExportInstallFileGenerator: Fix crash in FindNamespaces
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dbfdddf

-Brad
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[Cmake-commits] CMake branch, master, updated. v3.4.2-890-g3e7794a

2016-01-21 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  3e7794a2e6297e8ed3e114e92ea1480f75aa38b1 (commit)
   via  70788e92641c4cf4c3f20af607cc6e203203b420 (commit)
   via  bd2384f593d0cf2c894ff781c4e5278fff2ac96c (commit)
   via  ad9394f4fdb69f3f3376d7377fac0a22568aed7c (commit)
   via  f9599ed42f5bfda35b98936257423f00e260498f (commit)
   via  275f2a85b21d781e237dd22252261a0a62d9879b (commit)
  from  aaf06f2b0f4ce4085e2bf1c60ffc63065968a9c6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e7794a2e6297e8ed3e114e92ea1480f75aa38b1
commit 3e7794a2e6297e8ed3e114e92ea1480f75aa38b1
Merge: aaf06f2 70788e9
Author: Brad King 
AuthorDate: Thu Jan 21 13:55:53 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Thu Jan 21 13:55:53 2016 -0500

Merge topic 'reduce-allocations'

70788e92 Remove temporary allocations when calling cmHasLiteral{Suf,Pre}fix.
bd2384f5 Optimize cmMakefile::ExpandVariablesInStringNew.
ad9394f4 Remove temporary allocations in cmMacroHelper::InvokeInitialPass.
f9599ed4 Remove temporary allocations by extending the lifetime of the 
retval.
275f2a85 Remove temporary allocations when calling 
cmGeneratorTarget::GetName.


---

Summary of changes:
 Source/cmAlgorithms.h|4 ++--
 Source/cmGeneratorTarget.cxx |2 +-
 Source/cmGeneratorTarget.h   |2 +-
 Source/cmGlobalGenerator.cxx |   12 ++--
 Source/cmMacroCommand.cxx|   16 +++-
 Source/cmMakefile.cxx|   19 +--
 6 files changed, 26 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, next, updated. v3.4.2-2078-gf559b68

2016-01-21 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  f559b68db2e472b028d7e04f7b864b09fcfb4479 (commit)
   via  3e7794a2e6297e8ed3e114e92ea1480f75aa38b1 (commit)
   via  aaf06f2b0f4ce4085e2bf1c60ffc63065968a9c6 (commit)
   via  563a6c7be09c73bdd7e0ee7b0c52dd9bbc20c50a (commit)
   via  071c94eeac9811c8dbe7b6e627899051f1a18ec4 (commit)
   via  184676532c8192a520b4db8380efbddc13272289 (commit)
  from  92b073f950b7cb5e20f138fb685bc2145b0833b8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f559b68db2e472b028d7e04f7b864b09fcfb4479
commit f559b68db2e472b028d7e04f7b864b09fcfb4479
Merge: 92b073f 3e7794a
Author: Brad King 
AuthorDate: Thu Jan 21 13:56:01 2016 -0500
Commit: Brad King 
CommitDate: Thu Jan 21 13:56:01 2016 -0500

Merge branch 'master' into next


---

Summary of changes:


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, master, updated. v3.4.2-884-gaaf06f2

2016-01-21 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  aaf06f2b0f4ce4085e2bf1c60ffc63065968a9c6 (commit)
   via  f9e45ab9d412b08ded8a11ff1f4f0ef90e10358c (commit)
  from  563a6c7be09c73bdd7e0ee7b0c52dd9bbc20c50a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aaf06f2b0f4ce4085e2bf1c60ffc63065968a9c6
commit aaf06f2b0f4ce4085e2bf1c60ffc63065968a9c6
Merge: 563a6c7 f9e45ab
Author: Brad King 
AuthorDate: Thu Jan 21 13:55:50 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Thu Jan 21 13:55:50 2016 -0500

Merge topic 'add-FindXalanC'

f9e45ab9 FindXalanC: New module to find the Apache Xalan-C++ library


---

Summary of changes:
 Help/manual/cmake-modules.7.rst |1 +
 Help/module/FindXalanC.rst  |1 +
 Help/release/dev/FindXalanC.rst |5 +
 Modules/FindXalanC.cmake|  162 +++
 Tests/CMakeLists.txt|4 +
 Tests/{FindBoost => FindXalanC}/CMakeLists.txt  |8 +-
 Tests/FindXalanC/Test/CMakeLists.txt|   17 +++
 Tests/{FindXercesC => FindXalanC}/Test/main.cxx |3 +
 8 files changed, 197 insertions(+), 4 deletions(-)
 create mode 100644 Help/module/FindXalanC.rst
 create mode 100644 Help/release/dev/FindXalanC.rst
 create mode 100644 Modules/FindXalanC.cmake
 copy Tests/{FindBoost => FindXalanC}/CMakeLists.txt (54%)
 create mode 100644 Tests/FindXalanC/Test/CMakeLists.txt
 copy Tests/{FindXercesC => FindXalanC}/Test/main.cxx (50%)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, master, updated. v3.4.2-880-g071c94e

2016-01-21 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  071c94eeac9811c8dbe7b6e627899051f1a18ec4 (commit)
   via  ec00e89e83eeb91633affd662870b7a6955dbf5a (commit)
   via  5d739a3c843c95aec6c5c8df4d7e87e606c0c8ea (commit)
  from  184676532c8192a520b4db8380efbddc13272289 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=071c94eeac9811c8dbe7b6e627899051f1a18ec4
commit 071c94eeac9811c8dbe7b6e627899051f1a18ec4
Merge: 1846765 ec00e89
Author: Brad King 
AuthorDate: Thu Jan 21 13:55:44 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Thu Jan 21 13:55:44 2016 -0500

Merge topic 'ExternalProject-ctest-config'

ec00e89e ExternalProject: Fix TEST_BEFORE_INSTALL for multi-config 
generators
5d739a3c ExternalProject: Simplify `cmake --build` configuration passing


---

Summary of changes:
 Modules/ExternalProject.cmake |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, master, updated. v3.4.2-882-g563a6c7

2016-01-21 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  563a6c7be09c73bdd7e0ee7b0c52dd9bbc20c50a (commit)
   via  1787269ef3c476ee1176c92c54e5b22f9cb7f3fe (commit)
  from  071c94eeac9811c8dbe7b6e627899051f1a18ec4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=563a6c7be09c73bdd7e0ee7b0c52dd9bbc20c50a
commit 563a6c7be09c73bdd7e0ee7b0c52dd9bbc20c50a
Merge: 071c94e 1787269
Author: Brad King 
AuthorDate: Thu Jan 21 13:55:47 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Thu Jan 21 13:55:47 2016 -0500

Merge topic 'cmake-E-time-quoting'

1787269e cmake: Fix `-E time` argument passing to child


---

Summary of changes:
 Help/release/dev/cmake-E-time-quoting.rst   |7 +++
 Source/cmcmd.cxx|4 ++--
 .../E_time-no-arg-result.txt}   |0
 .../{E-no-arg-stderr.txt => E_time-no-arg-stderr.txt}   |0
 Tests/RunCMake/CommandLine/E_time-stdout.txt|3 +++
 Tests/RunCMake/CommandLine/RunCMakeTest.cmake   |3 +++
 6 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 Help/release/dev/cmake-E-time-quoting.rst
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
CommandLine/E_time-no-arg-result.txt} (100%)
 copy Tests/RunCMake/CommandLine/{E-no-arg-stderr.txt => 
E_time-no-arg-stderr.txt} (100%)
 create mode 100644 Tests/RunCMake/CommandLine/E_time-stdout.txt


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


Re: [CMake] Internal error bug in v3.4.2.

2016-01-21 Thread Brad King
On 01/21/2016 11:00 AM, Gonzalo wrote:
> Find attached the mrViewer/src/CMakeList.txt file that still fails.

Thanks.  From that I was able to reproduce it in a small test case
with CMake 3.4.  It appears that the problem has been fixed since
then in 'master'.  I've added a test case to keep it working:

 Tests: Cover fltk_wrap_ui on an executable that links libraries
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f98ae28e

Thanks,
-Brad

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[Cmake-commits] CMake branch, master, updated. v3.4.2-877-g1846765

2016-01-21 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  184676532c8192a520b4db8380efbddc13272289 (commit)
   via  c8daac3556bc4ef7b39e0e632ead55d566e927cc (commit)
  from  750ae8d5a8890f5d8091105a0b03bee085cc4dff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=184676532c8192a520b4db8380efbddc13272289
commit 184676532c8192a520b4db8380efbddc13272289
Merge: 750ae8d c8daac3
Author: Brad King 
AuthorDate: Thu Jan 21 13:55:41 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Thu Jan 21 13:55:41 2016 -0500

Merge topic 'GetPrerequisites-ms-ucrt'

c8daac35 GetPrerequisites: Define api-ms-win-* files as system libraries 
(#15691)


---

Summary of changes:
 Modules/GetPrerequisites.cmake |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, next, updated. v3.4.2-2080-gd194d14

2016-01-21 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  d194d14ba6d2d685ce50a01830f00f07f67650b7 (commit)
   via  9b08c6233052fa1c3d393ee474c874f997491f7b (commit)
  from  f559b68db2e472b028d7e04f7b864b09fcfb4479 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d194d14ba6d2d685ce50a01830f00f07f67650b7
commit d194d14ba6d2d685ce50a01830f00f07f67650b7
Merge: f559b68 9b08c62
Author: Brad King 
AuthorDate: Thu Jan 21 13:58:54 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Thu Jan 21 13:58:54 2016 -0500

Merge topic 'FindPNG-imported-targets' into next

9b08c623 FindPNG: Create an imported PNG::PNG target (#15911)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b08c6233052fa1c3d393ee474c874f997491f7b
commit 9b08c6233052fa1c3d393ee474c874f997491f7b
Author: Sam Thursfield 
AuthorDate: Tue Jan 19 17:43:05 2016 +
Commit: Brad King 
CommitDate: Thu Jan 21 13:58:15 2016 -0500

FindPNG: Create an imported PNG::PNG target (#15911)

Imported targets are now the recommended way of dealing with external
library dependencies.  Add one for FindPNG and update documentation
accordingly.  Also add a test case activated by CMake_TEST_FindPNG.

diff --git a/Help/release/dev/FindPNG-imported-targets.rst 
b/Help/release/dev/FindPNG-imported-targets.rst
new file mode 100644
index 000..e0d0ab1
--- /dev/null
+++ b/Help/release/dev/FindPNG-imported-targets.rst
@@ -0,0 +1,4 @@
+FindPNG-imported-targets
+
+
+* The :module:`FindPNG` module now provides imported targets.
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 7cf3f22..cae41ac 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -2,13 +2,20 @@
 # FindPNG
 # ---
 #
-# Find the native PNG includes and library
+# Find libpng, the official reference library for the PNG image format.
 #
+# Imported targets
+# 
 #
+# This module defines the following :prop_tgt:`IMPORTED` target:
 #
-# This module searches libpng, the library for working with PNG images.
+# ``PNG::PNG``
+#   The libpng library, if found.
 #
-# It defines the following variables
+# Result variables
+# 
+#
+# This module will set the following variables in your project:
 #
 # ``PNG_INCLUDE_DIRS``
 #   where to find png.h, etc.
@@ -22,19 +29,22 @@
 # ``PNG_VERSION_STRING``
 #   the version of the PNG library found (since CMake 2.8.8)
 #
-# Also defined, but not for general use are
+# Obsolete variables
+# ^^
+#
+# The following variables may also be set, for backwards compatibility:
 #
 # ``PNG_LIBRARY``
 #   where to find the PNG library.
-#
-# For backward compatiblity the variable PNG_INCLUDE_DIR is also set.
-# It has the same value as PNG_INCLUDE_DIRS.
+# ``PNG_INCLUDE_DIR``
+#   where to find the PNG headers (same as PNG_INCLUDE_DIRS)
 #
 # Since PNG depends on the ZLib compression library, none of the above
 # will be defined unless ZLib can be found.
 
 #=
 # Copyright 2002-2009 Kitware, Inc.
+# Copyright 2016 Raumfeld
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -105,6 +115,32 @@ if(ZLIB_FOUND)
 endif()
   endif ()
 
+  if(NOT TARGET PNG::PNG)
+add_library(PNG::PNG UNKNOWN IMPORTED)
+set_target_properties(PNG::PNG PROPERTIES
+  INTERFACE_COMPILE_DEFINITIONS "${PNG_DEFINITIONS}"
+  INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}"
+  INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
+if(EXISTS "${PNG_LIBRARY}")
+  set_target_properties(PNG::PNG PROPERTIES
+IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+IMPORTED_LOCATION "${PNG_LIBRARY}")
+endif()
+if(EXISTS "${PNG_LIBRARY_DEBUG}")
+  set_property(TARGET PNG::PNG APPEND PROPERTY
+IMPORTED_CONFIGURATIONS DEBUG)
+  set_target_properties(PNG::PNG PROPERTIES
+IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
+IMPORTED_LOCATION_DEBUG "${PNG_LIBRARY_DEBUG}")
+endif()
+if(EXISTS "${PNG_LIBRARY_RELEASE}")
+  set_property(TARGET PNG::PNG APPEND PROPERTY
+IMPORTED_CONFIGURATIONS RELEASE)
+  set_target_properties(PNG::PNG PROPERTIES
+IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
+IMPORTED_LOCATION_RELEASE "${PNG_LIBRARY_RELEASE}")
+endif()
+  

Re: [cmake-developers] [PATCH V2] FindPNG: Create an imported PNG::PNG target

2016-01-21 Thread Brad King
On 01/21/2016 11:46 AM, Sam Thursfield wrote:
> Imported targets are now the recommended way of dealing with external
> library dependencies.

Thanks, re-applied and merged to 'next' for testing:

 FindPNG: Create an imported PNG::PNG target (#15911)
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b08c623

For reference, the net diff since v1 is just:

> - INTERFACE_LIBRARIES "${PNG_LIBRARIES}")
> + INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)

Thanks,
-Brad

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [CMake] Internal error bug in v3.4.2.

2016-01-21 Thread Gonzalo Garramuño

On 21/01/2016 03:47 p.m., Brad King wrote:

On 01/21/2016 11:00 AM, Gonzalo wrote:

Find attached the mrViewer/src/CMakeList.txt file that still fails.

Thanks.  From that I was able to reproduce it in a small test case
with CMake 3.4.  It appears that the problem has been fixed since
then in 'master'.  I've added a test case to keep it working:
Thank you very much for the prompt resolution.   I'll check the master 
repo and shall confirm if all is fixed.


Once again,
thank you very mucho :D

--

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] ExternalProject not being configured / custom_command not executed

2016-01-21 Thread Bill Hoffman

On 1/21/2016 2:33 PM, Kügler, David wrote:

Hello everybody,

I am trying to build a Project (via ExternalProject from a parent project).

More precisely, I want to build the plus Toolkit (plustoolkit.org) and
the subprojects using the build “superproject” (i.e. PlusBuild).

It partly seems to work fine, but the ExternalProject PlusApp never
actually gets built. Build-rule-files in the CMakeFiles folder are
created, but it seems, the “configure”-command is never actually called.
Thusly there is never ANY file created in the BINARY_DIR of the
PlusApp-project subfolder.

Why do I ask you guys, and not the people from Plus? Because a second
subproject (i.e. PlusLib) just works fine, AND if I go ahead and extract
the configure-command (i.e. the command-line-command) either from
–trace-expand or from the PlusApp-CfgCmd.txt file (replacing ‘;’ with ‘“
“’ (space and double quotation) ) it works fine.

So: The command to configure, and the rule-files are created from CMake,
but the command is actually not executed and I cannot say why.

This definitely seems to be a hiccup in CMake, but I am at a deadend.

Any Idea, why this is so?

Using CMake 3.4.10 ; Visual Studio 2013 x64 ; Windows 8.1 ; plustoolkit

(I hope this would be the relevant information)

Still sounds like a question for the PlusApp guys.  It is possible that 
they have some error in their CMakeLists.txt files that prevents this 
from working.  CMake is pretty well tested and external project tests 
are all passing for that platform and version  of CMake.


-Bill

--

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[Cmake-commits] CMake branch, next, updated. v3.4.2-2068-g8ef9c76

2016-01-21 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  8ef9c76b623f3994bcc04c03cacc1f301fb22154 (commit)
   via  7dbfdddf33ab2d52e471c8533897bc2d7aeb40c9 (commit)
   via  750ae8d5a8890f5d8091105a0b03bee085cc4dff (commit)
  from  1ca14513c5df74ec3d4d5b9febbe1627a6a46cb9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8ef9c76b623f3994bcc04c03cacc1f301fb22154
commit 8ef9c76b623f3994bcc04c03cacc1f301fb22154
Merge: 1ca1451 7dbfddd
Author: Brad King 
AuthorDate: Thu Jan 21 11:25:52 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Thu Jan 21 11:25:52 2016 -0500

Merge topic 'fix-use-generator-target' into next

7dbfdddf cmExportInstallFileGenerator: Fix crash in FindNamespaces
750ae8d5 CMake Nightly Date Stamp


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dbfdddf33ab2d52e471c8533897bc2d7aeb40c9
commit 7dbfdddf33ab2d52e471c8533897bc2d7aeb40c9
Author: Andrey Pokrovskiy 
AuthorDate: Wed Jan 20 18:29:58 2016 -0800
Commit: Brad King 
CommitDate: Thu Jan 21 10:53:30 2016 -0500

cmExportInstallFileGenerator: Fix crash in FindNamespaces

Refactoring merged by commit 9afbb733ec (Merge topic
'use-generator-target', 2015-10-20) in and around commit 381e7afd
(cmExportSet: Store a cmGeneratorTarget, 2015-10-17) forgot to update
one place in this method.  This leads to a crash in code such as

  add_library(A a.c)
  add_library(B b.c)
  target_link_libraries(B A)
  install(TARGETS B DESTINATION lib EXPORT ExpB)
  install(EXPORT ExpB DESTINATION lib/cmake/test)
  add_executable(C c.c)
  install(TARGETS C DESTINATION bin EXPORT ExpC)

Fix the target name reference to avoid using an unpopulated Target
pointer.

diff --git a/Source/cmExportInstallFileGenerator.cxx 
b/Source/cmExportInstallFileGenerator.cxx
index b695904..71418e8 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -496,7 +496,7 @@ cmExportInstallFileGenerator
 bool containsTarget = false;
 for(unsigned int i=0; isize(); i++)
   {
-  if (name == (*targets)[i]->Target->GetName())
+  if (name == (*targets)[i]->TargetName)
 {
 containsTarget = true;
 break;

---

Summary of changes:
 Source/CMakeVersion.cmake   |2 +-
 Source/cmExportInstallFileGenerator.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


Re: [CMake] XCode Generation Issue

2016-01-21 Thread Eric Wing
On 1/21/16, David Morsberger  wrote:
> Eric,
>
> I went down a rabbit hole and pulled myself back out. I narrowed it down to
> the following.
>
> We are using cmake to check if the linker supports -Wl,—as-needed. The test
> compile (and link?) command cmake builds using ‘cmake -G Xcode’  does not
> fail.
>
> The command from ‘cmake -G’ has been narrowed down to the following:
>
> $
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
> \
>  -Qunused-arguments \
>  -DWS_LD_FLAG_VALID0 \
>  -Wl,--as-needed \
>  -c src.c \
>  -o src.o
> $
>
> The following modified command generates an error:
>
> $
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
> \
>  -Qunused-arguments \
>  -DWS_LD_FLAG_VALID0 \
>  -Wl,--as-needed \
>  src.c
>
> ld: unknown option: --as-needed
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> $
>
> It appears the linker isn’t called when the -c and the -o options are
> present. The following warning is generated when the ‘-Qunused-arguments’ is
> removed.
>
> clang: warning: -Wl,--as-needed: 'linker' input unused
>
> The cmake logic in CMakeLists.txt is basically:
>
>SET(CMAKE_REQUIRED_FLAGS "${_FLAG}")
>CHECK_C_SOURCE_RUNS(“int main() { return 0;}" ${_RESULT})
>
> where _FLAG is set to ‘-DWS_LD_FLAG_VALID0 -Wl,—-as-needed’
>
>
> So, how/where is the clang compile/link command generated and why isn’t it
> being setup for clang to link?
>
>

Sorry, these are internals I'm not very familiar with. I'm just
starting to get up to speed on the CMake internals for the Makefile
generator (Linux focus) because I'm trying to add a Swift backend.

My impression has always been (this could be wrong) that the Xcode
generator has more deference to Xcode than CMake actively getting
involved. I probably helped push this attitude too because Apple tries
to handle a lot of specific details through Xcode that they feel is
too arcane to expect/require their developers to know about. In
general, I find this to be the right thing, because ultimately getting
stuff that works well with Obj-C (CMake makefiles have a bug where
they compile as Obj-C++), all the packaging and codesigning, and
working with the iOS simulator are platform specific and somewhat
private/changing implementation details they don't want us to manually
hardcode.


Anyway, to your question, I almost never use CHECK_ commands so I'm not sure.
CHECK_C_SOURCE_RUNS is something I would never use because 'running'
is a serious problem for cross-compilation (Mac was
PowerPC/Intel/32-bit/64-bit, iOS is armv6/armv7(s)/arm64/i386).
Cross-compilation is kind of built-into Xcode's thinking now because
there are so many targets. I don't even know how LLVM bitcode factors
into this now, but hopefully the idea of deference to Xcode is that I
mostly won't need to care.

Are there separate CHECK_ commands for compilation and linking
(without running)?

-Eric
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[cmake-developers] [CMake 0015932]: Path too long installing from installer

2016-01-21 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://cmake.org/Bug/view.php?id=15932 
== 
Reported By:MPowell
Assigned To:
== 
Project:CMake
Issue ID:   15932
Category:   CMake
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2016-01-21 17:34 EST
Last Modified:  2016-01-21 17:34 EST
== 
Summary:Path too long installing from installer
Description: 
Seems like a duplicate of issue 0010257.

Steps to Reproduce: 
Installed, received passive dialog [OK] option. I don't know what I must have
done differently than anyone else. I simply installed and received the error.

Additional Information: 
My user path is only 220 characters. My All Users path is substantially longer,
but it is still a valid path; 1875 characters. So why can this issue not be
fixed?
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-01-21 17:34 MPowellNew Issue
==

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] CMake daemon for user tools

2016-01-21 Thread Daniel Pfeifer
On Wed, Jan 20, 2016 at 10:03 PM, Stephen Kelly  wrote:
> Milian Wolff wrote:
>
>>> I'm concerned that the memory usage of a daemon implementing the proposed
>>> capabilities may be too large to be practical (at least without a major
>>> redesign of certain structures that tend to duplicate substrings, or
>>> some kind of out-of-core approach).
>>
>> This sounds like optimizations to that daemon will benefit CMake.
>
> FYI I merged a reduce-allocations branch to next for testing. It came from
> Milian here:
>
>  https://github.com/steveire/CMake/pull/1

Very nice! It is impressive what kind of an impact a simple 'const&'
can have. Also, nice work identifying the hotspots.

> Milian also mentioned the possibility of using something like a sqlite
> database (probably what you meant by out-of-core above) for definitions for
> querying by the daemon.
>
> I also mentioned some possibile optimization possibilities, such as removing
> the closure of definitions created for all directories. I wrote a branch
> which does that some months ago, but it resulted in a slow down. I'll see if
> I can rebase the commit to master and push it to github, together with a
> patch for avoiding computing the hash multiple times in cmDefinitions.

What do you think about string interning? I started a cmString class
[2] that stores short strings inplace and puts long strings into a
pool. Copies never allocate extra memory and equality comparison is
always O(1).
In addition to `operator<` (which is lexicographical) there is a O(1)
comparison that can be used where lexicographical ordering is not
required (ie. for lookup tables).

[1] https://en.wikipedia.org/wiki/String_interning
[2] https://github.com/purpleKarrot/CMake/commits/string-pool

cheers, Daniel
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [CMake] CMake 3.4.2 available for download

2016-01-21 Thread Andrew Maclean
Thanks for this Brad, your comments in
https://cmake.org/Bug/view.php?id=15929#c40287 make it very clear as to
what is happening.

I had naively assumed that when installing a new Visual Studio compiler
that the latest SDK would be also installed! It is nice to see that CMake
3.4.2 does the checks now! It is nice to get a message.

I'll update the SDK on my other machine on Monday, unless you want me to
test something.

Andrew

On Fri, Jan 22, 2016 at 12:38 AM, Brad King  wrote:

> On 01/20/2016 04:36 PM, Andrew Maclean wrote:
> > "CMake Error at CMakeLists.txt:1 (project):
> >   Could not find an appropriate version of the Windows 10 SDK installed
> on
> >   this machine"
> >
> > In CMakeOutput.log, there is one line:
> > "The system is: Windows - 10.0.10586 - AMD64"
>
> It looks like this has been reported to the issue tracker here:
>
>  https://cmake.org/Bug/view.php?id=15929
>
> Please follow discussion over there for more.
>
> Thanks,
> -Brad
>
>


-- 
___
Andrew J. P. Maclean

___
-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[Cmake-commits] CMake branch, master, updated. v3.4.2-891-gf81ccc5

2016-01-21 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  f81ccc575331b4e184622b192deac2865931de19 (commit)
  from  3e7794a2e6297e8ed3e114e92ea1480f75aa38b1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f81ccc575331b4e184622b192deac2865931de19
commit f81ccc575331b4e184622b192deac2865931de19
Author: Kitware Robot <kwro...@kitware.com>
AuthorDate: Fri Jan 22 00:01:03 2016 -0500
Commit: Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Jan 22 00:01:03 2016 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 06c5a99..58d6bee 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 4)
-set(CMake_VERSION_PATCH 20160121)
+set(CMake_VERSION_PATCH 20160122)
 #set(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


[CMake] ExternalProject not being configured / custom_command not executed

2016-01-21 Thread Kügler , David
Hello everybody,

I am trying to build a Project (via ExternalProject from a parent project).

More precisely, I want to build the plus Toolkit (plustoolkit.org) and the 
subprojects using the build "superproject" (i.e. PlusBuild).

It partly seems to work fine, but the ExternalProject PlusApp never actually 
gets built. Build-rule-files in the CMakeFiles folder are created, but it 
seems, the "configure"-command is never actually called. Thusly there is never 
ANY file created in the BINARY_DIR of the PlusApp-project subfolder.

Why do I ask you guys, and not the people from Plus? Because a second 
subproject (i.e. PlusLib) just works fine, AND if I go ahead and extract the 
configure-command (i.e. the command-line-command) either from -trace-expand or 
from the PlusApp-CfgCmd.txt file (replacing ';' with '" "' (space and double 
quotation) ) it works fine.

So: The command to configure, and the rule-files are created from CMake, but 
the command is actually not executed and I cannot say why.

This definitely seems to be a hiccup in CMake, but I am at a deadend.

Any Idea, why this is so?

Using CMake 3.4.10 ; Visual Studio 2013 x64 ; Windows 8.1 ; plustoolkit
(I hope this would be the relevant information)

Thank you!
David

--
Dipl.-Ing. David Kügler
Gruppe "Medical Computing"
Fachgebiet Graphisch-Interaktive Systeme
Technische Universität Darmstadt

Gebäude S3|05
Fraunhoferstr. 5
64289 Darmstadt

Tel.: +49 6151 155-672
Fax: +49 6151 155-603
david.kueg...@gris.tu-darmstadt.de
http://www.gris.tu-darmstadt.de/

-- 

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Internal error bug in v3.4.2.

2016-01-21 Thread Gonzalo

El 21/01/16 a las 15:47, Brad King escribió:

Thanks.  From that I was able to reproduce it in a small test case
with CMake 3.4.  It appears that the problem has been fixed since
then in 'master'.  I've added a test case to keep it working:

I confirm the bug is squashed in master!  Congratulations and thanks again.

--
Gonzalo Garramuño
ggarr...@gmail.com

--

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 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake