1
1
libssh/CMakeLists.txt

112 строки
3.2 KiB
CMake
Исходник Обычный вид История

project(libssh C)
# Required cmake version
cmake_minimum_required(VERSION 2.6.0)
# global needed variables
set(APPLICATION_NAME ${PROJECT_NAME})
set(APPLICATION_VERSION_MAJOR "0")
2010-02-05 14:07:02 +03:00
set(APPLICATION_VERSION_MINOR "5")
set(APPLICATION_VERSION_PATCH "0")
2009-12-21 17:56:21 +03:00
set(APPLICATION_VERSION "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}")
2010-03-25 15:40:18 +03:00
# Set the lib CURRENT.REVISION.AGE version info
# If the source code was changed, but there were no interface changes:
# Increment REVISION.
# If there was a compatible interface change:
# Increment CURRENT and AGE. Set REVISION to 0
# If there was an incompatible interface change:
# Increment CURRENT. Set AGE and REVISION to 0
set(LIBRARY_VERSION "4.1.0")
set(LIBRARY_SOVERSION "4")
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake/Modules
)
# add definitions
include(DefineCMakeDefaults)
include(DefineCompilerFlags)
include(DefineInstallationPaths)
include(DefineOptions.cmake)
include(CPackConfig.cmake)
# disallow in-source build
include(MacroEnsureOutOfSourceBuild)
macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.")
# add macros
include(MacroAddPlugin)
include(MacroCopyFile)
# search for libraries
find_package(ZLIB REQUIRED)
if (WITH_GCRYPT)
find_package(GCrypt REQUIRED)
if (NOT GCRYPT_FOUND)
message(FATAL_ERROR "Could not find GCrypt")
endif (NOT GCRYPT_FOUND)
else (WITH_GCRYPT)
find_package(OpenSSL)
if (NOT CRYPTO_FOUND)
find_package(GCrypt)
if (NOT GCRYPT_FOUND)
message(FATAL_ERROR "Could not find OpenSSL or GCrypt")
endif (NOT GCRYPT_FOUND)
endif (NOT CRYPTO_FOUND)
endif(WITH_GCRYPT)
# config.h checks
include(ConfigureChecks.cmake)
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
# check subdirectories
add_subdirectory(doc)
add_subdirectory(include)
add_subdirectory(libssh)
# pkg-config file
configure_file(libssh.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/libssh.pc
DESTINATION
${LIB_INSTALL_DIR}/pkgconfig
COMPONENT
pkgconfig
)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
2009-07-30 13:40:28 +04:00
add_subdirectory(examples)
endif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
2010-03-15 18:09:16 +03:00
if (WITH_TESTING)
find_package(Check REQUIRED)
include(AddCheckTest)
add_subdirectory(tests)
2010-03-15 18:09:16 +03:00
endif (WITH_TESTING)
2010-03-03 01:37:49 +03:00
message(STATUS "********************************************")
message(STATUS "********** ${PROJECT_NAME} build options : **********")
2010-03-03 01:37:49 +03:00
message(STATUS "zlib support: ${WITH_LIBZ}")
message(STATUS "libgcrypt support: ${WITH_GCRYPT}")
message(STATUS "SSH-1 support: ${WITH_SSH1}")
message(STATUS "SFTP support: ${WITH_SFTP}")
message(STATUS "Server support : ${WITH_SERVER}")
message(STATUS "Pcap debugging support : ${WITH_PCAP}")
message(STATUS "Unit testing: ${WITH_TESTING}")
if (WITH_INTERNAL_DOC)
2010-03-03 01:37:49 +03:00
message(STATUS "Internal documentation generation")
else (WITH_INTERNAL_DOC)
2010-03-03 01:37:49 +03:00
message(STATUS "Public API documentation generation")
endif (WITH_INTERNAL_DOC)
2010-03-03 01:37:49 +03:00
message(STATUS "********************************************")