summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CMakeLists.txt24
-rw-r--r--Source/CTest/CMakeLists.txt36
2 files changed, 42 insertions, 18 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 9160932..423be68 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 1.3)
+CMAKE_MINIMUM_REQUIRED(VERSION 1.5)
SET(SRCS
cmake.cxx
@@ -102,7 +102,8 @@ LINK_DIRECTORIES(${CMake_BINARY_DIR}/Source)
ADD_EXECUTABLE(cmake cmakemain.cxx)
ADD_EXECUTABLE(DumpDocumentation cmDumpDocumentation)
-ADD_EXECUTABLE(ctest ctest.cxx cmCTest.cxx)
+
+SET(CMTEST_SRCS ctest.cxx cmCTest.cxx)
IF (UNIX)
TARGET_LINK_LIBRARIES(CMakeLib ${CMAKE_DL_LIBS})
@@ -110,7 +111,24 @@ ENDIF (UNIX)
TARGET_LINK_LIBRARIES(cmake 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)
INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL)
diff --git a/Source/CTest/CMakeLists.txt b/Source/CTest/CMakeLists.txt
index cf7df78..677615d 100644
--- a/Source/CTest/CMakeLists.txt
+++ b/Source/CTest/CMakeLists.txt
@@ -4,30 +4,36 @@ 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 ")
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "AIX.*")
SUBDIRS(Curl)
-FIND_LIBRARY(CMAKE_LIBRARY NAMES CMakeLib PATHS
- ${CTEST_BINARY_DIR}/..
- ${CTEST_BINARY_DIR}/../Source
- ${CTEST_BINARY_DIR}/../../Source)
+IF(CMAKE_WITH_CURL)
+ SET(CMAKE_LIBRARY CMakeLib)
+ELSE(CMAKE_WITH_CURL)
+ 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
- ../ctest.cxx
- ../cmCTest.cxx
- cmCTestSubmit.cxx)
+ ../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}/..)
+ ${CTEST_SOURCE_DIR}/..
+ ${CTEST_SOURCE_DIR}/Curl
+ ${CMAKE_DIR}
+ ${CMAKE_DIR}/..)
-ADD_DEFINITIONS(-DHAVE_CURL)
-ADD_EXECUTABLE(ctest ${CTEST_SRCS})
-TARGET_LINK_LIBRARIES(ctest ${CMAKE_LIBRARY} Curl)
+IF(NOT CMAKE_WITH_CURL)
+ ADD_DEFINITIONS(-DHAVE_CURL)
+ ADD_EXECUTABLE(cmtest ${CTEST_SRCS})
+ TARGET_LINK_LIBRARIES(cmtest ${CMAKE_LIBRARY} Curl)
+ENDIF(NOT CMAKE_WITH_CURL)