mirror of
https://github.com/pantor/inja.git
synced 2026-02-17 09:03:58 +00:00
Improve support for installing with cget (#88)
* Improve support for installing with cget * add specific version, clean cmake * fix version to "v2.1.0"
This commit is contained in:
@@ -7,8 +7,8 @@ project(inja LANGUAGES CXX VERSION 2.0.0)
|
||||
option(INJA_USE_EMBEDDED_JSON "Use the shipped json header if not available on the system" ON)
|
||||
option(INJA_INSTALL "Generate install targets for inja" ON)
|
||||
option(INJA_EXPORT "Export the current build tree to the package registry" ON)
|
||||
option(BUILD_TESTS "Build the inja unit tests" ON)
|
||||
option(BUILD_BENCHMARK "Build the inja benchmark" ON)
|
||||
option(BUILD_TESTING "Build unit tests" ON)
|
||||
option(BUILD_BENCHMARK "Build benchmark" ON)
|
||||
option(COVERALLS "Generate coveralls data" OFF)
|
||||
|
||||
set(INJA_INSTALL_INCLUDE_DIR "include")
|
||||
@@ -82,7 +82,7 @@ if (COVERALLS)
|
||||
endif()
|
||||
|
||||
|
||||
if(BUILD_TESTS)
|
||||
if(BUILD_TESTING)
|
||||
enable_testing()
|
||||
|
||||
add_executable(inja_test
|
||||
@@ -114,6 +114,7 @@ if(BUILD_BENCHMARK)
|
||||
target_link_libraries(inja_benchmark PRIVATE inja)
|
||||
endif()
|
||||
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
write_basic_package_version_file(
|
||||
@@ -122,6 +123,7 @@ write_basic_package_version_file(
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
|
||||
# build tree package config
|
||||
configure_file(
|
||||
cmake/config/injaBuildConfig.cmake.in
|
||||
@@ -129,14 +131,16 @@ configure_file(
|
||||
@ONLY
|
||||
)
|
||||
|
||||
|
||||
install(TARGETS inja EXPORT injaTargets)
|
||||
|
||||
|
||||
export(
|
||||
EXPORT injaTargets
|
||||
NAMESPACE pantor::
|
||||
FILE "${CMAKE_CURRENT_BINARY_DIR}/injaTargets.cmake"
|
||||
)
|
||||
|
||||
|
||||
# build tree package config
|
||||
configure_file(
|
||||
cmake/config/injaBuildConfig.cmake.in
|
||||
@@ -144,6 +148,7 @@ configure_file(
|
||||
@ONLY
|
||||
)
|
||||
|
||||
|
||||
if (INJA_INSTALL)
|
||||
set(INJA_CONFIG_PATH "lib/cmake/inja")
|
||||
|
||||
@@ -163,7 +168,7 @@ if (INJA_INSTALL)
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${INJA_CONFIG_PATH}/injaConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/injaConfigVersion.cmake"
|
||||
DESTINATION ${INJA_CONFIG_PATH}
|
||||
@@ -176,6 +181,7 @@ if (INJA_INSTALL)
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if (INJA_EXPORT)
|
||||
export(PACKAGE inja)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user