Mercurial > molko
annotate CMakeLists.txt @ 239:d47e70da760e
doc: switch to mkdocs+doxybook2, closes #2516 @2h
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 27 Nov 2020 17:00:30 +0100 |
parents | d5263d467934 |
children | 76afe639fd72 |
rev | line source |
---|---|
116
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
1 # |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
2 # CMakeLists.txt -- CMake build system for molko |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
3 # |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
4 # Copyright (c) 2020 David Demelier <markand@malikania.fr> |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
5 # |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
6 # Permission to use, copy, modify, and/or distribute this software for any |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
7 # purpose with or without fee is hereby granted, provided that the above |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
8 # copyright notice and this permission notice appear in all copies. |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
9 # |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
17 # |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
18 |
193 | 19 cmake_minimum_required(VERSION 3.17) |
116
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
20 project(molko) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
21 |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
22 set(CMAKE_C_STANDARD 11) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
23 set(CMAKE_C_STANDARD_REQUIRED On) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
24 set(CMAKE_C_EXTENSIONS Off) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
25 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
26 |
239
d47e70da760e
doc: switch to mkdocs+doxybook2, closes #2516 @2h
David Demelier <markand@malikania.fr>
parents:
225
diff
changeset
|
27 option(MOLKO_WITH_DOC "Enable documentation (requires doxygen, doxybook2 and mkdocs)" On) |
180 | 28 option(MOLKO_WITH_TESTS "Enable unit tests" On) |
29 option(MOLKO_WITH_EXAMPLES "Enable build of examples" On) | |
30 | |
121
789b23e01f52
misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents:
119
diff
changeset
|
31 set_property(GLOBAL PROPERTY USE_FOLDERS On) |
789b23e01f52
misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents:
119
diff
changeset
|
32 |
119
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
33 include(GNUInstallDirs) |
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
34 |
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
35 include(cmake/MolkoBuildAssets.cmake) |
215
64f24b482722
rpg: implement tilesets separately, closes #2515 @4h
David Demelier <markand@malikania.fr>
parents:
193
diff
changeset
|
36 include(cmake/MolkoBuildMaps.cmake) |
64f24b482722
rpg: implement tilesets separately, closes #2515 @4h
David Demelier <markand@malikania.fr>
parents:
193
diff
changeset
|
37 include(cmake/MolkoBuildTilesets.cmake) |
121
789b23e01f52
misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents:
119
diff
changeset
|
38 include(cmake/MolkoDefineExecutable.cmake) |
119
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
39 include(cmake/MolkoDefineLibrary.cmake) |
122
d1ec1aa3fbe0
cmake: finalize, closes #2487
David Demelier <markand@malikania.fr>
parents:
121
diff
changeset
|
40 include(cmake/MolkoDefineTest.cmake) |
119
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
41 |
116
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
42 find_package(Jansson REQUIRED) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
43 find_package(SDL2 REQUIRED COMPONENTS image mixer ttf) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
44 |
122
d1ec1aa3fbe0
cmake: finalize, closes #2487
David Demelier <markand@malikania.fr>
parents:
121
diff
changeset
|
45 add_subdirectory(cmake) |
d1ec1aa3fbe0
cmake: finalize, closes #2487
David Demelier <markand@malikania.fr>
parents:
121
diff
changeset
|
46 |
189
a5436e15898d
molko-js: start Javascript bindings, continue #2503 @4h
David Demelier <markand@malikania.fr>
parents:
180
diff
changeset
|
47 add_subdirectory(extern/libgreatest) |
116
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
48 add_subdirectory(extern/libsqlite) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
49 |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
50 add_subdirectory(tools/bcc) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
51 add_subdirectory(tools/map) |
215
64f24b482722
rpg: implement tilesets separately, closes #2515 @4h
David Demelier <markand@malikania.fr>
parents:
193
diff
changeset
|
52 add_subdirectory(tools/tileset) |
116
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
53 |
121
789b23e01f52
misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents:
119
diff
changeset
|
54 add_subdirectory(libcore) |
148
c577c15df07f
misc: split libraries, closes #2496
David Demelier <markand@malikania.fr>
parents:
131
diff
changeset
|
55 add_subdirectory(libui) |
c577c15df07f
misc: split libraries, closes #2496
David Demelier <markand@malikania.fr>
parents:
131
diff
changeset
|
56 add_subdirectory(librpg) |
121
789b23e01f52
misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents:
119
diff
changeset
|
57 add_subdirectory(libadventure) |
789b23e01f52
misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents:
119
diff
changeset
|
58 add_subdirectory(molko) |
119
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
59 |
191
633a25df450e
molko-js: miscellaneous fixes
David Demelier <markand@malikania.fr>
parents:
189
diff
changeset
|
60 if (MOLKO_WITH_DOC) |
633a25df450e
molko-js: miscellaneous fixes
David Demelier <markand@malikania.fr>
parents:
189
diff
changeset
|
61 add_subdirectory(doc) |
633a25df450e
molko-js: miscellaneous fixes
David Demelier <markand@malikania.fr>
parents:
189
diff
changeset
|
62 endif () |
633a25df450e
molko-js: miscellaneous fixes
David Demelier <markand@malikania.fr>
parents:
189
diff
changeset
|
63 |
180 | 64 if (MOLKO_WITH_EXAMPLES) |
65 add_subdirectory(examples) | |
66 endif () | |
125
d59efa737fcc
cmake: add examples and fix
David Demelier <markand@malikania.fr>
parents:
122
diff
changeset
|
67 |
180 | 68 if (MOLKO_WITH_TESTS) |
69 enable_testing() | |
70 add_subdirectory(tests) | |
71 endif () |