Explorar el 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 hace 5 años
padre
commit
3e05ee6d24
Se han modificado 1 ficheros con 5 adiciones y 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})