Add install target for 'extra-files'
So additional files like tests/calculateoverallcoverage.awk and coding-style.clang-format are installed and can be used by other projects, too.
This commit is contained in:
parent
37a8b78689
commit
28f76db46e
|
@ -94,7 +94,8 @@ set(CMAKE_TEMPLATE_FILES
|
|||
cmake/templates/global.h.in
|
||||
cmake/templates/template.pc.in
|
||||
)
|
||||
set(SCRIPT_FILES)
|
||||
set(SCRIPT_FILES
|
||||
)
|
||||
if(MINGW)
|
||||
list(APPEND CMAKE_TEMPLATE_FILES
|
||||
cmake/templates/windows.rc.in
|
||||
|
@ -109,6 +110,10 @@ set(DOC_FILES
|
|||
doc/buildvariables.md
|
||||
doc/testapplication.md
|
||||
)
|
||||
set(EXTRA_FILES
|
||||
tests/calculateoverallcoverage.awk
|
||||
coding-style.clang-format
|
||||
)
|
||||
|
||||
# required to include CMake modules from own project directory
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" "${CMAKE_MODULE_PATH}")
|
||||
|
|
|
@ -252,4 +252,19 @@ if(CLANG_SOURCE_BASED_COVERAGE_ENABLED)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# add install target for extra files
|
||||
foreach(EXTRA_FILE ${EXTRA_FILES})
|
||||
get_filename_component(EXTRA_DIR ${EXTRA_FILE} DIRECTORY)
|
||||
install(
|
||||
FILES ${EXTRA_FILE}
|
||||
DESTINATION "share/${META_PROJECT_NAME}/${EXTRA_DIR}"
|
||||
COMPONENT extra-files
|
||||
)
|
||||
endforeach()
|
||||
if(NOT TARGET install-extra-files)
|
||||
add_custom_target(install-extra-files
|
||||
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=extra-files -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(BASIC_PROJECT_CONFIG_DONE YES)
|
||||
|
|
Loading…
Reference in New Issue