Skip to content

Commit 9c66c01

Browse files
committed
Support sudo make install
1 parent ec593ec commit 9c66c01

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

cpp/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ $ make -j 16
5858
> Please check your cmake version via `cmake --version`.
5959
> If it is lower than 3.20, it is automatically updated by `scripts/install_latest_cmake.bash` (see [here](https://github.com/url-kaist/patchwork-plusplus/blob/master/cpp/CMakeLists.txt#L31)).
6060
61+
### sudo make install
62+
63+
Interestingly, our repository also supports `sudo make install`.
64+
After the build, go to `cpp/build` directory and then just run
65+
66+
```commandline
67+
sudo make install
68+
```
69+
70+
Consequently, our Patchwork++ is installed in your local environment.
71+
An example of finding the `patchworkpp` package in another package is also provided in [example_of_find_package](https://github.com/url-kaist/patchwork-plusplus/tree/master/cpp/example_of_find_package)
72+
73+
6174
## :runner: To run the demo codes
6275
> There are some example codes for your convenience!
6376
> Please try using Patchwork++ to segment ground points in a 3D point cloud :smiley:

cpp/patchworkpp/CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,24 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
2222
)
2323
install(TARGETS ${TARGET_NAME}
2424
EXPORT ${PARENT_PROJECT_NAME}Config
25-
LIBRARY DESTINATION lib
25+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
26+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
2627
)
2728

2829
export(TARGETS ${TARGET_NAME}
2930
NAMESPACE ${PARENT_PROJECT_NAME}::
3031
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PARENT_PROJECT_NAME}Config.cmake"
3132
)
33+
34+
# To install patchworkppConfig.cmake
3235
install(EXPORT ${PARENT_PROJECT_NAME}Config
33-
DESTINATION "${CMAKE_INSTALL_DATADIR}/${PARENT_PROJECT_NAME}/cmake"
36+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PARENT_PROJECT_NAME}"
3437
NAMESPACE ${PARENT_PROJECT_NAME}::
38+
)
39+
40+
# To install patchworkppTargets.cmake
41+
install(EXPORT ${PARENT_PROJECT_NAME}Config
42+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PARENT_PROJECT_NAME}
43+
NAMESPACE ${PARENT_PROJECT_NAME}::
44+
FILE ${PARENT_PROJECT_NAME}Targets.cmake
3545
)

0 commit comments

Comments
 (0)