On Tue, Mar 3, 2009 at 3:54 PM, Leopold Palomo Avellaneda
<[email protected]>wrote:

> > Hope that helps
>
> Yes, sure. Thanks. It's not exactly what I wanted, but it will help me.
>
> Thanks a lot.
>
> Best regards,


Another idea might be to use a function to add the flags with COMPILE_FLAGS
to all of your targets except one of them that passes a special argument to
the function...  Of course then you have to modify every one of your
CMakeLists.txt to call this special function.

(this is pseudo code but you probably get the idea):

# Assume BLAH is the thing you want added everywhere except one target
# have everyone call fixor_target(target) after creating a target, except
for the one where you want the flags stripped, then call
# fixor_target(target NOBLAH)
#
function(fixor_target _target)
 if (${ARGN} list contains "NOBLAH") # use LIST(FIND... or STRING(MATCH ...
   get_target_property(existing_compile_flags ${_target} COMPILE_FLAGS)
   set_target_properties(_target PROPERTIES COMPILE_FLAGS
"${existing_compile_flags} -BLAH")
 endif()
endfunction()


-- 
Philip Lowman
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to