mirror of
https://github.com/pantor/inja.git
synced 2026-10-05 12:00:36 +00:00
Add dependencies and include directories
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ if(HUNTER_ENABLED) # Use Hunter to manage dependencies
|
|||||||
target_link_libraries(inja INTERFACE nlohmann_json)
|
target_link_libraries(inja INTERFACE nlohmann_json)
|
||||||
else()
|
else()
|
||||||
target_include_directories(inja INTERFACE
|
target_include_directories(inja INTERFACE
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/test/thirdparty/json>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/test/thirdparty>
|
||||||
$<INSTALL_INTERFACE:${INJA_HEADER_INSTALL_DIR}>
|
$<INSTALL_INTERFACE:${INJA_HEADER_INSTALL_DIR}>
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
@PACKAGE_INIT@
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
include(CMakeFindDependencyMacro)
|
||||||
|
find_dependency(nlohmann_json CONFIG REQUIRED)
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||||
check_required_components("@PROJECT_NAME@")
|
check_required_components("@PROJECT_NAME@")
|
||||||
+7
-3
@@ -38,14 +38,18 @@ if(HUNTER_ENABLED) # Use Hunter to manage dependencies
|
|||||||
# Add dependencies to target
|
# Add dependencies to target
|
||||||
target_link_libraries(${UNITTEST_TARGET_NAME} Catch::Catch)
|
target_link_libraries(${UNITTEST_TARGET_NAME} Catch::Catch)
|
||||||
target_link_libraries(${UNITTEST_TARGET_NAME} nlohmann_json)
|
target_link_libraries(${UNITTEST_TARGET_NAME} nlohmann_json)
|
||||||
|
target_link_libraries(${UNITTEST_TARGET_NAME} inja)
|
||||||
else() # Manage dependencies manually
|
else() # Manage dependencies manually
|
||||||
# Prepare "Catch" library for other executables
|
# Prepare "Catch" library for other executables
|
||||||
set(CATCH_INCLUDE_DIR "thirdparty/catch")
|
|
||||||
add_library(Catch INTERFACE)
|
add_library(Catch INTERFACE)
|
||||||
target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
|
target_include_directories(Catch INTERFACE "thirdparty/catch")
|
||||||
|
# Prepare "JSON" library for other executables
|
||||||
|
add_library(JSON INTERFACE)
|
||||||
|
target_include_directories(JSON INTERFACE "thirdparty")
|
||||||
# Add dependencies to target
|
# Add dependencies to target
|
||||||
target_link_libraries(${UNITTEST_TARGET_NAME} Catch)
|
target_link_libraries(${UNITTEST_TARGET_NAME} Catch)
|
||||||
target_include_directories(${UNITTEST_TARGET_NAME} PRIVATE "../src" "thirdparty/json")
|
target_link_libraries(${UNITTEST_TARGET_NAME} JSON)
|
||||||
|
target_link_libraries(${UNITTEST_TARGET_NAME} inja)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|||||||
Reference in New Issue
Block a user