Skip to content

Commit ae278e7

Browse files
committed
Merge branch 'main' of https://github.com/kfrlib/kfr
2 parents 4be0578 + 4aa89ac commit ae278e7

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ option(KFR_EXTENDED_TESTS "Extended tests (up to hour)" OFF)
228228
option(KFR_SKIP_TESTS "Build tests but don't run tests" OFF)
229229
option(KFR_ENABLE_CAPI_BUILD "Enable KFR C API building" OFF)
230230
option(KFR_INSTALL_HEADERS "Include headers in installation" ON)
231+
option(KFR_INSTALL_LICENSE "Include LICENSE and README in installation" ON)
231232
option(KFR_INSTALL_LIBRARIES "Include libraries in installation" ON)
232233
option(KFR_MANAGED_ALLOCATION
233234
"Use KFR managed memory (copy-free aligned reallocation, ref counting)"
@@ -552,9 +553,13 @@ if (KFR_INSTALL_HEADERS)
552553
RENAME config.h)
553554
endif ()
554555

555-
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt
556-
${CMAKE_CURRENT_SOURCE_DIR}/README.md
557-
DESTINATION .)
556+
include(GNUInstallDirs)
557+
558+
if (KFR_INSTALL_LICENSE)
559+
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt
560+
${CMAKE_CURRENT_SOURCE_DIR}/README.md
561+
DESTINATION ${CMAKE_INSTALL_DOCDIR})
562+
endif ()
558563

559564
# uninstall target
560565
if (NOT TARGET uninstall)
@@ -569,7 +574,6 @@ if (NOT TARGET uninstall)
569574
${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake)
570575
endif ()
571576

572-
include(GNUInstallDirs)
573577
include(CMakePackageConfigHelpers)
574578

575579
write_basic_package_version_file(

‎docs/docs/advanced/configuration.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ or `OFF` during configuration, for example
133133
| `ENABLE_TESTS` | `OFF` | Add the KFR test suite to the build. |
134134
| `ENABLE_EXAMPLES` | `ON` when tests are enabled; otherwise `OFF` | Build the examples and tools. This is a dependent option controlled by `ENABLE_TESTS`. |
135135
| `KFR_INSTALL_HEADERS` | `ON` | Install public headers and the generated `kfr/config.h`. |
136+
| `KFR_INSTALL_LICENSE` | `ON` | Install `LICENSE.txt` and `README.md` to `CMAKE_INSTALL_DOCDIR`. |
136137
| `KFR_INSTALL_LIBRARIES` | `ON` | Install the enabled compiled module libraries. |
137138
| `KFR_DEBUG_INSTALL_SUFFIX` | `/debug` | Installation subdirectory suffix for Debug libraries. |
138139
| `KFR_INSTALL_CMAKEDIR` | `lib/cmake/kfr` | Installation directory for `KFRConfig.cmake` and exported targets. |

0 commit comments

Comments
 (0)