CMakeAddFortranSubdirectory: Simplfy logic to always build subdir

In the case that we use ExternalProject_Add to drive the subdirectory
build, replace the `forcebuild` step with the official `BUILD_ALWAYS`
option.

Issue: #20179
This commit is contained in:
Brad King 2020-01-28 11:59:21 -05:00
parent 228dc92b09
commit a7b844d6d4

View File

@ -149,17 +149,9 @@ function(cmake_add_fortran_subdirectory subdir)
-P ${build_dir}/config_mingw.cmake
BUILD_COMMAND ${CMAKE_COMMAND}
-P ${build_dir}/build_mingw.cmake
BUILD_ALWAYS 1
INSTALL_COMMAND ""
)
# make the external project always run make with each build
externalproject_add_step(${project_name}_build forcebuild
COMMAND ${CMAKE_COMMAND}
-E rm -f
${CMAKE_CURRENT_BUILD_DIR}/${project_name}-prefix/src/${project_name}-stamp/${project_name}-build
DEPENDEES configure
DEPENDERS build
ALWAYS 1
)
# create imported targets for all libraries
foreach(lib ${libraries})
add_library(${lib} SHARED IMPORTED GLOBAL)