Re: [CMake] clean custom_target

2016-10-26 Thread Steve Lorimer
There is an open issue about just this. If ADDITIONAL_MAKE_CLEAN_FILES doesn't work for you, you may want to make your case on the issue https://gitlab.kitware.com/cmake/cmake/issues/16358 On 26 October 2016 at 00:59, Petr Kmoch wrote: > Hi Tiago. > > The best I can think of is the directory p

Re: [CMake] Cannot get automoc to work properly with recommended Qt5 support method

2016-10-20 Thread Steve Lorimer
Sounds like you have ended up at the same solution I did. I had trouble getting the automated qt generation working, and in the end I made it explicit if(ARG_MOC) qt5_wrap_cpp(MOC_OUT ${ARG_MOC}) endif() if(ARG_RES) qt5_add_resources(RES_OUT ${ARG_RES}) endif() if(ARG_UI) qt5_wrap_ui(UI_OUT ${ARG_

Re: [CMake] How to configure CMake to add current path to include directive.

2016-10-20 Thread Steve Lorimer
wrote: > What about CMAKE_INCLUDE_CURRENT_DIR > <https://cmake.org/cmake/help/latest/variable/CMAKE_INCLUDE_CURRENT_DIR.html> > ? > > > > Regards, > > > > Dvir > > *From:* CMake [mailto:cmake-boun...@cmake.org] *On Behalf Of *Steve > Lorimer > *Sent:* Mon

Re: [CMake] How to configure CMake to add current path to include directive.

2016-10-16 Thread Steve Lorimer
ike the following was what I had in mind (untested): > > get_target_property(incDirs someTarget INCLUDE_DIRECTORIES) > list(APPEND incDirs .) > set_target_properties(someTarget PROPERTIES INCLUDE_DIRECTORIES > "${incDirs}") > > > On Mon, Oct 17, 2016 at 10:31 AM, S

Re: [CMake] How to configure CMake to add current path to include directive.

2016-10-16 Thread Steve Lorimer
that advice). > > > > On Mon, Oct 17, 2016 at 9:46 AM, Steve Lorimer > wrote: > >> In makefile parlance, I'm trying to add -I. (ie: the current directory) >> to my include paths >> >> I tried the following: >> >> include_directories("

[CMake] How to configure CMake to add current path to include directive.

2016-10-16 Thread Steve Lorimer
In makefile parlance, I'm trying to add -I. (ie: the current directory) to my include paths I tried the following: include_directories(".") This doesn't work unfortunately, as relative paths are interpreted as relative to the current source directory

Re: [CMake] set_directory_properties ADDITIONAL_MAKE_CLEAN_FILES globbing pattern?

2016-08-31 Thread Steve Lorimer
Is this just not possible? On 24 August 2016 at 11:35, Steve Lorimer wrote: > As part of our build process we tag certain binary files with version > information such as git branch, number of commits, build variant etc. > > Eg, for a binary called "app" we could insta

Re: [CMake] How to add -fPIC to a static library?

2016-08-28 Thread Steve Lorimer
Thanks Nicholas, you are indeed correct! On 28 August 2016 at 17:35, Nicholas Braden wrote: > Have you tried set_property(TARGET cpp-netlib_pic PROPERTY > POSITION_INDEPENDENT_CODE ON)? I think you must specify the value ON > for it to work. > > On Sun, Aug 28, 2016 at 4:28 PM

[CMake] How to add -fPIC to a static library?

2016-08-28 Thread Steve Lorimer
I'm trying to create a static library with -fPIC specified. add_library(cpp-netlib_pic STATIC ${SRCS}) set_property(TARGET cpp-netlib_pic PROPERTY POSITION_INDEPENDENT_CODE) This doesn't work. The library (cpp-netlib_pic) is built without the -fPIC flags. Other targets which link agains

[CMake] How to link against PIC version of a library's dependency in CMake?

2016-08-28 Thread Steve Lorimer
*CMake:* We have a dependency on cpp-netlib . We build it from source as part of our build system. cpp-netlib/CMakeLists.txt: add_library(cpp-netlib STATIC ${SRCS}) For one particular use case, we have to use it in a shared library, so I've created a second libr

[CMake] set_directory_properties ADDITIONAL_MAKE_CLEAN_FILES globbing pattern?

2016-08-24 Thread Steve Lorimer
As part of our build process we tag certain binary files with version information such as git branch, number of commits, build variant etc. Eg, for a binary called "app" we could install a file in the local source directory with the name "app.branch_foo.91.debug" The shell globbing pattern that m

Re: [CMake] Custom target for running tests as part of the build

2016-08-23 Thread Steve Lorimer
on the ugliness of > the extra indirection may not be desirable for you. > > -- > Matt Keeler > > > On August 23, 2016 at 11:20:48, Steve Lorimer (steve.lori...@gmail.com) > wrote: > > We have several unit tests which we would like to be run as part of our > build proces

[CMake] Custom target for running tests as part of the build

2016-08-23 Thread Steve Lorimer
We have several unit tests which we would like to be run as part of our build process. To achieve this I have a helper script which creates a custom command that runs the test, and if successful, creates a file "test_name.passed". I then add a custom target "test_name.run" which depends on "test_

Re: [CMake] in source makefile / helper script that enables building out of source?

2016-05-11 Thread Steve Lorimer
On 11 May 2016 at 09:01, Konstantin Tokarev wrote: > > FYI, CMake supports in-source builds (however, particular projects may not) > Thanks for your response! I am aware of being able to do in-source builds, but would like to continue to reap the benefits of out-of-source builds whilst being ab

[CMake] in source makefile / helper script that enables building out of source?

2016-05-11 Thread Steve Lorimer
I've recently changed over from using boost-build ( http://www.boost.org/build/) to cmake. Boost build builds in-source. I've become quite used to building and searching etc from the source root ~/src $ b2 module ~/src $ git grep foo This work flow has been broken because I'm not using out of