Dear CMakers,

I have a Fortran project to be built on Windows and Linux using ifort compiler. For two of the project files, I need to add specific compiler flag (i.e. /assume:byterecl). To do so, I used the following CMake command:

SET_SOURCE_FILES_PROPERTIES(file1.f90 PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS} /assume:byterecl")

There is one point I could not make clear up to now: if I want this extra flag to be used whatever the CMAKE_BUILD_TYPE, is the above command sufficient ? By sufficient I mean will the use of ${CMAKE_Fortran_FLAGS} be spread all over the ${CMAKE_Fortran_FLAGS_DEBUG}, ${CMAKE_Fortran_FLAGS_RELEASE} ... flags ?

I would like to avoid something like:

IF(CMAKE_BUILD_TYPE STREQUAL Debug)
SET_SOURCE_FILES_PROPERTIES(file1.f90 PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS_DEBUG} /assume:byterecl")
ELSEIF(CMAKE_BUILD_TYPE STREQUAL Release)
SET_SOURCE_FILES_PROPERTIES(file1.f90 PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS_RELEASE} /assume:byterecl")

... and so on for the other build type. Not very nice isn't it but do I have the choice ?

thanks a lot for your help

Eric

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Reply via email to