[CMake] What is the proper way to force compiler?

J Decker d3ck0r at gmail.com
Mon Mar 1 22:36:10 EST 2010


Nevermind - I Found it on a disrelated topic....

for instance ....

set_source_files_properties( ${SOURCES} PROPERTIES LANGUAGE "CXX" )



On Mon, Mar 1, 2010 at 6:47 PM, J Decker <d3ck0r at gmail.com> wrote:
> I'd like to know why I have to do this at the end of each CMakeLists.txt...
>
> if( C++ )
>  set( CMAKE_C_COMPILER "${CMAKE_CXX_COMPILER}" )
>  set( CMAKE_C_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}" )
> endif()
>
> if I do those lines any time sooner than the very end of the file,
> then the compiler override does not hold.
>
> I'd like to do this at the very beginning of my root CMakeLIsts.txt so
> all sub-projects inherit the settings.
>
> and I might not have to do both of these, probably just the first? ...
> well, the C and C++ options might very, so really maybe I should just
> do the second, except the line set in COMPILE_OBJECT references
> COMPILER...
>
>
> so at this state, I have to add this after all add_subdirectories() in
> each and every CMakeLists.txt file.
>


More information about the CMake mailing list