Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Tests/BuildDepends/CMakeLists.txt
3148 views
1
# this test creates a static library and an executable
2
# the source to the library is then changed
3
# and the build is done on the executable and if things
4
# are working the executable should relink with the new
5
# value. The subdir Project contains the CMakelists.txt
6
# and source files for the test project.
7
cmake_minimum_required (VERSION 3.10)
8
project(BuildDepends)
9
10
# This entire test takes place during the initial
11
# configure step. It should not run again when the
12
# project is built.
13
set(CMAKE_SUPPRESS_REGENERATION 1)
14
15
if(CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_VS_PLATFORM_TOOLSET MATCHES "^(v90|v100|v110|v120|v140)$")
16
# These toolsets update 'link_depends_no_shared_lib.lib' during rebuild in Release mode.
17
set(config Debug)
18
else()
19
# Some toolsets update 'link_depends_no_shared_lib.pdb' during rebuild in Debug mode.
20
set(config Release)
21
endif()
22
set(CMAKE_TRY_COMPILE_CONFIGURATION "${config}")
23
24
# Xcode needs some help with the fancy dependencies in this test.
25
if(XCODE AND XCODE_VERSION VERSION_LESS 5)
26
set(HELP_XCODE 1)
27
endif()
28
function(help_xcode_depends)
29
if(HELP_XCODE)
30
file(GLOB_RECURSE MACRO_OBJS
31
${BuildDepends_BINARY_DIR}/Project/zot_macro_*.o*
32
)
33
if(MACRO_OBJS)
34
message("Helping Xcode by removing objects [${MACRO_OBJS}]")
35
file(REMOVE ${MACRO_OBJS})
36
endif()
37
endif()
38
endfunction()
39
40
# The Intel compiler causes the MSVC linker to crash during
41
# incremental linking, so avoid the /INCREMENTAL:YES flag.
42
if(WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
43
set(_cmake_options "-DCMAKE_EXE_LINKER_FLAGS=")
44
endif()
45
46
if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja|FASTBuild")
47
set(TEST_LINK_DEPENDS ${BuildDepends_BINARY_DIR}/Project/linkdep.txt)
48
file(WRITE ${TEST_LINK_DEPENDS} "1")
49
endif()
50
list(APPEND _cmake_options "-DTEST_LINK_DEPENDS=${TEST_LINK_DEPENDS}")
51
52
list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1")
53
54
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
55
set(TEST_MULTI3 1)
56
list(APPEND _cmake_options "-DTEST_MULTI3=1")
57
endif()
58
59
if (APPLE)
60
list(APPEND _cmake_options "-DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION}")
61
endif()
62
63
file(MAKE_DIRECTORY ${BuildDepends_BINARY_DIR}/Project)
64
message("Creating Project/foo.cxx")
65
write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx
66
"const char* foo() { return \"foo\";}" )
67
68
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot.hxx.in
69
"static const char* zot = \"zot\";\n")
70
file(WRITE ${BuildDepends_BINARY_DIR}/Project/dir/header.txt
71
"#define HEADER_STRING \"ninja\"\n" )
72
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_custom.hxx.in
73
"static const char* zot_custom = \"zot_custom\";\n")
74
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_dir.hxx
75
"static const char* zot_macro_dir = \"zot_macro_dir\";\n")
76
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_tgt.hxx
77
"static const char* zot_macro_tgt = \"zot_macro_tgt\";\n")
78
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_pch.hxx
79
"#ifndef ZOT_PCH_HXX\n"
80
"#define ZOT_PCH_HXX\n"
81
"static const char* zot_pch = \"zot_pch\";\n"
82
"#endif\n"
83
)
84
85
file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_lib.h
86
"#define link_depends_no_shared_lib_value 1\n")
87
file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_exe.h
88
"#define link_depends_no_shared_exe_value 0\n")
89
set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_check.txt)
90
91
file(WRITE ${BuildDepends_BINARY_DIR}/Project/object_depends.txt "0\n")
92
set(object_depends_check_txt ${BuildDepends_BINARY_DIR}/Project/object_depends_check.txt)
93
94
file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external original\n")
95
file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in original\n")
96
file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp original\n")
97
file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt "multi3-stamp original\n")
98
99
help_xcode_depends()
100
101
message("Building project first time")
102
try_compile(RESULT
103
${BuildDepends_BINARY_DIR}/Project
104
${BuildDepends_SOURCE_DIR}/Project
105
testRebuild
106
CMAKE_FLAGS ${_cmake_options}
107
OUTPUT_VARIABLE OUTPUT)
108
if(HELP_XCODE)
109
try_compile(RESULT
110
${BuildDepends_BINARY_DIR}/Project
111
${BuildDepends_SOURCE_DIR}/Project
112
testRebuild
113
OUTPUT_VARIABLE OUTPUT)
114
try_compile(RESULT
115
${BuildDepends_BINARY_DIR}/Project
116
${BuildDepends_SOURCE_DIR}/Project
117
testRebuild
118
OUTPUT_VARIABLE OUTPUT)
119
endif()
120
121
message("Output from first build:\n${OUTPUT}")
122
if(NOT RESULT)
123
message(SEND_ERROR "Could not build test project (1)!")
124
endif()
125
126
# find and save the ninjadep executable
127
set(ninjadep ${BuildDepends_BINARY_DIR}/Project/ninjadep${CMAKE_EXECUTABLE_SUFFIX})
128
if(EXISTS
129
"${BuildDepends_BINARY_DIR}/Project/${config}/ninjadep${CMAKE_EXECUTABLE_SUFFIX}" )
130
message("found ${config}/ninjadep${CMAKE_EXECUTABLE_SUFFIX}")
131
set(ninjadep
132
"${BuildDepends_BINARY_DIR}/Project/${config}/ninjadep${CMAKE_EXECUTABLE_SUFFIX}")
133
endif()
134
message("Running ${ninjadep} ")
135
execute_process(COMMAND ${ninjadep} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
136
string(REGEX REPLACE "[\r\n]" " " out "${out}")
137
message("Run result: ${runResult} Output: \"${out}\"")
138
139
if("${out}" STREQUAL "HEADER_STRING: ninja ")
140
message("Worked!")
141
else()
142
message(SEND_ERROR "Project did not rebuild properly. Output[${out}]\n"
143
" expected [HEADER_STRING: ninja]")
144
endif()
145
146
set(bar ${BuildDepends_BINARY_DIR}/Project/bar${CMAKE_EXECUTABLE_SUFFIX})
147
if(EXISTS
148
"${BuildDepends_BINARY_DIR}/Project/${config}/bar${CMAKE_EXECUTABLE_SUFFIX}" )
149
message("found ${config}/bar${CMAKE_EXECUTABLE_SUFFIX}")
150
set(bar
151
"${BuildDepends_BINARY_DIR}/Project/${config}/bar${CMAKE_EXECUTABLE_SUFFIX}")
152
endif()
153
set(zot ${BuildDepends_BINARY_DIR}/Project/zot${CMAKE_EXECUTABLE_SUFFIX})
154
if(EXISTS
155
"${BuildDepends_BINARY_DIR}/Project/${config}/zot${CMAKE_EXECUTABLE_SUFFIX}" )
156
message("found ${config}/zot${CMAKE_EXECUTABLE_SUFFIX}")
157
set(zot
158
"${BuildDepends_BINARY_DIR}/Project/${config}/zot${CMAKE_EXECUTABLE_SUFFIX}")
159
endif()
160
161
message("Running ${bar} ")
162
execute_process(COMMAND ${bar} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
163
string(REGEX REPLACE "[\r\n]" " " out "${out}")
164
message("Run result: ${runResult} Output: \"${out}\"")
165
166
if("${out}" STREQUAL "foo ")
167
message("Worked!")
168
else()
169
message(SEND_ERROR "Project did not initially build properly: ${out}")
170
endif()
171
172
message("Running ${zot} ")
173
execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
174
string(REGEX REPLACE "[\r\n]" " " out "${out}")
175
message("Run result: ${runResult} Output: \"${out}\"")
176
177
set(VALUE_UNCHANGED "[zot] [zot_custom] [zot_macro_dir] [zot_macro_tgt] [zot_pch] ")
178
if("${out}" STREQUAL "${VALUE_UNCHANGED}")
179
message("Worked!")
180
else()
181
message(SEND_ERROR "Project did not initially build properly: ${out}")
182
endif()
183
184
if(EXISTS "${link_depends_no_shared_check_txt}")
185
file(STRINGS "${link_depends_no_shared_check_txt}" link_depends_no_shared_check LIMIT_COUNT 1)
186
if("${link_depends_no_shared_check}" STREQUAL "1")
187
message(STATUS "link_depends_no_shared_exe is newer than link_depends_no_shared_lib as expected.")
188
else()
189
message(SEND_ERROR "Project did not initially build properly: "
190
"link_depends_no_shared_exe is older than link_depends_no_shared_lib.")
191
endif()
192
else()
193
message(SEND_ERROR "Project did not initially build properly: "
194
"Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.")
195
endif()
196
197
if(EXISTS ${BuildDepends_BINARY_DIR}/Project/external.out)
198
file(STRINGS ${BuildDepends_BINARY_DIR}/Project/external.out external_out)
199
if("${external_out}" STREQUAL "external original")
200
message(STATUS "external.out contains '${external_out}'")
201
else()
202
message(SEND_ERROR "Project did not initially build properly: "
203
"external.out contains '${external_out}'")
204
endif()
205
else()
206
message(SEND_ERROR "Project did not initially build properly: "
207
"external.out is missing")
208
endif()
209
210
if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi1-out2-copy.txt)
211
file(STRINGS ${BuildDepends_BINARY_DIR}/Project/multi1-out2-copy.txt multi1_out)
212
if("${multi1_out}" STREQUAL "multi1-in original")
213
message(STATUS "multi1-out2-copy.txt contains '${multi1_out}'")
214
else()
215
message(SEND_ERROR "Project did not initially build properly: "
216
"multi1-out2-copy.txt contains '${multi1_out}'")
217
endif()
218
else()
219
message(SEND_ERROR "Project did not initially build properly: "
220
"multi1-out2-copy.txt is missing")
221
endif()
222
223
if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt)
224
if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt
225
IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt)
226
message(STATUS "multi2-real.txt is newer than multi2-stamp.txt")
227
else()
228
message(SEND_ERROR "Project did not initially build properly: "
229
"multi2-real.txt is not newer than multi2-stamp.txt")
230
endif()
231
else()
232
message(SEND_ERROR "Project did not initially build properly: "
233
"multi2-real.txt is missing")
234
endif()
235
236
if(TEST_MULTI3)
237
if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt)
238
if(${BuildDepends_BINARY_DIR}/Project/multi3-real.txt
239
IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt)
240
message(STATUS "multi3-real.txt is newer than multi3-stamp.txt")
241
else()
242
message(SEND_ERROR "Project did not initially build properly: "
243
"multi3-real.txt is not newer than multi3-stamp.txt")
244
endif()
245
else()
246
message(SEND_ERROR "Project did not initially build properly: "
247
"multi3-real.txt is missing")
248
endif()
249
endif()
250
251
message("Waiting 3 seconds...")
252
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 3)
253
254
message("Modifying Project/foo.cxx")
255
write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx
256
"const char* foo() { return \"foo changed\";}" )
257
file(WRITE "${BuildDepends_BINARY_DIR}/Project/dir/header.txt"
258
"#define HEADER_STRING \"ninja changed\"\n" )
259
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot.hxx.in
260
"static const char* zot = \"zot changed\";\n")
261
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_custom.hxx.in
262
"static const char* zot_custom = \"zot_custom changed\";\n")
263
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_dir.hxx
264
"static const char* zot_macro_dir = \"zot_macro_dir changed\";\n")
265
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_tgt.hxx
266
"static const char* zot_macro_tgt = \"zot_macro_tgt changed\";\n")
267
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_pch.hxx
268
"#ifndef ZOT_PCH_HXX\n"
269
"#define ZOT_PCH_HXX\n"
270
"static const char* zot_pch = \"zot_pch changed\";\n"
271
"#endif\n"
272
)
273
274
file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_lib.h
275
"#define link_depends_no_shared_lib_value 0\n")
276
277
file(WRITE ${BuildDepends_BINARY_DIR}/Project/object_depends.txt "1\n")
278
279
if(TEST_LINK_DEPENDS)
280
file(WRITE ${TEST_LINK_DEPENDS} "2")
281
endif()
282
283
file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external changed\n")
284
file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in changed\n")
285
file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp changed\n")
286
file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt "multi3-stamp changed\n")
287
288
help_xcode_depends()
289
290
message("Building project second time")
291
try_compile(RESULT
292
${BuildDepends_BINARY_DIR}/Project
293
${BuildDepends_SOURCE_DIR}/Project
294
testRebuild
295
CMAKE_FLAGS ${_cmake_options}
296
OUTPUT_VARIABLE OUTPUT)
297
298
# Xcode is in serious need of help here
299
if(HELP_XCODE)
300
try_compile(RESULT
301
${BuildDepends_BINARY_DIR}/Project
302
${BuildDepends_SOURCE_DIR}/Project
303
testRebuild
304
OUTPUT_VARIABLE OUTPUT)
305
try_compile(RESULT
306
${BuildDepends_BINARY_DIR}/Project
307
${BuildDepends_SOURCE_DIR}/Project
308
testRebuild
309
OUTPUT_VARIABLE OUTPUT)
310
endif()
311
312
message("Output from second build:\n${OUTPUT}")
313
if(NOT RESULT)
314
message(SEND_ERROR "Could not build test project (2)!")
315
endif()
316
if(EXISTS
317
"${BuildDepends_BINARY_DIR}/Project/${config}/bar${CMAKE_EXECUTABLE_SUFFIX}" )
318
message("found ${config}/bar${CMAKE_EXECUTABLE_SUFFIX}")
319
endif()
320
if(EXISTS
321
"${BuildDepends_BINARY_DIR}/Project/${config}/zot${CMAKE_EXECUTABLE_SUFFIX}" )
322
message("found ${config}/zot${CMAKE_EXECUTABLE_SUFFIX}")
323
endif()
324
325
message("Running ${ninjadep} ")
326
execute_process(COMMAND ${ninjadep} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
327
string(REGEX REPLACE "[\r\n]" " " out "${out}")
328
message("Run result: ${runResult} Output: \"${out}\"")
329
330
if("${out}" STREQUAL "HEADER_STRING: ninja changed ")
331
message("Worked!")
332
else()
333
message(SEND_ERROR "Project did not rebuild properly. Output[${out}]\n"
334
" expected [HEADER_STRING: ninja changed]")
335
endif()
336
337
message("Running ${bar} ")
338
execute_process(COMMAND ${bar} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
339
string(REGEX REPLACE "[\r\n]" " " out "${out}")
340
message("Run result: ${runResult} Output: \"${out}\"")
341
342
if("${out}" STREQUAL "foo changed ")
343
message("Worked!")
344
else()
345
message(SEND_ERROR "Project did not rebuild properly!")
346
endif()
347
348
message("Running ${zot} ")
349
execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
350
string(REGEX REPLACE "[\r\n]" " " out "${out}")
351
message("Run result: ${runResult} Output: \"${out}\"")
352
353
set(VALUE_CHANGED
354
"[zot changed] [zot_custom changed] [zot_macro_dir changed] [zot_macro_tgt changed] [zot_pch changed] "
355
)
356
if("${out}" STREQUAL "${VALUE_CHANGED}")
357
message("Worked!")
358
else()
359
message(SEND_ERROR "Project did not rebuild properly!")
360
endif()
361
362
if(TEST_LINK_DEPENDS)
363
set(linkdep ${BuildDepends_BINARY_DIR}/Project/linkdep${CMAKE_EXECUTABLE_SUFFIX})
364
if(${linkdep} IS_NEWER_THAN ${TEST_LINK_DEPENDS})
365
message("LINK_DEPENDS worked")
366
else()
367
message(SEND_ERROR "LINK_DEPENDS failed. Executable
368
${linkdep}
369
is not newer than dependency
370
${TEST_LINK_DEPENDS}
371
")
372
endif()
373
374
set(linkdep2 ${BuildDepends_BINARY_DIR}/Project/linkdep2${CMAKE_EXECUTABLE_SUFFIX})
375
if(${linkdep2} IS_NEWER_THAN ${TEST_LINK_DEPENDS})
376
message("INTERFACE_LINK_DEPENDS worked")
377
else()
378
message(SEND_ERROR "INTERFACE_LINK_DEPENDS failed. Executable
379
${linkdep2}
380
is not newer than dependency
381
${TEST_LINK_DEPENDS}
382
")
383
endif()
384
385
set(linkdep3 ${BuildDepends_BINARY_DIR}/Project/linkdep3${CMAKE_EXECUTABLE_SUFFIX})
386
if(${linkdep3} IS_NEWER_THAN ${TEST_LINK_DEPENDS})
387
message("$<LINK_LANGUAGE> in LINK_DEPENDS worked")
388
else()
389
message(SEND_ERROR "$<LINK_LANGUAGE> in LINK_DEPENDS failed. Executable
390
${linkdep3}
391
is not newer than dependency
392
${TEST_LINK_DEPENDS}
393
")
394
endif()
395
396
set(linkdep4 ${BuildDepends_BINARY_DIR}/Project/linkdep4${CMAKE_EXECUTABLE_SUFFIX})
397
if(${linkdep4} IS_NEWER_THAN ${TEST_LINK_DEPENDS})
398
message("$<LINK_LANGUAGE> in INTERFACE_LINK_DEPENDS worked")
399
else()
400
message(SEND_ERROR "$<LINK_LANGUAGE> in INTERFACE_LINK_DEPENDS failed. Executable
401
${linkdep4}
402
is not newer than dependency
403
${TEST_LINK_DEPENDS}
404
")
405
endif()
406
endif()
407
408
if(EXISTS "${link_depends_no_shared_check_txt}")
409
file(STRINGS "${link_depends_no_shared_check_txt}" link_depends_no_shared_check LIMIT_COUNT 1)
410
if("${link_depends_no_shared_check}" STREQUAL "0")
411
message(STATUS "link_depends_no_shared_exe is older than link_depends_no_shared_lib as expected.")
412
elseif(XCODE AND NOT XCODE_VERSION VERSION_LESS 5)
413
message(STATUS "Known limitation: link_depends_no_shared_exe is newer than link_depends_no_shared_lib but we cannot stop Xcode ${XCODE_VERSION} from enforcing this dependency.")
414
else()
415
message(SEND_ERROR "Project did not rebuild properly: link_depends_no_shared_exe is newer than link_depends_no_shared_lib.")
416
endif()
417
else()
418
message(SEND_ERROR "Project did not rebuild properly. "
419
"Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.")
420
endif()
421
422
if(EXISTS "${object_depends_check_txt}")
423
file(STRINGS "${object_depends_check_txt}" object_depends_check LIMIT_COUNT 1)
424
if("${object_depends_check}" STREQUAL "1")
425
message(STATUS "object_depends exe is newer than object_depends.txt as expected.")
426
elseif(CMAKE_GENERATOR MATCHES "Visual Studio|Xcode")
427
message(STATUS "Known limitation: OBJECT_DEPENDS does not work on ${CMAKE_GENERATOR}")
428
else()
429
message(SEND_ERROR "Project did not rebuild properly: object_depends exe is not newer than object_depends.txt.")
430
endif()
431
else()
432
message(SEND_ERROR "Project did not rebuild properly. "
433
"object_depends exe and object_depends.txt are not both present.")
434
endif()
435
436
if(EXISTS ${BuildDepends_BINARY_DIR}/Project/external.out)
437
file(STRINGS ${BuildDepends_BINARY_DIR}/Project/external.out external_out)
438
if("${external_out}" STREQUAL "external changed")
439
message(STATUS "external.out contains '${external_out}'")
440
else()
441
message(SEND_ERROR "Project did not rebuild properly: "
442
"external.out contains '${external_out}'")
443
endif()
444
else()
445
message(SEND_ERROR "Project did not rebuild properly: "
446
"external.out is missing")
447
endif()
448
449
if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi1-out2-copy.txt)
450
file(STRINGS ${BuildDepends_BINARY_DIR}/Project/multi1-out2-copy.txt multi1_out)
451
if("${multi1_out}" STREQUAL "multi1-in changed")
452
message(STATUS "multi1-out2-copy.txt contains '${multi1_out}'")
453
else()
454
message(SEND_ERROR "Project did not rebuild properly: "
455
"multi1-out2-copy.txt contains '${multi1_out}'")
456
endif()
457
else()
458
message(SEND_ERROR "Project did not rebuild properly: "
459
"multi1-out2-copy.txt is missing")
460
endif()
461
462
if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt)
463
if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt
464
IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt)
465
message(STATUS "multi2-real.txt is newer than multi2-stamp.txt")
466
else()
467
message(SEND_ERROR "Project did not rebuild properly: "
468
"multi2-real.txt is not newer than multi2-stamp.txt")
469
endif()
470
else()
471
message(SEND_ERROR "Project did not rebuild properly: "
472
"multi2-real.txt is missing")
473
endif()
474
475
if(TEST_MULTI3)
476
if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt)
477
if(${BuildDepends_BINARY_DIR}/Project/multi3-real.txt
478
IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt)
479
message(STATUS "multi3-real.txt is newer than multi3-stamp.txt")
480
else()
481
message(SEND_ERROR "Project did not rebuild properly: "
482
"multi3-real.txt is not newer than multi3-stamp.txt")
483
endif()
484
else()
485
message(SEND_ERROR "Project did not rebuild properly: "
486
"multi3-real.txt is missing")
487
endif()
488
endif()
489
490