~ubuntu-branches/ubuntu/edgy/cmake/edgy-backports

« back to all changes in this revision

Viewing changes to Tests/ComplexOneConfig/CMakeLists.txt

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2007-04-10 17:52:23 UTC
  • mfrom: (2.1.2 hoary) (8.1.5 feisty)
  • Revision ID: james.westby@ubuntu.com-20070410175223-taf5w6y2halxs5jh
Tags: 2.4.6-0ubuntu1~edgy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
SET(CMAKE_BACKWARDS_COMPATIBILITY 1.4)
5
5
PROJECT (Complex)
6
6
 
 
7
# Choose whether to test CMakeLib.
 
8
SET(COMPLEX_TEST_CMAKELIB 1)
 
9
IF(CMAKE_TEST_DIFFERENT_GENERATOR)
 
10
  SET(COMPLEX_TEST_CMAKELIB 0)
 
11
ENDIF(CMAKE_TEST_DIFFERENT_GENERATOR)
 
12
IF(CMAKE_TEST_SYSTEM_LIBRARIES)
 
13
  SET(COMPLEX_TEST_CMAKELIB 0)
 
14
ENDIF(CMAKE_TEST_SYSTEM_LIBRARIES)
 
15
 
7
16
#
8
17
# Define a macro
9
18
#
44
53
 
45
54
TEST_VAR_ARG(1 2 3)
46
55
 
 
56
# Floating-point comparison test.
 
57
IF(2.4 LESS 2.4)
 
58
  MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4")
 
59
ENDIF(2.4 LESS 2.4)
 
60
IF(2.4 GREATER 2.4)
 
61
  MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
 
62
ENDIF(2.4 GREATER 2.4)
 
63
IF(NOT 2.4 EQUAL 2.4)
 
64
  MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
 
65
ENDIF(NOT 2.4 EQUAL 2.4)
 
66
 
47
67
#
48
68
# Use the ansi CXX compile flag for building cmake
49
69
#
100
120
INCLUDE_DIRECTORIES(BEFORE
101
121
  ${Complex_BINARY_DIR}
102
122
)
 
123
INCLUDE_DIRECTORIES(SYSTEM Library/SystemDir)
103
124
 
104
 
INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile).*$" "^cmMissing")
 
125
INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile|test).*$" "^cmMissing")
105
126
 
106
127
LINK_DIRECTORIES(
107
128
  ${Complex_BINARY_DIR}/Library
271
292
 
272
293
SET(SHOULD_BE_ZERO )
273
294
SET(SHOULD_BE_ONE 1)
 
295
 
 
296
# test elseif functionality, the mess below tries to catch problem 
 
297
# of clauses being executed early or late etc
 
298
set (RESULT 3)
 
299
if (RESULT EQUAL 1)
 
300
  if (RESULT EQUAL 2)
 
301
    set (ELSEIF_RESULT 1)
 
302
  elseif (RESULT EQUAL 3)
 
303
    set (ELSEIF_RESULT 1)
 
304
  endif (RESULT EQUAL 2)  
 
305
elseif (RESULT EQUAL 2)
 
306
  set (ELSEIF_RESULT 1)
 
307
elseif (RESULT EQUAL 3)
 
308
  if (RESULT EQUAL 2)
 
309
    set (ELSEIF_RESULT 1)
 
310
  elseif (RESULT EQUAL 3)
 
311
    if (NOT ELSEIF_RESULT EQUAL 1)
 
312
      set (ELSEIF_RESULT 2)
 
313
    endif (NOT ELSEIF_RESULT EQUAL 1)      
 
314
  endif (RESULT EQUAL 2)  
 
315
elseif (RESULT EQUAL 4)
 
316
  if (RESULT EQUAL 2)
 
317
    set (ELSEIF_RESULT 1)
 
318
  elseif (RESULT EQUAL 3)
 
319
    set (ELSEIF_RESULT 1)
 
320
  endif (RESULT EQUAL 2)  
 
321
else (RESULT  EQUAL 1)
 
322
  if (RESULT EQUAL 2)
 
323
    set (ELSEIF_RESULT 1)
 
324
  elseif (RESULT EQUAL 3)
 
325
    set (ELSEIF_RESULT 1)
 
326
  endif (RESULT EQUAL 2)  
 
327
endif (RESULT EQUAL 1)
 
328
 
 
329
if (NOT ELSEIF_RESULT EQUAL 2)
 
330
  set (ELSEIF_RESULT 0)
 
331
endif (NOT ELSEIF_RESULT EQUAL 2)
 
332
 
274
333
#
275
334
# Configure file 
276
335
# (plug vars to #define so that they can be tested)
303
362
    "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")")
304
363
ENDIF(NOT STRING_REGEX_PASSED)
305
364
 
 
365
 
306
366
#
307
367
# Create the libs and the main exe
308
368
#