[CMake] Shared, static and header-only versions of library side by side.

2019-07-03 Thread Dmitry Igrishin
Hello, The libraries I developing can be used as a shared libraries, static libraries or header-only libraries. I want to let the users to: - install all three variants side by side; - choice what variant of library to use for linkage. I see 2 options here: 1. use different config files. For

[CMake] CMake APT Repository Signing Key

2019-07-03 Thread Kyle Edwards
All, The new 2020 signing key for the APT repository (https://apt.kitware.com/) has been generated for 2020, with fingerprint A8E5EF3A02600268. The 2019 key, with fingerprint C1F34CDD40CD72DA, will remain in effect until the beginning of 2020, at which point the 2020 key will go into effect. The  

Re: [CMake] getting compiler's include paths

2019-07-03 Thread Robert Maynard
I completely forgot that the Makefiles based generators in CMake have a separate heuristic for determining system headers. If you use the Ninja generator I see the expected behavior: ~/W/t/nbuild $ sudo touch /usr/include/c++/7/array ~/W/t/nbuild $ ninja -d explain -v ninja explain: output test/CM

Re: [CMake] compiling .cpp/.cxx with CUDA compiler

2019-07-03 Thread Kai Germaschewski
Thank. Yeah, I've seen BLT through it's use in RAJA. You're right, it'd work, but I'm reluctant to stray away from "vanilla" cmake too much, since other people will have to deal with this code, and cmake itself is already quite a step up from the regular Makefiles that they're used to. --Kai On

Re: [CMake] Combining two static libraries into one

2019-07-03 Thread Kyle Edwards
On Wed, 2019-07-03 at 18:55 +0530, vinay kumar Kotegowder wrote: >  I want to build lib2 static library with pre-built lib1 static > library. >  Does this work? > >  add_library(lib1 STATIC lib1.c) >  add_library(lib2 STATIC lib2.c) >  target_link_libraries(lib2 INTERFACE lib1) Yes, this will wor

Re: [CMake] Combining two static libraries into one

2019-07-03 Thread vinay kumar Kotegowder
I want to build lib2 static library with pre-built lib1 static library. Does this work? add_library(lib1 STATIC lib1.c) add_library(lib2 STATIC lib2.c) target_link_libraries(lib2 INTERFACE lib1) Also, Kyle said linking against lib2 will link against both lib1 and lib2. Is there a static way

Re: [CMake] Combining two static libraries into one

2019-07-03 Thread vinay kumar Kotegowder
I want to build lib2 static array with pre-built lib1 static array. Does this work? add_library(lib1 STATIC lib1.c) add_library(lib2 STATIC lib2.c) target_link_libraries(lib2 INTERFACE lib1) Also, Kyle said linking against lib2 will link against both lib1 and lib2. Is there a static way of

Re: [CMake] Combining two static libraries into one

2019-07-03 Thread Rainer Poisel
I think there is no platform-independent way to solve this. Maybe you could create two OBJECT libraries that are "linked" together into one static lib. Best regards, Rainer On Tue, Jul 2, 2019 at 5:30 PM Cristian Adam wrote: > > > On Tue, Jul 2, 2019 at 5:14 PM vinay kumar Kotegowder > wrote

Re: [CMake] Moving build artifacts to custom directory

2019-07-03 Thread Marc CHEVRIER
Have a look at variables ‘CMAKE_*_OUTPUT_DIRECTORY’ (Like CMAKE_ARCHIVE_OUTPUT_DIRECTORY. See  https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html) and target properties ‘*_OUTPUT_DIRECTORY’ (Like ARCHIVE_OUTPUT_DIRECTORY. See  https://cmake.org/cmake/help/latest/manual/cmake-proper