[CMake] SET_SOURCE_FILES_PROPERTIES and configurations

Tristan Carel tristan.carel at gmail.com
Tue Dec 5 11:31:00 EST 2006


On 12/5/06, Luca Cappa <luca.cappa at sequoia.it> wrote:
> Hello
>
> On Tue, 05 Dec 2006 16:57:18 +0100, Tristan Carel
> <tristan.carel at gmail.com> wrote:
>
> > On 12/5/06, Luca Cappa <luca.cappa at sequoia.it> wrote:
> >>
> >> The problem is that I cannot use different flags (perhaps
> >> <CONFIGURATION>_COMPILE_FLAGS) to generate two different precompiled
> >> files, one for DEBUG and one for the RELEASE build. Any help?
> >>
> > Maybe you should read the `Useful variables' wiki page:
> > http://www.cmake.org/Wiki/CMake_Useful_Variables#Compilers_and_Tools
> >
> > ----------------------------------------------------------------------------------------
> >      * None (CMAKE_C_FLAGS or CMAKE_CXX_FLAGS used)
> >     * Debug (CMAKE_C_FLAGS_DEBUG or CMAKE_CXX_FLAGS_DEBUG)
> >     * Release (CMAKE_C_FLAGS_RELEASE or CMAKE_CXX_FLAGS_RELEASE)
> > [...]
> > ----------------------------------------------------------------------------------------
>
>
> I am not sure that the SET_SOURCE_FILES_PROPERTIES rule supports those
> variables. In the documentation of PROPERTIES it is stated that "The
> following [variable] are used by CMake. ... ABSTRACT flag (boolean) ...
> WRAP_EXCLUDE (boolean) ... GENERATED (boolean) ... HEADER_FILE_ONLY
> (boolean ... OBJECT_DEPENDS (string) ... COMPILE_FLAGS (string) ...
> SYMBOLIC (boolean) ". As you see in the list there are not anyone of the
> ones you suggested, but perhaps they could be used with
> SET_SOURCE_FILES_PROPERTIES, I just have to try.

Apparently as you want to put this compile flag to all your .cpp
files, you can add it to the global compiles flags of your
configurations. So you don't need to use SET_SOURCE_FILE_PROPERTIES
anymore, just do something like:

LIST(APPEND CMAKE_CXX_FLAGS_RELEASE /Yu seqlibcommon.h)

-- 
Tristan Carel
Music with dinner is an insult both to the cook and the violinist.


More information about the CMake mailing list