ENH: Enable CTest to be build as a part of CMake

This commit is contained in:
Andy Cedilnik 2003-04-25 15:17:08 -04:00
parent 05ce4afb3e
commit d5e46fa947
2 changed files with 42 additions and 18 deletions

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 1.3) CMAKE_MINIMUM_REQUIRED(VERSION 1.5)
SET(SRCS SET(SRCS
cmake.cxx cmake.cxx
@ -102,7 +102,8 @@ LINK_DIRECTORIES(${CMake_BINARY_DIR}/Source)
ADD_EXECUTABLE(cmake cmakemain.cxx) ADD_EXECUTABLE(cmake cmakemain.cxx)
ADD_EXECUTABLE(DumpDocumentation cmDumpDocumentation) ADD_EXECUTABLE(DumpDocumentation cmDumpDocumentation)
ADD_EXECUTABLE(ctest ctest.cxx cmCTest.cxx)
SET(CMTEST_SRCS ctest.cxx cmCTest.cxx)
IF (UNIX) IF (UNIX)
TARGET_LINK_LIBRARIES(CMakeLib ${CMAKE_DL_LIBS}) TARGET_LINK_LIBRARIES(CMakeLib ${CMAKE_DL_LIBS})
@ -110,7 +111,24 @@ ENDIF (UNIX)
TARGET_LINK_LIBRARIES(cmake CMakeLib) TARGET_LINK_LIBRARIES(cmake CMakeLib)
TARGET_LINK_LIBRARIES(DumpDocumentation CMakeLib) TARGET_LINK_LIBRARIES(DumpDocumentation CMakeLib)
TARGET_LINK_LIBRARIES(ctest CMakeLib)
OPTION(CMAKE_WITH_CURL "Build CMake with Curl support" OFF)
MARK_AS_ADVANCED(CMAKE_WITH_CURL)
IF(CMAKE_WITH_CURL)
SUBDIRS(CTest)
SET(CMTEST_SRCS ${CMTEST_SRCS} CTest/cmCTestSubmit.cxx)
ADD_DEFINITIONS(-DHAVE_CURL)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/Source/CTest/Curl
${CMAKE_SOURCE_DIR}/Source/CTest
)
ENDIF(CMAKE_WITH_CURL)
ADD_EXECUTABLE(cmtest ${CMTEST_SRCS})
TARGET_LINK_LIBRARIES(cmtest CMakeLib)
IF(CMAKE_WITH_CURL)
TARGET_LINK_LIBRARIES(cmtest Curl)
ENDIF(CMAKE_WITH_CURL)
IF (UNIX) IF (UNIX)
INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL) INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL)

View File

@ -4,30 +4,36 @@ PROJECT(CTEST CXX)
#silence duplicate symbol warnings on AIX #silence duplicate symbol warnings on AIX
IF(CMAKE_SYSTEM MATCHES "AIX.*") IF(CMAKE_SYSTEM MATCHES "AIX.*")
IF(NOT CMAKE_COMPILER_IS_GNUCXX) IF(NOT CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "AIX.*") ENDIF(CMAKE_SYSTEM MATCHES "AIX.*")
SUBDIRS(Curl) SUBDIRS(Curl)
FIND_LIBRARY(CMAKE_LIBRARY NAMES CMakeLib PATHS IF(CMAKE_WITH_CURL)
${CTEST_BINARY_DIR}/.. SET(CMAKE_LIBRARY CMakeLib)
${CTEST_BINARY_DIR}/../Source ELSE(CMAKE_WITH_CURL)
${CTEST_BINARY_DIR}/../../Source) FIND_LIBRARY(CMAKE_LIBRARY NAMES CMakeLib PATHS
${CTEST_BINARY_DIR}/..
${CTEST_BINARY_DIR}/../Source
${CTEST_BINARY_DIR}/../../Source)
ENDIF(CMAKE_WITH_CURL)
SET(CTEST_SRCS SET(CTEST_SRCS
../ctest.cxx ../ctest.cxx
../cmCTest.cxx ../cmCTest.cxx
cmCTestSubmit.cxx) cmCTestSubmit.cxx)
GET_FILENAME_COMPONENT(CMAKE_DIR ${CMAKE_LIBRARY} PATH) GET_FILENAME_COMPONENT(CMAKE_DIR ${CMAKE_LIBRARY} PATH)
INCLUDE_DIRECTORIES(${CTEST_SOURCE_DIR} INCLUDE_DIRECTORIES(${CTEST_SOURCE_DIR}
${CTEST_SOURCE_DIR}/.. ${CTEST_SOURCE_DIR}/..
${CTEST_SOURCE_DIR}/Curl ${CTEST_SOURCE_DIR}/Curl
${CMAKE_DIR} ${CMAKE_DIR}
${CMAKE_DIR}/..) ${CMAKE_DIR}/..)
ADD_DEFINITIONS(-DHAVE_CURL) IF(NOT CMAKE_WITH_CURL)
ADD_EXECUTABLE(ctest ${CTEST_SRCS}) ADD_DEFINITIONS(-DHAVE_CURL)
TARGET_LINK_LIBRARIES(ctest ${CMAKE_LIBRARY} Curl) ADD_EXECUTABLE(cmtest ${CTEST_SRCS})
TARGET_LINK_LIBRARIES(cmtest ${CMAKE_LIBRARY} Curl)
ENDIF(NOT CMAKE_WITH_CURL)