Explorar o código

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 %!s(int64=5) %!d(string=hai) anos
pai
achega
3e05ee6d24
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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})