Skip to content

Commit 089bc28

Browse files
authored
fix installing (#9)
1 parent ec9f60f commit 089bc28

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ cmake_build*/
99
install_dir/
1010
compile_commands.json
1111

12-
/cmake/AddBoost.cmake
12+
/cmake/AddBoost.cmake/AddBoost.cmakeConfig.cmake

CMakeLists.txt

+8-13
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,29 @@ cmake_minimum_required(VERSION 3.14...3.22)
44

55
# ---- Project ----
66

7-
# Note: update this to your new project's name and version
8-
project(
9-
AddBoost.cmake
10-
VERSION 3.6
11-
LANGUAGES CXX
12-
)
7+
set(PackageProject.cmake_VERSION 3.6)
138

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

1611
configure_file(
17-
${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost/AddBoostConfig.cmake.in ${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost/AddBoostConfig.cmake
12+
${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost.cmake/AddBoost.cmakeConfig.cmake.in ${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost.cmake/AddBoost.cmakeConfig.cmake
1813
@ONLY
1914
)
2015

21-
include(${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost/AddBoostConfig.cmake)
16+
include(${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost.cmake/AddBoost.cmakeConfig.cmake)
2217

23-
if(${${PROJECT_NAME}_INSTALL})
18+
if(${AddBoost.cmake_INSTALL})
2419
include(GNUInstallDirs)
2520

2621
set(CMAKEDIR
27-
${CMAKE_INSTALL_DATADIR}/cmake
22+
${CMAKE_INSTALL_DATADIR}/cmake/AddBoost.cmake/
2823
CACHE
2924
PATH
30-
"Path to a folder to which install the script AddBoostConfig.cmake . By default: ${CMAKE_INSTALL_DATADIR}/cmake/AddBoostConfig/"
25+
"Path to a folder to which install the script AddBoostConfig.cmake . By default: ${CMAKE_INSTALL_DATADIR}/cmake/AddBoost.cmake/"
3126
)
3227

33-
install(FILES "${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost/AddBoostConfig.cmake" DESTINATION "${CMAKEDIR}")
28+
install(FILES "${CMAKE_CURRENT_LIST_DIR}/cmake/AddBoost.cmake/AddBoost.cmakeConfig.cmake" DESTINATION "${CMAKEDIR}")
3429

35-
message(STATUS "Use `find_package(AddBoost)` to use it")
30+
message(STATUS "Use `find_package(AddBoost.cmake)` to use it")
3631

3732
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 and use `find_package(AddBoost)`
80+
- [x] You can install it as a utility module. Use `AddBoost.cmake_INSTALL` option at configuring and use `find_package(AddBoost.cmake)`
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/

cmake/AddBoost/AddBoostConfig.cmake.in renamed to cmake/AddBoost.cmake/AddBoost.cmakeConfig.cmake.in

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
# ---- Project ----
44

55
# Note: update this to your new project's name and version
6-
project(
7-
@PROJECT_NAME@
8-
VERSION @PROJECT_VERSION@
9-
LANGUAGES CXX
10-
)
6+
7+
set(PackageProject.cmake_VERSION @PackageProject.cmake_VERSION@)
118

129
function(SUBDIRLIST result_var curdir)
1310
file(

0 commit comments

Comments
 (0)