[CMake] Modification of link flags for all targets within a subdirectory -- how?
Michael Hertling
mhertling at online.de
Fri Sep 3 21:26:36 EDT 2010
On 09/02/2010 09:11 PM, Ryan Pavlik wrote:
> On 9/2/2010 1:43 PM, Ingolf Steinbach wrote:
>> Hi,
>>
>> 2010/9/2 Ryan Pavlik<rpavlik at iastate.edu>:
>>> Set the appropriate variables at the top of the CMakeLists.txt file of the
>>> given subdirectory. Each add_subdirectory call creates a new scope, so
>>> variables set in sub-directories do not propagate to parents unless
>>> specifically told to.
>> But which variables would I have to set? Up to now I have used
>> set_target_properties(... LINK_FLAGS ...).
>>
>> Kind regards
>> Ingolf
>
> CMAKE_EXE_LINKER_FLAGS
> http://cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_EXE_LINKER_FLAGS
>
> I could have sworn there were matching variables for the other target
> types, but I can't seem to find them on the online documentation.
The other one is CMAKE_SHARED_LINKER_FLAGS - not documented but
mentioned in FAQ 4.17 and the Wiki. There's no corresponding variable
for static libraries as they are not created by the linker, but there
is a target property STATIC_LIBRARY_FLAGS[_<CONFIG>] for the archiver.
Regards,
Michael
More information about the CMake
mailing list