[CMake] speeding up FIND_PACKAGE(Qt4 ...)

2012-05-07 Thread Miller Henry
We have a cmake based project where cmake runtime is becoming a problem: everytime a CMakeLists.txt changes the build takes an extra 40-50 seconds. Our main CMakeLists.txt contains a lot of ADD_SUBDIRECTORY (and little else). Most of the subdirectories then call FIND_PACKAGE(Qt4) with

Re: [CMake] Query regarding header files in CMakeLists.txt

2012-09-18 Thread Miller Henry
On a practical matter though: if the file is not listed someplace, then your IDE may not pick it up. Thus while it is legal to not list all files, it is a good idea to list them anyway. -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of

[CMake] swig - how do I set compile flags on the generated files?

2012-11-27 Thread Miller Henry
Our normal coding standards requires zero warnings with -wall -wextra (gcc/clang), but often the swig generated file has warnings. We don't mind turning these warnings off for the generated file, but we still want to see them for other files in the project. However I'm stumped on how to do

[CMake] Is there an easy way to time how long build parts take.

2013-03-21 Thread Miller Henry
Our build it taking a long time, (15+ minutes even when with a massive build farm to distribute compiles across), and the question keeps coming up: what is actually taking so long. Is there an easy way to measure? If there are some top 10 files we might be able to split them (reducing some

Re: [CMake] CMakeModules repository at GitHub?

2013-03-28 Thread Miller Henry
Nice theory, but I have to deal with the real world where many projects don't provide a project config .cmake script. They see no reason to: they don't build with cmake, other downstreams don't build with cmake. It seems to them that they are supporting one system, and there are hundreds. I do

[CMake] Alternate compiler specific options - how to specify?

2013-09-11 Thread Miller Henry
We are using cmake 2.8.11 for out project. Our local compiler is gcc-4.4.3. There is desire to use a newer compiler, but we are not yet ready to commit to anything yet. In the mean time we have installed binaries gcc-4.7 and gcc-4.8. We can specify the alternate compiler with

Re: [CMake] Alternate compiler specific options - how to specify?

2013-09-12 Thread Miller Henry
- From: Игорь Пашев [mailto:pashev.i...@gmail.com] Sent: Wednesday, September 11, 2013 11:31 PM To: Miller Henry Cc: cmake@cmake.org Subject: Re: [CMake] Alternate compiler specific options - how to specify? 2013/9/11 Miller Henry millerhe...@johndeere.com: We are using cmake 2.8.11 for out

[CMake] ctest - how to specify tests that must not run in parallel

2013-11-15 Thread Miller Henry
I just switched to using ctest, which is overall much better, but when I run with -j it often happens that some test suite fails. After investigating I discovered that the failing test is not a unit tests (ie a test with everything mocked out), but an integration test that is intentionally

Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Miller Henry
I'll second (third) the vote for uncrustify over astyle. Astyle doesn't have enough options to take care of all style issues, with uncrustify you can configure everything. Also check out clang-format - it only supports 3 styles (last I checked), but if one of them fit it might be easiest.

[CMake] How can I prevent invalid -DCMAKE_BULD_TYPE values?

2014-06-13 Thread Miller Henry
One of my co-workers just did a build where they ran cmake with the option -DCMAKE_BUILD_TYPE=RelWithDebugInfo Of course what was obviously meant was RelWithDbgInfo. Because of this incorrect option the build was not as expected, but it took a while to figure out why it failed. Of course

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Miller Henry
You need to use include_directories to tell cmake where to find headers. include_directories(${CMAKE_SOURCE_DIR}/src) http://www.cmake.org/cmake/help/v3.0/command/include_directories.html http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_SOURCE_DIR.html From: CMake

[CMake] Export a target that must be built in the import environment

2015-03-30 Thread Miller Henry
I develop a shared library that gets imported into a number of applications (scattered across a number of different repositories). To aid in testing we provide some mocks and fakes, made available by a cmake export files. This works okay, but it isn't right: google mock doesn't guarantee

[CMake] 3.3.0-rc1 feedback - CMP0046 doens't obey policy push

2015-06-10 Thread Miller Henry
I'm trying out my project on 3.3.0-rc1, but currently I'm using 2.8.11 and 2.8.12. I got a couple errors from CMP0046. Most of them are correct: I've fixed a couple places where a non-existent dependency was used, and I want to set this policy to NEW so that more do not sneak in. However

Re: [CMake] Imported libraries and cross platform target names

2015-08-18 Thread Miller Henry
Use find_library to find the library. You will probably need this anyway because different systems install libraries in different locations. http://www.cmake.org/cmake/help/v3.3/command/find_library.html From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Ette, Anthony (CDS) Sent:

Re: [CMake] Colored diagnostic output for GCC 4.9 through Ninja

2015-10-28 Thread Miller Henry
I do something like this, which works for clang and should work for gcc 4.9 though I haven't tested it. I haven't wrote the right way to do this which is to check if the terminal supports color before passing the flag in. I don't know what will happen on our e.g. CI system which doesn't

[CMake] How can I export source code that needs to be built by downstream projects?

2015-12-16 Thread Miller Henry
I'm using cmake to build a set of libraries that then gets packaged and shipped to other groups that are also using cmake to use the library. Since I use google mock to mock my libraries, and the downstreams also want to mock my library I just provide the mock header for their use. This

Re: [CMake] Performance issues on very large project

2016-04-06 Thread Miller Henry
I found the same thing a few years ago, and my solution was the same: only include those modules once. I find that my sub cmake modules are much cleaner now as a bonus. I tend to blame the time not on file IO, but on time to parse those files. I've never done actual profiling though.

Re: [CMake] CTest usage

2016-03-08 Thread Miller Henry
I hate to state the obvious, but set_property (TEST test2 PROPERTY LABELS LABEL1 LABEL2 LABEL1andLABEL2) I know it isn’t what you asked for, but I don’t want cmake to change, but I don’t think it is worthwhile to add more complex set algebra to the -L command so that we can support complex

[CMake] Super builds and export with Namespace

2016-08-11 Thread Miller Henry
I have a few different cmake based projects that depend on each other (as a tree, no circular dependencies). Mostly this works great, but a few people have expressed interested in a superbuild which builds everything together for various purposes. I can make this work with ExternalProject,

Re: [CMake] Need ideas/opinions on third party library management

2016-08-12 Thread Miller Henry
A superbuild will work, and you can write your own Find*.cmake so that find_package works - you don't need most of what the real Find_package would do for you because you already know what is installed where as you control that. But, can you live with the trade off: long build times? What my

[CMake] find*.cmake config files, and Qt4 while cross compiling.

2016-07-15 Thread Miller Henry
I'm going to ask two questions, but a good answer to the first will make the second question redundant. I work with several different cmake projects that are cross compiled, and they depend on each other. Each project creates a cmake config, so we can use find_package to find the contents.

Re: [CMake] Building third party libraries along with normal targets

2017-03-30 Thread Miller Henry
I have found the following projects which all seem to do some variation of a meta build so that you can build multiple projects that depend on each other and manage dependencies. (there are a couple others that seem to not be maintained as well) https://gradle.org/ https://bazel.build/

Re: [CMake] Predownload

2017-04-17 Thread Miller Henry
Instead of trying to do this with the toolchain somehow in cmake I think you might want to look into a meta build system that handles the toolchain and all other dependencies. I listed all I know of a couple months ago in this thread. https://cmake.org/pipermail/cmake/2017-March/065229.html

Re: [CMake] target_link_libraries - private public interface rules

2017-08-22 Thread Miller Henry
in official cmake documentation, but it seems like something that has never been done before. -Original Message- From: Robert Maynard [mailto:robert.mayn...@kitware.com] Sent: Tuesday, August 22, 2017 9:46 AM To: Miller Henry <millerhe...@johndeere.com> Cc: cmake@cmake.org Subject: Re:

[CMake] target_link_libraries - private public interface rules

2017-08-22 Thread Miller Henry
I've been playing with the private/public/interface keyword to target_link_libraries. It seems to me that WHAT they do is well documented, but nobody has ever actually documented what they correct rules of WHEN/WHY you should use any of them. After a lot of misstarts I think I've started to

[CMake] build times increase 1.5x from cmake 2.8.12 to 3

2018-03-23 Thread Miller Henry
I have a fairly large project that I'm trying to update from building with cmake 2.8.12 to 3.10.2. When I make the change my build times go up by half on our Jenkins ci build system. The build machines are 32 core and my build time goes from 59m 38s to 1h 28m 33s. When I try this locally the

Re: [CMake] dependencies of cross compiliations

2018-11-09 Thread Miller Henry
There are two options. Each with pros and cons. The first what you are doing now, except you use external project https://cmake.org/cmake/help/v3.12/module/ExternalProject.html to build the host tools instead of add_custom_command. It otherwise has all the cons you mention, but are they

Re: [CMake] dependencies of cross compiliations

2018-11-27 Thread Miller Henry
I like the idea, some tweaks that I think you need add_host_build - executables built here need to be available not as targets, but as variables as if FIND_EXECUTABLE was called on them. This is probably what you meant, but it didn't come across that way. In the case where you are cross

Re: [CMake] Split Build and Test Pipelines

2019-05-10 Thread Miller Henry
We have had luck packaging all the CTestTestFile.cmake files, and using sed to adjust paths for the target location. You need to install ctest on the test machine, along with all the tests. The only paths we change are the test output location (ie google test .xml files: this might not apply

Re: [CMake] cross-testing support in cmake

2019-11-06 Thread Miller Henry
Easy enough. ADD_TEST can run whatever you want. I created a simple cmake function Function(RUN_REMOTE_TEST testname, other_args) # insert useful code here… add_test(${testname} remote_run_test ${binary_dir}/${testname} other test runner script args… ) End_function() You will have