"Fossies" - the Fresh Open Source Software Archive

Member "zuluCrypt-5.7.0/CMakeLists.txt" (1 Oct 2019, 23322 Bytes) of package /linux/misc/zuluCrypt-5.7.0.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "CMakeLists.txt": 5.6.0_vs_5.7.0.

    1 
    2 cmake_minimum_required(VERSION 2.6)
    3 
    4 set_property(GLOBAL PROPERTY ALLOW_DUPLICATE_CUSTOM_TARGETS ON)
    5 
    6 project(zuluCrypt)
    7 
    8 INCLUDE(GNUInstallDirs)
    9 
   10 set( PGR_VERSION "5.7.0" )
   11 set( LIB_VERSION "1.2.0" )
   12 set( LIB_PLUGIN_VERSION "1.0.0" )
   13 
   14 #add_definitions( -D_DEFAULT_SOURCE -fstack-protector-all -D_FORTIFY_SOURCE=2 --param ssp-buffer-size=4 )
   15 add_definitions( -D_DEFAULT_SOURCE -fstack-protector-all --param ssp-buffer-size=4 )
   16 
   17 include_directories( ${PROJECT_BINARY_DIR} )
   18 
   19 if( LIB_SUFFIX )
   20 	set( CMAKE_INSTALL_LIBDIR "${LIB_SUFFIX}" )
   21 	set( CMAKE_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${LIB_SUFFIX}" )
   22 endif()
   23 
   24 # These variables are used but they dont always appear to be set and we set them if we found them to be not set
   25 if( NOT CMAKE_INSTALL_DOCDIR )
   26 	set( CMAKE_INSTALL_DOCDIR "share/doc/zuluCrypt" )
   27 endif()
   28 
   29 if( NOT CMAKE_INSTALL_MANDIR )
   30 	set( CMAKE_INSTALL_MANDIR "share/man" )
   31 endif()
   32 
   33 if( NOT CMAKE_INSTALL_DATADIR )
   34 	set( CMAKE_INSTALL_DATADIR "share" )
   35 endif()
   36 
   37 if( NOT DEFINED QT5 )
   38     set( QT5 "true" )
   39 endif()
   40 
   41 # uninstall target
   42 configure_file(
   43 	"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
   44 	"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
   45 	IMMEDIATE @ONLY )
   46 
   47 add_custom_target( uninstall
   48 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake )
   49 
   50 INCLUDE(CMakeDependentOption)
   51 INCLUDE(FindPkgConfig)
   52 
   53 # options
   54 option(NOGUI "Don't build the GUI" OFF)
   55 cmake_dependent_option(WITH_PWQUALITY "Build with pwquality support" ON
   56 	"NOT NOGUI" OFF)
   57 option(NOGNOME "Build without gnome support" OFF)
   58 cmake_dependent_option(NOKDE "Build without kde support" OFF
   59 	"NOT NOGUI" ON)
   60 option(UDEVSUPPORT "Build without udev support" ON)
   61 
   62 if( NOT NOGNOME )
   63 	pkg_check_modules( LIBSECRET libsecret-1 )
   64 else( NOT NOGNOME )
   65 	set( NOSECRETSUPPORT "true" )
   66 endif( NOT NOGNOME )
   67 
   68 if( NOKDE )
   69 	set( NOKDESUPPORT "true" )
   70 endif( NOKDE )
   71 
   72 pkg_check_modules( CRYPTSETUP libcryptsetup )
   73 pkg_check_modules( BLKID blkid )
   74 pkg_check_modules( DEVMAPPER devmapper )
   75 pkg_check_modules( UUID uuid )
   76 pkg_check_modules( MCHUNGU_NETWORK mhogomchungu_network )
   77 pkg_check_modules( MCHUNGU_TASK mhogomchungu_task )
   78 
   79 if ( WITH_PWQUALITY )
   80 	pkg_check_modules( PWQUALITY pwquality )
   81 endif ( WITH_PWQUALITY )
   82 
   83 file( WRITE ${PROJECT_BINARY_DIR}/version_1.h "
   84 #ifndef THIS_VERSION
   85 #define THIS_VERSION \"${PGR_VERSION}\"
   86 #endif
   87 \n" )
   88 
   89 file( WRITE ${PROJECT_BINARY_DIR}/version.h "
   90 #ifndef ZULUCRYPT_VERSION
   91 #define ZULUCRYPT_VERSION
   92 #define VERSION_STRING \"Version  : ${PGR_VERSION}\\nCopyright: 2011-2019 Francis Banyikwa,mhogomchungu@gmail.com\\nLicense  : GPLv2+\"
   93 #endif
   94 \n" )
   95 
   96 if( NOT DEVMAPPER_FOUND )
   97 	message( FATAL_ERROR "ERROR: could not find devmapper package" )
   98 else( )
   99 	find_library( devmapper_lib libdevmapper.so )
  100 	if( NOT devmapper_lib )
  101 		message( FATAL_ERROR "ERROR: could not find libdevmapper.so" )
  102 	else()
  103 		message( STATUS "found version \"${DEVMAPPER_VERSION}\" of libdevmapper library at: ${devmapper_lib}" )
  104 	endif()
  105 endif()
  106 
  107 if( NOT UUID_FOUND )
  108 	message( FATAL_ERROR "ERROR: could not find uuid package" )
  109 else( )
  110 	find_library( uuid_lib libuuid.so )
  111 	if( NOT uuid_lib )
  112 		message( FATAL_ERROR "ERROR: could not find libuuid.so" )
  113 	else()
  114 		message( STATUS "found version \"${UUID_VERSION}\" of uuid library at: ${uuid_lib}" )
  115 	endif()
  116 endif()
  117 
  118 if( NOT BLKID_FOUND )
  119 	message( FATAL_ERROR "ERROR: could not find blkid package" )
  120 else( NOT BLKID_FOUND )
  121 	#add_definitions( "${BLKID_CFLAGS}" )
  122 	find_library( blkid_lib libblkid.so )
  123 	if( blkid_lib )
  124 		set( blkid "${blkid_lib}" )
  125 		message( STATUS "found version \"${BLKID_VERSION}\" of blkid library at: ${uuid_lib}" )
  126 	else( blkid_lib )
  127 		message( FATAL_ERROR "ERROR: could not find libblkid.so" )
  128 	endif( blkid_lib )
  129 endif( NOT BLKID_FOUND )
  130 
  131 if( NOT CRYPTSETUP_FOUND )
  132 	message( FATAL_ERROR "ERROR: could not find cryptsetup package" )
  133 else( NOT CRYPTSETUP_FOUND )
  134 	#add_definitions( "${CRYPTSETUP_CFLAGS}" )
  135 	find_library( cryptsetup_lib libcryptsetup.so )
  136 	#set( cryptsetup_lib "${CRYPTSETUP_LIBDIR}/libcryptsetup.so" )
  137 	MESSAGE( STATUS "found version \"${CRYPTSETUP_VERSION}\" of cryptsetup library at: ${cryptsetup_lib}" )
  138 
  139 	if( NOT cryptsetup_lib )
  140 		message( FATAL_ERROR "ERROR: could not find libcryptsetup.so" )
  141 	endif( NOT cryptsetup_lib )
  142 endif( NOT CRYPTSETUP_FOUND )
  143 
  144 find_file( GCRYPT_INCLUDE_FILE gcrypt.h )
  145 
  146 find_library( GCRYPT_LIBRARY gcrypt )
  147 
  148 if( NOT GCRYPT_INCLUDE_FILE )
  149 	MESSAGE( FATAL_ERROR "could not find gcrypt header file" )
  150 else()
  151 	MESSAGE( STATUS "found gcrypt header file: ${GCRYPT_INCLUDE_FILE}" )
  152 endif()
  153 
  154 if( NOT GCRYPT_LIBRARY )
  155 	MESSAGE( FATAL_ERROR "could not find gcrypt library(libgcrypt.so)" )
  156 else()
  157 	MESSAGE( STATUS "found gcrypt library: ${GCRYPT_LIBRARY}" )
  158 endif()
  159 
  160 find_file( JSON_HEADER_PATH "nlohmann/json.hpp" )
  161 
  162 if( NOT JSON_HEADER_PATH )
  163 	set( JSON_HEADER_PATH "${PROJECT_SOURCE_DIR}/external_libraries/json/nlohmann/json.hpp" )
  164 endif()
  165 
  166 file( WRITE ${PROJECT_BINARY_DIR}/json.h "\n#include \"${JSON_HEADER_PATH}\"" )
  167 MESSAGE( STATUS "found json.hpp header file at: ${JSON_HEADER_PATH}" )
  168 
  169 if( WITH_PWQUALITY )
  170 	pkg_check_modules( PWQUALITY pwquality )
  171 endif( WITH_PWQUALITY )
  172 
  173 file( WRITE  ${PROJECT_BINARY_DIR}/install_prefix.h "\n#define INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}/\"\n" )
  174 
  175 if( REUSEMOUNTPOINT )
  176 	file( WRITE  ${PROJECT_BINARY_DIR}/reuse_mount_point.h "\n#define REUSE_MOUNT_POINT 1\n" )
  177 else()
  178 	file( WRITE  ${PROJECT_BINARY_DIR}/reuse_mount_point.h "\n#define REUSE_MOUNT_POINT 0\n" )
  179 endif()
  180 
  181 set( PLUGINPATH "${CMAKE_INSTALL_FULL_LIBDIR}/zuluCrypt" )
  182 
  183 file( WRITE ${PROJECT_BINARY_DIR}/plugin_path.h "\n#define ZULUCRYPTpluginPath      \"${PLUGINPATH}/\"\n" )
  184 file( APPEND ${PROJECT_BINARY_DIR}/plugin_path.h "\n#define ZULUCRYPTTestPlugin      \"${PLUGINPATH}/zuluCrypt-testKey\"\n" )
  185 
  186 set( BUILD_TCPLAY "true" )
  187 set( TCPLAY_NEW_API "true" )
  188 
  189 if( NOT DEFINED INTERNAL_ZULUPLAY )
  190 	set( INTERNAL_ZULUPLAY "false" )
  191 endif()
  192 
  193 if( INTERNAL_ZULUPLAY )
  194 	message( STATUS "---------------------------------------------------------------------------" )
  195 	message( STATUS "internal version of zuluplay will be used to create and open TrueCrypt and VeraCrypt volumes." )
  196 	message( STATUS "internal version of zuluplay will be used to create and restore TrueCrypt and VeraCrypt volume headers." )
  197 	message( STATUS "---------------------------------------------------------------------------" )
  198 
  199 	set( STATIC_ZULUPLAY "true" )
  200 else()
  201 	pkg_check_modules( ZULUPLAY zuluplay )
  202 
  203 	if( ZULUPLAY_FOUND )
  204 		include_directories( ${ZULUPLAY_INCLUDEDIR} )
  205 		link_directories( ${ZULUPLAY_LIBDIR} )
  206 
  207 		message( STATUS "---------------------------------------------------------------------------" )
  208 		message( STATUS "external version of zuluplay will be used to create and open TrueCrypt and VeraCrypt volumes." )
  209 		message( STATUS "external version of zuluplay will be used to create and restore TrueCrypt volume headers." )
  210 		message( STATUS "creation and restoration of VeraCrypt volume headers is currently disabled." )
  211 		message( STATUS "---------------------------------------------------------------------------" )
  212 
  213 		set( STATIC_ZULUPLAY "false" )
  214 	else()
  215 		message( STATUS "---------------------------------------------------------------------------" )
  216 		message( STATUS "internal version of zuluplay will be used to create and open TrueCrypt and VeraCrypt volumes." )
  217 		message( STATUS "internal version of zuluplay will be used to create and restore TrueCrypt volume headers." )
  218 		message( STATUS "creation and restoration of VeraCrypt volume headers is currently disabled." )
  219 		message( STATUS "---------------------------------------------------------------------------" )
  220 
  221 		set( STATIC_ZULUPLAY "true" )
  222 	endif()
  223 endif()
  224 
  225 if( STATIC_ZULUPLAY )
  226 	set( ZULUPLAY_STATIC_ONLY "true" )
  227 	ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/external_libraries/zuluplay )
  228 	include_directories( ${PROJECT_SOURCE_DIR}/external_libraries/zuluplay )
  229 endif()
  230 
  231 file( WRITE  ${PROJECT_BINARY_DIR}/truecrypt_support_1.h "\n#define TRUECRYPT_CREATE 1\n#include \"zuluplay_api.h\"\n" )
  232 file( APPEND ${PROJECT_BINARY_DIR}/truecrypt_support_1.h "\n#define TCPLAY_NEW_API 1\n" )
  233 file( APPEND ${PROJECT_BINARY_DIR}/truecrypt_support_1.h "\n#define VERACRYPT_CREATE 1\n" )
  234 
  235 file( WRITE ${PROJECT_BINARY_DIR}/zuluplay_support.h "\n#define TCPLAY_OPEN 1\n#include \"zuluplay_api.h\"\n" )
  236 file( WRITE ${PROJECT_BINARY_DIR}/veracrypt_support.h "\n#define VERACRYPT_SUPPORT 1\n" )
  237 file( WRITE  ${PROJECT_BINARY_DIR}/truecrypt_support.h "\n#define TRUECRYPT_CRYPTSETUP 1\n#define TRUECRYPT_TCPLAY 1" )
  238 
  239 if( SHARE_MOUNT_PREFIX )
  240     if( "${SHARE_MOUNT_PREFIX}" STREQUAL "default" )
  241 	file( WRITE  ${PROJECT_BINARY_DIR}/share_mount_prefix_path.h "\n#define SHARE_MOUNT_PREFIX \"/run/media/public\"\n" )
  242     elseif( "${SHARE_MOUNT_PREFIX}" STREQUAL "" )
  243 	file( WRITE  ${PROJECT_BINARY_DIR}/share_mount_prefix_path.h "\n#define SHARE_MOUNT_PREFIX \"/run/media/public\"\n" )
  244     else()
  245 	file( WRITE  ${PROJECT_BINARY_DIR}/share_mount_prefix_path.h "\n#define SHARE_MOUNT_PREFIX \"${SHARE_MOUNT_PREFIX}\"\n" )
  246     endif()
  247 else()
  248 	file( WRITE  ${PROJECT_BINARY_DIR}/share_mount_prefix_path.h "\n#define SHARE_MOUNT_PREFIX \"/run/media/public\"\n" )
  249 endif()
  250 
  251 if( HOMEMOUNTPREFIX )
  252 	file( WRITE  ${PROJECT_BINARY_DIR}/mount_prefix_path.h "\n#define USE_HOME_PATH_AS_MOUNT_PREFIX 1\n" )
  253 else()
  254 	file( WRITE  ${PROJECT_BINARY_DIR}/mount_prefix_path.h "\n#define USE_HOME_PATH_AS_MOUNT_PREFIX 0\n" )
  255 endif()
  256 
  257 #add_library( crypt_buffer STATIC plugins/network_key/crypt_buffer.c zuluCrypt-cli/utility/socket/socket.c )
  258 #set_target_properties( crypt_buffer PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64 -Wextra -Wall -s -fPIC -pthread  -pedantic " )
  259 #TARGET_LINK_LIBRARIES( crypt_buffer -lgcrypt )
  260 
  261 ADD_SUBDIRECTORY( zuluCrypt-cli )
  262 
  263 if( NOT DEFINED INTERNAL_LXQT_WALLET )
  264 	set( INTERNAL_LXQT_WALLET "false" )
  265 endif()
  266 
  267 add_subdirectory( zuluSafe )
  268 
  269 if( NOT NOGUI )
  270 
  271 	if( INTERNAL_LXQT_WALLET )
  272 
  273 		message( STATUS "---------------------------------------------------------------------------" )
  274 		message( STATUS "lxqt wallet support will be provided by an internal library" )
  275 		message( STATUS "---------------------------------------------------------------------------" )
  276 
  277 		include_directories( external_libraries/lxqt_wallet )
  278 		include_directories( external_libraries/lxqt_wallet/frontend )
  279 		include_directories( external_libraries/lxqt_wallet/backend )
  280 
  281 		include_directories( ${PROJECT_BINARY_DIR}/external_libraries/lxqt_wallet/lxqt_wallet )
  282 		include_directories( ${PROJECT_BINARY_DIR}/external_libraries/lxqt_wallet/lxqt_wallet/frontend )
  283 		include_directories( ${PROJECT_BINARY_DIR}/external_libraries/lxqt_wallet/lxqt_wallet/backend )
  284 
  285 		add_subdirectory( external_libraries/lxqt_wallet )
  286 	else()
  287 		pkg_check_modules( LXQT_WALLET lxqt-wallet )
  288 
  289 		if( NOT LXQT_WALLET_FOUND )
  290 
  291 			message( STATUS "ERROR: could not find lxqt_wallet package" )
  292 			message( STATUS "---------------------------------------------------------------------------" )
  293 			message( STATUS "lxqt wallet support will be provided by an internal library" )
  294 			message( STATUS "---------------------------------------------------------------------------" )
  295 
  296 			include_directories( external_libraries/lxqt_wallet )
  297 			include_directories( external_libraries/lxqt_wallet/frontend )
  298 			include_directories( external_libraries/lxqt_wallet/backend )
  299 
  300 			include_directories( ${PROJECT_BINARY_DIR}/external_libraries/lxqt_wallet )
  301 			include_directories( ${PROJECT_BINARY_DIR}/external_libraries/lxqt_wallet/frontend )
  302 			include_directories( ${PROJECT_BINARY_DIR}/external_libraries/lxqt_wallet/backend )
  303 
  304 			add_subdirectory( external_libraries/lxqt_wallet )
  305 		else()
  306 			if( LXQT_WALLET_VERSION VERSION_GREATER "2.0.0" AND QT5 )
  307 
  308 				include_directories( ${LXQT_WALLET_INCLUDEDIR} )
  309 				link_directories( ${LXQT_WALLET_LIBDIR} )
  310 
  311 				message( STATUS "---------------------------------------------------------------------------" )
  312 				message( STATUS "lxqt wallet support will be provided by an external libary" )
  313 				message( STATUS "---------------------------------------------------------------------------" )
  314 			else()
  315 				message( STATUS "---------------------------------------------------------------------------" )
  316 				message( STATUS "lxqt wallet support will be provided by an internal library" )
  317 				message( STATUS "because external library is too old(<= 2.0.0) or cant build " )
  318 				message( STATUS "with external lxqt_wallet while building with Qt4" )
  319 				message( STATUS "---------------------------------------------------------------------------" )
  320 
  321 				include_directories( external_libraries/lxqt_wallet )
  322 				include_directories( external_libraries/lxqt_wallet/frontend )
  323 				include_directories( external_libraries/lxqt_wallet/backend )
  324 
  325 				include_directories( ${PROJECT_BINARY_DIR}/external_libraries/lxqt_wallet )
  326 				include_directories( ${PROJECT_BINARY_DIR}/external_libraries/lxqt_wallet/frontend )
  327 				include_directories( ${PROJECT_BINARY_DIR}/external_libraries/lxqt_wallet/backend )
  328 
  329 				add_subdirectory( external_libraries/lxqt_wallet )
  330 			endif()
  331 		endif()
  332 	endif()
  333 
  334 	if( WITH_PWQUALITY AND PWQUALITY_FOUND )
  335 		find_file ( header_pwquality pwquality.h PATHS ${PWQUALITY_INCLUDE_DIRS} )
  336 		find_library ( library_pwquality libpwquality.so )
  337 		set( BUILDPWQUALITY "true" )
  338 		if( library_pwquality )
  339 			if( header_pwquality )
  340 				file( WRITE ${PROJECT_BINARY_DIR}/can_build_pwquality.h "#define BUILD_PWQUALITY 1\n" )
  341 				file( APPEND ${PROJECT_BINARY_DIR}/can_build_pwquality.h "extern \"C\"\n{\n#include <${header_pwquality}>\n}" )
  342 			else( header_pwquality )
  343 				file( WRITE ${PROJECT_BINARY_DIR}/can_build_pwquality.h "#define BUILD_PWQUALITY 0\n" )
  344 			endif( header_pwquality )
  345 		else( library_pwquality )
  346 			file( WRITE ${PROJECT_BINARY_DIR}/can_build_pwquality.h "#define BUILD_PWQUALITY 0\n" )
  347 		endif( library_pwquality )
  348 	else( WITH_PWQUALITY AND PWQUALITY_FOUND )
  349 		file( WRITE ${PROJECT_BINARY_DIR}/can_build_pwquality.h "#define BUILD_PWQUALITY 0\n" )
  350 	endif( WITH_PWQUALITY AND PWQUALITY_FOUND )
  351 
  352 	if( QT5 )
  353 		find_package( Qt5Widgets REQUIRED )
  354 		find_package( Qt5Core REQUIRED )
  355 		find_package( Qt5Network REQUIRED )
  356 
  357 		message( STATUS "Found Qt5Widgets, version  ${Qt5Widgets_VERSION}" )
  358 		message( STATUS "Found Qt5Core, version  ${Qt5Core_VERSION}" )
  359 		message( STATUS "Found Qt5Network, version  ${Qt5Network_VERSION}" )
  360 
  361 		set( CMAKE_INCLUDE_CURRENT_DIR ON )
  362 		include_directories( ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} )
  363 
  364 		add_definitions( ${Qt5Widgets_DEFINITIONS} )
  365 	else()
  366 		find_package( Qt4 REQUIRED QtCore QtGui QtNetwork )
  367 
  368 		add_definitions( -I${Qt4_INCLUDE_DIR} )
  369 		add_definitions( -I${QT_HEADERS_DIR} )
  370 
  371 		INCLUDE( ${QT_USE_FILE} )
  372         endif()
  373 
  374 	if( MCHUNGU_NETWORK_FOUND )
  375 
  376 		message( STATUS "---------------------------------------------------------------------------" )
  377 		message( STATUS "mhogomchungu_network library will be provided by an external library" )
  378 		message( STATUS "---------------------------------------------------------------------------" )
  379 
  380 		include_directories( "${MCHUNGU_NETWORK_INCLUDEDIR}" )
  381 		link_directories( "${MCHUNGU_NETWORK_LIBDIR}" )
  382 	else()
  383 		message( STATUS "---------------------------------------------------------------------------" )
  384 		message( STATUS "mhogomchungu_network library will be provided by an internal library" )
  385 		message( STATUS "---------------------------------------------------------------------------" )
  386 		ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/external_libraries/NetworkAccessManager )
  387 		include_directories( ${PROJECT_SOURCE_DIR}/external_libraries/NetworkAccessManager )
  388 	endif()
  389 
  390 	if( MCHUNGU_TASK_FOUND )
  391 
  392 		message( STATUS "---------------------------------------------------------------------------" )
  393 		message( STATUS "mhogomchungu_task library will be provided by an external library" )
  394 		message( STATUS "---------------------------------------------------------------------------" )
  395 
  396 		include_directories( "${MCHUNGU_TASK_INCLUDEDIR}" )
  397 		link_directories( "${MCHUNGU_TASK_LIBDIR}" )
  398 	else()
  399 		message( STATUS "---------------------------------------------------------------------------" )
  400 		message( STATUS "mhogomchungu_task library will be provided by an internal library" )
  401 		message( STATUS "---------------------------------------------------------------------------" )
  402 		include_directories( ${PROJECT_SOURCE_DIR}/external_libraries/tasks )
  403 		ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/external_libraries/tasks )
  404 	endif()
  405 
  406 	add_definitions( -std=c++14 )
  407 
  408 	set( CMAKE_CXX_STANDARD 14 )
  409 	set( CMAKE_CXX_STANDARD_REQUIRED ON )
  410 	set( CMAKE_CXX_EXTENSIONS OFF)
  411 
  412 	ADD_SUBDIRECTORY( zuluCrypt-gui/sharedObjects )
  413 	ADD_SUBDIRECTORY( zuluCrypt-gui )
  414 	ADD_SUBDIRECTORY( plugins )
  415 	ADD_SUBDIRECTORY( zuluMount-gui )
  416 
  417         file( WRITE ${PROJECT_BINARY_DIR}/zuluPolkit.h "#define POLKIT_SUPPORT 1" )
  418 
  419         if( USE_POLKIT )
  420 
  421                 file( APPEND ${PROJECT_BINARY_DIR}/zuluPolkit.h "\n#define AUTO_ENABLE_POLKIT_SUPPORT 1" )
  422         else()
  423                 file( APPEND ${PROJECT_BINARY_DIR}/zuluPolkit.h "\n#define AUTO_ENABLE_POLKIT_SUPPORT 0" )
  424         endif()
  425 
  426         ADD_SUBDIRECTORY( zuluPolkit )
  427 
  428 else( NOT NOGUI )
  429 	if( QT5 )
  430 	#adding this one just to silence a warning
  431 	endif()
  432 endif( NOT NOGUI )
  433 
  434 file( WRITE ${PROJECT_BINARY_DIR}/locale_path.h "\n#define TRANSLATION_PATH \"${CMAKE_INSTALL_FULL_DATADIR}/zuluCrypt/translations/\"\n")
  435 
  436 message( STATUS "---------------------------------------------------------------------------" )
  437 message( STATUS "optional functionality that will be build" )
  438 
  439 if( NOT NOGUI )
  440 	message( STATUS "GUI front ends,zuluCrypt-gui and zuluMount-gui" )
  441 endif( NOT NOGUI )
  442 
  443 if( BUILDPWQUALITY )
  444 	message( STATUS "pwquality library support to give passphrase strength measure" )
  445 endif( BUILDPWQUALITY )
  446 
  447 if( UDEVSUPPORT )
  448 	message( STATUS "udev support will be enabled" )
  449 endif( UDEVSUPPORT )
  450 
  451 if( BUILD_TCPLAY )
  452 	message( STATUS "zuluplay adds the ability to create truecrypt compatible encrypted containers" )
  453 endif( BUILD_TCPLAY )
  454 
  455 if( CRYPTSETUP_VERSION VERSION_GREATER "1.6.3" )
  456 	file( WRITE ${PROJECT_BINARY_DIR}/support_whirlpool.h "\n#define SUPPORT_WHIRLPOOL 1\n" )
  457 else()
  458 	file( WRITE ${PROJECT_BINARY_DIR}/support_whirlpool.h "\n#define SUPPORT_WHIRLPOOL 0\n" )
  459 endif()
  460 
  461 if( ( CRYPTSETUP_VERSION VERSION_GREATER "2.0.3" ) OR ( CRYPTSETUP_VERSION VERSION_EQUAL "2.0.3" ) )
  462 	file( WRITE ${PROJECT_BINARY_DIR}/luks2_support.h "\n#define SUPPORT_crypt_get_pbkdf_default 1\n" )
  463 else()
  464 	file( WRITE ${PROJECT_BINARY_DIR}/luks2_support.h "\n#define SUPPORT_crypt_get_pbkdf_default 0\n" )
  465 endif()
  466 
  467 if( CRYPTSETUP_VERSION VERSION_GREATER "1.6.0" )
  468 	file( WRITE ${PROJECT_BINARY_DIR}/check_tcrypt.h "\n#define CHECK_TCRYPT 1\n" )
  469 else()
  470 	file( WRITE ${PROJECT_BINARY_DIR}/check_tcrypt.h "\n#define CHECK_TCRYPT 0\n" )
  471 endif()
  472 
  473 message( STATUS "---------------------------------------------------------------------------" )
  474 message( STATUS "---------------------------------------------------------------------------" )
  475 message( STATUS "optional functionality that will NOT be build" )
  476 
  477 if( NOGUI )
  478 	message( STATUS "GUI front ends,zuluCrypt-gui and zuluMount-gui\n" )
  479 endif( NOGUI )
  480 
  481 if( NOT BUILDPWQUALITY )
  482 	message( STATUS "pwquality library used to measure passphrase strength" )
  483 	message( STATUS "sources can be found at: https://fedorahosted.org/libpwquality/\n" )
  484 endif( NOT BUILDPWQUALITY )
  485 
  486 if( NOT UDEVSUPPORT )
  487 	message( STATUS "udev support\n" )
  488 endif( NOT UDEVSUPPORT )
  489 
  490 message( STATUS "---------------------------------------------------------------------------" )
  491 message( STATUS "\n" )
  492 
  493 if( CRYPTSETUP_VERSION VERSION_GREATER "1.4.0" )
  494 	file( WRITE ${PROJECT_BINARY_DIR}/luks_external_header.h "\n#define LUKS_EXTERNAL_HEADER 1\n" )
  495 else( CRYPTSETUP_VERSION VERSION_GREATER "1.4.0" )
  496 	file( WRITE ${PROJECT_BINARY_DIR}/luks_external_header.h "\n#define LUKS_EXTERNAL_HEADER 0\n" )
  497 endif( CRYPTSETUP_VERSION VERSION_GREATER "1.4.0" )
  498 
  499 if( UDEVSUPPORT )
  500 
  501 	file( WRITE ${PROJECT_BINARY_DIR}/udev_support.h "\n#define UDEV_SUPPORT 1\n")
  502 
  503 	message( STATUS "udev will be consulted when deciding if a volume is system or not." )
  504 	message( STATUS "please read \"udev_support\" file for more information about udev support and associated problems.\n" )
  505 
  506 else( UDEVSUPPORT )
  507 
  508 	file( WRITE ${PROJECT_BINARY_DIR}/udev_support.h "\n#define UDEV_SUPPORT 0\n")
  509 
  510 	message( STATUS "udev will NOT be consulted when deciding if a volume is system or not." )
  511 	message( STATUS "please read \"udev_support\" file for more information about udev support and how to enable it." )
  512 	message( STATUS "It is probably a good idea to enable it if you are creating a package for distribution.\n" )
  513 
  514 endif( UDEVSUPPORT )
  515 
  516 if( NOT NOGUI )
  517 	if( QT5 )
  518 		message( STATUS "---------------------------------------------------------------------------" )
  519 		message( STATUS "Building GUI components using Qt5" )
  520 		message( STATUS "---------------------------------------------------------------------------\n\n" )
  521 	else()
  522 		message( STATUS "---------------------------------------------------------------------------" )
  523 		message( STATUS "Building GUI components using Qt4" )
  524 		message( STATUS "---------------------------------------------------------------------------\n\n" )
  525 	endif()
  526 else()
  527 	message( STATUS "---------------------------------------------------------------------------" )
  528 	message( STATUS "Not building GUI components" )
  529 	message( STATUS "---------------------------------------------------------------------------\n\n" )
  530 endif()
  531 
  532 install ( FILES zuluCrypt.xml  DESTINATION "${CMAKE_INSTALL_PREFIX}/share/mime/packages/" )
  533 
  534 install ( FILES zuluCrypt-cli.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
  535 install ( FILES zuluCrypt-gui.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
  536 install ( FILES zuluMount-cli.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
  537 install ( FILES zuluMount-gui.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
  538 install ( FILES zuluSafe-cli.1  DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
  539 install ( FILES docs/zuluCrypt.pdf  DESTINATION ${CMAKE_INSTALL_DOCDIR} )
  540 
  541 file( WRITE ${PROJECT_BINARY_DIR}/pdf_path.h "\n#define PDF_PATH \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}/zuluCrypt.pdf\"\n" )
  542 
  543 install ( FILES translations/zuluCrypt/de_DE.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/zuluCrypt/translations/zuluCrypt-gui )
  544 install ( FILES translations/zuluCrypt/fr_FR.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/zuluCrypt/translations/zuluCrypt-gui )
  545 install ( FILES translations/zuluCrypt/en_US.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/zuluCrypt/translations/zuluCrypt-gui )
  546 install ( FILES translations/zuluCrypt/ar_SA.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/zuluCrypt/translations/zuluCrypt-gui )
  547 
  548 install ( FILES translations/zuluMount/de_DE.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/zuluCrypt/translations/zuluMount-gui )
  549 install ( FILES translations/zuluMount/en_US.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/zuluCrypt/translations/zuluMount-gui )
  550 install ( FILES translations/zuluMount/fr_FR.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/zuluCrypt/translations/zuluMount-gui )
  551 install ( FILES translations/zuluMount/ar_SA.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/zuluCrypt/translations/zuluMount-gui )
  552 
  553 #install ( FILES translations/zuluMount/de_DE.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/zuluCrypt/translations/zuluMount-gui )