annotate CMakeLists.txt @ 163:4bbfcd9180a8

core: add window_set_cursor function, closes #2502
author David Demelier <markand@malikania.fr>
date Sun, 18 Oct 2020 17:14:42 +0200
parents c577c15df07f
children 408e4823e378
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
c679e08b32b2 molko: fix startup
David Demelier <markand@malikania.fr>
parents: 125
diff changeset
27 if (CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU")
c679e08b32b2 molko: fix startup
David Demelier <markand@malikania.fr>
parents: 125
diff changeset
28 set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}")
c679e08b32b2 molko: fix startup
David Demelier <markand@malikania.fr>
parents: 125
diff changeset
29 endif ()
c679e08b32b2 molko: fix startup
David Demelier <markand@malikania.fr>
parents: 125
diff changeset
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)