File tree Expand file tree Collapse file tree 4 files changed +13
-7
lines changed
Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ Extra utilities for cmake:
99
1010These utilities can be included using both ` find_package() ` and ` ExternalProject ` , e.g. if ` CMakeExtraUtils ` is already
1111installed on your system:
12+
1213``` cmake
1314cmake_minimum_required(VERSION 3.25)
1415
@@ -22,6 +23,7 @@ project(MyProject
2223```
2324
2425or if you want to download a specific version:
26+
2527``` cmake
2628cmake_minimum_required(VERSION 3.25)
2729
@@ -40,8 +42,8 @@ project(MyProject
4042## TODO for v1.0
4143
4244- [ ] Add Github actions:
43- - [ ] Documentation
44- - [ ] Test
45- - [ ] Release
45+ - [ ] Documentation
46+ - [ ] Test
47+ - [ ] Release
4648- [ ] Add simple pre-commit and ` pyproject.toml ` environment
4749- [x] Fix ` DynamicVersion ` to work with buildable projects
Original file line number Diff line number Diff line change @@ -25,5 +25,5 @@ add_dependencies(version_lib My_Project_Version)
2525# Rebuild `version.cpp` whenever the version changes
2626# `.version` is automatically generated
2727set_property(SOURCE version.cpp.in APPEND PROPERTY
28- OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.version)
29- ```
28+ OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.version)
29+ ```
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Export and import targets as individual components. Special components `shared`
55## Example
66
77The main ` CMakeLists.txt ` that exports the target:
8+
89``` cmake
910cmake_minimum_required(VERSION 3.25)
1011
@@ -33,7 +34,9 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/My_ProjectConfigVersion.cmake
3334 # /path/to/PackageComps.cmake
3435 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/My_Project)
3536```
37+
3638with ` My_ProjectConfig.cmake.in `
39+
3740``` cmake
3841find_package(CMakeExtraUtils REQUIRED)
3942include(PackageComps)
@@ -43,10 +46,11 @@ find_components(COMPONENTS my_component)
4346```
4447
4548The user will then be able to use:
49+
4650``` cmake
4751cmake_minimum_required(VERSION 3.25)
4852
4953project(Downstream_Project)
5054
5155find_package(My_Project COMPONENTS my_component)
52- ```
56+ ```
Original file line number Diff line number Diff line change 55 name :
66 - cmake
77 - tmt
8- become : true
8+ become : true
You can’t perform that action at this time.
0 commit comments