From dd146a80b92dbf4afe42dd426e572bd07eb9066c Mon Sep 17 00:00:00 2001 From: Tom Body <116750897+tbody-cfs@users.noreply.github.com> Date: Wed, 16 Apr 2025 20:27:18 -0400 Subject: [PATCH 1/4] Update CMakeLists.txt Address #2945 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c45fca3b72..9405c9e8d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ message(STATUS "Configuring BOUT++ version ${BOUT_FULL_VERSION}") project(BOUT++ DESCRIPTION "Fluid PDE solver framework" VERSION ${BOUT_CMAKE_ACCEPTABLE_VERSION} - LANGUAGES CXX) + LANGUAGES C CXX) include(CMakeDependentOption) From 5988480b4f509c24b76602405fe4d4133a3eeb9c Mon Sep 17 00:00:00 2001 From: Tom Body
Date: Fri, 18 Apr 2025 16:18:09 +0000 Subject: [PATCH 2/4] Move enable C to NetCDF --- cmake/FindnetCDF.cmake | 1 + cmake/SetupBOUTThirdParty.cmake | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindnetCDF.cmake b/cmake/FindnetCDF.cmake index 393c57549b..361095954e 100644 --- a/cmake/FindnetCDF.cmake +++ b/cmake/FindnetCDF.cmake @@ -32,6 +32,7 @@ if (NOT netCDF_ROOT AND EXISTS "${BOUT_USE_NETCDF}") set(netCDF_ROOT "${BOUT_USE_NETCDF}") endif() +enable_language(C) find_package(netCDF QUIET CONFIG) if (netCDF_FOUND) diff --git a/cmake/SetupBOUTThirdParty.cmake b/cmake/SetupBOUTThirdParty.cmake index 10942f8aa9..f8712c1b58 100644 --- a/cmake/SetupBOUTThirdParty.cmake +++ b/cmake/SetupBOUTThirdParty.cmake @@ -293,7 +293,6 @@ if (BOUT_USE_SUNDIALS) FetchContent_MakeAvailable(sundials) message(STATUS "SUNDIALS done configuring") else() - enable_language(C) find_package(SUNDIALS REQUIRED) if (SUNDIALS_VERSION VERSION_LESS 4.0.0) message(FATAL_ERROR "SUNDIALS_VERSION 4.0.0 or newer is required. Found version ${SUNDIALS_VERSION}.") From 0f7c8546e6a5396c5c692a631bf103d0cde945bc Mon Sep 17 00:00:00 2001 From: Tom Body Date: Fri, 18 Apr 2025 17:36:08 +0000 Subject: [PATCH 3/4] Remove top-level C --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9405c9e8d6..c45fca3b72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ message(STATUS "Configuring BOUT++ version ${BOUT_FULL_VERSION}") project(BOUT++ DESCRIPTION "Fluid PDE solver framework" VERSION ${BOUT_CMAKE_ACCEPTABLE_VERSION} - LANGUAGES C CXX) + LANGUAGES CXX) include(CMakeDependentOption) From 0ab77ba7c88ba13d693d565423e2311abd59feac Mon Sep 17 00:00:00 2001 From: Tom Body Date: Fri, 18 Apr 2025 18:47:12 +0000 Subject: [PATCH 4/4] Add back in C language for SUNDIALS --- cmake/SetupBOUTThirdParty.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/SetupBOUTThirdParty.cmake b/cmake/SetupBOUTThirdParty.cmake index f8712c1b58..53ceb4351c 100644 --- a/cmake/SetupBOUTThirdParty.cmake +++ b/cmake/SetupBOUTThirdParty.cmake @@ -272,6 +272,7 @@ option(BOUT_DOWNLOAD_SUNDIALS "Download and build SUNDIALS" OFF) cmake_dependent_option(BOUT_USE_SUNDIALS "Enable support for SUNDIALS time solvers" OFF "NOT BOUT_DOWNLOAD_SUNDIALS" ON) if (BOUT_USE_SUNDIALS) + enable_language(C) if (BOUT_DOWNLOAD_SUNDIALS) message(STATUS "Downloading and configuring SUNDIALS") include(FetchContent)