Revision: 145253 https://trac.macports.org/changeset/145253 Author: michaelld@macports.org Date: 2016-01-29 12:46:25 -0800 (Fri, 29 Jan 2016) Log Message: ----------- qca: move all plugins into subports of qca; make qca-tls obsolete since it requires qt3. Modified Paths: -------------- trunk/dports/devel/qca/Portfile Added Paths: ----------- trunk/dports/devel/qca/files/patch-CMakeLists.txt_plugins.diff Removed Paths: ------------- trunk/dports/devel/qca-cyrus-sasl/ trunk/dports/devel/qca-gnupg/ trunk/dports/devel/qca-ossl/ trunk/dports/devel/qca-tls/ Modified: trunk/dports/devel/qca/Portfile =================================================================== --- trunk/dports/devel/qca/Portfile 2016-01-29 20:43:50 UTC (rev 145252) +++ trunk/dports/devel/qca/Portfile 2016-01-29 20:46:25 UTC (rev 145253) @@ -3,6 +3,7 @@ PortSystem 1.0 PortGroup cmake 1.0 +PortGroup active_variants 1.1 name qca version 2.1.0 @@ -11,12 +12,13 @@ categories devel crypto security maintainers michaelld openmaintainer license LGPL-2.1 -description Qt Cryptographic Architecture -long_description \ - Qt Cryptographic Architecture provides an easy API for the following \ - features: SSL/TLS, X509, SASL, RSA, Hashing (SHA1, MD5), Ciphers \ - (BlowFish, 3DES, AES). Functionality is supplied via plugins. +default description "Qt Cryptographic Architecture" +default long_description \ + "Qt Cryptographic Architecture provides an easy API for the following \ + features: SSL/TLS, X509, SASL, RSA, Hashing (SHA1, MD5), Ciphers \ + (BlowFish, 3DES, AES). Functionality is supplied via plugins." + platforms darwin homepage http://delta.affinix.com/qca/ @@ -29,29 +31,31 @@ cmake.out_of_source yes -# temporary patch to add including QIODevice to qca_basic.h +if {${name} eq ${subport}} { -patchfiles-append patch-include_QtCrypto_qca_basic.h.diff + # temporary patch to add including QIODevice to qca_basic.h -# fix install directories for certs and cmake files + patchfiles-append patch-include_QtCrypto_qca_basic.h.diff -patchfiles-append patch-CMakeLists.txt.diff + # fix install directories for certs and cmake files -# remove unnecessary Carbon #include, which fails on 10.8 + patchfiles-append patch-CMakeLists.txt.diff -patchfiles-append patch-src_qac_systemstore_mac.cpp.diff + # remove unnecessary Carbon #include, which fails on 10.8 -# Qt variants + patchfiles-append patch-src_qac_systemstore_mac.cpp.diff -variant qt4 conflicts qt5 description "Build with qt4" { - PortGroup qt4 1.0 - configure.args-append -DQT4_BUILD=ON +} else { + # fix top-level CMakeLists.txt to build just plugins + patchfiles-append patch-CMakeLists.txt_plugins.diff } -variant qt5 conflicts qt4 description "Build with qt5" { - PortGroup qt5 1.0 -} +# Qt variants +variant qt4 conflicts qt5 description "Build with qt4" {} + +variant qt5 conflicts qt4 description "Build with qt5" {} + if {![variant_isset qt4] && ![variant_isset qt5]} { default_variants +qt4 } @@ -59,34 +63,58 @@ # make sure -qt4 wasn't specified alone if {![variant_isset qt4] && ![variant_isset qt5]} { - ui_error "\n\nYou must select either the +qt4 or +qt5 variant to build ${name}\n" + ui_error "\n\nYou must select either the +qt4 or +qt5 variant to build ${subport}\n" return -code error "Invalid variant selection" } -# set install directory for mkspec files - -pre-configure { - configure.args-append \ - -DQCA_FEATURE_INSTALL_DIR=${qt_mkspecs_dir} +if {${name} eq ${subport}} { + if {[variant_isset qt4]} { + PortGroup qt4 1.0 + configure.args-append -DQT4_BUILD=ON + } else { + PortGroup qt5 1.0 + } +} else { + # require qca to also have the selected Qt variant + if {[variant_isset qt4]} { + PortGroup qt4 1.0 + require_active_variants port:qca qt4 + } else { + PortGroup qt5 1.0 + require_active_variants port:qca qt5 + } } -# build as a framework +# set install directory for mkspec files configure.args-append \ - -DOSX_FRAMEWORK=YES + -DQCA_FEATURE_INSTALL_DIR=${qt_mkspecs_dir} # specify various configure options configure.args-append \ - -DBUILD_PLUGINS=NO \ -DQCA_INSTALL_IN_QT_PREFIX=NO \ - -DQCA_MAN_INSTALL_DIR=${prefix}/share/man \ - -DQCA_LIBRARY_INSTALL_DIR=${frameworks_dir} \ - -DCMAKE_MODULES_DIR=${prefix}/share/cmake \ - -DPKGCONFIG_INSTALL_PREFIX=${prefix}/lib/pkgconfig \ - -DQCA_PLUGINS_INSTALL_DIR=${prefix}/share/${name}/plugins \ - -DQCA_DOC_INSTALL_DIR=${prefix}/share/${name}/doc + -DQCA_PLUGINS_INSTALL_DIR=${prefix}/share/${name}/plugins +if {${name} eq ${subport}} { + + # build as a framework + + configure.args-append \ + -DOSX_FRAMEWORK=YES + + # specify various configure options + + configure.args-append \ + -DBUILD_PLUGINS=NO \ + -DQCA_MAN_INSTALL_DIR=${prefix}/share/man \ + -DQCA_LIBRARY_INSTALL_DIR=${frameworks_dir} \ + -DCMAKE_MODULES_DIR=${prefix}/share/cmake \ + -DPKGCONFIG_INSTALL_PREFIX=${prefix}/lib/pkgconfig \ + -DQCA_DOC_INSTALL_DIR=${prefix}/share/${name}/doc + +} + # allow ccache, if specified by the user pre-build { @@ -97,48 +125,98 @@ post-destroot { - # install docs + if {${name} eq ${subport}} { - xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name} - xinstall -m 644 -W ${worksrcpath} COPYING README TODO \ - ${destroot}${prefix}/share/doc/${name} + # install docs - # get qca's version numbers + xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name} + xinstall -m 644 -W ${worksrcpath} COPYING README TODO \ + ${destroot}${prefix}/share/doc/${name} - set qca_vers [split ${version} "."] - set qca_major [lindex ${qca_vers} 0] - set qca_minor [lindex ${qca_vers} 1] - set qca_patch [lindex ${qca_vers} 2] + # get qca's version numbers - # link includes and libraries for each actual installed framework + set qca_vers [split ${version} "."] + set qca_major [lindex ${qca_vers} 0] + set qca_minor [lindex ${qca_vers} 1] + set qca_patch [lindex ${qca_vers} 2] - set tf_full ${frameworks_dir}/qca.framework/Versions/${version} + # link includes and libraries for each actual installed framework - # link headers into ${prefix}/include, removing - # directories if they are already there first + set tf_full ${frameworks_dir}/qca.framework/Versions/${version} - set dr_inc_file ${destroot}${prefix}/include - ln -s ${tf_full}/Headers ${dr_inc_file}/qca - ln -s ${tf_full}/Headers ${dr_inc_file}/QtCrypto + # link headers into ${prefix}/include, removing + # directories if they are already there first - # link libraries into ${dr_libs_dir}, all 4 number variants + set dr_inc_file ${destroot}${prefix}/include + ln -s ${tf_full}/Headers ${dr_inc_file}/qca + ln -s ${tf_full}/Headers ${dr_inc_file}/QtCrypto - set dr_libs_dir ${destroot}${prefix}/lib - ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.dylib - ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.${qca_major}.dylib - ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.${qca_major}.${qca_minor}.dylib - ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.${qca_major}.${qca_minor}.${qca_patch}.dylib + # link libraries into ${dr_libs_dir}, all 4 number variants + set dr_libs_dir ${destroot}${prefix}/lib + ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.dylib + ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.${qca_major}.dylib + ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.${qca_major}.${qca_minor}.dylib + ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.${qca_major}.${qca_minor}.${qca_patch}.dylib + + } + + variant examples description {Include examples in install} { + post-destroot { + xinstall -d -m 755 ${destroot}${prefix}/share/examples/${name} + eval file copy [glob ${worksrcpath}/examples/*] \ + ${destroot}${prefix}/share/examples/${name} + } + } } -variant examples description {Include examples in install} { - post-destroot { - xinstall -d -m 755 ${destroot}${prefix}/share/examples/${name} - eval file copy [glob ${worksrcpath}/examples/*] \ - ${destroot}${prefix}/share/examples/${name} +array set bindings { + botan {port:botan botan} + cyrus-sasl {port:cyrus-sasl2 cyrus-sasl} + gcrypt {port:libgcrypt gcrypt} + gnupg {port:gnupg gnupg} + logger {"" logger} + nss {port:nss nss} + ossl {path:lib/libssl.dylib:openssl ossl} + softstore {"" softstore} +} +# pkcs11 {port:pkcs11 pkcs11} +array set prettynames { + botan Botan cyrus-sasl Cyrus-SASL gcrypt GCrypt + gnupg GNUPG logger Logger nss NSS + ossl OpenSSL pkcs11 pkcs11 softstore SoftStore +} + +options qca.plugin +default qca.plugin "" + +foreach plugin [lsort [array names bindings]] { + set arg [lindex $bindings($plugin) 1] + set arg_name [lindex [split ${arg} =] 0] + subport qca-${plugin} { + if {[lindex $bindings($plugin) 0] ne ""} { + depends_lib-append [lindex $bindings($plugin) 0] + } + configure.args-append -DWITH_${arg}_PLUGIN=ON + qca.plugin ${arg_name} } + if {${qca.plugin} != ${arg_name}} { + configure.args-append -DWITH_${arg_name}_PLUGIN=OFF + } } +if {${qca.plugin} ne ""} { + description $prettynames(${qca.plugin}) plugin for ${name} + long_description \ + Qt Cryptographic Architecture. This is the \ + $prettynames(${qca.plugin}) plugin. + depends_lib-append port:qca + livecheck.type none +} else { + livecheck.type regex + livecheck.url ${homepage} + livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}" +} -livecheck.type regex -livecheck.url ${homepage} -livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}" +subport qca-tls { + PortGroup obsolete 1.0 +} Added: trunk/dports/devel/qca/files/patch-CMakeLists.txt_plugins.diff =================================================================== --- trunk/dports/devel/qca/files/patch-CMakeLists.txt_plugins.diff (rev 0) +++ trunk/dports/devel/qca/files/patch-CMakeLists.txt_plugins.diff 2016-01-29 20:46:25 UTC (rev 145253) @@ -0,0 +1,351 @@ +--- CMakeLists.txt.orig ++++ CMakeLists.txt +@@ -6,30 +6,27 @@ if(NOT CMAKE_INSTALL_PREFIX) + unset(CMAKE_INSTALL_PREFIX CACHE) + endif(NOT CMAKE_INSTALL_PREFIX) + +-project(qca) ++project(qca-plugins) + + cmake_minimum_required(VERSION 2.6.0) + + set(QCA_LIB_MAJOR_VERSION "2") + set(QCA_LIB_MINOR_VERSION "1") + set(QCA_LIB_PATCH_VERSION "0") ++set(QCA_LIB_VERSION ${QCA_LIB_MAJOR_VERSION}.${QCA_LIB_MINOR_VERSION}.${QCA_LIB_PATCH_VERSION}) + + # Do not automatically link Qt executables to qtmain target on Windows. + # QCA exucatables use console mode only. Not need to link against + # qtmain.lib. + cmake_policy(SET CMP0020 OLD) + +-option(BUILD_TESTS "Create test" ON) +-option(BUILD_TOOLS "Compile mozcerts and qcatool" ON) +-set(BUILD_PLUGINS "auto" CACHE STRING "Plugins for building (also possible values: none, all and auto)") +-option(BUILD_SHARED_LIBS "Build shared library" ON) +-option(DEVELOPER_MODE "Special developer mode" OFF) ++find_package(Qca ${QCA_LIB_VERSION} EXACT REQUIRED) ++get_property(QCA_INCLUDE_DIRS TARGET qca PROPERTY INTERFACE_INCLUDE_DIRECTORIES) ++get_property(QCA_LIBRARY TARGET qca PROPERTY IMPORTED_LOCATION_RELEASE) ++set(QCA_LIB_NAME ${QCA_LIBRARY}) ++include_directories(${QCA_INCLUDE_DIRS}) + +-if(APPLE) +- option(OSX_FRAMEWORK "Build a Mac OS X Framework" ON) +-else() +- set(OSX_FRAMEWORK OFF) +-endif() ++set(BUILD_PLUGINS "none" CACHE STRING "Plugins for building (also possible values: none, all and auto)") + + find_package(Doxygen) + +@@ -75,32 +72,7 @@ else() + set(QCA_QT_PC_VERSION "QtCore") + endif() + +-# QCA can be shared but plugins will be static +-# if Qt is static. +-if(NOT BUILD_SHARED_LIBS OR QT_IS_STATIC) +- set(STATIC_PLUGINS ON) +- add_definitions(-DQT_STATICPLUGIN) +- set(PLUGIN_TYPE "STATIC") +-else(NOT BUILD_SHARED_LIBS OR QT_IS_STATIC) +- set(PLUGIN_TYPE "MODULE") +-endif(NOT BUILD_SHARED_LIBS OR QT_IS_STATIC) +- +-set(QCA_SUFFIX "" CACHE STRING "QCA common suffix") +-if(QCA_SUFFIX) +- set(QCA_LIB_NAME qca-${QCA_SUFFIX}) +- set(QCA_TOOL_NAME qcatool-${QCA_SUFFIX}) +- set(MOZCERTS_NAME mozcerts-${QCA_SUFFIX}) +- set(QCA_PC_NAME qca2-${QCA_SUFFIX}.pc) +-else(QCA_SUFFIX) +- set(QCA_LIB_NAME qca) +- set(QCA_TOOL_NAME qcatool) +- set(MOZCERTS_NAME mozcerts) +- set(QCA_PC_NAME qca2.pc) +-endif(QCA_SUFFIX) +- +-set(QCA_LIB_VERSION_STRING "${QCA_LIB_MAJOR_VERSION}.${QCA_LIB_MINOR_VERSION}.${QCA_LIB_PATCH_VERSION}") +- +-configure_file("include/QtCrypto/qca_version.h.in" "${CMAKE_BINARY_DIR}/qca_version.h") ++set(PLUGIN_TYPE "MODULE") + + if (WIN32) + set(CMAKE_DEBUG_POSTFIX "d") +@@ -118,9 +90,6 @@ if (CMAKE_COMPILER_IS_GNUCXX) + endif (CMAKE_COMPILER_IS_GNUCXX) + + add_definitions (${QT_DEFINITIONS}) +-include_directories("include/QtCrypto/") +-# for generated files +-include_directories(${CMAKE_BINARY_DIR}) + + if(NOT DEVELOPER_MODE) + # uninstall target +@@ -166,17 +135,31 @@ else( QCA_INSTALL_IN_QT_PREFIX ) + set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "Directory where lib will install") + + set(QCA_PREFIX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Directory where qca will install") +- set(QCA_PLUGINS_INSTALL_DIR "${LIB_INSTALL_DIR}/${QCA_LIB_NAME}" CACHE PATH "Directory where qca plugins will install") ++ if(NOT QCA_PLUGINS_INSTALL_DIR) ++ set(QCA_PLUGINS_INSTALL_DIR "${LIB_INSTALL_DIR}/${QCA_LIB_NAME}" ++ CACHE PATH "Directory where qca plugins will install") ++ endif() + set(QCA_BINARY_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Directory where qca plugins will install") + set(QCA_LIBRARY_INSTALL_DIR "${LIB_INSTALL_DIR}" CACHE PATH "Directory where qca library will install") +- set(QCA_FEATURE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/mkspecs/features" CACHE PATH "Directory where qca feature file will install") ++ if(NOT QCA_FEATURE_INSTALL_DIR) ++ set(QCA_FEATURE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/mkspecs/features" CACHE PATH "Directory where qca feature file will install") ++ endif() + set(QCA_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Directory where qca public headers will install") +- set(QCA_PRIVATE_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Directory where qca headers will install") +- set(QCA_DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${QCA_LIB_NAME}/html" CACHE PATH "Directory where qca documentation will install") +- set(QCA_MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Directory where qca man pages will install") ++ set(QCA_PRIVATE_INCLUDE_INSTALL_DIR ++ "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Directory where qca ++ headers will install") ++ if(NOT QCA_DOC_INSTALL_DIR) ++ set(QCA_DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${QCA_LIB_NAME}/html" CACHE PATH "Directory where qca documentation will install") ++ endif() ++ if(NOT QCA_MAN_INSTALL_DIR) ++ set(QCA_MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH ++ "Directory where qca man pages will install") ++ endif() + endif( QCA_INSTALL_IN_QT_PREFIX ) + ++if(NOT PKGCONFIG_INSTALL_PREFIX) + set(PKGCONFIG_INSTALL_PREFIX "${QCA_LIBRARY_INSTALL_DIR}/pkgconfig" CACHE PATH "Base directory for pkgconfig files") ++endif() + + normalize_path(QCA_PREFIX_INSTALL_DIR) + +@@ -203,22 +186,6 @@ foreach(PATH QCA_PLUGINS_INSTALL_DIR + endif() + endforeach() + +-if(NOT WIN32) +- if(OSX_FRAMEWORK) +- set(PKGCONFIG_CFLAGS "-F\${libdir} -I\${libdir}/${QCA_LIB_NAME}.framework/Headers") +- set(PKGCONFIG_LIBS "-F\${libdir} -framework ${QCA_LIB_NAME}") +- else() +- set(PKGCONFIG_CFLAGS "-I\${includedir}") +- set(PKGCONFIG_LIBS "-L\${libdir} -l${QCA_LIB_NAME}") +- endif() +- +- # qca2.pc uses absolute paths. So it must be there. Don't rellocate this. +- configure_file("qca2.pc.cmake" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pkgconfig/${QCA_PC_NAME}" @ONLY) +- if(NOT DEVELOPER_MODE) +- install(FILES "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pkgconfig/${QCA_PC_NAME}" DESTINATION ${PKGCONFIG_INSTALL_PREFIX}) +- endif() +-endif(NOT WIN32) +- + # strip CMAKE_INSTALL_PREFIX in all paths + if(USE_RELATIVE_PATHS) + message(STATUS "Installed package is relocatable") +@@ -241,203 +208,14 @@ else() + set(CRYPTO_PRF_RELATIVE_PATH "") + endif() + +-if(DEVELOPER_MODE) +- add_definitions(-DDEVELOPER_MODE) +- +-# To prefer plugins from build tree when run qca from build tree +- file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf +-"[Paths] +-Plugins=${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME} +-") +-endif() +- + if (APPLE) + find_package(Carbon REQUIRED) + set(CMAKE_INSTALL_NAME_DIR ${QCA_LIBRARY_INSTALL_DIR}) + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +-endif (APPLE) +- +-message(STATUS "Checking for certstore..") +-# fixme add OR mac +-if( WIN32 ) +-# USE BUILTIN +-else ( WIN32 ) +- if ( ENV{QC_CERTSTORE_PATH} ) +- if(EXISTS ENV{QC_CERTSTORE_PATH}) +- set( qca_CERTSTORE $ENV{QC_CERTSTORE_PATH}) +- else(EXISTS ENV{QC_CERTSTORE_PATH}) +- # path to try +- endif(EXISTS ENV{QC_CERTSTORE_PATH}) +- else( ENV{QC_CERTSTORE_PATH} ) +- set( toTry +- "/etc/ssl/certs/ca-certificates.crt" +- "/usr/share/ssl/cert.pem" +- "/usr/share/ssl/certs/ca-bundle.crt" +- "/etc/pki/tls/cert.pem" +- "/etc/ssl/ca-bundle.pem" +- "/usr/share/curl/curl-ca-bundle.crt" +- ) +- foreach (_current_try ${toTry}) +- if(EXISTS ${_current_try}) +- set( qca_CERTSTORE ${_current_try}) +- endif(EXISTS ${_current_try}) +- endforeach (_current_try) +- endif( ENV{QC_CERTSTORE_PATH} ) +-endif(WIN32) +- +-if (qca_CERTSTORE) +- message(STATUS "Found system certstore") +-else (qca_CERTSTORE) +- message(STATUS "Using built in certstore.") +- set( qca_CERTSTORE "${CMAKE_CURRENT_SOURCE_DIR}/certs/rootcerts.pem") +- # note that INSTALL_FILES targets are relative to the current installation prefix... +- if(NOT DEVELOPER_MODE) +- install(FILES "${qca_CERTSTORE}" DESTINATION "${QCA_PREFIX_INSTALL_DIR}/certs") +- endif() +-endif (qca_CERTSTORE) +-message(STATUS "certstore path: " ${qca_CERTSTORE}) +-add_definitions( -DQCA_SYSTEMSTORE_PATH="${qca_CERTSTORE}" ) +- +- +-set( private_HEADERS ${qca_INCLUDEDIR}/QtCrypto/qca_plugin.h ${qca_INCLUDEDIR}/QtCrypto/qca_systemstore.h ) +- +-set( public_HEADERS +- ${qca_INCLUDEDIR}/QtCrypto/qca.h +- ${qca_INCLUDEDIR}/QtCrypto/qcaprovider.h +- ${qca_INCLUDEDIR}/QtCrypto/QtCrypto +- ${qca_INCLUDEDIR}/QtCrypto/qca_export.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_support.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_tools.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_core.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_textfilter.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_basic.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_publickey.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_cert.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_keystore.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_securelayer.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_securemessage.h +- ${CMAKE_BINARY_DIR}/qca_version.h +- ${qca_INCLUDEDIR}/QtCrypto/qpipe.h +- ${qca_INCLUDEDIR}/QtCrypto/qca_safetimer.h) +- +-set( qca_HEADERS ${private_HEADERS} ${public_HEADERS} ) +- +-include_directories(${QT_QTCORE_INCLUDE_DIR} "${qca_INCLUDEDIR}/QtCrypto") +- +-configure_file("crypto.prf.cmake" "${CMAKE_BINARY_DIR}/mkspecs/features/crypto.prf" @ONLY) +-if(NOT DEVELOPER_MODE) +- install(FILES "${CMAKE_BINARY_DIR}/mkspecs/features/crypto.prf" DESTINATION "${QCA_FEATURE_INSTALL_DIR}") +-endif() ++endif(APPLE) + +-configure_file(man/qcatool.1 "${CMAKE_BINARY_DIR}/share/man/man1/${QCA_TOOL_NAME}.1" COPYONLY) +-if(NOT DEVELOPER_MODE) +- install(FILES "${CMAKE_BINARY_DIR}/share/man/man1/${QCA_TOOL_NAME}.1" DESTINATION "${QCA_MAN_INSTALL_DIR}/man1") +-endif() ++include_directories(${QT_QTCORE_INCLUDE_DIR}) + + set(QCA_CRYPTO_INSTALL_DIR "${QCA_PLUGINS_INSTALL_DIR}/crypto") + +-add_subdirectory(src) + add_subdirectory(plugins) +- +-if(STATIC_PLUGINS) +- # Generate header with static plugins list +- file(WRITE "${CMAKE_BINARY_DIR}/import_plugins.h" "#include <QtPlugin>\n") +- foreach(PLUGIN IN LISTS PLUGINS) +- if(WITH_${PLUGIN}_PLUGIN_INTERNAL) +- string(REPLACE "-" "_" IMPORT_NAME "qca-${PLUGIN}") +- file(APPEND "${CMAKE_BINARY_DIR}/import_plugins.h" "Q_IMPORT_PLUGIN(${IMPORT_NAME})\n") +- endif(WITH_${PLUGIN}_PLUGIN_INTERNAL) +- endforeach(PLUGIN IN LISTS PLUGINS) +-endif(STATIC_PLUGINS) +- +-if(BUILD_TESTS) +- enable_testing() +- add_subdirectory(unittest) +- add_subdirectory(examples) +-endif(BUILD_TESTS) +-if(BUILD_TOOLS) +- add_subdirectory(tools) +-endif(BUILD_TOOLS) +- +-if(DOXYGEN_FOUND) +- configure_file(${CMAKE_SOURCE_DIR}/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile @ONLY) +- add_custom_target(doc +- ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile +- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/images +- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/images/qca-arch.eps ${CMAKE_BINARY_DIR}/images/qca-arch.eps +- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/images/qca-arch.png ${CMAKE_BINARY_DIR}/images/qca-arch.png +- WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +- COMMENT "Generating API documentation with Doxygen" VERBATIM) +-endif(DOXYGEN_FOUND) +- +-include(CMakePackageConfigHelpers) +-configure_package_config_file( +- "${CMAKE_CURRENT_SOURCE_DIR}/QcaConfig.cmake.in" +- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Qca/QcaConfig.cmake" +- INSTALL_DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/Qca +-) +-write_basic_config_version_file("${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Qca/QcaConfigVersion.cmake" VERSION ${QCA_LIB_VERSION_STRING} COMPATIBILITY AnyNewerVersion) +- +-if(NOT DEVELOPER_MODE) +- +- # /usr/local is traditional path for installing apps on POSIX-systems. +- # I consciously break this. Qt by default looks plugins and features only in +- # own directory. So by default install libs in Qt prefix it is a best choice. +- # This can be unwanted behaviour for users who don't read INSTALL file or/and +- # not read cmake reports. I just try to warn their. +- +- # In really anybody who do cmake . && make && sudo make install do it for own risk. +- +- if(QCA_INSTALL_IN_QT_PREFIX) +- string(ASCII 27 ESCAPE) +- message("") +- message("${ESCAPE}[31m") +- message("!!!!!!!!!!!!!!!!!!!!!ATTENTION!!!!!!!!!!!!!!!!!!!!!!") +- message("!! QCA will be installed in Qt prefix !!") +- message("!! If you want to install in /usr/local !!") +- message("!! you MUST explicity define CMAKE_INSTALL_PREFIX !!") +- message("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") +- message("${ESCAPE}[0m") +- endif(QCA_INSTALL_IN_QT_PREFIX) +- +- message("") +- if(USE_RELATIVE_PATHS) +- message("QCA prefix is " "${QCA_PREFIX_INSTALL_DIR}") +- message("Plugins will be installed to " "${QCA_PREFIX_INSTALL_DIR}/${QCA_PLUGINS_INSTALL_DIR}") +- message("Binary will be installed to " "${QCA_PREFIX_INSTALL_DIR}/${QCA_BINARY_INSTALL_DIR}") +- if(OSX_FRAMEWORK) +- message("Framework will be installed to " "${QCA_PREFIX_INSTALL_DIR}/${QCA_LIBRARY_INSTALL_DIR}") +- else() +- message("Library will be installed to " "${QCA_PREFIX_INSTALL_DIR}/${QCA_LIBRARY_INSTALL_DIR}") +- message("Public headers will be installed to " "${QCA_PREFIX_INSTALL_DIR}/${QCA_INCLUDE_INSTALL_DIR}") +- message("Private headers will be installed to " "${QCA_PREFIX_INSTALL_DIR}/${QCA_PRIVATE_INCLUDE_INSTALL_DIR}") +- endif() +- message("Feature file will be installed to " "${QCA_PREFIX_INSTALL_DIR}/${QCA_FEATURE_INSTALL_DIR}") +- message("Documentation will be installed to " "${QCA_PREFIX_INSTALL_DIR}/${QCA_DOC_INSTALL_DIR}") +- message("Man page will be installed to " "${QCA_PREFIX_INSTALL_DIR}/${QCA_MAN_INSTALL_DIR}") +- message("Pkg-config file will be installed to " "${QCA_PREFIX_INSTALL_DIR}/${PKGCONFIG_INSTALL_PREFIX}") +- else() +- message("QCA prefix is " "${QCA_PREFIX_INSTALL_DIR}") +- message("Plugins will be installed to " "${QCA_PLUGINS_INSTALL_DIR}") +- message("Binary will be installed to " "${QCA_BINARY_INSTALL_DIR}") +- if(OSX_FRAMEWORK) +- message("Framework will be installed to " "${QCA_LIBRARY_INSTALL_DIR}") +- else() +- message("Library will be installed to " "${QCA_LIBRARY_INSTALL_DIR}") +- message("Public headers will be installed to " "${QCA_INCLUDE_INSTALL_DIR}") +- message("Private headers will be installed to " "${QCA_PRIVATE_INCLUDE_INSTALL_DIR}") +- endif() +- message("Feature file will be installed to " "${QCA_FEATURE_INSTALL_DIR}") +- message("Documentation will be installed to " "${QCA_DOC_INSTALL_DIR}") +- message("Man page will be installed to " "${QCA_MAN_INSTALL_DIR}") +- message("Pkg-config file will be installed to " "${PKGCONFIG_INSTALL_PREFIX}") +- endif() +- message("") +- +- install(EXPORT QCATargets DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/Qca FILE QcaTargets.cmake) +- install(FILES +- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Qca/QcaConfig.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Qca/QcaConfigVersion.cmake" +- DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/Qca +- ) +-endif()