Skip to content

Commit ec9f60f

Browse files
authored
Make it really installable and usable via find_package (#8)
1 parent 168f40e commit ec9f60f

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CMakeLists.txt

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ cmake_minimum_required(VERSION 3.14...3.22)
77
# Note: update this to your new project's name and version
88
project(
99
AddBoost.cmake
10-
VERSION 3.5
10+
VERSION 3.6
1111
LANGUAGES CXX
1212
)
1313

1414
option(${PROJECT_NAME}_INSTALL "Install the script at local system?" NO)
1515

1616
configure_file(
17-
${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost.cmake.in ${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost.cmake
17+
${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost/AddBoostConfig.cmake.in ${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost/AddBoostConfig.cmake
1818
@ONLY
1919
)
2020

21-
include(${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost.cmake)
21+
include(${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost/AddBoostConfig.cmake)
2222

2323
if(${${PROJECT_NAME}_INSTALL})
2424
include(GNUInstallDirs)
@@ -27,9 +27,11 @@ if(${${PROJECT_NAME}_INSTALL})
2727
${CMAKE_INSTALL_DATADIR}/cmake
2828
CACHE
2929
PATH
30-
"Path to a folder to which install the script ArniiiiiAddBoost.cmake . By default: ${CMAKE_INSTALL_DATADIR}/cmake/"
30+
"Path to a folder to which install the script AddBoostConfig.cmake . By default: ${CMAKE_INSTALL_DATADIR}/cmake/AddBoostConfig/"
3131
)
3232

33-
install(FILES "${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost.cmake" DESTINATION "${CMAKEDIR}")
33+
install(FILES "${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost/AddBoostConfig.cmake" DESTINATION "${CMAKEDIR}")
34+
35+
message(STATUS "Use `find_package(AddBoost)` to use it")
3436

3537
endif()

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ packageProject(
7777
- [x] You can link Boost libs automagically to multiple targets just by adding them to the end of the `add_boost(...)` macro.
7878
- [x] You can use `ADDBOOSTCMAKE_LINK_TYPE` to override default behaviour of linking: if target is INTERFACE, use INTERFACE, if else: PUBLIC
7979
- [ ] Internally, this uses my fork of CPM with better logging handling. Waiting until PRs for CPM are going to be reviewed...
80-
- [x] You can install it as a utility module. Use `AddBoost.cmake_INSTALL` option at configuring.
80+
- [x] You can install it as a utility module. Use `AddBoost.cmake_INSTALL` option at configuring and use `find_package(AddBoost)`
8181
- [x] You can apply your patches to Boost. Before calling the ~~function~~ macro `add_boost(...)`, define variable `BOOST_ADD_MY_PATCHES` to be a path to folder in which there's `*.patch` in such layout:
8282
```
8383
patches/
File renamed without changes.

0 commit comments

Comments
 (0)