-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
72 lines (60 loc) · 1.81 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
cmake_minimum_required(VERSION 3.21.0)
project(Apyre VERSION 0.1.0)
find_package(SDL2 REQUIRED)
set(APYRE_SOURCES
#Headers:
src/apyre/config.hpp
src/apyre/application.hpp
src/apyre/monitor.hpp
src/apyre/inputs.hpp
src/apyre/window.hpp
src/apyre/event.hpp
src/apyre/messagebox.hpp
src/apyre/power.hpp
#Sources:
src/apyre/application.cpp
src/apyre/inputs.cpp
src/apyre/window.cpp
src/apyre/event.cpp
src/apyre/messagebox.cpp
src/apyre/power.cpp
)
if(CPT_BUILD_APYRE_STATIC)
add_library(Apyre STATIC ${APYRE_SOURCES})
target_compile_definitions(Apyre PUBLIC APYRE_STATIC_BUILD)
set_target_properties(Apyre PROPERTIES POSITION_INDEPENDENT_CODE ON)
else()
add_library(Apyre SHARED ${APYRE_SOURCES})
target_compile_definitions(Apyre PUBLIC APYRE_SHARED_BUILD)
endif()
set_target_properties(Apyre PROPERTIES PREFIX "" OUTPUT_NAME "apyre")
target_compile_definitions(Apyre
PUBLIC
APYRE_MAJOR_VERSION=${PROJECT_VERSION_MAJOR}
APYRE_MINOR_VERSION=${PROJECT_VERSION_MINOR}
APYRE_PATCH_VERSION=${PROJECT_VERSION_PATCH}
)
target_include_directories(Apyre
INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include/apyre>
)
target_link_libraries(Apyre
PRIVATE
SDL2::SDL2main
SDL2::SDL2-static
PUBLIC
CaptalFoundation
)
if(WIN32)
target_sources(Apyre PRIVATE src/apyre/resources.rc)
target_link_libraries(Apyre PRIVATE dwmapi)
target_compile_definitions(Apyre PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
endif()
if(CPT_BUILD_APYRE_EXAMPLES)
add_executable(ApyreTest "main.cpp")
target_link_libraries(ApyreTest PRIVATE Apyre)
endif()
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/apyre
DESTINATION include
FILES_MATCHING PATTERN *.hpp)