gravatar
ladanyi@tmit.bme.hu
ladanyi@tmit.bme.hu
Add check target for CMake (#388)
0 2 0
default
2 files changed with 4 insertions and 1 deletions:
↑ Collapse diff ↑
Ignore white space 48 line context
... ...
@@ -18,48 +18,50 @@
18 18
  IF(HG_REVISION STREQUAL "")
19 19
    SET(HG_REVISION "hg-tip")
20 20
  ENDIF()
21 21
  SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
22 22
ENDIF()
23 23

	
24 24
SET(PROJECT_VERSION ${LEMON_VERSION})
25 25

	
26 26
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
27 27

	
28 28
FIND_PACKAGE(Doxygen)
29 29
FIND_PACKAGE(Ghostscript)
30 30
FIND_PACKAGE(GLPK 4.33)
31 31
FIND_PACKAGE(CPLEX)
32 32
FIND_PACKAGE(COIN)
33 33

	
34 34
INCLUDE(CheckTypeSize)
35 35
CHECK_TYPE_SIZE("long long" LONG_LONG)
36 36
SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
37 37

	
38 38
INCLUDE(FindPythonInterp)
39 39

	
40 40
ENABLE_TESTING()
41 41

	
42
ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
43

	
42 44
ADD_SUBDIRECTORY(lemon)
43 45
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
44 46
  ADD_SUBDIRECTORY(demo)
45 47
  ADD_SUBDIRECTORY(tools)
46 48
  ADD_SUBDIRECTORY(doc)
47 49
  ADD_SUBDIRECTORY(test)
48 50
ENDIF()
49 51

	
50 52
CONFIGURE_FILE(
51 53
  ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
52 54
  ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
53 55
  @ONLY
54 56
)
55 57
IF(UNIX)
56 58
  INSTALL(
57 59
    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
58 60
    DESTINATION share/lemon/cmake
59 61
  )
60 62
ELSEIF(WIN32)
61 63
  INSTALL(
62 64
    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
63 65
    DESTINATION cmake
64 66
  )
65 67
ENDIF()
Ignore white space 48 line context
... ...
@@ -96,28 +96,29 @@
96 96

	
97 97
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
98 98
  ADD_TEST(mip_test mip_test)
99 99

	
100 100
  IF(WIN32 AND LEMON_HAVE_GLPK)
101 101
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
102 102
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
103 103
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
104 104
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
105 105
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
106 106
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
107 107
    )
108 108
  ENDIF()
109 109

	
110 110
  IF(WIN32 AND LEMON_HAVE_CPLEX)
111 111
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
112 112
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
113 113
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
114 114
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
115 115
    )
116 116
  ENDIF()
117 117
ENDIF()
118 118

	
119 119
FOREACH(TEST_NAME ${TESTS})
120
  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
120
  ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
121 121
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
122 122
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
123
  ADD_DEPENDENCIES(check ${TEST_NAME})
123 124
ENDFOREACH()
0 comments (0 inline)