Conditionally include hunter gate

This commit is contained in:
Jorrit Wronski
2017-11-15 13:23:37 +01:00
parent b7ce13bf7e
commit cea75e7f6a
2 changed files with 18 additions and 14 deletions

View File

@@ -9,11 +9,13 @@ option(BUILD_UNIT_TESTS "Build the unit tests" ON)
## HUNTER
##
option(HUNTER_ENABLED "Use hunter to manage dependencies" OFF)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.19.156.tar.gz"
SHA1 "8d5e4635b137365e0d1ade4d60accf4e2bb41f0d"
)
if(HUNTER_ENABLED)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.19.156.tar.gz"
SHA1 "8d5e4635b137365e0d1ade4d60accf4e2bb41f0d"
)
endif()
##
## PROJECT
@@ -55,10 +57,10 @@ if(HUNTER_ENABLED) # Use Hunter to manage dependencies
# Add dependencies to target
target_link_libraries(inja INTERFACE nlohmann_json)
else()
#target_include_directories(inja INTERFACE
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/test/thirdparty/json>
# $<INSTALL_INTERFACE:${INJA_HEADER_INSTALL_DIR}>
#)
target_include_directories(inja INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/test/thirdparty/json>
$<INSTALL_INTERFACE:${INJA_HEADER_INSTALL_DIR}>
)
endif()
##

View File

@@ -4,11 +4,13 @@ cmake_minimum_required(VERSION 3.1)
## HUNTER
##
option(HUNTER_ENABLED "Use hunter to manage dependencies" OFF)
include("../cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.19.156.tar.gz"
SHA1 "8d5e4635b137365e0d1ade4d60accf4e2bb41f0d"
)
if(HUNTER_ENABLED)
include("../cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.19.156.tar.gz"
SHA1 "8d5e4635b137365e0d1ade4d60accf4e2bb41f0d"
)
endif()
##
## PROJECT