4
0
mirror of https://github.com/QuasarApp/qca.git synced 2025-05-14 03:29:32 +00:00
Ivan Romanov 6d690c0070 Build static QCA
Added new cmake variable SHARED_LIBRARY. By default is on.
When it is off QCA library, plugins, tools, examples and unittests
will be built as static. Also if is used static Qt plugins will be
built as static. Tested with Qt4.
2014-01-02 03:50:18 +06:00

37 lines
1.3 KiB
CMake

if(WITH_gcrypt_PLUGIN STREQUAL "yes")
find_package(LibGcrypt REQUIRED)
else(WITH_gcrypt_PLUGIN STREQUAL "yes")
find_package(LibGcrypt)
endif(WITH_gcrypt_PLUGIN STREQUAL "yes")
if(LIBGCRYPT_FOUND)
include(CheckTypeSize)
set(remember_includes ${CMAKE_EXTRA_INCLUDE_FILES})
set(remember_defines ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_EXTRA_INCLUDE_FILES gcrypt.h)
set(CMAKE_REQUIRED_FLAGS ${LIBGCRYPT_CFLAGS})
check_type_size(gcry_error_t GCRY_ERROR_T)
set(CMAKE_REQUIRED_FLAGS ${remember_defines})
set(CMAKE_EXTRA_INCLUDE_FILES ${remember_includes})
if(HAVE_GCRY_ERROR_T)
enable_plugin("gcrypt")
set(QCA_GCRYPT_SOURCES qca-gcrypt.cpp)
add_definitions(${LIBGCRYPT_CFLAGS})
my_automoc(QCA_GCRYPT_SOURCES)
add_library(qca-gcrypt ${PLUGIN_TYPE} ${QCA_GCRYPT_SOURCES})
target_link_libraries(qca-gcrypt ${QT_QTCORE_LIBRARY} ${QCA_LIB_NAME} ${LIBGCRYPT_LIBRARIES})
install(TARGETS qca-gcrypt
LIBRARY DESTINATION "${QCA_PLUGINS_INSTALL_DIR}"
ARCHIVE DESTINATION "${QCA_PLUGINS_INSTALL_DIR}"
RUNTIME DESTINATION "${QCA_PLUGINS_INSTALL_DIR}")
else(HAVE_GCRY_ERROR_T)
message(STATUS "libgcrypt seems to be too old")
disable_plugin("gcrypt")
endif(HAVE_GCRY_ERROR_T)
else(LIBGCRYPT_FOUND)
disable_plugin("gcrypt")
endif(LIBGCRYPT_FOUND)