Re: [CMake] How to write a correct wrapper of MESSAGE()?

2013-10-16 Thread Clark WANG
On Tue, Oct 15, 2013 at 8:12 PM, Johannes Zarl wrote: > On Monday, 14. October 2013, 19:07:06, Matthew Woehlke wrote: > > > The "IN LISTS" signature of foreach seems to do additional list > > > splitting, leading to ("foo;bar" "baz") appearing as 3 elements. > > > Accessing the ARGV array by the

Re: [CMake] Faking a library

2013-10-16 Thread Alexander Neundorf
On Wednesday 16 October 2013, Magnus Therning wrote: > When defining a library via add_library() it's possible to link > against it by just putting its name into target_link_libraries(). Is > there some way of wrapping up an external library in a similar way? > > As a concrete example I'm playing

Re: [CMake] Faking a library

2013-10-16 Thread Robert Maynard
You can create imported libraries with the add_library command using the IMPORTED option. I have very quick example at: https://github.com/robertmaynard/Sandbox/blob/master/ImportedLibrary/CMakeLists.txt On Wed, Oct 16, 2013 at 5:00 PM, Magnus Therning wrote: > When defining a library via add_li

[CMake] Faking a library

2013-10-16 Thread Magnus Therning
When defining a library via add_library() it's possible to link against it by just putting its name into target_link_libraries(). Is there some way of wrapping up an external library in a similar way? As a concrete example I'm playing around with gtest[1] via externalproject_add() like this:

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread Robert Maynard
Can you try something like this? https://github.com/robertmaynard/Sandbox/blob/master/ImportedLibrary/CMakeLists.txt I don't see the second shared library linking to the imported static library. On Wed, Oct 16, 2013 at 3:44 PM, James Bigler wrote: > On Wed, Oct 16, 2013 at 1:34 PM, Giordano Kh

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread James Bigler
On Wed, Oct 16, 2013 at 1:34 PM, Giordano Khouri wrote: > The static libraries must be compiled with -fvisibility=hidden. Symbols > with default visibility are marked as “public” and will leak from a shared > library. With hidden visibility, they symbols are marked as “private > extern”, allowing

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread Giordano Khouri
The static libraries must be compiled with -fvisibility=hidden. Symbols with default visibility are marked as "public" and will leak from a shared library. With hidden visibility, they symbols are marked as "private extern", allowing you to link with them, but not allowing them to leak from a sh

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread James Bigler
This seems to do what I want. Is there a version of this that works for IMPORTED targets. There's *IMPORTED_LINK_INTERFACE_LIBRARIES*, but I'm not sure how to make them private for static libraries. Thanks, James On Wed, Oct 16, 2013 at 12:17 PM, Robert Maynard wrote: > Have you tried using

Re: [CMake] 2.8.11: CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX Value Changed

2013-10-16 Thread Brad King
On 10/16/2013 12:56 PM, Giordano Khouri wrote: > Looking at the source code, a check is first made for __clang__ > and sets CMAKE__COMPILER_ID to “Clang”. Yes. > If you are using CMake 2.8.12, you can even get “AppleClang” > to further differentiate it. AppleClang was introduced just after 2.8.1

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread Robert Maynard
Have you tried using the LINK_PRIVATE signature to target link libraries? On Wed, Oct 16, 2013 at 2:05 PM, James Bigler wrote: > Is it possible to stop known static libraries from being carried through > shared libraries? > > add_library(mystatic1 STATIC ...) > add_library(mystatic2 STATIC ...) >

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread Matthew Woehlke
On 2013-10-16 14:05, James Bigler wrote: Is it possible to stop known static libraries from being carried through shared libraries? Did you try using 'LINK_PRIVATE' in your target_link_libraries? -- Matthew -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ

[CMake] Transitive linking and static libraries

2013-10-16 Thread James Bigler
Is it possible to stop known static libraries from being carried through shared libraries? add_library(mystatic1 STATIC ...) add_library(mystatic2 STATIC ...) add_library(myshared SHARED ...) target_link_libraries(myshared mystatic1 mystatic2) add_executable(myexe) target_link_libraries(myexe mysh

Re: [CMake] How to test for the usability of a target

2013-10-16 Thread Alexander Neundorf
On Tuesday 15 October 2013, Johannes Zarl wrote: > Hi, > > I'd like to make some code in my build system dependent on the existance of > a target. Basically I'd like to write something like this: > > if(TARGET optional_lib) > add_library(bar ${bar_srcs}) > target_link_library(bar optional_lib

Re: [CMake] 2.8.11: CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX Value Changed

2013-10-16 Thread Giordano Khouri
Looking at the source code, a check is first made for __clang__ and sets CMAKE__COMPILER_ID to "Clang". If you are using CMake 2.8.12, you can even get "AppleClang" to further differentiate it. Since you are using clang, this is correct. This is the variable you should be looking at. Since so ma

Re: [CMake] Allow CPack generated WiX installer to set registry key values

2013-10-16 Thread Nils Gladitz
I think the documentation for CPACK_PACKAGE_INSTALL_REGISTRY_KEY predates the WIX generator and therefor might be misleading. Currently the WIX generator itself does not use it. You may be able to create a custom WiX template for this though. This would require some familiarity with WiX itself.

[CMake] RTTI enabled or disabled ?

2013-10-16 Thread Sajjadul Islam
Hi forum, I compiled OpenSceneGraph using CMake with debug mode. and I installed another plugin osgCompute with the same configuration. But i m having the following linking error : /// Linking CXX executable ../.

[CMake] Allow CPack generated WiX installer to set registry key values

2013-10-16 Thread Evan Zhang
Hi, Is there a way to set registry key values after defining the install registry key using "SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Example Registry Key")"? I would like to create an installer that actually populates REG_SZ string values under the key. I am assuming the above value for "CPAC

Re: [CMake] How to test for the usability of a target

2013-10-16 Thread Johannes Zarl
On Wednesday, 16. October 2013, 01:22:09, Matthew Woehlke wrote: > If you *REALLY* need to know about all your targets before you decide on > linking, then you're going to have to implement multi-pass project > parsing. This is possible - see e.g. VTK - but makes the configuration > process much mo