From f37dc0b0bef023bebf10ecdf78637870bda33036 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 17 Jun 2024 08:52:20 -0700 Subject: [PATCH] set CMake_Fortran_MODULE_DIRECTORY in examples that were missing it --- examples/sunnonlinsol/fixedpoint/CMakeLists.txt | 3 +++ examples/sunnonlinsol/newton/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt index 4906cd1a31..834af69c2e 100644 --- a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt +++ b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt @@ -97,6 +97,9 @@ foreach(example_tuple ${fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) diff --git a/examples/sunnonlinsol/newton/CMakeLists.txt b/examples/sunnonlinsol/newton/CMakeLists.txt index 08870d929f..2f3413bd0b 100644 --- a/examples/sunnonlinsol/newton/CMakeLists.txt +++ b/examples/sunnonlinsol/newton/CMakeLists.txt @@ -98,6 +98,9 @@ foreach(example_tuple ${fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90)