-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
42 lines (36 loc) · 1.51 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required(VERSION 3.3)
project(dui VERSION 0.3)
add_definitions(-Wall -pedantic)
find_package(PkgConfig REQUIRED)
# if(PKGCONFIG_FOUND)
pkg_search_module(SDL2 REQUIRED IMPORTED_TARGET SDL2>=2.0.8 sdl2>=2.0.8)
# pkg_search_module(SDL2_gfx REQUIRED IMPORTED_TARGET SDL2_gfx>=1.0.0)
# pkg_search_module(SDL2_image REQUIRED IMPORTED_TARGET SDL2_image>=2.0.0 SDL2_Image>=2.0.0)
add_library(dui INTERFACE)
target_include_directories(dui INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include/dui/)
target_link_libraries(dui INTERFACE PkgConfig::SDL2)
target_compile_features(dui INTERFACE cxx_std_17)
add_executable(elements_demo examples/elements_demo.cpp)
target_link_libraries(elements_demo PRIVATE dui)
add_executable(focus_demo examples/focus_demo.cpp)
target_link_libraries(focus_demo PRIVATE dui)
add_executable(hello_demo examples/hello_demo.cpp)
target_link_libraries(hello_demo PRIVATE dui)
add_executable(scrolling_demo examples/scrolling_demo.cpp)
target_link_libraries(scrolling_demo PRIVATE dui)
add_custom_target(single_header ALL
node ${CMAKE_CURRENT_SOURCE_DIR}/makeSingleHeader.js ${CMAKE_CURRENT_BINARY_DIR}/dui.hpp
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/dui/
COMMENT "Generating single header file"
VERBATIM
)
# Build documentation
find_package(Doxygen)
if(DOXYGEN_FOUND)
add_custom_target(docs
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
endif()