Add CMake configuration file and export installed targets

This commit is contained in:
Alexander Damian
2019-06-27 17:37:33 -04:00
parent 07b3c4957d
commit d20cab69f3
12 changed files with 213 additions and 78 deletions

View File

@@ -1,6 +1,5 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include/)
include_directories(SYSTEM ${CATCH_INCLUDE})
include_directories(SYSTEM ${RDKAFKA_INCLUDE_DIR})
set(KAFKA_TEST_INSTANCE "kafka-vm:9092"
CACHE STRING "The kafka instance to which to connect to run tests")
@@ -24,6 +23,8 @@ add_executable(cppkafka_tests
# Main file
test_main.cpp
)
target_link_libraries(cppkafka_tests cppkafka ${RDKAFKA_LIBRARY} pthread rt ssl crypto dl z)
# In CMake >= 3.15 Boost::boost == Boost::headers
target_link_libraries(cppkafka_tests cppkafka ${RdKafka_DEPENDENCIES} Boost::boost Boost::program_options )
add_dependencies(tests cppkafka_tests)
add_test(cppkafka cppkafka_tests)