[CMake] Remove default compiler options

Sylvain Benner benner at virtools.com
Fri Sep 1 04:30:24 EDT 2006


The GR option is driven by CMAKE_CXX_USE_RTTI variable.
For the GS option I don't know where it is set.

Sylvain

----- Original Message ----- 
From: "Antoine Tollenaere" <atollena at gmail.com>
To: <cmake at cmake.org>
Sent: Friday, September 01, 2006 9:45 AM
Subject: [CMake] Remove default compiler options


> Hi,
> 
> I'm trying to get rid of the default CMake compiler options when
> generating a VS2003 project. I'm linking to some binary components
> that I can not recompile and it looks like when executing my project I
> get some runtime error due to calling conventions incompatibilities.
> I tried it several ways, including saving  CMake_CXX_FLAGS and all the
> build type variants, unsetting them, and restore after ADD_EXECUTABLE,
> but the result is not was I'm looking for:
> 
>  SET(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
>  SET(CMAKE_CXX_FLAGS_RELEASE_SAVE ${CMAKE_CXX_FLAGS_RELEASE})
>  SET(CMAKE_CXX_FLAGS_DEBUG_SAVE ${CMAKE_CXX_FLAGS_DEBUG})
>  SET(CMAKE_SHARED_LINKER_FLAGS_SAVE ${CMAKE_SHARED_LINKER_FLAGS})
>  SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE_SAVE
> ${CMAKE_SHARED_LINKER_FLAGS_RELEASE})
>  SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG_SAVE ${CMAKE_SHARED_LINKER_FLAGS_DEBUG})
> 
>  SET(CMAKE_CXX_FLAGS "")
>  SET(CMAKE_CXX_FLAGS_RELEASE "")
>  SET(CMAKE_CXX_FLAGS_DEBUG "")
>  SET(CMAKE_SHARED_LINKER_FLAGS "")
>  SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "")
>  SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "")
> 
>  ADD_EXECUTABLE(something
>    aFile.cpp)
> 
>  SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
>  SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVE})
>  SET(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG_SAVE})
>  SET(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_SAVE})
>  SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE
> ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_SAVE})
>  SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_SAVE})
> 
> When built, target "something" still have some options like  "/GS /GR".
> Is there a clean way to remove all the default options and to
> customize them properly.
> Regards,
> 
> 
> -- 
> Antoine Tollenaere
> 
> Jabber ID : atollena at fritalk.com
> tel : +33 6 86 75 99 35
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060901/aa1d2169/attachment.htm


More information about the CMake mailing list