Re: [CMake] Removing duplicate entries from CXXFLAGS

2015-10-06 Thread Roman Bolshakov
CMake performs deduplication of per-target flags for sure. However I'm not sure if CMAKE_CXX_FLAGS is deduplicated. But I consider this variable as global flags for the whole project which is defined at topmost CMakeLists.txt. If you need to specify some flags specifically for a target use t

Re: [CMake] New to cmake and I have a problem.

2015-09-07 Thread Roman Bolshakov
Hi Jay,  Have you tried something like this (http://www.cmake.org/pipermail/cmake/2010-July/038312.html)? — Отправлено из Mailbox On Fri, Sep 4, 2015 at 9:37 PM, Jay Cotton wrote: > Hi: > I need to add an 'S' to the ar flags. Now, I have found that I can edit > the link.txt file but, > th

Re: [CMake] List all binaries associated with a target.

2015-03-22 Thread Roman Bolshakov
2015-03-16 23:22 GMT+03:00 Klaim - Joël Lamotte : > Then you can invoke top-level cmake_install.cmake to install a subset >> of your project: >> DESTDIR=/destination/install/path cmake -DCOMPONENT=A -P >> cmake_install.cmake >> >> > It is not clear to me how all this would help installing automati

Re: [CMake] List all binaries associated with a target.

2015-03-22 Thread Roman Bolshakov
> > Unfortunately, if my understanding is correct, > this code cannot work with external dependencies as they are not targets. It should work with external dependencies which are imported targets. You just need to check IMPORTED property is True and then you can extract precise location from IMPO

Re: [CMake] List all binaries associated with a target.

2015-03-16 Thread Roman Bolshakov
> I'm not totally sure install() does exactly what I need. > My use case is that I need to debug each executable in an installed-like > context (with data), which imply that each time it is compiled it should be > installed too. > Actually 2 and 3 are the same, I just put the files in a specific p

Re: [CMake] List all binaries associated with a target.

2015-03-14 Thread Roman Bolshakov
Here's an example function which addresses 1. It creates a string of generator expressions for direct and indirect dependencies of a target recursively. When all recursive invocations are done, it spits -deps file in the CURRENT_BINARY_DIR which contains full paths of the dependencies: function(st

Re: [CMake] Are CMAKE_CXX_FLAGS supposed to go on the link line?

2015-03-02 Thread Roman Bolshakov
Apparently, command line to link executable is quite different from a shared library (Modules/CMakeCXXInformation.cmake): if(NOT CMAKE_CXX_LINK_EXECUTABLE) set(CMAKE_CXX_LINK_EXECUTABLE " -o ") endif() set(CMAKE_CXX_CREATE_SHARED_LIBRARY " -o ") CMAKE_CXX_FLAGS/CMAKE

Re: [CMake] cmake shared library exported symbols on 64bit AIX XLC compiler

2015-02-23 Thread Roman Bolshakov
Hi Michael, Gotcha, thanks for explanation. Right, there should be a way to pass -X32/-X64 for CreateExportList right prior to /objects.exp. Current definition in Modules/Compiler/XL.cmake doesn't have a spot for that: set(CMAKE_${lang}_CREATE_SHARED_LIBRARY "${CMAKE_XL_CreateExportLi

Re: [CMake] cmake shared library exported symbols on 64bit AIX XLC compiler

2015-02-19 Thread Roman Bolshakov
If your project is supposed to be built 64-bit only on 64-bit build host and 32-bit only on 32-bit one, you can just append proper flag into CMAKE_CXX_FLAGS and CMAKE_C_FLAGS depending on the value of CMAKE_SIZEOF_VOID_P ( http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_SIZEOF_VOID_P.html). In

Re: [CMake] How to force package target generate a file before proceeding

2015-02-18 Thread Roman Bolshakov
add_custom_command is rather used for operations performed during build phase (which is completely separate off packaging) You could create hgHash.txt during packaging by using install(SCRIPT) command: install(SCRIPT hgHash.cmake) install(   FILES hgHash.txt   DESTINATION yourapp )

Re: [CMake] Visual Studio add-in: adding non-cmake files as dependencies to trigger re-generation

2015-02-18 Thread Roman Bolshakov
You might try to use CMAKE_CONFIGURE_DEPENDS (http://www.cmake.org/cmake/help/v3.0/prop_dir/CMAKE_CONFIGURE_DEPENDS.html) property: set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS dependency.txt) That would trigger CMake regeneration upon a change of dependency.txt -Roma

Re: [CMake] add_dependencies: Disallow use with INTERFACE_LIBRARY. WHY?!?

2015-02-17 Thread Roman Bolshakov
I agree with Andrey, there should be a way to use interface library type with generated headers. There's a workaround but it involves manual set up of extra dependencies solely for dependency tracking. You have to add dependency between a target which consumes the generated headers and a cus

Re: [CMake] Library include path question

2015-01-19 Thread Roman Bolshakov
We use similar layout in a set of components, but in order to do that we just store library interface headers in /include/ directory. And layout of library directory is the following: src/ - internal headers and implementation include/ - external headers CMakeLists.txt Then you can define the f