Re: [CMake] Good practice: using INTERFACE-libraries in FindABC.cmake?

2016-02-29 Thread Stephen Kelly
Patrick Boettcher wrote: > I came across the INTERFACE-type of libraries when writing a > FindModule.cmake-file for custom libraries installed by my > project. You don't provide FindModules for your CMake-built libraries. See https://cmake.org/cmake/help/v3.4/manual/cmake-packages.7.html Tha

[CMake] COMPILER_LOADED vs ENABLED_LANGUAGES

2016-02-29 Thread 🐋 Jan Hegewald
Hi all, I stumbled upon a problem where a find module did tests via "check_function_exists". It first checks if C is enabled via the ENABLED_LANGUAGES. Now this does not seem to be reliable, as the project language is not C, but C is enables by a project included via add_subdirectory. Now ENABLE

Re: [CMake] Good practice: using INTERFACE-libraries in FindABC.cmake?

2016-02-29 Thread Nils Gladitz
On 02/29/2016 04:06 PM, Clément Gregoire wrote: Speaking of imported targets, I'm wondering why alias imported targets aren't added to all default FindXXX.cmake scripts. This would help provide better examples, and have the community use better cmakelists.txt and hopefully reduce the bad usag

Re: [CMake] Good practice: using INTERFACE-libraries in FindABC.cmake?

2016-02-29 Thread Clément Gregoire
Speaking of imported targets, I'm wondering why alias imported targets aren't added to all default FindXXX.cmake scripts. This would help provide better examples, and have the community use better cmakelists.txt and hopefully reduce the bad usages of include_directories and such Le lun. 29 févr. 2

Re: [CMake] Good practice: using INTERFACE-libraries in FindABC.cmake?

2016-02-29 Thread Nils Gladitz
On 02/29/2016 03:34 PM, Patrick Boettcher wrote: Hi list, I came across the INTERFACE-type of libraries when writing a FindModule.cmake-file for custom libraries installed by my project. Here is what I'm doing after having found the libraries and the determined the paths: LIB1 is the library an

Re: [CMake] empty list evaluates to false?

2016-02-29 Thread Stuermer, Michael SP/HZA-ZSEP
You can check for existence of a variable and you can invert the result of the evaluation: if(DEFINED ) # called if variable exists, never mind if it's empty or not endif() if(NOT DEFINED ) # called if variable is not defined endif() if(NOT ) # called if variable is empt

[CMake] Good practice: using INTERFACE-libraries in FindABC.cmake?

2016-02-29 Thread Patrick Boettcher
Hi list, I came across the INTERFACE-type of libraries when writing a FindModule.cmake-file for custom libraries installed by my project. Here is what I'm doing after having found the libraries and the determined the paths: LIB1 is the library and LIB1_INCLUDE_DIRS its include-dirs: add_librar

Re: [CMake] empty list evaluates to false?

2016-02-29 Thread 🐋 Jan Hegewald
Hi Petr, > On 29.02.2016, at 15:27, Petr Kmoch wrote: > > Hi Jan. > > No, that's not possible. Internally, CMake does not differentiate between > "list" and "string" in any way. OK, thanks for the clarification. Best, Jan -- Powered by www.kitware.com Please keep messages on-topic and che

Re: [CMake] empty list evaluates to false?

2016-02-29 Thread Petr Kmoch
Hi Jan. No, that's not possible. Internally, CMake does not differentiate between "list" and "string" in any way. An empty list and an empty string are indistinguishable. A non-empty string containing N semi-colons is indistinguishable from a list containing N+1 elements. Quantum mechanics has wa

[CMake] empty list evaluates to false?

2016-02-29 Thread 🐋 Jan Hegewald
Hi cmakers, can I create an empty list which evaluates to true? The way I tried they evaluate to false: set(BLAS_LIBRARIES "") # trying to create an empty list if(BLAS_LIBRARIES) # not called endif() Cheers, Jan -- Powered by www.kitware.com Please keep messages on-topic and check the