Linking with Conan targets only when they exists (resolves #98)

This commit is contained in:
Mateusz Pusz
2020-05-08 11:56:07 +02:00
parent 2f6ecb113a
commit d18480879d
4 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ function(add_metabench_test target name erb_path range)
target_compile_features(${target} PUBLIC cxx_std_20)
target_link_libraries(${target}
PUBLIC
CONAN_PKG::range-v3
$<IF:$<TARGET_EXISTS:CONAN_PKG::range-v3>, CONAN_PKG::range-v3, range-v3::range-v3>
)
target_compile_options(${target}
PUBLIC
+1 -1
View File
@@ -33,7 +33,7 @@ add_executable(unit_tests_runtime
target_link_libraries(unit_tests_runtime
PRIVATE
mp::units
CONAN_PKG::Catch2
$<IF:$<TARGET_EXISTS:CONAN_PKG::Catch2>, CONAN_PKG::Catch2, Catch2::Catch2>
)
include(lib/cmake/Catch2/Catch)