diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cd0264b72..0893fbaa1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ -cmake_minimum_required( VERSION 3.20 ) -cmake_policy( SET CMP0118 NEW ) +cmake_minimum_required( VERSION 3.19 ) enable_language( C ) enable_language( CXX ) diff --git a/cmake/c_preproc.cmake b/cmake/c_preproc.cmake index 0d0dd751ef..40af0a8ee2 100644 --- a/cmake/c_preproc.cmake +++ b/cmake/c_preproc.cmake @@ -60,19 +60,13 @@ macro( wrf_c_preproc_fortran ) # # It keeps getting better lol # # https://gitlab.kitware.com/cmake/cmake/-/issues/18399 # # We could use cmake 3.20+ and CMP0118, but this allows usage from 3.18.6+ - # TL;DR - This doesn't work despite all documentation stating otherwise, need to use CMP0118 - # set_source_files_properties( - # ${WRF_PP_F_OUTPUT_FILE} - # ${WRF_PP_F_TARGET_DIRECTORY} - # PROPERTIES - # GENERATED TRUE - # ) set_source_files_properties( ${WRF_PP_F_OUTPUT_FILE} DIRECTORY ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${WRF_PP_F_TARGET_DIRECTORY} PROPERTIES Fortran_PREPROCESS OFF + GENERATED TRUE ) # message( STATUS "File ${WRF_PP_F_SOURCE_FILE} will be preprocessed into ${WRF_PP_F_OUTPUT_FILE}" ) diff --git a/cmake/m4_preproc.cmake b/cmake/m4_preproc.cmake index 4158795578..f4deefd365 100644 --- a/cmake/m4_preproc.cmake +++ b/cmake/m4_preproc.cmake @@ -54,19 +54,13 @@ macro( wrf_m4_preproc_fortran ) # # It keeps getting better lol # # https://gitlab.kitware.com/cmake/cmake/-/issues/18399 # # We could use cmake 3.20+ and CMP0118, but this allows usage from 3.18.6+ - # TL;DR - This doesn't work despite all documentation stating otherwise, need to use CMP0118 - # set_source_files_properties( - # ${WRF_PP_M4_OUTPUT_FILE} - # ${WRF_PP_M4_TARGET_DIRECTORY} - # PROPERTIES - # GENERATED TRUE - # ) set_source_files_properties( ${WRF_PP_M4_OUTPUT_FILE} DIRECTORY ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${WRF_PP_M4_TARGET_DIRECTORY} PROPERTIES Fortran_PREPROCESS OFF + GENERATED TRUE ) # message( STATUS "File ${WRF_PP_M4_SOURCE_FILE} will be preprocessed into ${WRF_PP_M4_OUTPUT_FILE}" ) diff --git a/frame/CMakeLists.txt b/frame/CMakeLists.txt index 4543c4694e..52675e13b9 100644 --- a/frame/CMakeLists.txt +++ b/frame/CMakeLists.txt @@ -102,7 +102,8 @@ endif() target_sources( ${PROJECT_NAME}_Core PRIVATE - ${WRF_INCLUDE_FILES} + module_internal_header_util.F + module_configure.F module_driver_constants.F diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 7f07eb2539..c858d2e281 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -165,6 +165,15 @@ add_custom_target( ${allocs_source} ) +set_source_files_properties( + ${CMAKE_BINARY_DIR}/frame/module_state_description.F + ${dealloc_source} + ${allocs_source} + DIRECTORY ${PROJECT_SOURCE_DIR} + PROPERTIES + GENERATED TRUE + ) + target_sources( ${PROJECT_NAME}_Core PRIVATE