File: private-find-boost-json.cmake

package info (click to toggle)
scitokens-cpp 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,988 kB
  • sloc: cpp: 25,363; makefile: 14
file content (16 lines) | stat: -rw-r--r-- 833 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
if(TARGET boost_json)
  return()
endif()

unset(BOOSTJSON_INCLUDE_DIR CACHE)
find_path(BOOSTJSON_INCLUDE_DIR "boost/json.hpp" "boost/json/src.hpp")
if(EXISTS "${BOOSTJSON_INCLUDE_DIR}/boost/json.hpp")
  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/private-boost-json.cpp.in" "#include <boost/json/src.hpp>")
  configure_file("${CMAKE_CURRENT_BINARY_DIR}/private-boost-json.cpp.in" private-boost-json.cpp COPYONLY)
  add_library(boost_json "${BOOSTJSON_INCLUDE_DIR}/boost/json.hpp"
                         "${BOOSTJSON_INCLUDE_DIR}/boost/json/src.hpp"
                         "${CMAKE_CURRENT_BINARY_DIR}/private-boost-json.cpp")
  target_include_directories(boost_json PUBLIC ${BOOSTJSON_INCLUDE_DIR})
  target_compile_definitions(boost_json PUBLIC BOOST_JSON_STANDALONE)
  target_compile_features(boost_json PUBLIC cxx_std_17)
endif()