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] 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] 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


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 www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kit

[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] 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

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] 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 
mailto:vania.jolob...@inria.fr>> 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
> > ExternalProject_Add(). In theory this should be 

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&fileviewer=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 
>> mailto:vania.jolob...@inria.fr>> 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


[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] 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

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] 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, Nicholas Braden
>  wrote:
>>

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

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 done
> > -- Generating done
> >
> >
> > It also works if

[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] 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
>>
>> >
>>
>> > Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> >
>>
>> > Follow this link to subscribe/unsubscribe:
>>
>> >http

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 open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> >
>>
>> > Follow this link to subscribe/unsubscribe:
>>
>> >http://public.kitware.

[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:

>

> 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.

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

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

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


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


[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

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


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

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