Browse Source

Using find_package for libraries

pthread seems to be needed on my setup but I think it depends so I left
it as optional.
I set boost to be required and forced a minimum version of 1.67 so we can
develop on top of the same library version.
anon 5 years ago
parent
commit
3e05ee6d24
1 changed files with 5 additions and 1 deletions
  1. 5 1
      daemon/CMakeLists.txt

+ 5 - 1
daemon/CMakeLists.txt

@@ -6,4 +6,8 @@ project(ccats)
 
 add_executable(ccats src/main.cpp)
 
-target_link_libraries(ccats PRIVATE -lboost_system)
+find_package(Threads)
+find_package(Boost 1.67 REQUIRED COMPONENTS system)
+
+include_directories(${Boost_INCLUDE_DIR})
+target_link_libraries(ccats PRIVATE ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES})