Skip to content

Commit

Permalink
cmake: private include nlohmann-json / install path = lib
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Dec 8, 2024
1 parent 1aab745 commit 570af0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hello_imgui_cmake/hello_imgui_build_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ function(him_install_imgui)
return()
endif()

install(TARGETS imgui DESTINATION ./lib/)
install(TARGETS imgui DESTINATION lib)
file(GLOB imgui_headers
${HELLOIMGUI_IMGUI_SOURCE_DIR}/*.h
${HELLOIMGUI_IMGUI_SOURCE_DIR}/misc/cpp/*.h
Expand Down Expand Up @@ -1192,15 +1192,15 @@ function(him_add_nlohmann_json)
find_package(nlohmann_json CONFIG QUIET)
if(nlohmann_json_FOUND)
message(STATUS "HelloImGui: using nlohmann_json from find_package(nlohmann_json)")
target_link_libraries(${HELLOIMGUI_TARGET} PUBLIC nlohmann_json::nlohmann_json)
target_link_libraries(${HELLOIMGUI_TARGET} PRIVATE nlohmann_json::nlohmann_json)
set(HELLOIMGUI_NLOHMANN_JSON_SELECTED_INFO "Found via find_package(nlohmann_json)" CACHE INTERNAL "" FORCE)
else()
message(STATUS "HelloImGui: using nlohmann_json from external/nlohmann_json")
set(nlohmann_json_dir ${HELLOIMGUI_BASEPATH}/external/nlohmann_json)
add_library(nlohmann_json INTERFACE)
target_include_directories(nlohmann_json INTERFACE $<BUILD_INTERFACE:${nlohmann_json_dir}>)
# target_compile_definitions(nlohmann_json INTERFACE NLOHMANN_JSON_NOEXCEPTION)
target_link_libraries(${HELLOIMGUI_TARGET} PUBLIC nlohmann_json)
target_link_libraries(${HELLOIMGUI_TARGET} PRIVATE nlohmann_json)
set(HELLOIMGUI_NLOHMANN_JSON_SELECTED_INFO "Using external/nlohmann_json" CACHE INTERNAL "" FORCE)

him_add_installable_dependency(nlohmann_json)
Expand Down

0 comments on commit 570af0f

Please sign in to comment.