2007-08-21 04:54:02 +00:00
|
|
|
include(CheckIncludeFiles)
|
2007-08-15 19:23:24 +00:00
|
|
|
CHECK_INCLUDE_FILES(sys/filio.h HAVE_SYS_FILIO_H)
|
|
|
|
IF(HAVE_SYS_FILIO_H)
|
|
|
|
ADD_DEFINITIONS(-DHAVE_SYS_FILIO_H)
|
|
|
|
ENDIF(HAVE_SYS_FILIO_H)
|
2006-10-02 09:59:51 +00:00
|
|
|
|
2007-08-15 20:01:32 +00:00
|
|
|
INCLUDE(CheckCXXSourceCompiles)
|
|
|
|
CHECK_CXX_SOURCE_COMPILES("
|
|
|
|
# include <stdlib.h>
|
|
|
|
# include <sys/mman.h>
|
|
|
|
int main() { void *f = 0; return mlock(f,8); }
|
|
|
|
" MLOCK_TAKES_VOID)
|
|
|
|
if(NOT MLOCK_TAKES_VOID)
|
|
|
|
MESSAGE(STATUS "mlock(2) does not take a void *")
|
|
|
|
ADD_DEFINITIONS(-DMLOCK_NOT_VOID_PTR)
|
|
|
|
endif(NOT MLOCK_TAKES_VOID)
|
|
|
|
|
2014-09-25 14:27:44 +06:00
|
|
|
if(DEVELOPER_MODE)
|
|
|
|
add_definitions(-DQCA_PLUGIN_PATH="${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME}")
|
|
|
|
else()
|
2014-11-05 19:21:29 +06:00
|
|
|
if(USE_RELATIVE_PATHS)
|
|
|
|
add_definitions(-DQCA_PLUGIN_PATH="${QCA_PREFIX_INSTALL_DIR}/${QCA_PLUGINS_INSTALL_DIR}")
|
|
|
|
else()
|
|
|
|
add_definitions(-DQCA_PLUGIN_PATH="${QCA_PLUGINS_INSTALL_DIR}")
|
|
|
|
endif()
|
2014-09-25 14:27:44 +06:00
|
|
|
endif()
|
|
|
|
|
2006-10-02 09:59:51 +00:00
|
|
|
# base source files
|
|
|
|
|
2007-01-09 14:42:11 +00:00
|
|
|
|
2006-10-02 09:59:51 +00:00
|
|
|
SET( nonmoc_SOURCES
|
|
|
|
qca_tools.cpp
|
|
|
|
qca_plugin.cpp
|
|
|
|
qca_textfilter.cpp
|
|
|
|
qca_basic.cpp
|
2007-04-03 11:24:12 +00:00
|
|
|
support/logger.cpp
|
2006-10-02 09:59:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
SET( moc_SOURCES
|
2008-05-18 06:50:01 +00:00
|
|
|
qca_cert.cpp
|
2006-10-02 09:59:51 +00:00
|
|
|
qca_core.cpp
|
2008-05-18 06:50:01 +00:00
|
|
|
qca_default.cpp
|
2006-10-02 09:59:51 +00:00
|
|
|
qca_keystore.cpp
|
2008-05-18 06:50:01 +00:00
|
|
|
qca_publickey.cpp
|
2014-09-25 01:03:18 +06:00
|
|
|
qca_safetimer.cpp
|
2006-10-02 09:59:51 +00:00
|
|
|
qca_securelayer.cpp
|
|
|
|
qca_securemessage.cpp
|
|
|
|
support/qpipe.cpp
|
|
|
|
support/console.cpp
|
2007-01-20 07:05:31 +00:00
|
|
|
support/synchronizer.cpp
|
2007-05-12 08:38:34 +00:00
|
|
|
support/dirwatch.cpp
|
2007-01-20 07:05:31 +00:00
|
|
|
support/syncthread.cpp
|
2006-10-02 09:59:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
IF (WIN32)
|
2014-02-01 00:53:38 +06:00
|
|
|
SET( nonmoc_SOURCES ${nonmoc_SOURCES} qca_systemstore_win.cpp )
|
2013-04-02 12:37:47 +00:00
|
|
|
elseif(APPLE)
|
2006-10-03 14:09:13 +00:00
|
|
|
set( nonmoc_SOURCES ${nonmoc_SOURCES} qca_systemstore_mac.cpp)
|
2013-04-02 12:37:47 +00:00
|
|
|
else()
|
|
|
|
SET( nonmoc_SOURCES ${nonmoc_SOURCES} qca_systemstore_flatfile.cpp )
|
|
|
|
endif()
|
2006-10-02 09:59:51 +00:00
|
|
|
|
|
|
|
# Support files
|
2006-10-03 14:09:13 +00:00
|
|
|
#SET( qca_HEADERS ${qca_HEADERS} support/dirwatch/dirwatch_p.h )
|
2006-10-02 09:59:51 +00:00
|
|
|
|
|
|
|
# Botan tools
|
2006-10-03 14:09:13 +00:00
|
|
|
SET( botan_BASE botantools/botan )
|
2006-10-02 09:59:51 +00:00
|
|
|
|
2007-01-09 14:42:11 +00:00
|
|
|
|
2007-05-12 08:38:34 +00:00
|
|
|
INCLUDE_DIRECTORIES(${QT_QTCORE_INCLUDE_DIR} support ${botan_BASE} )
|
2007-01-09 14:42:11 +00:00
|
|
|
|
2006-10-02 09:59:51 +00:00
|
|
|
ADD_DEFINITIONS(
|
|
|
|
-DBOTAN_TYPES_QT
|
|
|
|
-DBOTAN_NO_INIT_H
|
|
|
|
-DBOTAN_NO_CONF_H
|
|
|
|
-DBOTAN_TOOLS_ONLY
|
|
|
|
-DBOTAN_MINIMAL_BIGINT
|
|
|
|
)
|
|
|
|
|
|
|
|
ADD_DEFINITIONS(
|
|
|
|
-DBOTAN_MP_WORD_BITS=32
|
2007-04-19 22:08:49 +00:00
|
|
|
-DBOTAN_KARAT_MUL_THRESHOLD=12
|
|
|
|
-DBOTAN_KARAT_SQR_THRESHOLD=12
|
2007-04-22 03:04:04 +00:00
|
|
|
-DBOTAN_EXT_MUTEX_QT
|
2006-10-02 09:59:51 +00:00
|
|
|
)
|
2006-11-16 13:07:08 +00:00
|
|
|
|
2007-04-22 03:04:04 +00:00
|
|
|
if(UNIX)
|
|
|
|
ADD_DEFINITIONS( -DBOTAN_EXT_ALLOC_MMAP)
|
|
|
|
endif(UNIX)
|
2006-10-02 09:59:51 +00:00
|
|
|
|
|
|
|
SET( botan_SOURCES
|
|
|
|
${botan_BASE}/util.cpp
|
|
|
|
${botan_BASE}/exceptn.cpp
|
|
|
|
${botan_BASE}/mutex.cpp
|
|
|
|
${botan_BASE}/mux_qt/mux_qt.cpp
|
2007-04-19 22:08:49 +00:00
|
|
|
${botan_BASE}/charset.cpp
|
2006-10-02 09:59:51 +00:00
|
|
|
${botan_BASE}/defalloc.cpp
|
|
|
|
${botan_BASE}/mp_comba.cpp
|
|
|
|
${botan_BASE}/mp_mul.cpp
|
|
|
|
${botan_BASE}/mp_shift.cpp
|
|
|
|
${botan_BASE}/mp_misc.cpp
|
|
|
|
${botan_BASE}/divide.cpp
|
|
|
|
${botan_BASE}/big_base.cpp
|
|
|
|
${botan_BASE}/big_code.cpp
|
|
|
|
${botan_BASE}/big_io.cpp
|
|
|
|
${botan_BASE}/big_ops2.cpp
|
|
|
|
${botan_BASE}/big_ops3.cpp
|
2007-04-19 22:08:49 +00:00
|
|
|
${botan_BASE}/bit_ops.cpp
|
|
|
|
${botan_BASE}/libstate.cpp
|
|
|
|
${botan_BASE}/mem_pool.cpp
|
|
|
|
${botan_BASE}/modules.cpp
|
|
|
|
${botan_BASE}/mp_asm.cpp
|
|
|
|
${botan_BASE}/mp_mulop.cpp
|
|
|
|
${botan_BASE}/parsing.cpp
|
2006-10-02 09:59:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
IF (UNIX)
|
|
|
|
SET( botan_SOURCES ${botan_SOURCES} ${botan_BASE}/ml_unix/mlock.cpp)
|
|
|
|
SET( botan_SOURCES ${botan_SOURCES} ${botan_BASE}/alloc_mmap/mmap_mem.cpp)
|
|
|
|
ENDIF (UNIX)
|
|
|
|
|
|
|
|
IF(WIN32)
|
|
|
|
SET( botan_SOURCES ${botan_SOURCES} ${botan_BASE}/ml_win32/mlock.cpp)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
MY_AUTOMOC( moc_SOURCES )
|
|
|
|
SET( SOURCES ${SOURCES} ${moc_SOURCES} ${nonmoc_SOURCES} )
|
|
|
|
|
|
|
|
SET( SOURCES ${SOURCES} ${botan_SOURCES})
|
|
|
|
|
|
|
|
qt4_wrap_cpp( SOURCES "${qca_INCLUDEDIR}/QtCrypto/qca_core.h")
|
2007-04-08 12:46:16 +00:00
|
|
|
qt4_wrap_cpp( SOURCES "${qca_INCLUDEDIR}/QtCrypto/qca_cert.h")
|
2006-10-02 09:59:51 +00:00
|
|
|
qt4_wrap_cpp( SOURCES "${qca_INCLUDEDIR}/QtCrypto/qca_keystore.h")
|
|
|
|
qt4_wrap_cpp( SOURCES "${qca_INCLUDEDIR}/QtCrypto/qcaprovider.h")
|
|
|
|
qt4_wrap_cpp( SOURCES "${qca_INCLUDEDIR}/QtCrypto/qca_publickey.h")
|
|
|
|
qt4_wrap_cpp( SOURCES "${qca_INCLUDEDIR}/QtCrypto/qca_securelayer.h")
|
|
|
|
qt4_wrap_cpp( SOURCES "${qca_INCLUDEDIR}/QtCrypto/qca_securemessage.h")
|
|
|
|
qt4_wrap_cpp( SOURCES "${qca_INCLUDEDIR}/QtCrypto/qca_support.h")
|
|
|
|
qt4_wrap_cpp( SOURCES "${qca_INCLUDEDIR}/QtCrypto/qpipe.h")
|
2008-05-18 06:50:01 +00:00
|
|
|
qt4_wrap_cpp( SOURCES "qca_safeobj.h")
|
2014-09-25 01:03:18 +06:00
|
|
|
qt4_wrap_cpp( SOURCES "${qca_INCLUDEDIR}/QtCrypto/qca_safetimer.h")
|
2006-10-02 09:59:51 +00:00
|
|
|
|
2014-11-12 15:37:09 +05:00
|
|
|
add_library(${QCA_LIB_NAME} ${SOURCES} ${public_HEADERS})
|
2013-08-24 23:24:13 +06:00
|
|
|
TARGET_LINK_LIBRARIES(${QCA_LIB_NAME} ${QT_QTCORE_LIBRARY})
|
2006-10-02 09:59:51 +00:00
|
|
|
|
2006-11-16 13:38:24 +00:00
|
|
|
if(WIN32)
|
2013-08-24 23:24:13 +06:00
|
|
|
TARGET_LINK_LIBRARIES(${QCA_LIB_NAME} crypt32 ws2_32)
|
2006-11-16 13:38:24 +00:00
|
|
|
endif(WIN32)
|
|
|
|
|
2006-11-17 19:35:45 +00:00
|
|
|
if(APPLE)
|
2015-04-22 13:06:26 +02:00
|
|
|
set(COREFOUNDATION_LIBRARY_SECURITY "-framework Security")
|
|
|
|
TARGET_LINK_LIBRARIES(${QCA_LIB_NAME} ${COREFOUNDATION_LIBRARY} ${COREFOUNDATION_LIBRARY_SECURITY})
|
2006-11-17 19:35:45 +00:00
|
|
|
endif(APPLE)
|
|
|
|
|
2014-11-06 22:09:36 +05:00
|
|
|
if(NOT ANDROID)
|
|
|
|
set_target_properties(${QCA_LIB_NAME} PROPERTIES
|
|
|
|
VERSION ${QCA_LIB_MAJOR_VERSION}.${QCA_LIB_MINOR_VERSION}.${QCA_LIB_PATCH_VERSION}
|
|
|
|
SOVERSION ${QCA_LIB_MAJOR_VERSION}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2013-08-24 23:24:13 +06:00
|
|
|
set_target_properties(${QCA_LIB_NAME} PROPERTIES
|
2008-04-03 17:11:08 +00:00
|
|
|
DEFINE_SYMBOL QCA_MAKEDLL
|
2014-08-12 03:54:47 +06:00
|
|
|
PUBLIC_HEADER "${public_HEADERS}"
|
2014-10-29 03:17:28 +06:00
|
|
|
FRAMEWORK ${OSX_FRAMEWORK}
|
2015-01-14 13:51:07 +01:00
|
|
|
EXPORT_NAME ${QCA_LIB_NAME}
|
2008-04-03 17:11:08 +00:00
|
|
|
)
|
2007-01-09 14:42:11 +00:00
|
|
|
|
2014-09-28 20:57:53 +06:00
|
|
|
if(NOT DEVELOPER_MODE)
|
|
|
|
install(TARGETS ${QCA_LIB_NAME}
|
2015-01-14 13:51:07 +01:00
|
|
|
EXPORT ${QCA_CONFIG_NAME_BASE}Targets
|
2014-09-28 20:57:53 +06:00
|
|
|
LIBRARY DESTINATION "${QCA_LIBRARY_INSTALL_DIR}"
|
|
|
|
RUNTIME DESTINATION "${QCA_BINARY_INSTALL_DIR}"
|
|
|
|
ARCHIVE DESTINATION "${QCA_LIBRARY_INSTALL_DIR}"
|
2014-10-29 03:17:28 +06:00
|
|
|
FRAMEWORK DESTINATION "${QCA_LIBRARY_INSTALL_DIR}"
|
2014-12-22 12:50:18 +01:00
|
|
|
PUBLIC_HEADER DESTINATION "${QCA_INCLUDE_INSTALL_DIR}/QtCrypto"
|
|
|
|
INCLUDES DESTINATION "${QCA_INCLUDE_INSTALL_DIR}/QtCrypto"
|
2014-09-28 20:57:53 +06:00
|
|
|
)
|
|
|
|
|
|
|
|
install_pdb(${QCA_LIB_NAME} ${QCA_BINARY_INSTALL_DIR})
|
|
|
|
endif()
|
2014-02-03 02:05:54 +06:00
|
|
|
|