Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 34 additions & 22 deletions cmake/optional.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -325,36 +325,48 @@ else()
endif()

# Check for HDF5 libraries
find_package(HDF5 QUIET COMPONENTS C)
if(HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIR}) # for older versions of cmake
include_directories(${HDF5_INCLUDE_DIRS}) # for newer cmake
message("-- Found HDF5 version: ${HDF5_VERSION}")
if (HDF5_VERSION VERSION_GREATER 1.12 OR HDF5_VERSION VERSION_EQUAL 1.12)
message(" Enforcing API macro mapping to HDF5 version 1.10.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DH5_USE_110_API")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DH5_USE_110_API")
endif()
message(" Found HDF5 libraries: ${HDF5_LIBRARIES}")
if(VERBOSE)
message(STATUS ${HDF5_INCLUDE_DIRS} ${HDF5_INCLUDE_DIR})
option(WITH_HDF5 "Compile with HDF5 enabled" ON)
if(WITH_HDF5)
find_package(HDF5 QUIET COMPONENTS C)
if(HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIR}) # for older versions of cmake
include_directories(${HDF5_INCLUDE_DIRS}) # for newer cmake
message("-- Found HDF5 version: ${HDF5_VERSION}")
if (HDF5_VERSION VERSION_GREATER 1.12 OR HDF5_VERSION VERSION_EQUAL 1.12)
message(" Enforcing API macro mapping to HDF5 version 1.10.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DH5_USE_110_API")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DH5_USE_110_API")
endif()
message(" Found HDF5 libraries: ${HDF5_LIBRARIES}")
if(VERBOSE)
message(STATUS ${HDF5_INCLUDE_DIRS} ${HDF5_INCLUDE_DIR})
endif()
else()
message("${BoldCyan} X No HDF5 C libraries found. Excluding hdf5printer and hdf5reader from GAMBIT configuration.${ColourReset}")
set(itch "${itch}" "hdf5printer" "hdf5reader")
endif()
else()
message("${BoldCyan} X No HDF5 C libraries found. Excluding hdf5printer and hdf5reader from GAMBIT configuration.${ColourReset}")
message("${BoldCyan} X HDF5 is disabled. Excluding hdf5printer and hdf5reader from GAMBIT configuration. Use -DWITH_MPI=ON to enable HDF5. ${ColourReset}")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be Use -DWITH_HDF5=ON to enable HDF5. Simply copy paste error.

set(itch "${itch}" "hdf5printer" "hdf5reader")
endif()

# Check for SQLite libraries
find_package(SQLite3 QUIET COMPONENTS C)
if(SQLite3_FOUND)
include_directories(${SQLite3_INCLUDE_DIRS})
message("-- Found SQLite3 libraries: ${SQLite3_LIBRARIES}")
if(VERBOSE)
message(STATUS ${SQLite3_INCLUDE_DIRS})
option(WITH_SQLite3 "Compile with SQLite3 enabled" ON)
if(WITH_SQLite3)
find_package(SQLite3 QUIET COMPONENTS C)
if(SQLite3_FOUND)
include_directories(${SQLite3_INCLUDE_DIRS})
message("-- Found SQLite3 libraries: ${SQLite3_LIBRARIES}")
if(VERBOSE)
message(STATUS ${SQLite3_INCLUDE_DIRS})
endif()
else()
message("${BoldCyan} X No SQLite C libraries found. Excluding sqliteprinter and sqlitereader from GAMBIT configuration.${ColourReset}")
message(" Backends depending on SQLite3 (e.g. Contur) will be deactivated.")
set(itch "${itch}" "sqliteprinter" "sqlitereader")
endif()
else()
message("${BoldCyan} X No SQLite C libraries found. Excluding sqliteprinter and sqlitereader from GAMBIT configuration.${ColourReset}")
message(" Backends depending on SQLite3 (e.g. Contur) will be deactivated.")
message("${BoldCyan} X SQLite3 is disabled. Excluding sqliteprinter and sqlitereader from GAMBIT configuration. Use -DWITH_SQLite3=ON to enable SQLite3. ${ColourReset}")
set(itch "${itch}" "sqliteprinter" "sqlitereader")
endif()

Expand Down
Loading