summaryrefslogtreecommitdiffstats
path: root/examples/CMakeLists.txt
blob: 53c571dba01248cc74fa3983f1279c19462bc9fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
include(GNUInstallDirs)

find_package(Threads  REQUIRED)

file(GLOB sources_examples *.cpp)
foreach(src ${sources_examples})
  get_filename_component(bin ${src} NAME_WE)
  add_executable(${bin} ${src})
  target_link_libraries(${bin} PRIVATE ${PROJECT_NAME} Threads::Threads)
endforeach()

if(WITH_DOC)
  install(FILES ${sources_examples}
    DESTINATION "${CMAKE_INSTALL_DOCDIR}/${PROJECT_NAME}/examples")
endif()