CMakeLists.txt 2.07 KB
Newer Older
Andy Cedilnik's avatar
Andy Cedilnik committed
1 2 3 4 5 6 7 8 9
## Copyright 2003 Sandia Coporation
## Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
## license for use of this work by or on behalf of the U.S. Government.
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that this Notice and any statement
## of authorship are reproduced on all copies.
#

SET(MyTests
10 11 12 13 14 15 16
  BlankTiles.c
  BoundsBehindViewer.c
  CompressionSize.c
  DisplayNoDraw.c
  RandomTransform.c
  SimpleExample.c
  )
Andy Cedilnik's avatar
Andy Cedilnik committed
17 18 19

SET(UTIL_SRCS init.c ppm.c)

20 21
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

Andy Cedilnik's avatar
Andy Cedilnik committed
22
CREATE_TEST_SOURCELIST(Tests icetTests_mpi.c ${MyTests}
23 24
  EXTRA_INCLUDE mpi_comm.h
  FUNCTION init_mpi_comm)
Andy Cedilnik's avatar
Andy Cedilnik committed
25 26

ADD_EXECUTABLE(icetTests_mpi ${Tests} ${UTIL_SRCS})
27 28
TARGET_LINK_LIBRARIES(icetTests_mpi
  icet
29
  icet_gl
30 31 32
  icet_strategies
  icet_mpi
  ${OPENGL_glu_LIBRARY}
33
  ${GLUT_LIBRARIES}
34
  )
Andy Cedilnik's avatar
Andy Cedilnik committed
35 36

IF (ICET_MPIRUN_EXE)
37
  SET(PRE_TEST_FLAGS ${ICET_MPIRUN_EXE} ${ICET_MPI_NUMPROC_FLAG} ${ICET_MPI_MAX_NUMPROCS} ${ICET_MPI_PREFLAGS})
Andy Cedilnik's avatar
Andy Cedilnik committed
38 39 40
  SET(POST_TEST_FLAGS ${ICET_MPI_POSTFLAGS})
ENDIF (ICET_MPIRUN_EXE)

41
SET(ICET_TEST_FLAGS "" CACHE STRING "Arguments given to the test program.  These are given between the test executable and the name of the test.  Run the test executable with the -h flag to see what is available.")
Andy Cedilnik's avatar
Andy Cedilnik committed
42 43 44 45 46
MARK_AS_ADVANCED(ICET_TEST_FLAGS)
SEPARATE_ARGUMENTS(ICET_TEST_FLAGS)

FOREACH (test ${MyTests})
  GET_FILENAME_COMPONENT(TName ${test} NAME_WE)
47 48 49 50
  ADD_TEST(IceT${TName}
    ${PRE_TEST_FLAGS}
    ${C_TEST_PATH}/icetTests_mpi ${ICET_TEST_FLAGS} ${TName}
    ${POST_TEST_FLAGS})
51 52 53 54 55 56 57 58 59
  IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.1)
    SET_TESTS_PROPERTIES(IceT${TName}
      PROPERTIES FAIL_REGULAR_EXPRESSION
      ":ERROR:;TEST NOT RUN;TEST NOT PASSED;TEST FAILED"
      )
    SET_TESTS_PROPERTIES(IceT${TName}
      PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed"
      )
  ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.1)
Andy Cedilnik's avatar
Andy Cedilnik committed
60 61 62
ENDFOREACH(test)

IF (WIN32)
Kenneth Moreland's avatar
Kenneth Moreland committed
63
  ADD_CUSTOM_TARGET(logclean erase log.???? *.ppm)
Andy Cedilnik's avatar
Andy Cedilnik committed
64
ELSE (WIN32)
65
  ADD_CUSTOM_TARGET(logclean rm -f log.???? *.ppm core.*)
Andy Cedilnik's avatar
Andy Cedilnik committed
66
ENDIF (WIN32)