henrywoo / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

CMAKE_CXX_FLAGS are duplicated #421

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I found a problem with the code in internal_utils.cmake when including the 
CMakeLists for GMock in a larger project  that already defines CMAKE_CXX_FLAGS 
to include flags that are not repeatable.

Things crash and burn because calling set_target_properties() to set the flags 
for a target actually appends them to the existing flags[1] (resulting in 
duplicates because of the code on line 113).

Seems like when you initialize ${cxx_no_exception} you could just remove 
${CMAKE_CXX_FLAGS} like you have for ${cxx_exception}.

[1]: 
http://stackoverflow.com/questions/5096881/does-set-target-properties-in-cmake-o
verride-cmake-cxx-flags

Original issue reported on code.google.com by j...@kirkconsulting.co.uk on 18 Oct 2012 at 7:36