annotate CMakeLists.txt @ 241:76afe639fd72

misc: add support for NLS, closes #22510 @4h While here cleanup the path functions in sys.c/sys.h
author David Demelier <markand@malikania.fr>
date Sat, 28 Nov 2020 18:00:05 +0100
parents d47e70da760e
children 71b3b7036de7
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
193
78774cc2cc6b doc: minimal typo
David Demelier <markand@malikania.fr>
parents: 191
diff changeset
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
241
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 239
diff changeset
27 option(MOLKO_WITH_NLS "Enable native language support" On)
239
d47e70da760e doc: switch to mkdocs+doxybook2, closes #2516 @2h
David Demelier <markand@malikania.fr>
parents: 225
diff changeset
28 option(MOLKO_WITH_DOC "Enable documentation (requires doxygen, doxybook2 and mkdocs)" On)
180
43aec6678cad cmake: add options
David Demelier <markand@malikania.fr>
parents: 177
diff changeset
29 option(MOLKO_WITH_TESTS "Enable unit tests" On)
43aec6678cad cmake: add options
David Demelier <markand@malikania.fr>
parents: 177
diff changeset
30 option(MOLKO_WITH_EXAMPLES "Enable build of examples" On)
43aec6678cad cmake: add options
David Demelier <markand@malikania.fr>
parents: 177
diff changeset
31
121
789b23e01f52 misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents: 119
diff changeset
32 set_property(GLOBAL PROPERTY USE_FOLDERS On)
789b23e01f52 misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents: 119
diff changeset
33
119
43e04bf2c350 cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents: 118
diff changeset
34 include(GNUInstallDirs)
43e04bf2c350 cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents: 118
diff changeset
35
43e04bf2c350 cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents: 118
diff changeset
36 include(cmake/MolkoBuildAssets.cmake)
215
64f24b482722 rpg: implement tilesets separately, closes #2515 @4h
David Demelier <markand@malikania.fr>
parents: 193
diff changeset
37 include(cmake/MolkoBuildMaps.cmake)
64f24b482722 rpg: implement tilesets separately, closes #2515 @4h
David Demelier <markand@malikania.fr>
parents: 193
diff changeset
38 include(cmake/MolkoBuildTilesets.cmake)
121
789b23e01f52 misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents: 119
diff changeset
39 include(cmake/MolkoDefineExecutable.cmake)
119
43e04bf2c350 cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents: 118
diff changeset
40 include(cmake/MolkoDefineLibrary.cmake)
122
d1ec1aa3fbe0 cmake: finalize, closes #2487
David Demelier <markand@malikania.fr>
parents: 121
diff changeset
41 include(cmake/MolkoDefineTest.cmake)
119
43e04bf2c350 cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents: 118
diff changeset
42
116
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 find_package(Jansson REQUIRED)
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 find_package(SDL2 REQUIRED COMPONENTS image mixer ttf)
241
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 239
diff changeset
45 find_package(Intl)
116
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
46
122
d1ec1aa3fbe0 cmake: finalize, closes #2487
David Demelier <markand@malikania.fr>
parents: 121
diff changeset
47 add_subdirectory(cmake)
d1ec1aa3fbe0 cmake: finalize, closes #2487
David Demelier <markand@malikania.fr>
parents: 121
diff changeset
48
189
a5436e15898d molko-js: start Javascript bindings, continue #2503 @4h
David Demelier <markand@malikania.fr>
parents: 180
diff changeset
49 add_subdirectory(extern/libgreatest)
116
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 add_subdirectory(extern/libsqlite)
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)
215
64f24b482722 rpg: implement tilesets separately, closes #2515 @4h
David Demelier <markand@malikania.fr>
parents: 193
diff changeset
54 add_subdirectory(tools/tileset)
116
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
55
121
789b23e01f52 misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents: 119
diff changeset
56 add_subdirectory(libcore)
148
c577c15df07f misc: split libraries, closes #2496
David Demelier <markand@malikania.fr>
parents: 131
diff changeset
57 add_subdirectory(libui)
c577c15df07f misc: split libraries, closes #2496
David Demelier <markand@malikania.fr>
parents: 131
diff changeset
58 add_subdirectory(librpg)
121
789b23e01f52 misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents: 119
diff changeset
59 add_subdirectory(libadventure)
789b23e01f52 misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents: 119
diff changeset
60 add_subdirectory(molko)
119
43e04bf2c350 cmake: add tests, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents: 118
diff changeset
61
191
633a25df450e molko-js: miscellaneous fixes
David Demelier <markand@malikania.fr>
parents: 189
diff changeset
62 if (MOLKO_WITH_DOC)
633a25df450e molko-js: miscellaneous fixes
David Demelier <markand@malikania.fr>
parents: 189
diff changeset
63 add_subdirectory(doc)
633a25df450e molko-js: miscellaneous fixes
David Demelier <markand@malikania.fr>
parents: 189
diff changeset
64 endif ()
633a25df450e molko-js: miscellaneous fixes
David Demelier <markand@malikania.fr>
parents: 189
diff changeset
65
180
43aec6678cad cmake: add options
David Demelier <markand@malikania.fr>
parents: 177
diff changeset
66 if (MOLKO_WITH_EXAMPLES)
43aec6678cad cmake: add options
David Demelier <markand@malikania.fr>
parents: 177
diff changeset
67 add_subdirectory(examples)
43aec6678cad cmake: add options
David Demelier <markand@malikania.fr>
parents: 177
diff changeset
68 endif ()
125
d59efa737fcc cmake: add examples and fix
David Demelier <markand@malikania.fr>
parents: 122
diff changeset
69
180
43aec6678cad cmake: add options
David Demelier <markand@malikania.fr>
parents: 177
diff changeset
70 if (MOLKO_WITH_TESTS)
43aec6678cad cmake: add options
David Demelier <markand@malikania.fr>
parents: 177
diff changeset
71 enable_testing()
43aec6678cad cmake: add options
David Demelier <markand@malikania.fr>
parents: 177
diff changeset
72 add_subdirectory(tests)
43aec6678cad cmake: add options
David Demelier <markand@malikania.fr>
parents: 177
diff changeset
73 endif ()