CMakeLists.txt 764 B

12345678910111213141516171819202122232425
  1. cmake_minimum_required(VERSION 3.1)
  2. project(file-change-observer LANGUAGES CXX)
  3. set(CMAKE_CXX_STANDARD 17)
  4. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  5. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Os -Wall -Wextra")
  6. set(Boost_USE_STATIC_LIBS OFF)
  7. set(Boost_USE_MULTITHREADED ON)
  8. set(Boost_USE_STATIC_RUNTIME OFF)
  9. find_package(Boost REQUIRED COMPONENTS filesystem program_options)
  10. if(Boost_FOUND)
  11. file(GLOB SRC_PATH src/*.cpp)
  12. file(GLOB INC_PATH include/*.h)
  13. add_executable(${PROJECT_NAME} ${SRC_PATH} ${INC_PATH})
  14. if(WIN32)
  15. target_link_libraries(${PROJECT_NAME} Boost::filesystem Boost::program_options ws2_32)
  16. elseif(UNIX)
  17. target_link_libraries(${PROJECT_NAME} Boost::filesystem Boost::program_options pthread)
  18. endif()
  19. endif()