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
6 changes: 4 additions & 2 deletions tooling/internal/cpp/cmake.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,29 @@ find_package(xtensor ${XTENSOR_MINIMUM_VERSION} REQUIRED)
if options.GenerateHDF5 {
fmt.Fprintf(w, `
option(%s_USE_HDF5 "Whether to use HDF5 in the generated code" ON)
set(%s_USE_HDF5 ${%s_USE_HDF5} PARENT_SCOPE)
if(%s_USE_HDF5)
set(HDF5_MINIMUM_VERSION "1.10.5")
find_package(HDF5 ${HDF5_MINIMUM_VERSION} REQUIRED COMPONENTS CXX)

list(APPEND %s_SOURCES hdf5/protocols.cc)
list(APPEND %s_LINK_LIBRARIES HDF5::HDF5)
endif()
`, cmakePrefix, cmakePrefix, cmakePrefix, cmakePrefix)
`, cmakePrefix, cmakePrefix, cmakePrefix, cmakePrefix, cmakePrefix, cmakePrefix)
}

if options.GenerateNDJson {
fmt.Fprintf(w, `
option(%s_USE_NDJSON "Whether to use NDJSON in the generated code" ON)
set(%s_USE_NDJSON ${%s_USE_NDJSON} PARENT_SCOPE)
if(%s_USE_NDJSON)
set(NLOHMANN_JSON_MINIMUM_VERSION "3.11.1")
find_package(nlohmann_json ${NLOHMANN_JSON_MINIMUM_VERSION} REQUIRED)

list(APPEND %s_SOURCES ndjson/protocols.cc)
list(APPEND %s_LINK_LIBRARIES nlohmann_json::nlohmann_json)
endif()
`, cmakePrefix, cmakePrefix, cmakePrefix, cmakePrefix)
`, cmakePrefix, cmakePrefix, cmakePrefix, cmakePrefix, cmakePrefix, cmakePrefix)
}

w.WriteStringln("")
Expand Down