Re: [CMake] How to run the install step of an ExternalProject when installing the whole project?

2019-03-08 Thread Patrick Boettcher
On Fri, 8 Mar 2019 15:45:50 +0100 Patrick Boettcher wrote: > Hi list, > > I have several externalprojects in my build. Some of them have a quite > complete install-step which I would like to have running when the > parent-build is installed (and not during the compile build

[CMake] How to run the install step of an ExternalProject when installing the whole project?

2019-03-08 Thread Patrick Boettcher
Hi list, I have several externalprojects in my build. Some of them have a quite complete install-step which I would like to have running when the parent-build is installed (and not during the compile build of the parent). How can I achieve that? (It is related to the usage of the DESTDIR-variabl

Re: [CMake] .def files since CMake 3.10 in Linux

2018-07-11 Thread Patrick Boettcher
On Mon, 2 Jul 2018 12:08:16 +0200 Patrick Boettcher wrote: > Hi, > > I (and someone else) stumbled upon a problem when using the Azure > IOTHUB SDK for C on a Linux platform using cmake 3.10+: > > https://github.com/Azure/azure-iot-sdk-c/issues/505 > > The problem

[CMake] .def files since CMake 3.10 in Linux

2018-07-02 Thread Patrick Boettcher
Hi, I (and someone else) stumbled upon a problem when using the Azure IOTHUB SDK for C on a Linux platform using cmake 3.10+: https://github.com/Azure/azure-iot-sdk-c/issues/505 The problem seems to be triggered by having two .def-files as add_library()-source-files. During the build cmake gene

Re: [CMake] Force target to always run last?

2017-05-18 Thread Patrick Boettcher
Now that you described in more detail what you're trying to do I realized that I had a similar problem to solve. It's about generating packages for an arm-based linux-build (Yocto-based). I decided against integrating my build into the Yocto-build and instead I'm using cmake to cross-compile the e

Re: [CMake] Force target to always run last?

2017-05-18 Thread Patrick Boettcher
On Wed, 17 May 2017 10:36:59 -0500 Robert Dailey wrote: > I have a custom target that must meet the following requirements: > > * It must always run, regardless of what subset of other targets are > being built > * It must always be the very last thing run. In parallelized builds, > it must wait

Re: [CMake] Link order and interface multiplicity

2017-05-17 Thread Patrick Boettcher
On Wed, 17 May 2017 21:15:39 + Etan Kissling wrote: > Not sure if I understand that correctly, but isn't that essential the > same as creating a FooA and BarA that link to IA, and a FooB and BarB > that link to IB, and linking ExeA to FooA and ExeB to FooB? > > Problem with this approach is

Re: [CMake] RPATH for external library

2017-05-17 Thread Patrick Boettcher
On Wed, 17 May 2017 17:13:13 -0700 Pawel Veselov wrote: > On Wed, May 17, 2017 at 2:55 AM, Patrick Boettcher > > My reason of preferring pkg-config is > because it may have all > >> other kind of stuff in it that the maintainer thought is necessary. > >> I

Re: [CMake] RPATH for external library

2017-05-17 Thread Patrick Boettcher
On Tue, 16 May 2017 12:32:11 -0700 Pawel Veselov wrote: > > I was once in a situation where I could have used pkg-config with a > > custom path to have pkg-config look for the .pc-file. I then > > switched to find_library with the custom-path slightly adapted and > > it worked at least as good as

Re: [CMake] RPATH for external library

2017-05-16 Thread Patrick Boettcher
On Tue, 16 May 2017 11:50:47 -0700 Pawel Veselov wrote: > >> I'm trying to make CMake add to the linker RPATH automatically. > >> There is a library that is installed in a non-default location. > >> I'm discovering the library using PkgConfig (custom > >> CMAKE_APPBUNDLE_PATH) and add the library

Re: [CMake] Link order and interface multiplicity

2017-05-16 Thread Patrick Boettcher
Hi, On Mon, 15 May 2017 12:30:10 + Etan Kissling wrote: > I have a project with a layer consisting of interface libraries: > add_library(I INTERFACE) > > These interface libraries are then implemented several times, to fit > the different environments of applications: add_library(IA ST

Re: [CMake] RPATH for external library

2017-05-16 Thread Patrick Boettcher
On Mon, 15 May 2017 13:32:15 -0700 Pawel Veselov wrote: > Hello. > > I'm trying to make CMake add to the linker RPATH automatically. > There is a library that is installed in a non-default location. > I'm discovering the library using PkgConfig (custom > CMAKE_APPBUNDLE_PATH) and add the library

Re: [CMake] CLANG vs GCC when linking executables

2017-05-12 Thread Patrick Boettcher
On Fri, 12 May 2017 17:30:16 +0200 Patrick Boettcher wrote: > The problem only occurs when the compiler is coming from a custom > build from a custom path. Running > > CXX=clang++ cmake > > makes cmake generate the correct link options. > > CXX=/local/path/bin/c

Re: [CMake] CLANG vs GCC when linking executables

2017-05-12 Thread Patrick Boettcher
On Fri, 12 May 2017 16:57:25 +0200 Patrick Boettcher wrote: > Hi list, > > I'm trying to link an executable with a locally build and imported > dynamic library. The link-code generated by CMake differs when > using GCC and Clang in regards to the rpath-options: > >

[CMake] CLANG vs GCC when linking executables

2017-05-12 Thread Patrick Boettcher
Hi list, I'm trying to link an executable with a locally build and imported dynamic library. The link-code generated by CMake differs when using GCC and Clang in regards to the rpath-options: This is my cmake-code for importing the library (this code is actually generated by using export() )

Re: [CMake] Is it possible to run ctest outside build tree?

2017-04-04 Thread Patrick Boettcher
Hi, Answering a little bit late: I had a similar problem I wanted to run only parts of my tests (-R) dedicated test-reports. As cmake is using absolute paths to the executable the only thing I needed to copy were the CTestFiles in all sub-directories. # copy all ctest-files to the current dir

[CMake] Policy to forbid linking with non-cmake-targets

2016-12-12 Thread Patrick Boettcher
Hi list, is there a policy which can be enabled to forbid calling target_link_libraries(foo bar) where bar is _not_ a known cmake target? Right now, if 'bar' is not a cmake-target cmake tries to link with -lbar (on linux). Can I inhibit this behavior in any way? I'd prefer cmake telling me

Re: [CMake] clang-format

2016-11-13 Thread Patrick Boettcher
Hi, On Mon, 7 Nov 2016 12:06:15 -0800 Tiago Macarios wrote: > CMake has "built-in" support for clang_tidy and include-what-you-use. > I was wondering why there is not support for clang_format. No one ever > contributed, or people think this should not be part of CMake? First thought which came t

Re: [CMake] object-libraries and compile-dependencies to other target

2016-07-21 Thread Patrick Boettcher
On Wed, 20 Jul 2016 13:49:52 -0400 Robert Maynard wrote: > Hi Patrick, > > Can you provide a simple example of what you are trying to do, and > where it is failing? - add_library(lib1 STATIC ) target_include_directories(lib1 PUBLIC lib1-dir) target_compile_features(lib1 PUBLIC cxx_nonstatic

[CMake] object-libraries and compile-dependencies to other target

2016-07-20 Thread Patrick Boettcher
Hi list, I'm using an object-library to generate a list of .o-files instead of archives which I use to link into several executable. Even though it is only an object-library it has compile-dependencies to other targets - this includes include-paths, compile-definitions and compile-features. I c

Re: [CMake] CTest - how to structure tests for different test jobs with a shared build-dir

2016-07-06 Thread Patrick Boettcher
Hi list, On Wed, 6 Jul 2016 10:19:05 +0200 Patrick Boettcher wrote: > I have several options at hand: > > - I could install the tests into the test-job-workspace (not sure if > this will really work with ctest) > - I could copy the build-dir (what about the absolute paths us

[CMake] CTest - how to structure tests for different test jobs with a shared build-dir

2016-07-06 Thread Patrick Boettcher
Hi, in my project I have several hundreds of non-regression and unit tests. Generated by cmake/make (or ninja) and run with ctest. Build jobs and test-run-jobs are separated and have their dedicated workspace available. (within jenkins) Tests are prefixed with an adjective to indicate when they

Re: [CMake] Dependency on imported target with ninja-generator

2016-06-28 Thread Patrick Boettcher
On Wed, 22 Jun 2016 19:44:14 -0500 Nicholas Braden wrote: > If Project B depends on Project A, you should probably be using the > ExternalProject module with a superproject structure that builds both > projects in the proper order. > > https://cmake.org/cmake/help/latest/module/ExternalProject.h

[CMake] Dependency on imported target with ninja-generator

2016-06-22 Thread Patrick Boettcher
Hi list, I'm finding myself in the following situation. - Project A generates libmain.a and export(TARGETS ... NAMESPACE ns) it to a file. The target is called ns::main - Project B includes this file and has some executables link with libmain.a (via target_link_libraries(exe ns::main). - Pr

Re: [CMake] CMake generator executable variable

2016-06-22 Thread Patrick Boettcher
Hi Petr, On Wed, 22 Jun 2016 16:52:17 +0200 Petr Kmoch wrote: > Hi Patrick. > > If the "subproject" is also CMake-generated, as you say, the best way > to build it would be: > > add_custom_target(build-app > COMMAND ${CMAKE_COMMAND} --build #... other options as > appropriate ) > > You

[CMake] CMake generator executable variable

2016-06-22 Thread Patrick Boettcher
Hi list, In my project some people use Ninja as a generator, some use GNU Make. In a part of my projects I have a add_custom_command() which runs, for convenience, the build of another cmake-generated project in another dir using a different set of compilers (which is the reason for not being a s

Re: [CMake] GCC: -std=g++14 vs -std=c++14

2016-06-15 Thread Patrick Boettcher
On Wed, 15 Jun 2016 10:50:13 -0400 "Elizabeth A. Fischer" wrote: > Why are these extensions not turned off by default? Normally, things > should conform to the standards out-of-the-box; and you should have to > explicitly enable extensions. Following that principle would have > avoided this ent

Re: [CMake] GCC: -std=g++14 vs -std=c++14

2016-06-14 Thread Patrick Boettcher
On Mon, 13 Jun 2016 20:05:23 +0200 Patrick Boettcher wrote: > > You also need to correctly set the CXX_EXTENSIONS properties to get > > a standard standard. > > Yep, > > set(CXX_EXTENSIONS OFF) > > seems to do the trick - thanks. Well, it is set(CMAKE

Re: [CMake] GCC: -std=g++14 vs -std=c++14

2016-06-13 Thread Patrick Boettcher
On Mon, 13 Jun 2016 18:40:59 +0200 Sylvain Joubert wrote: > Le 13/06/2016 11:36, Patrick Boettcher a écrit : > > Hi list, > > > > I'm using gcc for a c++14-based project. > > > > To have cmake add the corresponding -std=-flag I'm setting > > >

[CMake] GCC: -std=g++14 vs -std=c++14

2016-06-13 Thread Patrick Boettcher
Hi list, I'm using gcc for a c++14-based project. To have cmake add the corresponding -std=-flag I'm setting set_property(TARGET PROPERTY CXX_STANDARD 14) This makes that when gcc is used cmake adds -std=gnu++14 . How can I make it set -std=c++14 instead? Background: my problem is the com

Re: [CMake] C header file cross dependency

2016-06-06 Thread Patrick Boettcher
Hi Martin, On Wed, 1 Jun 2016 14:58:53 + Wagner Martin wrote: > > > > Could you provide a working, stripped down example to show the > > problem provided via github (in an example repo). > > > > I've added a simple test project to > > https://github.com/martinwag/test_cmake/tree/maste

Re: [CMake] C header file cross dependency

2016-05-25 Thread Patrick Boettcher
On Mon, 23 May 2016 13:49:14 + Wagner Martin wrote: > Hi @all, > > I'm quite new to CMake. If I've made a mistake or something is much > easier to solve, please tell me. > > I'd like to use CMake in embedded development (Build System: Linux, > Target: ARM Microcontroller) to get rid of comp

Re: [CMake] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-13 Thread Patrick Boettcher
On Fri, 13 May 2016 07:06:32 +1000 Craig Scott wrote: > Patrick, > > I suggest if you can reduce your problem down to a small, reproducible > example, then file a bug. I did a test just now with CMake 3.5.2 and > everything behaved as expected, including the header search path > propagation, so

Re: [CMake] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-12 Thread Patrick Boettcher
On Thu, 12 May 2016 09:20:10 -0500 iosif neitzke wrote: > I'm sorry, I'm not sure I understand. In your example, there is > target_link_libraries(lib3 PUBLIC lib1). It looks like lib2 has > target_link_libraries(lib2 PRIVATE lib1). Yes. That is correct. When building the code for lib2 and lib

Re: [CMake] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-12 Thread Patrick Boettcher
On Thu, 12 May 2016 09:04:10 -0500 iosif neitzke wrote: > target_include_directories(lib1 INTERFACE /tmp) means /tmp is > propagated with lib1, but not used to build lib1. I know. Could you elaborate how this is related with lib3 PRIVATEly linking to lib1? regards, -- Patrick. -- Powered by w

Re: [CMake] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-12 Thread Patrick Boettcher
On Thu, 12 May 2016 08:47:33 -0500 iosif neitzke wrote: > My reading of your examples: > > exe1 gets linked to lib2, and lib2/bin is included. exe1 probably > won't link ultimately because lib2 may need symbols from lib1. > Depends on the structure of the C code between lib2 and lib1. See > J

Re: [CMake] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-12 Thread Patrick Boettcher
On Wed, 11 May 2016 21:58:34 +1000 Craig Scott wrote: [..] > If you were paying careful attention, you would have noticed that > when A links in B as PRIVATE, the include directories of B never > propagate to something linking to A, but if A is a static library, > then the *linking* of B behaves

Re: [CMake] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-10 Thread Patrick Boettcher
On Tue, 10 May 2016 11:39:49 +0200 Attila Krasznahorkay wrote: > Hi Patrick, > > I *think* that these public/private rules behave a bit differently > for static libraries than they do for shared ones. > > But I have to admit, that based on this code I also would've guessed > that -I/tmp would n

[CMake] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-09 Thread Patrick Boettcher
Hi list, What is the differences between PRIVATE and PUBLIC when used with target_link_libraries? I read the help and understood that it works like in C++: PRIVATE will make everything which was PUBLIC before also PRIVATE if inherited privately. An example: add_library(lib1 INTERFACE) targe

[CMake] Two-stage build - how to include and know existing targets

2016-05-09 Thread Patrick Boettcher
Hi list, In my project I have to build things in two stages (different compilers and different flags between the two stages). Both are built with CMake. I'm looking for a way of how to correctly include the generated products from one project (libraries in my case) in the other project's build.

Re: [CMake] Performance issues on very large project

2016-04-05 Thread Patrick Boettcher
Hi, On Tue, 5 Apr 2016 23:18:41 -0500 Steven Stallion wrote: > All, > > I am currently working on a very large project that contains over 500 > (yes, really) listfiles. A co-worker was looking into some performance > issues we were seeing during configuration and found something very > interest

[CMake] cross-compilation: add dependency to all linked targets

2016-03-08 Thread Patrick Boettcher
Hi list, I'm building applications for an bare-metal sytem. There are no standard libraries. In my toolchain-file I specify set(CMAKE_SYSTEM_NAME "Generic") and I'm telling gcc to not include std-libraries with -nostdlib . In my toolchain-file I changed CMAKE_EXE_LINKER_FLAGS in order

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

2016-03-01 Thread Patrick Boettcher
On Mon, 29 Feb 2016 21:20:59 +0100 Stephen Kelly wrote: > 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 FindMod

[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