From 52fa0dfbb7bee855d60fe79a648f3ce1da24d130 Mon Sep 17 00:00:00 2001 From: Jonah Maxwell Miller Date: Fri, 8 Dec 2023 15:33:10 -0700 Subject: [PATCH] OK FINALLY --- CMakeLists.txt | 1 - cmake/SetupCompilers.cmake | 2 +- cmake/SetupDeps.cmake | 17 ++++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e8d4b9..359132a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,6 @@ # publicly, and to permit others to do so. cmake_minimum_required(VERSION 3.14) -set(CMAKE_CXX_STANDARD 17 CACHE BOOL "") project("singularity-opac" VERSION 0.0.1 diff --git a/cmake/SetupCompilers.cmake b/cmake/SetupCompilers.cmake index 70259ad..ebab8e2 100644 --- a/cmake/SetupCompilers.cmake +++ b/cmake/SetupCompilers.cmake @@ -6,7 +6,7 @@ enable_language(CXX) include(CMakeDetermineCXXCompiler) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/cmake/SetupDeps.cmake b/cmake/SetupDeps.cmake index cdf169e..d7782b1 100644 --- a/cmake/SetupDeps.cmake +++ b/cmake/SetupDeps.cmake @@ -34,9 +34,8 @@ endif() # Can't play the target games above unless using # cmake 3.20+, so leave this one for now. # JMM: DO NOT SEARCH FOR HDF5 IF WE DON'T NEED IT -# HDF5 WILL SUCK US ALL INTO HELL -if (SPINER_USE_HDF) -find_package(HDF5 COMPONENTS C HL QUIET) +if (SINGULARITY_USE_HDF5) +find_package(HDF5 COMPONENTS C HL) # findpackage doesnt export an interface for HDF5, # so create one @@ -67,10 +66,22 @@ if (HDF5_FOUND) else() message("MPI::MPI_CXX provided by parent package") endif() + else() + message(status "HDF5 is not parallel") endif() +else() + message(STATUS "No HDF5") endif() endif() +# JMM: I'm putting this here, as it depends on what happens with HDF5, +# and I want that to be set AFTER we set all our options, so we don't +# set HDF5 unnecessarily. +cmake_dependent_option(SINGULARITY_USE_MPI + "Link to MPI" + ON "${SINGULARITY_USE_MPI};${HDF5_IS_PARALLEL}" + OFF) + #======================================= # Setup Catch2 # - provides Catch2::Catch2