summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-06-28 00:12:11 +0200
committerJulian Andres Klode <jak@debian.org>2017-06-28 15:52:38 +0200
commit0fe2161020d6e331639ed11872a947dd20035890 (patch)
tree876f3836313ee70230b21c781d700c77a482d8ac
parent2851ec6cf037d552118b885be0dd7796d74730c6 (diff)
Allow building without curl
This makes testing easier and prepares us for the transition.
-rw-r--r--CMakeLists.txt12
-rw-r--r--methods/CMakeLists.txt17
-rw-r--r--po/CMakeLists.txt8
3 files changed, 30 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8f8ffb898..a0690923c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -77,10 +77,16 @@ endif()
# apt-transport-https dependencies
-find_package(CURL REQUIRED)
-if (CURL_FOUND)
- set(HAVE_CURL 1)
+option(WITH_CURL "Build curl-based methods" ON)
+if (WITH_CURL)
+ find_package(CURL REQUIRED)
+ if (CURL_FOUND)
+ set(HAVE_CURL 1)
+ endif()
+else()
+ set(HAVE_CURL 0)
endif()
+
find_package(GnuTLS REQUIRED)
if (GNUTLS_FOUND)
set(HAVE_GNUTLS 1)
diff --git a/methods/CMakeLists.txt b/methods/CMakeLists.txt
index 64807e310..9f01ec506 100644
--- a/methods/CMakeLists.txt
+++ b/methods/CMakeLists.txt
@@ -6,14 +6,18 @@ add_executable(gpgv gpgv.cc)
add_executable(cdrom cdrom.cc)
add_executable(http http.cc http_main.cc rfc2553emu.cc connect.cc basehttp.cc)
add_executable(mirror mirror.cc http.cc rfc2553emu.cc connect.cc basehttp.cc)
-add_executable(https https.cc basehttp.cc)
+if (HAVE_CURL)
+ add_executable(https https.cc basehttp.cc)
+endif()
add_executable(ftp ftp.cc rfc2553emu.cc connect.cc)
add_executable(rred rred.cc)
add_executable(rsh rsh.cc)
target_compile_definitions(http PRIVATE ${GNUTLS_DEFINITIONS})
target_include_directories(http PRIVATE ${GNUTLS_INCLUDE_DIR})
+if (HAVE_CURL)
target_include_directories(https PRIVATE ${CURL_INCLUDE_DIRS})
+endif()
# Link the executables against the libraries
target_link_libraries(file apt-pkg)
@@ -23,14 +27,21 @@ target_link_libraries(gpgv apt-pkg)
target_link_libraries(cdrom apt-pkg)
target_link_libraries(http apt-pkg ${GNUTLS_LIBRARIES})
target_link_libraries(mirror apt-pkg ${RESOLV_LIBRARIES} ${GNUTLS_LIBRARIES})
-target_link_libraries(https apt-pkg ${CURL_LIBRARIES})
+if (HAVE_CURL)
+ target_link_libraries(https apt-pkg ${CURL_LIBRARIES})
+endif()
target_link_libraries(ftp apt-pkg ${GNUTLS_LIBRARIES})
target_link_libraries(rred apt-pkg)
target_link_libraries(rsh apt-pkg)
# Install the library
-install(TARGETS file copy store gpgv cdrom http https ftp rred rsh mirror
+install(TARGETS file copy store gpgv cdrom http ftp rred rsh mirror
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/methods)
add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods store gzip lzma bzip2 xz)
add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods rsh ssh)
+if (HAVE_CURL)
+ install(TARGETS https RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/methods)
+else()
+ add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods http https)
+endif()
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 258c9b050..2630a2f89 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -10,12 +10,18 @@ apt_add_translation_domain(
EXCLUDE_LANGUAGES ${languages_excluded}
)
+if (HAVE_CURL)
+ set(curl_methods https)
+else()
+ set(curl_methods)
+endif()
+
apt_add_translation_domain(
DOMAIN apt
TARGETS apt apt-cache apt-get apt-config apt-cdrom apt-helper apt-mark
apt-private
# Methods
- file copy store gpgv cdrom http https ftp rred rsh mirror
+ file copy store gpgv cdrom http ${curl_methods} ftp rred rsh mirror
SCRIPTS ../dselect/install ../dselect/update
EXCLUDE_LANGUAGES ${languages_excluded}
)