Re: [CMake] Export environment variables in generated Makefile

2015-05-18 Thread Taylor Braun-Jones
On Mon, May 18, 2015 at 8:48 AM, Brad King wrote: > On 05/17/2015 12:35 AM, Taylor Braun-Jones wrote: > > CMake already has an ENVIRONMENT property for tests ... > > symmetric feature would be to support an ENVIRONMENT property > > for targets as well. > > We can provide it for tests because ctes

Re: [CMake] Problem Compiling on Solaris 10 x86

2015-05-18 Thread Bill Hoffman
On 5/18/2015 12:01 PM, Konstantin Andreev wrote: SUN/Oracle Solaris typically has two `curses' packages installed : traditional Unix `curses' and GNU `ncurses'. The wise cmake builds itself against headers of GNU `ncurses', but links with Unix `curses' with obvious result above. To workarou

Re: [CMake] Problem Compiling on Solaris 10 x86

2015-05-18 Thread Konstantin Andreev
[posting to the old thread for reference] On 09 Dec 2011, Christopher Hylarides wrote: I'm trying to build cmake on Solaris 10 x86 and am getting the following error: ... [ 96%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/cmCursesWidget.cxx.o [ 96%] Building CXX object Sourc

Re: [CMake] Unknown argument in FOREACH

2015-05-18 Thread Cedric Doucet
Hi Petr, thank you very much! I checked the documentation and for examples on the internet. However, I did not noticed the details. I may be blind because I am familiar with range-based loops like in C++ or Python. I will try to look the documentation more carefully the next time. Of cour

Re: [CMake] Unknown argument in FOREACH

2015-05-18 Thread Petr Kmoch
Hi Cedric. If you check the documentation of foreach() ( http://www.cmake.org/cmake/help/v3.2/command/foreach.html), you will see there is no "IN item item..." syntax. Either LISTS or ITEMS has to follow after IN, or IN must be omitted altogether. So either do this: foreach(LIBRARY IN LISTS L

[CMake] Unknown argument in FOREACH

2015-05-18 Thread Cedric Doucet
Hello, I try to write a loop to donwload and install libraries whose name is contained in a list. I wrote these lines from the 45th line of my CMakeLists.txt file: === set(LIBRARIES_TO_DOWNLOAD EIGEN) foreach(LIBRARY IN ${LIBRARIES_T

Re: [CMake] Where do all the extra clang flags come from in Xcode?

2015-05-18 Thread Ruslan Baratov via CMake
On 18-May-15 16:50, Parag Chandra wrote: In other words, these flags might very well be the same ones you’d see if you were to manually create an Xcode project via its wizards. Not exactly. Wizard add some extra attributes: Xcode 6.2 -> New project -> OSX -> Application -> Command Line Tool >

Re: [CMake] Where do all the extra clang flags come from in Xcode?

2015-05-18 Thread Ruslan Baratov via CMake
On 18-May-15 15:20, Paul Smith wrote: On Mon, 2015-05-18 at 12:32 +0200, Ruslan Baratov via CMake wrote: This table tells you what attribute you need to set to disable/enable specific warning. I see, so these are CMake attributes? That wasn't clear to me. I thought they were attributes of Xco

Re: [CMake] Where do all the extra clang flags come from in Xcode?

2015-05-18 Thread Andreas Pakulat
Hi Paul, On Mon, May 18, 2015 at 3:20 PM, Paul Smith wrote: > On Mon, 2015-05-18 at 12:32 +0200, Ruslan Baratov via CMake wrote: > > This table tells you what attribute you need to set to disable/enable > > specific warning. > > I see, so these are CMake attributes? That wasn't clear to me. I

Re: [CMake] Where do all the extra clang flags come from in Xcode?

2015-05-18 Thread Parag Chandra
This is just a guess, but I think the reason you’re seeing all these extra warnings enabled/disabled when you use Xcode is that Xcode is going to, by default, enable many of these warnings when you create a new project, and CMake isn’t doing anything special to alter those in order to match up

Re: [CMake] Where do all the extra clang flags come from in Xcode?

2015-05-18 Thread Paul Smith
On Mon, 2015-05-18 at 12:32 +0200, Ruslan Baratov via CMake wrote: > This table tells you what attribute you need to set to disable/enable > specific warning. I see, so these are CMake attributes? That wasn't clear to me. I thought they were attributes of Xcode. I guess my basic question is, wh

Re: [CMake] Export environment variables in generated Makefile

2015-05-18 Thread Brad King
On 05/17/2015 12:35 AM, Taylor Braun-Jones wrote: > CMake already has an ENVIRONMENT property for tests ... > symmetric feature would be to support an ENVIRONMENT property > for targets as well. We can provide it for tests because ctest directly runs the tests. There is no way to implement environ

[CMake] Is it possible to define a custom help message?

2015-05-18 Thread Cedric Doucet
Hello, when one types 'cmake -help', one gets a message containing a summary of all available options to the cmake command. Is it possible to customize this message, so as to print a description of all useful variables and all options defined by the option command? Thank you for your help!

Re: [CMake] What is the correct way to manage a possibly user-defined directory?

2015-05-18 Thread Cedric Doucet
Hi Petr! Thank you very much! Now, I understand when an option should be used! :) I tried set(FOO_DIR "" CACHE PATH "Provide path to FOO library here") and it works fine with the user interface! Cheers, Cédric - Mail original - > De: "Petr Kmoch" > À: "Cedric Doucet" > Cc: c

Re: [CMake] Where do all the extra clang flags come from in Xcode?

2015-05-18 Thread Ruslan Baratov via CMake
On 18-May-15 06:50, Paul Smith wrote: On Sun, 2015-05-17 at 14:43 +0200, Ruslan Baratov via CMake wrote: As far as I know extra flags set by Xcode itself. You can use XCODE_ATTRIBUTE_* target properties to enable/disable warnings. This table can be helpful: https://github.com/ruslo/leathers/wiki

Re: [CMake] What is the correct way to manage a possibly user-defined directory?

2015-05-18 Thread Cedric Doucet
Ok, I found the error: IF(NOT EXISTS FOO_DIR) should be replaced by IF(NOT EXISTS ${FOO_DIR}) However, it seems I don't need to define an option. I just have to type cmake -D FOO_DIR=path .. Should I define an option? When does one need to define an option? Cédric - Mail original

Re: [CMake] What is the correct way to manage a possibly user-defined directory?

2015-05-18 Thread Petr Kmoch
Hi Cedric. if(EXISTS) does not automatically dereference its argument. So your current code is testing for the existence of a directory literally named "FOO_DIR". You want to dereference the variable: if(NOT EXISTS ${FOO_DIR}) Second, option() is intended for on/off options only (a checkbox)

[CMake] What is the correct way to manage a possibly user-defined directory?

2015-05-18 Thread Cedric Doucet
Hello, I would like to let users choose between providing third party libraries or let CMake download them. To do that, I try to write a simple code like this to manage a third party library FOO of an executable MY_EXEC: = IF(NOT EXISTS FOO_DI