Mercurial > minori
annotate dep/animia/CMakeLists.txt @ 156:cdf79282d647
dep/animia: add VERY early x11 window stuff
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 15 Nov 2023 18:04:04 -0500 |
parents | d2bbb5773616 |
children | 80d6b28eb29f |
rev | line source |
---|---|
56
6ff7aabeb9d7
deps: add animia for open files detection
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
1 cmake_minimum_required(VERSION 3.9) |
155
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
2 project(animia LANGUAGES CXX) |
56
6ff7aabeb9d7
deps: add animia for open files detection
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
3 set(SRC_FILES |
137
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
4 # any non-platform-specific files go here |
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
5 src/animia.cc |
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
6 src/player.cc |
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
7 src/util.cc |
138
28842a8d0c6b
dep/animia: huge refactor (again...)
Paper <mrpapersonic@gmail.com>
parents:
137
diff
changeset
|
8 src/strategist.cc |
146
d8a61e7e2a36
dep/animia: move fd stuff to a new fd.cc, don't force the user
Paper <mrpapersonic@gmail.com>
parents:
139
diff
changeset
|
9 src/fd.cc |
152
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
10 src/win.cc |
56
6ff7aabeb9d7
deps: add animia for open files detection
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
11 ) |
139
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
12 |
155
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
13 set(LIBRARIES) |
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
14 |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
15 set(INCLUDE_DIRS |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
16 include |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
17 ) |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
18 |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
19 set(DEFINES) |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
20 |
154 | 21 # FD |
56
6ff7aabeb9d7
deps: add animia for open files detection
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
22 if(LINUX) |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
23 list(APPEND DEFINES LINUX) |
137
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
24 list(APPEND SRC_FILES |
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
25 # linux |
138
28842a8d0c6b
dep/animia: huge refactor (again...)
Paper <mrpapersonic@gmail.com>
parents:
137
diff
changeset
|
26 src/fd/linux.cc |
137
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
27 ) |
154 | 28 elseif(APPLE) # this won't run on Linux |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
29 list(APPEND DEFINES MACOSX) |
137
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
30 list(APPEND SRC_FILES |
153
bd439dd6ffc5
*: make win stuff actually work, rename bsd.cc to xnu.cc
Paper <mrpapersonic@gmail.com>
parents:
152
diff
changeset
|
31 # xnu stuff |
bd439dd6ffc5
*: make win stuff actually work, rename bsd.cc to xnu.cc
Paper <mrpapersonic@gmail.com>
parents:
152
diff
changeset
|
32 src/fd/xnu.cc |
137
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
33 ) |
56
6ff7aabeb9d7
deps: add animia for open files detection
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
34 elseif(WIN32) |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
35 list(APPEND DEFINES WIN32) |
137
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
36 list(APPEND SRC_FILES |
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
37 # win32 |
138
28842a8d0c6b
dep/animia: huge refactor (again...)
Paper <mrpapersonic@gmail.com>
parents:
137
diff
changeset
|
38 src/fd/win32.cc |
137
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
39 ) |
56
6ff7aabeb9d7
deps: add animia for open files detection
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
40 endif() |
139
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
41 |
154 | 42 # Windows |
152
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
43 if(WIN32) |
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
44 list(APPEND SRC_FILES |
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
45 src/win/win32.cc |
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
46 src/util/win32.cc |
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
47 ) |
155
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
48 elseif(APPLE) |
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
49 enable_language(OBJCXX) |
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
50 list(APPEND SRC_FILES |
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
51 src/win/quartz.mm |
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
52 ) |
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
53 find_library(FOUNDATION_LIBRARY Foundation) |
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
54 find_library(COREGRAPHICS_LIBRARY CoreGraphics) |
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
55 find_library(APPKIT_LIBRARY AppKit) |
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
56 list(APPEND LIBRARIES ${FOUNDATION_LIBRARY} ${COREGRAPHICS_LIBRARY} ${APPKIT_LIBRARY}) |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
57 else() |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
58 find_package(X11::X11) |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
59 if (X11_FOUND) |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
60 list(APPEND DEFINES X11) |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
61 list(APPEND SRC_FILES |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
62 src/win/x11.cc |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
63 ) |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
64 list(APPEND INCLUDE_DIRS |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
65 ${X11_INCLUDE_DIR} |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
66 ) |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
67 list(APPEND LIBRARIES |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
68 ${X11_LIBRARIES} |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
69 ) |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
155
diff
changeset
|
70 endif() |
152
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
71 endif() |
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
72 |
56
6ff7aabeb9d7
deps: add animia for open files detection
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
73 add_library(animia SHARED ${SRC_FILES}) |
78
1ce00c1c8ddc
dep/animia: update to upstream
Paper <mrpapersonic@gmail.com>
parents:
64
diff
changeset
|
74 set_target_properties(animia PROPERTIES |
137
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
75 PUBLIC_HEADER include/animia.h |
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
76 CXX_STANDARD 17 |
69db40272acd
dep/animia: [WIP] huge refactor
Paper <mrpapersonic@gmail.com>
parents:
84
diff
changeset
|
77 ) |
139
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
78 |
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
79 if(WIN32) |
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
80 target_compile_definitions(animia PUBLIC WIN32) |
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
81 elseif(LINUX) |
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
82 target_compile_definitions(animia PUBLIC LINUX) |
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
83 elseif(UNIX) |
152
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
84 if(APPLE) |
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
85 target_compile_definitions(animia PUBLIC MACOSX) |
8700806c2cc2
dep/animia: awesome new breaking changes!
Paper <mrpapersonic@gmail.com>
parents:
146
diff
changeset
|
86 endif() |
139
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
87 target_compile_definitions(animia PUBLIC UNIX) |
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
88 endif() |
478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
Paper <mrpapersonic@gmail.com>
parents:
138
diff
changeset
|
89 |
56
6ff7aabeb9d7
deps: add animia for open files detection
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
90 target_include_directories(animia PRIVATE include) |
155
d2bbb5773616
dep/animia: add quartz backend for windows
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
91 target_link_libraries(animia PUBLIC ${LIBRARIES}) |