Re: [CMake] LINK_FLAGS directory property

2016-05-02 Thread Attila Krasznahorkay
Hi Matt, Have you tried using the CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS cache variables? These actually set these flags globally, and not just for one directory, but on the directory level they are easy to override. You can just do something like this in a

[CMake] Override CMAKE_SHARED_LINKER_FLAGS for one particular library

2016-05-02 Thread Attila Krasznahorkay
Dear All, I have a similar issue as Matt Keeler. In our project we have some global linker flags that we set for all targets using the CMAKE_EXE_LINKER_FLAGS, CMAKE_SHARED_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS cache variables. Now it turns out that for some libraries in the project I need

[CMake] Xcode generator results in a project file without optimization

2016-05-02 Thread Siyuan Ren
I have CMake 3.5.2. I write a simple CMakeLists.txt like the below ``` project(mytest) add_executable(mytest test.cpp) ``` Then generate the Xcode project file with `cmake -G Xcode .`. Open the project file in Xcode, and I found the optimization level on all kinds of build, including "Debug", "R

Re: [CMake] LINK_FLAGS directory property

2016-05-02 Thread Matthew Keeler
I am doing that for some things but it gets quite cumbersome as I have to override those for several different configurations. I guess that is the only way to do it currently.  --  Matt Keeler On May 2, 2016 at 03:48:59, Attila Krasznahorkay (attila.krasznahor...@gmail.com) wrote: Hi Matt,

[CMake] Emulating --whole-archive with MSVC

2016-05-02 Thread Guillaume Dumont
Hi, I have been playing with the WINDOWS_EXPORT_ALL_SYMBOLS recently and found the feature very useful. I reused part of the this functionality to emulate the --whole-archive link flag with MSVC. Here is the process I used: 1. Use a POST_BUILD custom command to list the object files linked in the

Re: [CMake] Emulating --whole-archive with MSVC

2016-05-02 Thread Brad King
On 05/02/2016 11:03 AM, Guillaume Dumont wrote: > emulate the --whole-archive link flag with MSVC FYI, this is the purpose of OBJECT libraries in CMake. However, currently OBJECT libraries cannot be installed or used externally. This limitation is primarily due to difficulty in defining semantics