@@ -33,6 +33,8 @@ production-ready | production-ready | production-ready | production-ready
3333[ PyCasbin] ( https://github.com/casbin/pycasbin ) | [ Casbin.NET] ( https://github.com/casbin-net/Casbin.NET ) | [ Casbin-CPP] ( https://github.com/casbin/casbin-cpp ) | [ Casbin-RS] ( https://github.com/casbin/casbin-rs )
3434production-ready | production-ready | beta-test | production-ready
3535
36+ ** Note** : PyCasbin-on-CPP is available to use. Refer to the [ documentation] ( ./bindings/README.md ) for installation and usage.
37+
3638## Supported models
3739
38401 . [ ** ACL (Access Control List)** ] ( https://en.wikipedia.org/wiki/Access_control_list )
@@ -113,8 +115,10 @@ https://casbin.org/docs/en/tutorials
113115
114116## Integrating Casbin to your project through CMake
115117
116- Here is a [ working project] ( https://github.com/EmperorYP7/casbin-CMake-setup ) to demonstarte how to set up your CMake
117- configurations to integrate casbin.
118+ ### Without installing casbin locally
119+
120+ Here is a [ working project] ( https://github.com/EmperorYP7/casbin-CMake-setup ) to demonstarte how to set up
121+ your CMake configurations to integrate casbin without any prior installations.
118122
119123You may integrate casbin into your CMake project through ` find_package ` . ** It is assumed that you're using CMake >= v3.19.**
120124
@@ -161,6 +165,57 @@ target_include_directories(myexec PRIVATE ${myexec_INCLUDE_DIR})
161165
162166Do remember to include ` casbin_SOURCE_DIR/include ` directory wherever casbin's functions are utilised.
163167
168+ ### With local installation
169+
170+ You may integrate casbin into your CMake project through ` find_package ` .
171+ ** It is assumed that you're using CMake >= v3.19**
172+
173+ 1 . Clone/checkout to [ ` casbin/casbin-cpp:master ` ] ( https://github.com/EmperorYP7/casbin-cpp/tree/ctest-setup )
174+ ``` bash
175+ git clone https://github.com/casbin/casbin-cpp.git
176+ ```
177+
178+ 2. Open terminal/cmd in the root directory of the project:
179+
180+ ` ` ` bash
181+ mkdir build
182+ cd build
183+ cmake ..
184+ ` ` `
185+
186+ ** Note:** Look up for the logs of this step. And add the path indicated by the log into your PATH/project include directory.
187+ The log message you' re looking for should be something like this:
188+ ```bash
189+ [casbin]: Installing casbin ...
190+ [casbin]: Installing casbin ... - The targets can now be imported with find_package(casbin)
191+ [casbin]: Build the "install" target and add "/usr/local/include" to you PATH for casbin to work
192+ ```
193+
194+ 3. After the project is configured successfully, build it:
195+ ```bash
196+ cmake --build . --config Release
197+ ```
198+
199+ 4. Install casbin:
200+
201+ ```bash
202+ cmake --build . --config Release --target install
203+ ```
204+ Now, casbin has been installed and ready to go.
205+
206+ 5. In your project' s CMake file, add
207+ ` ` ` cmake
208+ find_package(casbin REQUIRED)
209+ ` ` `
210+ This will import all the targets exported by casbin to your project
211+
212+ 6. Link against casbin (Refer to Step 2' s **Note** to get the value of `MY_INCLUDE_DIR` for your system):
213+ ```cmake
214+ set(MY_INCLUDE_DIR "/usr/local/include")
215+ target_include_directories(MyTargetName PRIVATE ${MY_INCLUDE_DIR})
216+ target_link_libraries(MyTargetName PRIVATE casbin::casbin)
217+ ```
218+
164219## Installation and Set-Up
165220
166221### Build instructions for all platforms
@@ -194,8 +249,8 @@ Do remember to include `casbin_SOURCE_DIR/include` directory wherever casbin's f
194249 cmake --build . --target install
195250 ```
196251
197- - For ** Windows** , this will install ` casbin.lib` to ` C:/Program Files/casbin-cpp /lib`
198- and the headers to ` C:/Program Files/casbin-cpp /include` .
252+ - For **Windows**, this will install `casbin.lib` to `C:/Program Files/casbin/lib`
253+ and the headers to `C:/Program Files/casbin/include`.
199254 - For Unix based OS i.e. **Linux and macOS**, this will install `casbin.a` to `usr/local/lib`
200255 and the headers to `usr/local/include`.
201256
0 commit comments