feat: add vcpkg support with proper CMake package config by Copilot · Pull Request #265 · apache/casbin-cpp · GitHub
Skip to content
Open
Show file tree
Hide file tree
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: 48 additions & 8 deletions CMakeLists.txt
8 changes: 6 additions & 2 deletions casbin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ set(CMAKE_CXX_STANDARD 17)
add_library(casbin STATIC ${CASBIN_SOURCE_FILES})

target_precompile_headers(casbin PRIVATE ${CASBIN_INCLUDE_DIR}/casbin/pch.h)
target_include_directories(casbin PRIVATE ${CASBIN_INCLUDE_DIR})
target_link_libraries(casbin PRIVATE nlohmann_json::nlohmann_json)
target_include_directories(casbin
PUBLIC
$<BUILD_INTERFACE:${CASBIN_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(casbin PUBLIC nlohmann_json::nlohmann_json)

set_target_properties(casbin PROPERTIES
PREFIX ""
Expand Down
25 changes: 25 additions & 0 deletions cmake/casbinConfig.cmake.in