summaryrefslogtreecommitdiffstats
path: root/Source/CTest/CMakeLists.txt
blob: 0cfef8a46f752b8a835078c54f0d359f207d735f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
CMAKE_MINIMUM_REQUIRED(VERSION 1.5)
PROJECT(CTEST CXX)

#silence duplicate symbol warnings on AIX
IF(CMAKE_SYSTEM MATCHES "AIX.*")
  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "AIX.*")

IF(CMAKE_BUILD_WITH_CURL)
  SET(CMAKE_LIBRARY CMakeLib)
ELSE(CMAKE_BUILD_WITH_CURL)
  SUBDIRS(Curl)
  FIND_LIBRARY(CMAKE_LIBRARY NAMES CMakeLib PATHS 
    ${CTEST_BINARY_DIR}/..
    ${CTEST_BINARY_DIR}/../Source
    ${CTEST_BINARY_DIR}/../../Source)
ENDIF(CMAKE_BUILD_WITH_CURL)

SET(CTEST_SRCS
  ../ctest.cxx
  ../cmCTest.cxx
  cmCTestSubmit.cxx)

GET_FILENAME_COMPONENT(CMAKE_DIR ${CMAKE_LIBRARY} PATH)

INCLUDE_DIRECTORIES(${CTEST_SOURCE_DIR}
  ${CTEST_SOURCE_DIR}/..
  ${CTEST_SOURCE_DIR}/Curl
  ${CMAKE_DIR}
  ${CMAKE_DIR}/..)

IF(NOT CMAKE_BUILD_WITH_CURL)
  ADD_DEFINITIONS(-DHAVE_CURL)
  ADD_EXECUTABLE(cmtest ${CTEST_SRCS})
  TARGET_LINK_LIBRARIES(cmtest ${CMAKE_LIBRARY} Curl)
ENDIF(NOT CMAKE_BUILD_WITH_CURL)