[CMake] Mix Debug and Release Flags In One Library

sindimo at gmail.com sindimo at gmail.com
Tue May 6 08:13:31 EDT 2014


Dear All,

We currently have  a FORTRAN library we’re building with CMake (around 1000
files of FORTRAN).

ADD_LIBRARY(

My_Fortran_Lib

…….

)

For the release build we set the release compilation flags with
“CMAKE_Fortran_FLAGS_RELEASE” and set “CMAKE_BUILD_TYPE” to “Release” for
those flags to be honored.

For the debug build we set the debug compilation flags with
“CMAKE_Fortran_FLAGS_DEBUG” and set “CMAKE_BUILD_TYPE” to “Debug” for those
flags to be honored.

Out of those 1000 files we have a subset that we want to build always in
“Release” mode while the rest of the files can be built either in Debug or
Release depending on what “CMAKE_BUILD_TYPE” is set to.

Is there a way to tell CMake to build a specific subset of files always
with Release flags even if “CMAKE_BUILD_TYPE” was Debug?

Thank you for your help.

*Mohamad O. Sindi*

EXPEC Advanced Research Center

Saudi Aramco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140506/58df2200/attachment.html>


More information about the CMake mailing list