hsluoyz commented on issue #217:
URL: https://github.com/apache/casbin-cpp/issues/217#issuecomment-5207497805

   @shishirong 
   
   Fixed in 
[[d8d4ef8](https://github.com/casbin/casbin-cpp/commit/d8d4ef892206ad4c4f9a7bdd263d57c882ce8246)](https://github.com/casbin/casbin-cpp/commit/d8d4ef892206ad4c4f9a7bdd263d57c882ce8246).
   
   @BillyONeal @ex-purple were right: `install()` only ever covered the 
headers, and the CMake config went to the User Package Registry via 
`export(PACKAGE)` instead of the install prefix — so a packaged casbin had 
nothing to link against. The library is now installed to `lib/`, the headers to 
`include/casbin/`, and `casbinConfig.cmake` / `casbinTargets.cmake` to 
`lib/cmake/casbin/`, so `find_package(casbin)` + `target_link_libraries(... 
casbin::casbin)` works against any install prefix. `nlohmann_json` is now 
picked up from the system when available rather than always vendored via 
`FetchContent`, so a port won't bundle its own copy.
   
   Verified end-to-end: install to a custom prefix, then consume it from a 
separate project via `find_package` (compiles, links, and enforces correctly). 
Someone should be able to write a working `portfile.cmake` on top of this now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to