|
| 1 | +cmake_minimum_required(VERSION 3.0) |
| 2 | + |
| 3 | +project(kr C) |
| 4 | + |
| 5 | +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
| 6 | + |
| 7 | +# Build information |
| 8 | +message(STATUS "Build Configuration: ${CMAKE_BUILD_TYPE}") |
| 9 | +message(STATUS "Build executables in: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") |
| 10 | + |
| 11 | +#add_definitions(-std=c++11) |
| 12 | + |
| 13 | +# Source directories |
| 14 | +set(CHAP1_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../chapter01) |
| 15 | +set(CHAP2_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../chapter02) |
| 16 | +set(CHAP3_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../chapter03) |
| 17 | +set(CHAP4_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../chapter04) |
| 18 | +set(CHAP5_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../chapter05) |
| 19 | +set(CHAP6_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../chapter06) |
| 20 | +set(CHAP7_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../chapter07) |
| 21 | +set(CHAP8_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../chapter08) |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +# Create the target |
| 26 | +set(target c1_1) |
| 27 | +add_executable(${target} ${CHAP1_DIR}/1-1.c) |
| 28 | +set(target c1_2) |
| 29 | +add_executable(${target} ${CHAP1_DIR}/1-2.c) |
| 30 | +set(target c1_3) |
| 31 | +add_executable(${target} ${CHAP1_DIR}/1-3.c) |
| 32 | +set(target c1_4) |
| 33 | +add_executable(${target} ${CHAP1_DIR}/1-4.c) |
| 34 | +set(target c1_5) |
| 35 | +add_executable(${target} ${CHAP1_DIR}/1-5.c) |
| 36 | +set(target c1_6) |
| 37 | +add_executable(${target} ${CHAP1_DIR}/1-6.c) |
| 38 | +set(target c1_7) |
| 39 | +add_executable(${target} ${CHAP1_DIR}/1-7.c) |
| 40 | +set(target c1_8) |
| 41 | +add_executable(${target} ${CHAP1_DIR}/1-8.c) |
| 42 | +set(target c1_9) |
| 43 | +add_executable(${target} ${CHAP1_DIR}/1-9.c) |
| 44 | + |
| 45 | +set(target c1_10) |
| 46 | +add_executable(${target} ${CHAP1_DIR}/1-10.c) |
| 47 | +set(target c1_11) |
| 48 | +add_executable(${target} ${CHAP1_DIR}/1-11.c) |
| 49 | +set(target c1_12) |
| 50 | +add_executable(${target} ${CHAP1_DIR}/1-12.c) |
| 51 | +set(target c1_13) |
| 52 | +add_executable(${target} ${CHAP1_DIR}/1-13.c) |
| 53 | +set(target c1_14) |
| 54 | +add_executable(${target} ${CHAP1_DIR}/1-14.c) |
| 55 | +set(target c1_15) |
| 56 | +add_executable(${target} ${CHAP1_DIR}/1-15.c) |
| 57 | +set(target c1_16) |
| 58 | +add_executable(${target} ${CHAP1_DIR}/1-16.c) |
| 59 | +set(target c1_17) |
| 60 | +add_executable(${target} ${CHAP1_DIR}/1-17.c) |
| 61 | +set(target c1_18) |
| 62 | +add_executable(${target} ${CHAP1_DIR}/1-18.c) |
| 63 | +set(target c1_19) |
| 64 | +add_executable(${target} ${CHAP1_DIR}/1-19.c) |
| 65 | + |
| 66 | + |
| 67 | +set(target c1_20) |
| 68 | +add_executable(${target} ${CHAP1_DIR}/1-20.c) |
| 69 | +set(target c1_21) |
| 70 | +add_executable(${target} ${CHAP1_DIR}/1-21.c) |
| 71 | +set(target c1_22) |
| 72 | +add_executable(${target} ${CHAP1_DIR}/1-22.c) |
| 73 | +set(target c1_23) |
| 74 | +add_executable(${target} ${CHAP1_DIR}/1-23.c) |
| 75 | +set(target c1_24) |
| 76 | +add_executable(${target} ${CHAP1_DIR}/1-24.c) |
| 77 | + |
| 78 | + |
| 79 | +set(target c2_1) |
| 80 | +add_executable(${target} ${CHAP2_DIR}/2-1.c) |
| 81 | +set(target c2_2) |
| 82 | +add_executable(${target} ${CHAP2_DIR}/2-2.c) |
| 83 | +set(target c2_3) |
| 84 | +add_executable(${target} ${CHAP2_DIR}/2-3.c) |
| 85 | +set(target c2_4) |
| 86 | +add_executable(${target} ${CHAP2_DIR}/2-4.c) |
| 87 | +set(target c2_5) |
| 88 | +add_executable(${target} ${CHAP2_DIR}/2-5.c) |
| 89 | +set(target c2_6) |
| 90 | +add_executable(${target} ${CHAP2_DIR}/2-6.c) |
| 91 | +set(target c2_7) |
| 92 | +add_executable(${target} ${CHAP2_DIR}/2-7.c) |
| 93 | +set(target c2_8) |
| 94 | +add_executable(${target} ${CHAP2_DIR}/2-8.c) |
| 95 | +set(target c2_9) |
| 96 | +add_executable(${target} ${CHAP2_DIR}/2-9.c) |
| 97 | + |
| 98 | +set(target c2_10) |
| 99 | +add_executable(${target} ${CHAP2_DIR}/2-10.c) |
| 100 | + |
| 101 | + |
| 102 | +set(target c3_1) |
| 103 | +add_executable(${target} ${CHAP3_DIR}/3-1.c) |
| 104 | +set(target c3_2) |
| 105 | +add_executable(${target} ${CHAP3_DIR}/3-2.c) |
| 106 | +set(target c3_3) |
| 107 | +add_executable(${target} ${CHAP3_DIR}/3-3.c) |
| 108 | +set(target c3_4) |
| 109 | +add_executable(${target} ${CHAP3_DIR}/3-4.c) |
| 110 | +set(target c3_4a) |
| 111 | +add_executable(${target} ${CHAP3_DIR}/3-4a.c) |
| 112 | +set(target c3_5) |
| 113 | +add_executable(${target} ${CHAP3_DIR}/3-5.c) |
| 114 | +set(target c3_6) |
| 115 | +add_executable(${target} ${CHAP3_DIR}/3-6.c) |
| 116 | + |
| 117 | + |
| 118 | +set(target c4_1) |
| 119 | +add_executable(${target} ${CHAP4_DIR}/4-1.c) |
| 120 | +set(target c4_2) |
| 121 | +add_executable(${target} ${CHAP4_DIR}/4-2.c) |
| 122 | +set(target c4_3) |
| 123 | +add_executable(${target} ${CHAP4_DIR}/4-3.c) |
| 124 | +set(target c4_4) |
| 125 | +add_executable(${target} ${CHAP4_DIR}/4-4.c) |
| 126 | +set(target c4_5) |
| 127 | +add_executable(${target} ${CHAP4_DIR}/4-5.c) |
| 128 | +target_link_libraries(c4_5 m) |
| 129 | + |
| 130 | +set(target c4_6) |
| 131 | +add_executable(${target} ${CHAP4_DIR}/4-6.c) |
| 132 | +target_link_libraries(c4_6 m) |
| 133 | +set(target c4_7) |
| 134 | +add_executable(${target} ${CHAP4_DIR}/4-7.c) |
| 135 | +set(target c4_8) |
| 136 | +add_executable(${target} ${CHAP4_DIR}/4-8.c) |
| 137 | +set(target c4_9) |
| 138 | +add_executable(${target} ${CHAP4_DIR}/4-9.c) |
| 139 | + |
| 140 | +set(target c4_10) |
| 141 | +add_executable(${target} ${CHAP4_DIR}/4-10.c) |
| 142 | +target_link_libraries(c4_10 m) |
| 143 | +set(target c4_11) |
| 144 | +add_executable(${target} ${CHAP4_DIR}/4-11.c) |
| 145 | +target_link_libraries(c4_11 m) |
| 146 | +set(target c4_12) |
| 147 | +add_executable(${target} ${CHAP4_DIR}/4-12.c) |
| 148 | +set(target c4_13) |
| 149 | +add_executable(${target} ${CHAP4_DIR}/4-13.c) |
| 150 | +set(target c4_14) |
| 151 | +add_executable(${target} ${CHAP4_DIR}/4-14.c) |
| 152 | + |
| 153 | + |
| 154 | +set(target c5_1) |
| 155 | +add_executable(${target} ${CHAP5_DIR}/5-1.c) |
| 156 | +set(target c5_2) |
| 157 | +add_executable(${target} ${CHAP5_DIR}/5-2.c) |
| 158 | +set(target c5_3) |
| 159 | +add_executable(${target} ${CHAP5_DIR}/5-3.c) |
| 160 | +set(target c5_4) |
| 161 | +add_executable(${target} ${CHAP5_DIR}/5-4.c) |
| 162 | +set(target c5_5) |
| 163 | +add_executable(${target} ${CHAP5_DIR}/5-5.c) |
| 164 | + |
| 165 | +set(target c5_6) |
| 166 | +add_executable(${target} ${CHAP5_DIR}/5-6/main.c ${CHAP5_DIR}/5-6/functions.c) |
| 167 | + |
| 168 | +set(target c5_7) |
| 169 | +add_executable(${target} ${CHAP5_DIR}/5-7.c) |
| 170 | +set(target c5_7a) |
| 171 | +add_executable(${target} ${CHAP5_DIR}/5-7-alloc.c) |
| 172 | + |
| 173 | +set(target c5_8) |
| 174 | +add_executable(${target} ${CHAP5_DIR}/5-8.c) |
| 175 | +set(target c5_9) |
| 176 | +add_executable(${target} ${CHAP5_DIR}/5-9.c) |
| 177 | + |
| 178 | +set(target c5_10) |
| 179 | +add_executable(${target} ${CHAP5_DIR}/5-10.c) |
| 180 | + |
| 181 | +set(target c5_11d) |
| 182 | +add_executable(${target} ${CHAP5_DIR}/5-11/detab.c) |
| 183 | +set(target c5_11e) |
| 184 | +add_executable(${target} ${CHAP5_DIR}/5-11/entab.c) |
| 185 | + |
| 186 | +set(target c5_12d) |
| 187 | +add_executable(${target} ${CHAP5_DIR}/5-12/detab.c) |
| 188 | +set(target c5_12e) |
| 189 | +add_executable(${target} ${CHAP5_DIR}/5-12/entab.c) |
| 190 | + |
| 191 | +set(target c5_13) |
| 192 | +add_executable(${target} ${CHAP5_DIR}/5-13.c) |
| 193 | +set(target c5_14) |
| 194 | +add_executable(${target} ${CHAP5_DIR}/5-14.c) |
| 195 | +set(target c5_15) |
| 196 | +add_executable(${target} ${CHAP5_DIR}/5-15.c) |
| 197 | +set(target c5_16) |
| 198 | +add_executable(${target} ${CHAP5_DIR}/5-16.c) |
| 199 | +set(target c5_17) |
| 200 | +add_executable(${target} ${CHAP5_DIR}/5-17.c) |
| 201 | +set(target c5_18) |
| 202 | +add_executable(${target} ${CHAP5_DIR}/5-18.c) |
| 203 | +set(target c5_19) |
| 204 | +add_executable(${target} ${CHAP5_DIR}/5-19.c) |
| 205 | + |
| 206 | + |
| 207 | +set(target c5_20) |
| 208 | +add_executable(${target} ${CHAP5_DIR}/5-20.c) |
| 209 | + |
| 210 | + |
| 211 | +set(target c6_1) |
| 212 | +add_executable(${target} ${CHAP6_DIR}/6-1.c) |
| 213 | +set(target c6_2) |
| 214 | +add_executable(${target} ${CHAP6_DIR}/6-2.c) |
| 215 | +set(target c6_3) |
| 216 | +add_executable(${target} ${CHAP6_DIR}/6-3.c) |
| 217 | +set(target c6_4) |
| 218 | +add_executable(${target} ${CHAP6_DIR}/6-4.c) |
| 219 | +set(target c6_5) |
| 220 | +add_executable(${target} ${CHAP6_DIR}/6-5.c) |
| 221 | +set(target c6_6) |
| 222 | +add_executable(${target} ${CHAP6_DIR}/6-6.c) |
| 223 | + |
| 224 | +set(target c7_1) |
| 225 | +add_executable(${target} ${CHAP7_DIR}/7-1.c) |
| 226 | +set(target c7_2) |
| 227 | +add_executable(${target} ${CHAP7_DIR}/7-2.c) |
| 228 | +set(target c7_3) |
| 229 | +add_executable(${target} ${CHAP7_DIR}/7-3.c) |
| 230 | +set(target c7_4) |
| 231 | +add_executable(${target} ${CHAP7_DIR}/7-4.c) |
| 232 | +set(target c7_5) |
| 233 | +add_executable(${target} ${CHAP7_DIR}/7-5.c) |
| 234 | +set(target c7_5a) |
| 235 | +add_executable(${target} ${CHAP7_DIR}/7-5a.c) |
| 236 | +set(target c7_6) |
| 237 | +add_executable(${target} ${CHAP7_DIR}/7-6.c) |
| 238 | +set(target c7_7) |
| 239 | +add_executable(${target} ${CHAP7_DIR}/7-7.c) |
| 240 | +set(target c7_8) |
| 241 | +add_executable(${target} ${CHAP7_DIR}/7-8.c) |
| 242 | +set(target c7_9) |
| 243 | +add_executable(${target} ${CHAP7_DIR}/7-9.c) |
| 244 | + |
| 245 | +set(target c8_1) |
| 246 | +add_executable(${target} ${CHAP8_DIR}/8-1.c) |
| 247 | +set(target c8_2) |
| 248 | +add_executable(${target} ${CHAP8_DIR}/8-2.c) |
| 249 | +set(target c8_3) |
| 250 | +add_executable(${target} ${CHAP8_DIR}/8-3.c) |
| 251 | +set(target c8_4) |
| 252 | +add_executable(${target} ${CHAP8_DIR}/8-4.c) |
| 253 | +set(target c8_4l) |
| 254 | +add_executable(${target} ${CHAP8_DIR}/8-4-linebuf.c) |
| 255 | + |
| 256 | +set(target c8_5) |
| 257 | +add_executable(${target} ${CHAP8_DIR}/8-5.c) |
| 258 | +set(target c8_6) |
| 259 | +add_executable(${target} ${CHAP8_DIR}/8-6.c) |
| 260 | +set(target c8_7) |
| 261 | +add_executable(${target} ${CHAP8_DIR}/8-7.c) |
| 262 | +set(target c8_8) |
| 263 | +add_executable(${target} ${CHAP8_DIR}/8-8.c) |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
0 commit comments