| 1 |
if(MSVC) |
| 2 |
add_definitions(-wd"4127" -wd"4102") |
| 3 |
else() |
| 4 |
if(NOT BEOS AND NOT HAIKU) |
| 5 |
add_definitions(-Wno-unused-label) |
| 6 |
set(EXTRA_LIBRARIES "m") |
| 7 |
endif() |
| 8 |
endif() |
| 9 |
|
| 10 |
add_subdirectory(cbehave) |
| 11 |
|
| 12 |
include_directories( |
| 13 |
. ../cdogs |
| 14 |
${SDL2_INCLUDE_DIRS}) |
| 15 |
|
| 16 |
add_executable(animated_counter_test |
| 17 |
animated_counter_test.c |
| 18 |
../animated_counter.h |
| 19 |
../animated_counter.c) |
| 20 |
target_link_libraries(animated_counter_test |
| 21 |
cbehave |
| 22 |
cdogs |
| 23 |
cdogs_proto |
| 24 |
SDL2::SDL2 |
| 25 |
${EXTRA_LIBRARIES}) |
| 26 |
add_test(NAME animated_counter_test COMMAND animated_counter_test) |
| 27 |
if(APPLE) |
| 28 |
set_target_properties(animated_counter_test PROPERTIES |
| 29 |
MACOSX_RPATH 1 |
| 30 |
BUILD_WITH_INSTALL_RPATH 1 |
| 31 |
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks") |
| 32 |
endif() |
| 33 |
|
| 34 |
add_executable(actor_test |
| 35 |
actor_test.c |
| 36 |
../cdogs/actors.h |
| 37 |
../cdogs/actors.c) |
| 38 |
target_link_libraries(actor_test |
| 39 |
cbehave |
| 40 |
cdogs |
| 41 |
cdogs_proto |
| 42 |
SDL2::SDL2 |
| 43 |
${EXTRA_LIBRARIES}) |
| 44 |
add_test(NAME actor_test COMMAND actor_test) |
| 45 |
if(APPLE) |
| 46 |
set_target_properties(actor_test PROPERTIES |
| 47 |
MACOSX_RPATH 1 |
| 48 |
BUILD_WITH_INSTALL_RPATH 1 |
| 49 |
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks") |
| 50 |
endif() |
| 51 |
|
| 52 |
add_executable(autosave_test |
| 53 |
autosave_test.c |
| 54 |
../autosave.h |
| 55 |
../autosave.c) |
| 56 |
target_link_libraries(autosave_test |
| 57 |
cbehave |
| 58 |
cdogs |
| 59 |
cdogs_proto |
| 60 |
SDL2::SDL2 |
| 61 |
${EXTRA_LIBRARIES}) |
| 62 |
add_test(NAME autosave_test COMMAND autosave_test) |
| 63 |
if(APPLE) |
| 64 |
set_target_properties(autosave_test PROPERTIES |
| 65 |
MACOSX_RPATH 1 |
| 66 |
BUILD_WITH_INSTALL_RPATH 1 |
| 67 |
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks") |
| 68 |
endif() |
| 69 |
|
| 70 |
add_executable(c_hashmap_test |
| 71 |
c_hashmap_test.c |
| 72 |
../cdogs/c_hashmap/hashmap.h |
| 73 |
../cdogs/c_hashmap/hashmap.c) |
| 74 |
target_link_libraries(c_hashmap_test cbehave ${EXTRA_LIBRARIES}) |
| 75 |
add_test(NAME c_hashmap_test COMMAND c_hashmap_test) |
| 76 |
|
| 77 |
add_executable(c_array_test |
| 78 |
c_array_test.c |
| 79 |
../cdogs/c_array.h |
| 80 |
../cdogs/c_array.c) |
| 81 |
target_link_libraries(c_array_test |
| 82 |
cbehave ${EXTRA_LIBRARIES}) |
| 83 |
add_test(NAME c_array_test COMMAND c_array_test) |
| 84 |
|
| 85 |
add_executable(color_test |
| 86 |
color_test.c |
| 87 |
../cdogs/color.c |
| 88 |
../cdogs/color.h) |
| 89 |
target_link_libraries(color_test cbehave ${EXTRA_LIBRARIES}) |
| 90 |
add_test(NAME color_test COMMAND color_test) |
| 91 |
|
| 92 |
add_executable(config_test config_test.c) |
| 93 |
target_link_libraries(config_test |
| 94 |
cbehave |
| 95 |
cdogs |
| 96 |
cdogs_proto |
| 97 |
SDL2::SDL2 |
| 98 |
${EXTRA_LIBRARIES}) |
| 99 |
add_test(NAME config_test COMMAND config_test) |
| 100 |
if(APPLE) |
| 101 |
set_target_properties(config_test PROPERTIES |
| 102 |
MACOSX_RPATH 1 |
| 103 |
BUILD_WITH_INSTALL_RPATH 1 |
| 104 |
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks") |
| 105 |
endif() |
| 106 |
|
| 107 |
add_executable(json_test json_test.c) |
| 108 |
target_link_libraries(json_test |
| 109 |
cbehave |
| 110 |
cdogs |
| 111 |
cdogs_proto |
| 112 |
SDL2::SDL2 |
| 113 |
${EXTRA_LIBRARIES}) |
| 114 |
add_test(NAME json_test COMMAND json_test) |
| 115 |
if(APPLE) |
| 116 |
set_target_properties(json_test PROPERTIES |
| 117 |
MACOSX_RPATH 1 |
| 118 |
BUILD_WITH_INSTALL_RPATH 1 |
| 119 |
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks") |
| 120 |
endif() |
| 121 |
|
| 122 |
add_executable(minkowski_hex_test minkowski_hex_test.c) |
| 123 |
target_link_libraries(minkowski_hex_test |
| 124 |
cbehave |
| 125 |
cdogs |
| 126 |
cdogs_proto |
| 127 |
SDL2::SDL2 |
| 128 |
${EXTRA_LIBRARIES}) |
| 129 |
add_test(NAME minkowski_hex_test COMMAND minkowski_hex_test) |
| 130 |
if(APPLE) |
| 131 |
set_target_properties(minkowski_hex_test PROPERTIES |
| 132 |
MACOSX_RPATH 1 |
| 133 |
BUILD_WITH_INSTALL_RPATH 1 |
| 134 |
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks") |
| 135 |
endif() |
| 136 |
|
| 137 |
add_executable(pic_test pic_test.c) |
| 138 |
target_link_libraries(pic_test |
| 139 |
cbehave |
| 140 |
cdogs |
| 141 |
cdogs_proto |
| 142 |
SDL2::SDL2 |
| 143 |
${EXTRA_LIBRARIES}) |
| 144 |
# TODO: test disabled since CI fails with Couldn't find matching render driver |
| 145 |
#add_test(NAME pic_test COMMAND pic_test) |
| 146 |
if(APPLE) |
| 147 |
set_target_properties(pic_test PROPERTIES |
| 148 |
MACOSX_RPATH 1 |
| 149 |
BUILD_WITH_INSTALL_RPATH 1 |
| 150 |
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks") |
| 151 |
endif() |
| 152 |
|
| 153 |
add_executable(player_test player_test.c) |
| 154 |
target_link_libraries(player_test |
| 155 |
cbehave |
| 156 |
cdogs |
| 157 |
cdogs_proto |
| 158 |
SDL2::SDL2 |
| 159 |
${EXTRA_LIBRARIES}) |
| 160 |
add_test(NAME player_test COMMAND player_test) |
| 161 |
if(APPLE) |
| 162 |
set_target_properties(player_test PROPERTIES |
| 163 |
MACOSX_RPATH 1 |
| 164 |
BUILD_WITH_INSTALL_RPATH 1 |
| 165 |
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks") |
| 166 |
endif() |
| 167 |
|
| 168 |
add_executable(utils_test utils_test.c) |
| 169 |
target_link_libraries(utils_test |
| 170 |
cbehave |
| 171 |
cdogs |
| 172 |
cdogs_proto |
| 173 |
SDL2::SDL2 ${EXTRA_LIBRARIES}) |
| 174 |
add_test(NAME utils_test COMMAND utils_test) |
| 175 |
if(APPLE) |
| 176 |
set_target_properties(utils_test PROPERTIES |
| 177 |
MACOSX_RPATH 1 |
| 178 |
BUILD_WITH_INSTALL_RPATH 1 |
| 179 |
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks") |
| 180 |
endif() |
| 181 |
|
| 182 |
add_executable(yajl_test yajl_test.c) |
| 183 |
target_link_libraries(yajl_test |
| 184 |
cbehave |
| 185 |
cdogs |
| 186 |
SDL2::SDL2) |
| 187 |
add_test(NAME yajl_test COMMAND yajl_test) |
| 188 |
if(APPLE) |
| 189 |
set_target_properties(yajl_test PROPERTIES |
| 190 |
MACOSX_RPATH 1 |
| 191 |
BUILD_WITH_INSTALL_RPATH 1 |
| 192 |
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks") |
| 193 |
endif() |