CMP0230ΒΆ

Added in version 4.6.

CMakeAddFortranSubdirectory builds the MinGW project with the parent configuration.

When the parent project uses MSVC without a Fortran compiler, the cmake_add_fortran_subdirectory() command builds the Fortran project as an external project using a MinGW gfortran and a single-config MinGW Makefiles generator. CMake 4.5 and below configure that project without CMAKE_BUILD_TYPE, so it is built without configuration-specific flags regardless of the parent's CMAKE_BUILD_TYPE or the configuration selected in a multi-config generator.

CMake 4.6 and above prefer to set CMAKE_BUILD_TYPE in the MinGW project to the configuration being built by the parent project. With a multi-config parent, the MinGW build tree is shared by all configurations, so it is reconfigured when the configuration being built differs from the one it was last configured with. A CMAKE_BUILD_TYPE given in the CMAKE_COMMAND_LINE option is overridden.

The OLD behavior for this policy is to configure the MinGW project without setting CMAKE_BUILD_TYPE. The NEW behavior is to set CMAKE_BUILD_TYPE to the parent project's configuration.

This policy is checked when cmake_add_fortran_subdirectory() is called. It has no effect when the Fortran project is added directly with add_subdirectory().

This policy was introduced in CMake version 4.6. It may be set by cmake_policy() or cmake_minimum_required(). If it is not set, CMake does not warn, and uses OLD behavior.

Note

The OLD behavior of a policy is deprecated by definition and may be removed in a future version of CMake.