Re: [CMake] Append to property COMPILE_DEFINITIONS

2017-07-17 Thread Florian Lindner
Am 18.07.2017 um 10:59 schrieb Craig Scott: > You appear to be setting a GLOBAL property where you probably meant > DIRECTORY. You could also consider setting the > target property instead rather than applying it to all targets (unless that's > what you want). I tried to set the property on all

Re: [CMake] Append to property COMPILE_DEFINITIONS

2017-07-17 Thread Craig Scott
You appear to be setting a GLOBAL property where you probably meant DIRECTORY. You could also consider setting the target property instead rather than applying it to all targets (unless that's what you want). On Tue, Jul 18, 2017 at 12:56 PM, Florian Lindner wrote: > Hello, > > I want to add co

[CMake] Append to property COMPILE_DEFINITIONS

2017-07-17 Thread Florian Lindner
Hello, I want to add compile definitions. Since I want to use generator expressions, I can't use add_definitions, but have to use the COMPILE_DEFINITIONS property, but neither: set_property(GLOBAL APPEND PROPERTY COMPILE_DEFINITIONS "-DFOO") for testing or set_property(GLOBAL APPEND PROPE

[CMake] ExternalProject + PREFIX + CPACK - cannot get the good path

2017-07-17 Thread Alfred Sawaya
Hello folks, I am trying to create a package with CPack from an External Project using the autotools. The make install part try to copy files to /usr/local/lib, but I do not want to package as root, so it fails. The cpack works because (I think) it create a temp dir and set it as environment varia

Re: [CMake] Built-in way to detect if a root script is standalone or not?

2017-07-17 Thread Robert Maynard
That is about the easiest way to check if you are standalone. On Mon, Jul 17, 2017 at 10:58 AM, Robert Dailey wrote: > I have logic similar to this in some of my middleware libraries' root > CMakeLists.txt: > > if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) > set( STANDALONE TRUE )

Re: [CMake] How to get list of generated object-files of OBJECT-library?

2017-07-17 Thread Deniz Bahadir
Am 17.07.2017 um 17:15 schrieb Nils Gladitz: On 17.07.2017 17:13, Deniz Bahadir wrote: Am 17.07.2017 um 16:47 schrieb Nils Gladitz: On 7/17/2017 3:52 PM, Deniz Bahadir wrote: This works just fine. However, now I want to add an additional build-step after creation of the object-files and befo

[CMake] problem linking a library and addressing cross dependency

2017-07-17 Thread Zahid Iqbal
Hi, I have started using *cmake* recently. I have the following question: For building my system, I am working with two directories. Let's call them *my_application_directory* and *protocol_source_directory. * The code relating to my application resides under *my_application_directory*. In fact

Re: [CMake] OBJECT libraries and working around lake of target_link_libraries

2017-07-17 Thread Chuck Atkins
Hi David, > Supporting OBJECT libraries in > target_link_libraries calls was mentioned mentioned right back here > https://cmake.org/pipermail/cmake-developers/2012-March/015422.html but > sadly seems still to be on the back burner. > It's not on the back burner! There has been progress on desi

[CMake] Transitive behavior of target_link_libraries between shared/static

2017-07-17 Thread Robert Dailey
Suppose I have the following: ``` add_library( A STATIC ${files} ) add_library( B SHARED ${more_files} ) target_link_libraries( B PUBLIC A ) add_library( C STATIC ${even_more_files} ) target_link_libraries( C PUBLIC B ) add_executable( D ${exe_files} ) target_link_libraries( D PRIVATE C ) ```

Re: [CMake] How to get list of generated object-files of OBJECT-library?

2017-07-17 Thread Nils Gladitz
On 17.07.2017 17:13, Deniz Bahadir wrote: Am 17.07.2017 um 16:47 schrieb Nils Gladitz: On 7/17/2017 3:52 PM, Deniz Bahadir wrote: This works just fine. However, now I want to add an additional build-step after creation of the object-files and before linking the shared library. (In particular

Re: [CMake] How to get list of generated object-files of OBJECT-library?

2017-07-17 Thread Deniz Bahadir
Am 17.07.2017 um 16:47 schrieb Nils Gladitz: On 7/17/2017 3:52 PM, Deniz Bahadir wrote: This works just fine. However, now I want to add an additional build-step after creation of the object-files and before linking the shared library. (In particular, I want to compress the debug-symbols in

[CMake] Built-in way to detect if a root script is standalone or not?

2017-07-17 Thread Robert Dailey
I have logic similar to this in some of my middleware libraries' root CMakeLists.txt: if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) set( STANDALONE TRUE ) endif() Is there a built-in way to detect this? -- Powered by www.kitware.com Please keep messages on-topic and check the CM

Re: [CMake] How to get list of generated object-files of OBJECT-library?

2017-07-17 Thread Nils Gladitz
On 7/17/2017 3:52 PM, Deniz Bahadir wrote: This works just fine. However, now I want to add an additional build-step after creation of the object-files and before linking the shared library. (In particular, I want to compress the debug-symbols in the object-files. But that should be irrelevan

[CMake] How to get list of generated object-files of OBJECT-library?

2017-07-17 Thread Deniz Bahadir
Hi list, I have a question regarding "add_custom_command" and OBJECT-libraries: My CMakeLists.txt contains the following (simplified) targets: ``` set ( SOURCE_FILES # ... several C++-source files ) add_library( OBJECT ${PROJECT_NAME}_OBJECTS ${SOURCE_FILES} ) add_library( ${PROJECT_NA

Re: [CMake] DLL handling under CMake

2017-07-17 Thread Louis-Paul CORDIER
Hi, I bump this question again for DLL library handling. Still I have the issue with my dependency "scanner" in my previous email that can't evaluate if a target with a generator expression is a valid one or not. if(NOT TARGET "$<$:Foo_lib>") # will never go into this statement endif() Tha