annotate CMakeLists.txt @ 214:e2574aa8301d

client: add basic input text, closes #910
author David Demelier <markand@malikania.fr>
date Sun, 01 Sep 2019 06:53:48 +0200
parents 18e442a52f29
children 268b66d72ec0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
1 #
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
2 # CMakeLists.txt -- CMake build system for malikania
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
3 #
158
4b292c20124c Misc: update copyrights
David Demelier <markand@malikania.fr>
parents: 149
diff changeset
4 # Copyright (c) 2013-2018 David Demelier <markand@malikania.fr>
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
5 #
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
6 # Permission to use, copy, modify, and/or distribute this software for any
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
7 # purpose with or without fee is hereby granted, provided that the above
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
8 # copyright notice and this permission notice appear in all copies.
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
9 #
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
17 #
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
18
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
19 cmake_minimum_required(VERSION 3.0)
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
20 project(malikania)
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
21
200
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
22 set_property(GLOBAL PROPERTY USE_FOLDERS On)
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
23
169
450d884456c4 Server: initial re-support of PostgreSQL
David Demelier <markand@malikania.fr>
parents: 165
diff changeset
24 set(CMAKE_CXX_STANDARD 17)
182
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
25 set(CMAKE_CXX_STANDARD_REQUIRED On)
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
26 set(CMAKE_POSITION_INDEPENDENT_CODE On)
200
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
27 set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On)
182
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
28 set(CMAKE_MODULE_PATH ${malikania_SOURCE_DIR}/cmake/packages)
200
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
29 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
30
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
31 foreach (cfg ${CMAKE_CONFIGURATION_TYPES})
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
32 string(TOUPPER CFG ${cfg})
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
33 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG} ${CMAKE_BINARY_DIR}/bin/${cfg})
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
34 endforeach ()
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
35
182
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
36 include(cmake/function/MalikaniaBuildAssets.cmake)
49
2804ae55c70f CMake: big cleanup, closes #598
David Demelier <markand@malikania.fr>
parents: 47
diff changeset
37 include(cmake/function/MalikaniaDefineLibrary.cmake)
182
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
38 include(cmake/function/MalikaniaDefineExample.cmake)
49
2804ae55c70f CMake: big cleanup, closes #598
David Demelier <markand@malikania.fr>
parents: 47
diff changeset
39 include(cmake/function/MalikaniaDefineExecutable.cmake)
2804ae55c70f CMake: big cleanup, closes #598
David Demelier <markand@malikania.fr>
parents: 47
diff changeset
40 include(cmake/function/MalikaniaDefineTest.cmake)
2804ae55c70f CMake: big cleanup, closes #598
David Demelier <markand@malikania.fr>
parents: 47
diff changeset
41 include(cmake/function/MalikaniaSetg.cmake)
165
3e3040d085b5 Misc: reset to a new target
David Demelier <markand@malikania.fr>
parents: 158
diff changeset
42
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
43 include(cmake/MalikaniaVersion.cmake)
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
44 include(cmake/MalikaniaOptions.cmake)
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
45 include(cmake/MalikaniaSystem.cmake)
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
46
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
47 configure_file(
182
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
48 ${malikania_SOURCE_DIR}/cmake/internal/sysconfig.hpp.in
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
49 ${malikania_BINARY_DIR}/sysconfig.hpp
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
50 )
165
3e3040d085b5 Misc: reset to a new target
David Demelier <markand@malikania.fr>
parents: 158
diff changeset
51 include_directories(${malikania_BINARY_DIR})
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
52
149
dece83c24c64 CMake: put find_package(Boost) quiet
David Demelier <markand@malikania.fr>
parents: 127
diff changeset
53 find_package(Boost REQUIRED QUIET COMPONENTS filesystem system timer unit_test_framework)
40
1e206fdc7021 Server: switch to Boost.DLL, closes #583
David Demelier <markand@malikania.fr>
parents: 37
diff changeset
54 find_package(OpenSSL REQUIRED)
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
55
47
7097a91b08a8 Tools: add mlk-bcc tool, closes #596
David Demelier <markand@malikania.fr>
parents: 44
diff changeset
56 add_subdirectory(tools)
201
19f32bd3e568 cmake: disable examples correctly
David Demelier <markand@malikania.fr>
parents: 200
diff changeset
57
19f32bd3e568 cmake: disable examples correctly
David Demelier <markand@malikania.fr>
parents: 200
diff changeset
58 if (MALIKANIA_WITH_EXAMPLES)
19f32bd3e568 cmake: disable examples correctly
David Demelier <markand@malikania.fr>
parents: 200
diff changeset
59 add_subdirectory(examples)
19f32bd3e568 cmake: disable examples correctly
David Demelier <markand@malikania.fr>
parents: 200
diff changeset
60 endif ()
19f32bd3e568 cmake: disable examples correctly
David Demelier <markand@malikania.fr>
parents: 200
diff changeset
61
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
62 add_subdirectory(extern)
196
5b0f7ffab962 doc: initial html support
David Demelier <markand@malikania.fr>
parents: 195
diff changeset
63 add_subdirectory(doc)
189
f28cb6d04731 Misc: extreme refactoring
David Demelier <markand@malikania.fr>
parents: 188
diff changeset
64 add_subdirectory(libmlk)
f28cb6d04731 Misc: extreme refactoring
David Demelier <markand@malikania.fr>
parents: 188
diff changeset
65 add_subdirectory(libmlk-js)
200
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
66
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
67 if (MALIKANIA_HAS_SERVER)
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
68 add_subdirectory(libmlk-db)
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
69 add_subdirectory(libmlk-server)
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
70 add_subdirectory(mlk-server)
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
71 endif ()
69
fce7e41875db CMake: add WITH_TESTS option
David Demelier <markand@malikania.fr>
parents: 66
diff changeset
72
200
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
73 if (MALIKANIA_HAS_CLIENT)
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
74 add_subdirectory(libmlk-client)
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
75 add_subdirectory(libmlk-client-js)
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
76 add_subdirectory(mlk-client)
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
77 endif ()
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
78
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
79 if (MALIKANIA_WITH_TESTS)
195
ae3741be8c38 Tests: don't build test libraries if disabled
David Demelier <markand@malikania.fr>
parents: 193
diff changeset
80 add_subdirectory(libmlk-js-test)
204
18e442a52f29 cmake: enable tests correctly
David Demelier <markand@malikania.fr>
parents: 201
diff changeset
81
18e442a52f29 cmake: enable tests correctly
David Demelier <markand@malikania.fr>
parents: 201
diff changeset
82 if (MALIKANIA_HAS_SERVER)
18e442a52f29 cmake: enable tests correctly
David Demelier <markand@malikania.fr>
parents: 201
diff changeset
83 add_subdirectory(libmlk-db-test)
18e442a52f29 cmake: enable tests correctly
David Demelier <markand@malikania.fr>
parents: 201
diff changeset
84 endif ()
18e442a52f29 cmake: enable tests correctly
David Demelier <markand@malikania.fr>
parents: 201
diff changeset
85
18e442a52f29 cmake: enable tests correctly
David Demelier <markand@malikania.fr>
parents: 201
diff changeset
86 if (MALIKANIA_HAS_CLIENT)
18e442a52f29 cmake: enable tests correctly
David Demelier <markand@malikania.fr>
parents: 201
diff changeset
87 add_subdirectory(libmlk-client-js-test)
18e442a52f29 cmake: enable tests correctly
David Demelier <markand@malikania.fr>
parents: 201
diff changeset
88 endif ()
188
0cecdadfb5c4 Misc: rework javascript bindings, closes #916
David Demelier <markand@malikania.fr>
parents: 183
diff changeset
89
182
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
90 enable_testing()
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
91 add_subdirectory(tests)
69
fce7e41875db CMake: add WITH_TESTS option
David Demelier <markand@malikania.fr>
parents: 66
diff changeset
92 endif ()
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
93
200
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
94 message("")
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
95 message("Building information:")
182
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
96 message(" General flags: ${CMAKE_CXX_FLAGS}")
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
97 message(" Debug flags: ${CMAKE_CXX_FLAGS_DEBUG}")
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
98 message(" Release flags: ${CMAKE_CXX_FLAGS_RELEASE}")
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
99 message("")
200
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
100 message("Component selection:")
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
101 message(" Server: ${MALIKANIA_HAS_SERVER_MSG}")
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
102 message(" Client: ${MALIKANIA_HAS_CLIENT_MSG}")
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
103 message("")
182
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents: 179
diff changeset
104 message("Documentation:")
196
5b0f7ffab962 doc: initial html support
David Demelier <markand@malikania.fr>
parents: 195
diff changeset
105 message(" HTML: ${MALIKANIA_HAS_HTML_MSG}")
33
d4f5f7231b84 Misc: switch to .hpp, dos2unix everything while here, #478
David Demelier <markand@malikania.fr>
parents: 31
diff changeset
106 message("")
69
fce7e41875db CMake: add WITH_TESTS option
David Demelier <markand@malikania.fr>
parents: 66
diff changeset
107 message("Additional options:")
200
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
108 message(" Tests: ${MALIKANIA_HAS_TESTS_MSG}")
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
109 message(" Examples: ${MALIKANIA_HAS_EXAMPLES_MSG}")
0a285d62ace7 windows: initial VS2017 support
David Demelier <markand@malikania.fr>
parents: 199
diff changeset
110 message("")