Improve build system a bit

This commit is contained in:
Matias Fontanini
2016-06-14 21:03:07 -07:00
parent 387438fc74
commit 74eb74785d
3 changed files with 41 additions and 27 deletions

View File

@@ -1,8 +1,13 @@
find_package(Boost REQUIRED COMPONENTS program_options)
find_package(Boost COMPONENTS program_options)
link_libraries(${Boost_LIBRARIES} cppkafka ${RDKAFKA_LIBRARY} ${ZOOKEEPER_LIBRARY})
if (Boost_PROGRAM_OPTIONS_FOUND)
link_libraries(${Boost_LIBRARIES} cppkafka ${RDKAFKA_LIBRARY} ${ZOOKEEPER_LIBRARY})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include)
add_executable(kafka_producer kafka_producer.cpp)
add_executable(kafka_consumer kafka_consumer.cpp)
add_executable(kafka_producer kafka_producer.cpp)
add_executable(kafka_consumer kafka_consumer.cpp)
add_custom_target(examples DEPENDS kafka_producer kafka_consumer)
else()
message(STATUS "Disabling examples since boost.program_options was not found")
endif()