Mercurial > molko
annotate CMakeLists.txt @ 169:eb0a7ab71023
misc: extreme cleanup, closes #2506
While here, remove unneeded stuff.
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 20 Oct 2020 17:39:13 +0200 |
parents | c577c15df07f |
children | 408e4823e378 |
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 |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
19 cmake_minimum_required(VERSION 3.18) |
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 |
131 | 27 if (CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU") |
28 set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}") | |
29 endif () | |
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) |
121
789b23e01f52
misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents:
119
diff
changeset
|
36 include(cmake/MolkoDefineExecutable.cmake) |
119
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
37 include(cmake/MolkoDefineLibrary.cmake) |
122
d1ec1aa3fbe0
cmake: finalize, closes #2487
David Demelier <markand@malikania.fr>
parents:
121
diff
changeset
|
38 include(cmake/MolkoDefineTest.cmake) |
119
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
39 |
116
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
40 find_package(Jansson REQUIRED) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
41 find_package(SDL2 REQUIRED COMPONENTS image mixer ttf) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
42 |
119
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
43 enable_testing() |
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
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 |
116
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
47 add_subdirectory(extern/libsqlite) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
48 add_subdirectory(extern/libgreatest) |
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(doxygen) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
51 |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
52 add_subdirectory(tools/bcc) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
53 add_subdirectory(tools/map) |
0a6683615c73
cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
54 |
121
789b23e01f52
misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents:
119
diff
changeset
|
55 add_subdirectory(libcore) |
148
c577c15df07f
misc: split libraries, closes #2496
David Demelier <markand@malikania.fr>
parents:
131
diff
changeset
|
56 add_subdirectory(libui) |
c577c15df07f
misc: split libraries, closes #2496
David Demelier <markand@malikania.fr>
parents:
131
diff
changeset
|
57 add_subdirectory(librpg) |
121
789b23e01f52
misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents:
119
diff
changeset
|
58 add_subdirectory(libadventure) |
789b23e01f52
misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents:
119
diff
changeset
|
59 add_subdirectory(molko) |
119
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
60 |
125
d59efa737fcc
cmake: add examples and fix
David Demelier <markand@malikania.fr>
parents:
122
diff
changeset
|
61 add_subdirectory(examples) |
d59efa737fcc
cmake: add examples and fix
David Demelier <markand@malikania.fr>
parents:
122
diff
changeset
|
62 |
119
43e04bf2c350
cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents:
118
diff
changeset
|
63 add_subdirectory(tests) |