Re: [CMake] How to set platform-specific compiler-options from within CMakeFiles

2008-07-04 Thread Philip Lowman
On Thu, Jul 3, 2008 at 9:10 AM, Bill Hoffman <[EMAIL PROTECTED]> wrote: > Philip Lowman wrote: > > Wow this is an old thread. Sorry for the late response. >> >> I think what's needed here is a way to detect the platform and allow >> people to modify CMAKE_CXX_FLAGS and friends before they get ce

Re: [CMake] How to set platform-specific compiler-options from within CMakeFiles

2008-07-03 Thread Bill Hoffman
Philip Lowman wrote: Wow this is an old thread. Sorry for the late response. I think what's needed here is a way to detect the platform and allow people to modify CMAKE_CXX_FLAGS and friends before they get cemented in stone in the cache. IIRC doesn't CMAKE_USER_MAKE_RULES_OVERRIDE put the

Re: [CMake] How to set platform-specific compiler-options from within CMakeFiles

2008-07-02 Thread Philip Lowman
On Fri, Jun 6, 2008 at 9:00 AM, Bill Hoffman <[EMAIL PROTECTED]> wrote: > Martin Apel wrote: > >> Mike Jackson wrote: >> >>> typically, the PROJECT() statement is the first line of your >>> CMakeLists.txt. Could you explain your project layout a bit more? >>> >>> >>> I found out, that CMAKE_CXX_F

Re: [CMake] How to set platform-specific compiler-options from within CMakeFiles

2008-06-06 Thread Bill Hoffman
Martin Apel wrote: Mike Jackson wrote: typically, the PROJECT() statement is the first line of your CMakeLists.txt. Could you explain your project layout a bit more? I found out, that CMAKE_CXX_FLAGS is set to the compound of $ENV{CXXFLAGS} and the platform-specific default at the time, the

Re: [CMake] How to set platform-specific compiler-options from within CMakeFiles

2008-06-06 Thread Martin Apel
Mike Jackson wrote: typically, the PROJECT() statement is the first line of your CMakeLists.txt. Could you explain your project layout a bit more? I found out, that CMAKE_CXX_FLAGS is set to the compound of $ENV{CXXFLAGS} and the platform-specific default at the time, the PROJECT statement i

Re: [CMake] How to set platform-specific compiler-options from within CMakeFiles

2008-06-06 Thread Mike Jackson
typically, the PROJECT() statement is the first line of your CMakeLists.txt. Could you explain your project layout a bit more? -- Mike Jackson Senior Research Engineer Innovative Management & Technology Services On Jun 6, 2008, at 2:31 AM, Martin Apel wrote: Thanks for your help. The prob

Re: [CMake] How to set platform-specific compiler-options from within CMakeFiles

2008-06-05 Thread Martin Apel
Thanks for your help. The problem is, that CMAKE_SYSTEM is not set at the time the INCLUDE statement is necessary. The PROJECT statement seems to cause it to be defined and at the same time sets the compiler flags. If I put the INCLUDE before PROJECT, then CMAKE_SYSTEM is not available, only de

Re: [CMake] How to set platform-specific compiler-options from within CMakeFiles

2008-06-05 Thread Werner Smekal
Hi, just use ADD_DEFINITION, e.g. # Disable warnings about deprecated functions (Visual C++ 2005) if(MSVC_VERSION GREATER 1399) ADD_DEFINITIONS("/D_CRT_SECURE_NO_DEPRECATE") endif(MSVC_VERSION GREATER 1399) You could just use "if(WIN32)" but than for all compilers on Windows this option would

Re: [CMake] How to set platform-specific compiler-options from within CMakeFiles

2008-06-05 Thread Mike Jackson
Sure you can: INCLUDE (MSVC_Compiler_Stuff.cmake) #--MSVC_Compiler_Stuff.cmake if (MSVC) endif (MSVC) I do this all the time for OS X specific stuff. For Linux you can try: IF(CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") # Linux Specific flags ENDIF(CMAKE_SYSTEM MAT

[CMake] How to set platform-specific compiler-options from within CMakeFiles

2008-06-05 Thread Martin Apel
Hi all, I am trying to set the CMAKE_CXX_FLAGS or CMAKE_CXX_FLAGS_INIT variable, such that it contains flags to turn off specific warnings for the Visual Studio compiler. I definitely want to set these additional flags from within a CMakeFile, specifying them on the command line or interactive