[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_DIR) 
MESSAGE(STATUS "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED") 
# download and install FOO, define FOO_DIR 
ENDIF() 
INCLUDE_DIRECTORIES(MY_EXEC ${FOO_DIR}/include) 
TARGET_LINK_LIBRARIES(MY_EXEC ${FOO_DIR}/include) 
= 
To do that, I think the user should have the possibility to define FOO_DIR with 
an option. 
So, I put the line 
OPTION(FOO_DIR) 
before the code below. 

However, it doesn't seem to work because FOO_DIR does not seem to be defined. 
The message "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED" always appears, 
- even if I type "cmake -D FOO_DIR=path", where path is a user-defined path to 
FOO library, 
- even if I put a default value to FOO_DIR with OPTION(FOO_DIR path), where 
path is a hard-coded path to FOO. 

Where does I make a mistake here? 
What is the correct way to manage FOO_DIR when it can be defined by a user? 

Note: the next step is to define FOO_DIR in a FindFoo.cmake file and use 
find_package(Foo), but it's not my goal yet. 

Thank you very much for your help! 

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

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). If you
want to provide a path selector, use set(... CACHE) instead:

set(FOO_DIR "" CACHE PATH "Provide path to FOO library here")


This will create a path selector widget in CMake UI, with "Provide path to
FOO library here" serving as its tooltip/documentation.

Petr

On Mon, May 18, 2015 at 11:48 AM, Cedric Doucet 
wrote:

>
> 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_DIR)
>   MESSAGE(STATUS "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED")
>   # download and install FOO, define FOO_DIR
> ENDIF()
> INCLUDE_DIRECTORIES(MY_EXEC ${FOO_DIR}/include)
> TARGET_LINK_LIBRARIES(MY_EXEC ${FOO_DIR}/include)
> =
> To do that, I think the user should have the possibility to define FOO_DIR
> with an option.
> So, I put the line
> OPTION(FOO_DIR)
> before the code below.
>
> However, it doesn't seem to work because FOO_DIR does not seem to be
> defined.
> The message "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED" always appears,
> - even if I type "cmake -D FOO_DIR=path", where path is a user-defined
> path to FOO library,
> - even if I put a default value to FOO_DIR with OPTION(FOO_DIR path),
> where path is a hard-coded path to FOO.
>
> Where does I make a mistake here?
> What is the correct way to manage FOO_DIR when it can be defined by a user?
>
> Note: the next step is to define FOO_DIR in a FindFoo.cmake file and use
> find_package(Foo), but it's not my goal yet.
>
> Thank you very much for your help!
>
> 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] 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 -

> De: "Cedric Doucet" 
> À: cmake@cmake.org
> Envoyé: Lundi 18 Mai 2015 11:48:52
> Objet: [CMake] What is the correct way to manage a possibly user-defined
> directory?

> 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_DIR)
> MESSAGE(STATUS "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED")
> # download and install FOO, define FOO_DIR
> ENDIF()
> INCLUDE_DIRECTORIES(MY_EXEC ${FOO_DIR}/include)
> TARGET_LINK_LIBRARIES(MY_EXEC ${FOO_DIR}/include)
> =
> To do that, I think the user should have the possibility to define FOO_DIR
> with an option.
> So, I put the line
> OPTION(FOO_DIR)
> before the code below.

> However, it doesn't seem to work because FOO_DIR does not seem to be defined.
> The message "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED" always appears,
> - even if I type "cmake -D FOO_DIR=path", where path is a user-defined path
> to FOO library,
> - even if I put a default value to FOO_DIR with OPTION(FOO_DIR path), where
> path is a hard-coded path to FOO.

> Where does I make a mistake here?
> What is the correct way to manage FOO_DIR when it can be defined by a user?

> Note: the next step is to define FOO_DIR in a FindFoo.cmake file and use
> find_package(Foo), but it's not my goal yet.

> Thank you very much for your help!

> 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] 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/List#xcodeclang-table

Thanks for your reply... but I don't quite understand what this table is
telling me.
This table tells you what attribute you need to set to disable/enable 
specific warning.

E.g.:

   | Clang   | Xcode  |

   +-++

   | enum-conversion | CLANG_WARN_ENUM_CONVERSION |


Makefile generator:

> cat CMakeLists.txt
   cmake_minimum_required(VERSION 3.0)
   project(Foo)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wenum-conversion")
   add_library(foo foo.cpp)

> cmake -H. -B_builds "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON
> cmake --build _builds
   /.../usr/bin/c++ -Wenum-conversion ...


Xcode generator (default):

> cat CMakeLists.txt
   cmake_minimum_required(VERSION 3.0)
   project(Foo)
   add_library(foo foo.cpp)

> cmake -H. -B_builds -GXcode
> cmake --build _builds
   /.../usr/bin/clang ... -Wno-enum-conversion ...

Xcode generator (enable):

> cat CMakeLists.txt
   cmake_minimum_required(VERSION 3.0)
   project(Foo)
   add_library(foo foo.cpp)

   set_target_properties(
foo
PROPERTIES
XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION YES
   )

> cmake -H. -B_builds -GXcode
> cmake --build _builds
   /.../usr/bin/clang ... -Wenum-conversion ...

Xcode generator (disable):

> cat CMakeLists.txt
   cmake_minimum_required(VERSION 3.0)
   project(Foo)
   add_library(foo foo.cpp)

   set_target_properties(
foo
PROPERTIES
XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION NO
   )

> cmake -H. -B_builds -GXcode
> cmake --build _builds
   /.../usr/bin/clang ... -Wno-enum-conversion ...



As mentioned, these builds are performed on build servers running OSX,
where basically the code is retrieved via Git, then cmake is run, then
cmake -build is run (which invokes xcodebuild via the command line), all
using SSH commands from a build control server.  At no time is Xcode
itself invoked.
I don't understand what you mean by "no time is Xcode itself invoked". 
When you set generator to "Unix Makefiles" then Makefile project generated:

> cmake -H. -B_builds "-GUnix Makefiles"
> ls _builds/Makefile
_builds/Makefile

when you set generator to "Xcode" then Xcode project used:
> cmake -H. -B_builds -GXcode
> ls _builds/Foo.xcodeproj/project.pbxproj
_builds/Foo.xcodeproj/project.pbxproj

so there is no difference between:
* open Xcode project and hit "Build"
* cmake --build _builds
* (cd _builds && xcodebuild -alltargets)


So, if the properties you describe are Xcode settings that need to be
tweaked then do you know if there is some command-line way to do it,
that I could encode into my build scripts for example?

See example above.

Also you can use some helper functions to do it in cross-platform way:

   sugar_generate_warning_flags(
target_compile_options
target_properties
ENABLE enum-conversion
   )

   set_target_properties(
foo
PROPERTIES
${target_properties}
COMPILE_OPTIONS
"${target_compile_options}"
   )

This will set MSVC flags too. See this wiki: 
https://github.com/ruslo/sugar/wiki/Cross-platform-warning-suppression


Cheers, Ruslo
-- 

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] 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: cmake@cmake.org
> Envoyé: Lundi 18 Mai 2015 12:04:21
> Objet: Re: [CMake] What is the correct way to manage a possibly user-defined
> directory?

> 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). If you
> want to provide a path selector, use set(... CACHE) instead:

> set(FOO_DIR "" CACHE PATH "Provide path to FOO library here")

> This will create a path selector widget in CMake UI, with "Provide path to
> FOO library here" serving as its tooltip/documentation.

> Petr

> On Mon, May 18, 2015 at 11:48 AM, Cedric Doucet < cedric.dou...@inria.fr >
> wrote:

> > 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_DIR)
> 
> > MESSAGE(STATUS "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED")
> 
> > # download and install FOO, define FOO_DIR
> 
> > ENDIF()
> 
> > INCLUDE_DIRECTORIES(MY_EXEC ${FOO_DIR}/include)
> 
> > TARGET_LINK_LIBRARIES(MY_EXEC ${FOO_DIR}/include)
> 
> > =
> 
> > To do that, I think the user should have the possibility to define FOO_DIR
> > with an option.
> 
> > So, I put the line
> 
> > OPTION(FOO_DIR)
> 
> > before the code below.
> 

> > However, it doesn't seem to work because FOO_DIR does not seem to be
> > defined.
> 
> > The message "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED" always appears,
> 
> > - even if I type "cmake -D FOO_DIR=path", where path is a user-defined path
> > to FOO library,
> 
> > - even if I put a default value to FOO_DIR with OPTION(FOO_DIR path), where
> > path is a hard-coded path to FOO.
> 

> > Where does I make a mistake here?
> 
> > What is the correct way to manage FOO_DIR when it can be defined by a user?
> 

> > Note: the next step is to define FOO_DIR in a FindFoo.cmake file and use
> > find_package(Foo), but it's not my goal yet.
> 

> > Thank you very much for your help!
> 

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

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

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

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 environment settings consistently
across all generators when launching compiler tools.  The VS
and Xcode IDE project files provide no way to do it in general.
Our workflow for command-line builds has always been to have the
necessary environment variables defined by the caller and not
within the scope of CMake.

-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] 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, why are all these extra flags to disable
and enable various warnings set in the Xcode generator?  I expected it
would work like the makefile generator, where if you don't set any flags
in CMakeLists.txt then you don't get any warnings enabled (or explicitly
disabled).  It surprises me that when I take the same CMakeLists.txt
file and use a Makefile generator and an Xcode generator, I get very
different compile lines.

And secondarily, is there any way to get the Xcode generator to work
like the Makefile generator, where only the warning flags I explicitly
defined in my CMakeLists.txt file are added to the compile/link lines
and no others?

-- 

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] 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 
with the Makefiles it generates. 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.

So in reference to your last question, I don’t think you’re going to be 
able to just ‘whitelist’ the flags you want enabled. You’ll also have to 
take stock of the default flags Xcode enables and ‘blacklist’ those.


Parag Chandra
Senior Software Engineer, Mobile Team
Mobile: +1.919.824.1410

  

Ionic Security Inc.
1170 Peachtree St. NE STE 400, Atlanta, GA 30309














On 5/18/15, 1: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
>thought they were attributes of Xcode.
>
>I guess my basic question is, why are all these extra flags to disable
>and enable various warnings set in the Xcode generator?  I expected it
>would work like the makefile generator, where if you don't set any flags
>in CMakeLists.txt then you don't get any warnings enabled (or explicitly
>disabled).  It surprises me that when I take the same CMakeLists.txt
>file and use a Makefile generator and an Xcode generator, I get very
>different compile lines.
>
>And secondarily, is there any way to get the Xcode generator to work
>like the Makefile generator, where only the warning flags I explicitly
>defined in my CMakeLists.txt file are added to the compile/link lines
>and no others?
>
>-- 
>
>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] 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
> thought they were attributes of Xcode.
>
> I guess my basic question is, why are all these extra flags to disable
> and enable various warnings set in the Xcode generator?  I expected it
> would work like the makefile generator, where if you don't set any flags
> in CMakeLists.txt then you don't get any warnings enabled (or explicitly
> disabled).  It surprises me that when I take the same CMakeLists.txt
> file and use a Makefile generator and an Xcode generator, I get very
> different compile lines.
>

If you look at the foo.xcodeproj contents of a very simple CMake project
(hello-world style) you'll notice just 1 file and there are not a lot of -W
words inside that file either. I see 3 warnings being added by CMake when
generating this file.

That suggests anything else is added by Xcode itself because thats what its
default settings are. Xcode (and xcodebuild) has a lot more logics builtin
that make. Make is essentially just a dependency-tracking and execution
tool and thus cannot make any assumptions about what is being executed when
a target is to be 'made'. It cannot add any compile flags that the
make-developers deem useful, since the action executed for a target may not
be a compile run at all. Xcode on the other hand with its more structured
project file has a very clear idea of what is a compile action and what is
not and apparently the Apple devs think a certain set of flags are useful
for everybody and hence are added to all compiler invocations.

You'll also notice this when creating a new project inside xcode and then
examine and run it outside, i.e. grep for -W flags in the generated files.
There are  literally none, but still xcodebuild shows tons of -W flags
added to the compiler invocation.


> And secondarily, is there any way to get the Xcode generator to work
> like the Makefile generator, where only the warning flags I explicitly
> defined in my CMakeLists.txt file are added to the compile/link lines
> and no others?
> 
>

Given the above, your only options are: propose a patch to cmake (or find
someone to do this for you) that enhances the xcode generator to disable
all flags that are not explicitly enabled so its closer to the makefile
generator. This is however quite a lot of effort upfront and in maintenance
since each new xcode version (even just bugfix versions) may need changes
to the list.

The alternative to that is that you blacklist via the mentioned attributes
the warnings you don't want to have enabled, each and every one of them
individually.

Andreas
-- 

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] 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 Xcode.
Please take a look at examples I've sent earlier. I have no idea how I 
can make it even more clearer.


I guess my basic question is, why are all these extra flags to disable
and enable various warnings set in the Xcode generator?
As far as I know this is Xcode defaults. So I guess you need to ask 
Apple's Xcode support team.

   I expected it
would work like the makefile generator, where if you don't set any flags
in CMakeLists.txt then you don't get any warnings enabled (or explicitly
disabled).  It surprises me that when I take the same CMakeLists.txt
file and use a Makefile generator and an Xcode generator, I get very
different compile lines.
I guess you can open a bug with feature request. Note that only it's not 
enough to just set all this attributes to YES, but also you need to read 
compiler flags (+ build types) and change attributes accordingly.
E.g. -Wno-enum-conversion in CMAKE_CXX_FLAGS automatically must add 
property `XCODE_ATTRIBUTE_CLANG_WANR_ENUM_CONVERSION NO` to all targets.


And secondarily, is there any way to get the Xcode generator to work
like the Makefile generator, where only the warning flags I explicitly
defined in my CMakeLists.txt file are added to the compile/link lines
and no others?

Again. Take a look at examples I've sent earlier. The helper function 
works exactly like you want. This is the only way known to me to achieve 
this nicely.


Cheer, Ruslo
--

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

> grep -i warn project.pbxproj
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;

However CMake use others:
> cmake -H. -B_builds -GXcode
> grep -i warn project.pbxproj
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );
WARNING_CFLAGS = ("-Wmost", 
"-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", );


In CMake case Xcode set missing attributes to default values, some of 
them set to YES, some of them set to NO

--

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] 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_TO_DOWNLOAD}) 
string(TOLOWER ${LIBRARY} LIBRARY_NAME) 
ExternalProject_Add(${LIBRARY_NAME} 
PREFIX ${LIBRARY_PREFIX} 
DOWNLOAD_DIR ${${LIBRARY}_DOWNLOAD_DIR} 
SOURCE_DIR ${${LIBRARY}_SOURCE_DIR} 
BINARY_DIR ${${LIBRARY}_BINARY_DIR} 
STAMP_DIR ${${LIBRARY}_STAMP_DIR} 
INSTALL_DIR ${${LIBRARY}_INSTALL_DIR} 
URL ${${LIBRARY}_URL} 
URL_MD5 ${${LIBRARY}_URL_MD5} 
CMAKE_ARGS ${${LIBRARY}_ARGS} 
LOG_DOWNLOAD 1 
LOG_UPDATE 1 
LOG_CONFIGURE 1 
LOG_BUILD 1 
LOG_TEST 1 
LOG_INSTALL 1 
) 
endforeach(LIBRARY) 
=== 

However, I get the following error message: 

=
 
CMake Error at CMakeLists.txt:45 (foreach): 
Unknown argument: 
EIGEN 

CMake Error at CMakeLists.txt:46 (string): 
string no output variable specified 

CMake Error at 
/usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:1850
 (message): 
error: no download info for 'PREFIX' -- please specify existing/non-empty 
SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, 
GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND 
Call Stack (most recent call first): 
/usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:2321
 (_ep_add_download_command) 
CMakeLists.txt:47 (ExternalProject_Add) 

CMake Error at CMakeLists.txt:64 (endforeach): 
endforeach An ENDFOREACH command was found outside of a proper FOREACH 
ENDFOREACH structure. Or its arguments did not match the opening FOREACH 
command. 
=
 

Do you know where the problem come from? 

Cheers, 

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

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 LIBRARIES_TO_DOWNLOAD)

or this:

foreach(LIBRARY ${LIBRARIES_TO_DOWNLOAD})

I always prefer the former, because the latter will fail if the first item
in the list happens to be "IN".

Petr

On Mon, May 18, 2015 at 6:05 PM, Cedric Doucet 
wrote:

>
> 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_TO_DOWNLOAD})
> string(TOLOWER ${LIBRARY} LIBRARY_NAME)
> ExternalProject_Add(${LIBRARY_NAME}
> PREFIX ${LIBRARY_PREFIX}
> DOWNLOAD_DIR ${${LIBRARY}_DOWNLOAD_DIR}
> SOURCE_DIR ${${LIBRARY}_SOURCE_DIR}
> BINARY_DIR ${${LIBRARY}_BINARY_DIR}
> STAMP_DIR  ${${LIBRARY}_STAMP_DIR}
> INSTALL_DIR ${${LIBRARY}_INSTALL_DIR}
> URL ${${LIBRARY}_URL}
> URL_MD5 ${${LIBRARY}_URL_MD5}
> CMAKE_ARGS ${${LIBRARY}_ARGS}
> LOG_DOWNLOAD 1
> LOG_UPDATE 1
> LOG_CONFIGURE 1
> LOG_BUILD 1
> LOG_TEST 1
> LOG_INSTALL 1
>)
> endforeach(LIBRARY)
> ===
>
> However, I get the following error message:
>
>
> =
> CMake Error at CMakeLists.txt:45 (foreach):
>   Unknown argument:
> EIGEN
>
> CMake Error at CMakeLists.txt:46 (string):
>   string no output variable specified
>
> CMake Error at
> /usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:1850
> (message):
>   error: no download info for 'PREFIX' -- please specify existing/non-empty
>   SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY,
>   GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND
> Call Stack (most recent call first):
>
> /usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:2321
> (_ep_add_download_command)
>   CMakeLists.txt:47 (ExternalProject_Add)
>
> CMake Error at CMakeLists.txt:64 (endforeach):
>   endforeach An ENDFOREACH command was found outside of a proper FOREACH
>   ENDFOREACH structure.  Or its arguments did not match the opening FOREACH
>   command.
>
> =
>
> Do you know where the problem come from?
>
> Cheers,
>
> 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] 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 course, after some tests, your solution works fine! :) 

Cédric 

- Mail original -

> De: "Petr Kmoch" 
> À: "Cedric Doucet" 
> Cc: cmake@cmake.org
> Envoyé: Lundi 18 Mai 2015 18:16:16
> Objet: Re: [CMake] Unknown argument in FOREACH

> 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 LIBRARIES_TO_DOWNLOAD)

> or this:

> foreach(LIBRARY ${LIBRARIES_TO_DOWNLOAD})

> I always prefer the former, because the latter will fail if the first item in
> the list happens to be "IN".

> Petr

> On Mon, May 18, 2015 at 6:05 PM, Cedric Doucet < cedric.dou...@inria.fr >
> wrote:

> > 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_TO_DOWNLOAD})
> 
> > string(TOLOWER ${LIBRARY} LIBRARY_NAME)
> 
> > ExternalProject_Add(${LIBRARY_NAME}
> 
> > PREFIX ${LIBRARY_PREFIX}
> 
> > DOWNLOAD_DIR ${${LIBRARY}_DOWNLOAD_DIR}
> 
> > SOURCE_DIR ${${LIBRARY}_SOURCE_DIR}
> 
> > BINARY_DIR ${${LIBRARY}_BINARY_DIR}
> 
> > STAMP_DIR ${${LIBRARY}_STAMP_DIR}
> 
> > INSTALL_DIR ${${LIBRARY}_INSTALL_DIR}
> 
> > URL ${${LIBRARY}_URL}
> 
> > URL_MD5 ${${LIBRARY}_URL_MD5}
> 
> > CMAKE_ARGS ${${LIBRARY}_ARGS}
> 
> > LOG_DOWNLOAD 1
> 
> > LOG_UPDATE 1
> 
> > LOG_CONFIGURE 1
> 
> > LOG_BUILD 1
> 
> > LOG_TEST 1
> 
> > LOG_INSTALL 1
> 
> > )
> 
> > endforeach(LIBRARY)
> 
> > ===
> 

> > However, I get the following error message:
> 

> > =
> 
> > CMake Error at CMakeLists.txt:45 (foreach):
> 
> > Unknown argument:
> 
> > EIGEN
> 

> > CMake Error at CMakeLists.txt:46 (string):
> 
> > string no output variable specified
> 

> > CMake Error at
> > /usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:1850
> > (message):
> 
> > error: no download info for 'PREFIX' -- please specify existing/non-empty
> 
> > SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY,
> 
> > GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND
> 
> > Call Stack (most recent call first):
> 
> > /usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:2321
> > (_ep_add_download_command)
> 
> > CMakeLists.txt:47 (ExternalProject_Add)
> 

> > CMake Error at CMakeLists.txt:64 (endforeach):
> 
> > endforeach An ENDFOREACH command was found outside of a proper FOREACH
> 
> > ENDFOREACH structure. Or its arguments did not match the opening FOREACH
> 
> > command.
> 
> > =
> 

> > Do you know where the problem come from?
> 

> > Cheers,
> 

> > 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] 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 
Source/CMakeFiles/ccmake.dir/CursesDialog/ccmake.cxx.o
Linking CXX executable ../bin/ccmake
Undefined  first referenced
 symbolin file
wattr_on   CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.cxx.o
wattr_off  CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.cxx.o
ld: fatal: symbol referencing errors. No output written to ../bin/ccmake
...


This bug is still not fixed in the contemporary cmake-3.2.2. Explanation:

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 workaround, you could uninstall either Unix `curses' or GNU `ncurses' 
development package.

Konstantin Andreev
Software Engineer
Swemel JSC
--

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] 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 workaround, you could uninstall either Unix `curses' or GNU `ncurses' 
development package.


Where is the ncurses library?

From your cache it seems that it can not find the ncurses library:

CURSES_LIBRARY:FILEPATH=/usr/lib/libcurses.so
CURSES_NCURSES_LIBRARY:FILEPATH=CURSES_NCURSES_LIBRARY-NOTFOUND

-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] 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 ctest directly runs the tests.
> There is no way to implement environment settings consistently
> across all generators when launching compiler tools.  The VS
> and Xcode IDE project files provide no way to do it in general.
> Our workflow for command-line builds has always been to have the
> necessary environment variables defined by the caller and not
> within the scope of CMake.
>

Okay, I had a hunch this might be the case. Thanks for clarifying.

Taylor
-- 

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