All other headers are not meant to be included by a client of this library and should be declared in `srcs`.
27 lines
639 B
CMake
27 lines
639 B
CMake
# generate Bazel BUILD file
|
|
|
|
set(PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/../..")
|
|
set(BUILD_FILE "${PROJECT_ROOT}/BUILD.bazel")
|
|
|
|
file(GLOB_RECURSE HEADERS LIST_DIRECTORIES false RELATIVE "${PROJECT_ROOT}" "include/*.hpp")
|
|
list(REMOVE_ITEM HEADERS "include/nlohmann/json.hpp")
|
|
|
|
file(WRITE "${BUILD_FILE}" [=[
|
|
cc_library(
|
|
name = "json",
|
|
srcs = [
|
|
]=])
|
|
|
|
foreach(header ${HEADERS})
|
|
file(APPEND "${BUILD_FILE}" " \"${header}\",\n")
|
|
endforeach()
|
|
|
|
file(APPEND "${BUILD_FILE}" [=[
|
|
],
|
|
hdrs = ["include/nlohmann/json.hpp"],
|
|
includes = ["include"],
|
|
visibility = ["//visibility:public"],
|
|
alwayslink = True,
|
|
)
|
|
]=])
|