From 22ab01b5a25ad5cccd52200a6d2b01fb20cf9c1b Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 26 Feb 2020 13:38:18 +0100 Subject: [PATCH] Dont include tests in conan package. --- CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c73171..e73079d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,16 +9,21 @@ add_library(Arbutils SHARED ${SRC_FILES}) set_target_properties(Arbutils PROPERTIES LINKER_LANGUAGE CXX) file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp") -add_executable(ArbutilsTests ${TEST_FILES} extern/catch.hpp) - -target_link_libraries(ArbutilsTests Arbutils) +if (NOT DEFINED CONAN_EXPORTED) + add_executable(ArbutilsTests ${TEST_FILES} extern/catch.hpp) + target_link_libraries(ArbutilsTests Arbutils) +endif() if (WINDOWS) MESSAGE(WARNING, "Using Windows Build.") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -Wa,-mbig-obj -Wl,-allow-multiple-definition") # Statically link libraries we need in Windows. target_link_libraries(Arbutils -static -static-libgcc -static-libstdc++) - target_link_libraries(ArbutilsTests -static -static-libgcc -static-libstdc++) + if (NOT DEFINED CONAN_EXPORTED) + target_link_libraries(ArbutilsTests -static -static-libgcc -static-libstdc++) + endif() endif (WINDOWS) -target_compile_definitions(ArbutilsTests PRIVATE TESTS_BUILD) +if (NOT DEFINED CONAN_EXPORTED) + target_compile_definitions(ArbutilsTests PRIVATE TESTS_BUILD) +endif()