Back to home page

Enduro/X

 
 

    


0001 ##
0002 ## @brief Enduro Execution platform main Make descriptor
0003 ##
0004 ## @file CMakeLists.txt
0005 ##
0006 ## -----------------------------------------------------------------------------
0007 ## Enduro/X Middleware Platform for Distributed Transaction Processing
0008 ## Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
0009 ## Copyright (C) 2017-2018, Mavimax, Ltd. All Rights Reserved.
0010 ## This software is released under one of the following licenses:
0011 ## GPL or Mavimax's license for commercial use.
0012 ## -----------------------------------------------------------------------------
0013 ## GPL license:
0014 ## 
0015 ## This program is free software; you can redistribute it and/or modify it under
0016 ## the terms of the GNU General Public License as published by the Free Software
0017 ## Foundation; either version 3 of the License, or (at your option) any later
0018 ## version.
0019 ##
0020 ## This program is distributed in the hope that it will be useful, but WITHOUT ANY
0021 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0022 ## PARTICULAR PURPOSE. See the GNU General Public License for more details.
0023 ##
0024 ## You should have received a copy of the GNU General Public License along with
0025 ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
0026 ## Place, Suite 330, Boston, MA 02111-1307 USA
0027 ##
0028 ## -----------------------------------------------------------------------------
0029 ## A commercial use license is available from Mavimax, Ltd
0030 ## contact@mavimax.com
0031 ## -----------------------------------------------------------------------------
0032 ##
0033 
0034 cmake_minimum_required (VERSION 2.6) 
0035 project (ENDUROX) 
0036 set(VERSION "5.3.18")
0037 set(PROJ_NAME "Enduro/X")
0038 set(RELEASE "1")
0039 
0040 
0041 ################################################################################
0042 # OS Confiugration
0043 ################################################################################
0044 
0045 EXEC_PROGRAM(uname ARGS -a OUTPUT_VARIABLE _TMP_CMAKE_OS_NAME)
0046 string(REGEX MATCH "^[a-zA-Z0-9-]*" _TMP_CMAKE_OS_NAME_EXTR ${_TMP_CMAKE_OS_NAME})
0047 string(TOUPPER ${_TMP_CMAKE_OS_NAME_EXTR} CMAKE_OS_NAME)
0048 
0049 message("CMake CMAKE_OS_NAME  = ${CMAKE_OS_NAME}")
0050 message("CMake CMAKE_C_COMPILER_ID  = ${CMAKE_C_COMPILER_ID}")
0051 message("CMake CMAKE_CXX_COMPILER_ID  = ${CMAKE_CXX_COMPILER_ID}")
0052 
0053 OPTION(DEFINE_FORCEPOLL "Force POLL (even on linux)" OFF)
0054 OPTION(DEFINE_FORCEFDPOLL "Force FDPOLL" OFF)
0055 OPTION(DEFINE_FORCEKQUEUE "Force Kqueue (BSD poll framework)" OFF)
0056 
0057 OPTION(DEFINE_RELEASEBUILD "Do relesae build" OFF)
0058 OPTION(DEFINE_FORCEEMQ "Force Emulated Message Queue" OFF)
0059 
0060 
0061 SET ( CMAKE_CXX_FLAGS "-O2 -fno-exceptions -fno-rtti" CACHE STRING "compile flags" FORCE)
0062 
0063 # Support #310 Ubuntu 18.04 prints lot of unneeded warnings...
0064 SET(CMAKE_C_FLAGS "-Wno-format-truncation ${CMAKE_C_FLAGS}")
0065 
0066 # Enable release only if specified.
0067 # By default if RELEASE_BUILD is not defined, then we run in debug!
0068 IF (DEFINE_RELEASEBUILD)
0069         MESSAGE( RELEASE_BUILD )
0070         SET(CMAKE_BUILD_TYPE release)
0071         SET(CMAKE_C_FLAGS "-fstack-protector -O2 ${CMAKE_C_FLAGS}")
0072 ELSE ()
0073         MESSAGE( DEBUG_BUILD )
0074         SET(CMAKE_BUILD_TYPE debug)
0075 # Memory debugging:
0076 #       SET(CMAKE_C_FLAGS "-fsanitize=alignment -fsanitize=address -fno-omit-frame-pointer -O1 -ggdb ${CMAKE_C_FLAGS}")
0077 #       SET(CMAKE_C_FLAGS "-fsanitize=address -fno-omit-frame-pointer -O1 -ggdb ${CMAKE_C_FLAGS}")
0078         SET(CMAKE_C_FLAGS "-fstack-protector -O2 -ggdb ${CMAKE_C_FLAGS}")
0079 ENDIF ()
0080 
0081 SET(RT_LIB rt dl)
0082 if( ${CMAKE_OS_NAME} STREQUAL "LINUX" )
0083         set(EX_OS_LINUX "1")
0084         set(NDRX_LD_LIBRARY_PATH "LD_LIBRARY_PATH")
0085         # Enable poll only
0086         IF(DEFINE_FORCEPOLL)
0087             message("Linux - Using poll()")
0088             set(EX_USE_POLL "1")
0089         ELSEIF(DEFINE_FORCEFDPOLL)
0090             message("Linux - Using fdpoll()")
0091         ELSE()
0092             message("Linux - Using epoll()")
0093             set(EX_USE_EPOLL "1")
0094         ENDIF()
0095 elseif(${CMAKE_OS_NAME} STREQUAL "AIX")
0096 # Configure the compiler, we support XLC too..
0097 
0098         message("No threads mode for CPM - bit slower child process exit status check...")
0099         # Seems aix 7.1 does not like threads mixed with fork...
0100         set(EX_CPM_NO_THREADS "1")
0101         set(NDRX_LD_LIBRARY_PATH "LD_LIBRARY_PATH")
0102 
0103         if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
0104                 message("GNU compiler")
0105                 set ( CMAKE_C_FLAGS "-D_SEM_SEMUN_UNDEFINED -D_THREAD_SAFE -pthread -maix64 ${CMAKE_C_FLAGS}")
0106         elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "XL")
0107                 message("XL compiler")
0108                 set ( CMAKE_C_FLAGS " -D_SEM_SEMUN_UNDEFINED -D_THREAD_SAFE ")
0109                 set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qwarn64 -qpic -bexpfull -b64")
0110                 set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -brtl -qtls -q64 -qlanglvl=extc99")
0111                 set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qsuppress=1506-997 -qprocimported=setjmp -lbsd")
0112 
0113                 if (NOT DEFINE_RELEASEBUILD)
0114                         message("XL compiler: with -g (debug symbols...)")
0115                         set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
0116                 endif()
0117         endif()
0118 
0119     set(EX_USE_POLL "1")
0120         set(EX_OS_AIX "1")
0121     # For AIX we do not have other options that use file system
0122     # base queue registry.
0123     set(USE_FS_REGISTRY "1")
0124 elseif(${CMAKE_OS_NAME} STREQUAL "HP-UX")
0125     set(EX_USE_POLL "1")
0126         set(EX_OS_HPUX "1")
0127     set(NDRX_LD_LIBRARY_PATH "SHLIB_PATH")
0128 elseif(${CMAKE_OS_NAME} STREQUAL "SUNOS")
0129         set(EX_OS_SUNOS "1")
0130     set(EX_USE_POLL "1")
0131     set(NDRX_LD_LIBRARY_PATH "LD_LIBRARY_PATH")
0132         # Bug #219 !!! _REENTRANT makes errno thread safe
0133         SET(CMAKE_C_FLAGS "-D_REENTRANT")
0134         if ("${CMAKE_C_COMPILER_ID}" STREQUAL "SunPro")
0135                 message("SUN Studio compiler (building for 64bit) ")
0136 
0137                 # Bug #219 !!! _REENTRANT makes errno thread safe
0138                 # For GNU I guess 
0139                 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -errtags -fast -m64 -xc99=all -erroff=E_PTR_TO_VOID_IN_ARITHMETIC ")
0140                 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=E_EMPTY_MBR_DECLARATION -erroff=E_NO_IMPLICIT_DECL_ALLOWED")
0141                 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=E_EMPTY_DECLARATION -erroff=E_ARGUEMENT_MISMATCH -erroff=E_ZERO_OR_NEGATIVE_SUBSCRIPT")
0142                 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=E_ARG_INCOMPATIBLE_WITH_ARG_L")
0143                 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=E_BAD_PTR_INT_COMBINATION")
0144 
0145                 SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -m64")
0146                 # Add Sun Studio C runtime
0147                 SET(RT_LIB ${RT_LIB} Crun)
0148         endif()
0149 elseif(${CMAKE_OS_NAME} STREQUAL "FREEBSD")
0150     SET(RT_LIB rt)
0151         # seem that threading model also does not work here...
0152     set(EX_CPM_NO_THREADS "1")
0153         set(EX_OS_FREEBSD "1")
0154         # Best option...
0155     set(EX_USE_KQUEUE "1")
0156     set(NDRX_LD_LIBRARY_PATH "LD_LIBRARY_PATH")
0157 elseif(${CMAKE_OS_NAME} STREQUAL "CYGWIN")
0158         set(EX_OS_CYGWIN "1")
0159     set(EX_USE_POLL "1")
0160     set(NDRX_LD_LIBRARY_PATH "LD_LIBRARY_PATH")
0161 elseif(${CMAKE_OS_NAME} STREQUAL "DARWIN")
0162     SET(RT_LIB dl)
0163     set(EX_OS_DARWIN "1")
0164     set(EX_USE_EMQ "1")
0165     set(EX_USE_POLL "1")
0166     set(NDRX_LD_LIBRARY_PATH "DYLD_FALLBACK_LIBRARY_PATH")
0167 # Unknown OS:
0168 else()
0169         message( FATAL_ERROR "Unsupported OS" )
0170 endif()
0171 
0172 # Use emulated message queue
0173 IF(DEFINE_FORCEEMQ)
0174     message("Using emulated message queue")
0175     set(EX_USE_EMQ "1")
0176     set(EX_USE_POLL "1")
0177 ENDIF()
0178 
0179 # Use emulated message queue
0180 IF(DEFINE_FORCEFDPOLL)
0181     message("Using poll on MQ mqd_t as file descriptor")
0182     set(EX_USE_FDPOLL "1")
0183 ENDIF()
0184 
0185 IF(DEFINE_FORCEKQUEUE)
0186     message("Using Kqueue event mechanism")
0187     set(EX_USE_KQUEUE "1")
0188 ENDIF()
0189 
0190 ################################################################################
0191 # "Configure"
0192 ################################################################################
0193 
0194 # In this file we are doing all of our 'configure' checks. Things like checking
0195 # for headers, functions, libraries, types and size of types.
0196 INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
0197 INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
0198 INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
0199 INCLUDE (${CMAKE_ROOT}/Modules/CheckCSourceCompiles.cmake)
0200 INCLUDE (${CMAKE_ROOT}/Modules/CheckCXXSourceCompiles.cmake)
0201 INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
0202 INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
0203 
0204 
0205 CHECK_C_SOURCE_COMPILES("extern const char * __progname; int main() {return __progname[0];}" HAVE_PROGNAME)
0206 
0207 CHECK_C_SOURCE_COMPILES("int main() {__builtin_expect(1, 1);}" HAVE_EXPECT)
0208 
0209 CHECK_C_SOURCE_COMPILES("int main() { int X = 0; __sync_bool_compare_and_swap(&X, 0, 1); __sync_synchronize();}" HAVE_SYNC)
0210 
0211 CHECK_C_SOURCE_COMPILES("#include <stdio.h> \n int main() {char buf[128]; size_t len; getline(buf, &len, stdin);}" HAVE_GETLINE)
0212 
0213 CHECK_C_SOURCE_COMPILES("#include <string.h> \n int main() {char dest[1]; char src[1]; strlcpy(dest, src, 1);}" HAVE_STRLCPY)
0214 
0215 CHECK_C_SOURCE_COMPILES("#include <string.h> \n int main() {strnlen(\"ABC\", 1);}" HAVE_STRNLEN)
0216 
0217 # To check for an include file you do this: 
0218 CHECK_INCLUDE_FILE("stdint.h"        HAVE_STDINT_H)
0219 CHECK_INCLUDE_FILE("getopt.h"       HAVE_GETOPT_H)
0220         
0221 
0222 # To check the size of a primitive type:
0223 CHECK_TYPE_SIZE("int"   SIZEOF_INT)
0224 
0225 IF (DEFINE_DISABLEPSCRIPT)
0226         set(NDRX_DISABLEPSCRIPT "1")
0227 ENDIF()
0228 
0229 # Output the project version
0230 set(NDRX_VERSION_STR "${PROJ_NAME} ${VERSION}")
0231 
0232 ################################################################################
0233 # Install dir config
0234 ################################################################################
0235 get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
0236 
0237 message("LIB: ${LIB64}")
0238 
0239 if(${CMAKE_OS_NAME} STREQUAL "DARWIN")
0240     set(LIB_SUFFIX "")
0241 # Seems like BSD does not use lib64 folder
0242 elseif ("${CMAKE_OS_NAME}" STREQUAL "FREEBSD")
0243     set(LIB_SUFFIX "")
0244 elseif ("${LIB64}" STREQUAL "TRUE")
0245     set(LIB_SUFFIX 64)
0246 else()
0247     set(LIB_SUFFIX "")
0248 endif()
0249 
0250 message("LIB_SUFFIX: ${LIB_SUFFIX}")
0251 
0252 set(INSTALL_LIB_DIR lib${LIB_SUFFIX} CACHE PATH "Installation directory for libraries")
0253 
0254 message("INSTALL_LIB_DIR: ${INSTALL_LIB_DIR}")
0255 
0256 mark_as_advanced(INSTALL_LIB_DIR) 
0257 MESSAGE( STATUS "INSTALL_LIB_DIR: " ${INSTALL_LIB_DIR} )
0258 
0259 ################################################################################
0260 # Options
0261 ################################################################################
0262 
0263 # Option to disable gpg-me (gpg-me enabled by default)
0264 
0265 OPTION(DEFINE_DISABLEGPGME "Use GPG-ME encryption" OFF)
0266  
0267 IF(DEFINE_DISABLEGPGME)
0268     ADD_DEFINITIONS(-DDISABLEGPGME)
0269 ENDIF(DEFINE_DISABLEGPGME)
0270 
0271 OPTION(DEFINE_DISABLEPSCRIPT "Disable Platform Script" OFF)
0272 ###############################################################################
0273 
0274 ################################################################################
0275 # Option to disable documentation build (dos are enabled by default)
0276 OPTION(DEFINE_DISABLEDOC "Disable documentation generation" OFF) 
0277 ################################################################################
0278 
0279 ################################################################################
0280 # Submakes
0281 ################################################################################
0282 # Recurse into the project subdirectories. This does not actually
0283 # cause another cmake executable to run. The same process will walk through 
0284 # the project's entire directory structure. 
0285 add_subdirectory (libnstd)
0286 add_subdirectory (embedfile)
0287 add_subdirectory (libcgreen)
0288 add_subdirectory (libexuuid)
0289 add_subdirectory (libubf)
0290 add_subdirectory (libnetproto)
0291 add_subdirectory (libthpool)
0292 add_subdirectory (ubftest)
0293 add_subdirectory (mkfldhdr)
0294 # EnduroX sub-directories for ATMI
0295 add_subdirectory (libatmi) # General Purpose ATMI library
0296 add_subdirectory (libatmisrv) #  ATMI server library 
0297 add_subdirectory (libatmiclt) #  ATMI client library 
0298 add_subdirectory (libexnet)
0299 add_subdirectory (libexmemck)
0300 
0301 IF (NOT DEFINE_DISABLEPSCRIPT)
0302         add_subdirectory (libps) # Platform script
0303         add_subdirectory (libpsstdlib) # Platform script standard library
0304 ENDIF()
0305 
0306 add_subdirectory (tpevsrv)
0307 add_subdirectory (tpcachesv)
0308 add_subdirectory (tpcached)
0309 add_subdirectory (tprecover) # Special recovery server
0310 add_subdirectory (tpbrdcstsv) # tpbroadcast remote machine dispatcher
0311 add_subdirectory (ud)
0312 
0313 
0314 IF (NOT DEFINE_DISABLEPSCRIPT)
0315         add_subdirectory (pscript) # Platform script interpreter
0316 ENDIF()
0317 
0318 add_subdirectory (viewc) # View compiler
0319 add_subdirectory (ndrxd) # Enduro X daemon
0320 add_subdirectory (xadmin) # Enduro X command line interface
0321 add_subdirectory (lmdb_util) # LMDB/EXDB Admin utilities
0322 add_subdirectory (xmemck) # Enduro X memcory checking tool
0323 add_subdirectory (bridge) # Cluster bridge server
0324 add_subdirectory (tmsrv) # Transaction Manager server for XA transactions
0325 add_subdirectory (tmqueue) # Persistant Queue server
0326 add_subdirectory (cpmsrv) # Client Process Monitor
0327 add_subdirectory (xadrv) # XA Drivers for RMs
0328 add_subdirectory (cconfsrv) # Common-Config server
0329 add_subdirectory (plugins) # XA Drivers for RMs
0330 add_subdirectory (enctools) # XA Drivers for RMs
0331 add_subdirectory (atmitest) #  ATMI testing
0332 
0333 IF(DEFINE_DISABLEDOC)
0334         message("Documentation disabled - not building")
0335 ELSE (DEFINE_DISABLEDOC)
0336         add_subdirectory (doc) #  Documentation project.
0337 ENDIF (DEFINE_DISABLEDOC)
0338 
0339 add_subdirectory (include) #  For install
0340 add_subdirectory (scripts) #  For install
0341 add_subdirectory (sampleconfig) #  For install
0342 
0343 
0344 ################################################################################
0345 # uninstall target
0346 ################################################################################
0347 configure_file(
0348     "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
0349     "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
0350     IMMEDIATE @ONLY)
0351 
0352 add_custom_target(uninstall
0353     COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
0354 ################################################################################
0355 # Packages
0356 ################################################################################
0357 
0358 find_program(LSB_RELEASE_EXECUTABLE lsb_release)
0359 if(LSB_RELEASE_EXECUTABLE)
0360         execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -si
0361                 OUTPUT_VARIABLE _TMP_LSB_RELEASE_OUTPUT_OS
0362                 ERROR_QUIET
0363                 OUTPUT_STRIP_TRAILING_WHITESPACE)
0364 
0365         string(TOLOWER 
0366                 ${_TMP_LSB_RELEASE_OUTPUT_OS}
0367         LSB_RELEASE_OUTPUT_OS)
0368         string(REPLACE " " "_" LSB_RELEASE_OUTPUT_OS ${LSB_RELEASE_OUTPUT_OS})
0369 
0370         execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -sr
0371                 OUTPUT_VARIABLE _TMP_LSB_RELEASE_OUTPUT_VER
0372                 ERROR_QUIET
0373                 OUTPUT_STRIP_TRAILING_WHITESPACE)
0374         string(REPLACE "." "_" LSB_RELEASE_OUTPUT_VER ${_TMP_LSB_RELEASE_OUTPUT_VER})
0375         #string(REGEX MATCH "^[0-9]+" LSB_RELEASE_OUTPUT_VER ${_TMP_LSB_RELEASE_OUTPUT_VER})
0376 else ()
0377         set(LSB_RELEASE_OUTPUT_OS ${CMAKE_OS_NAME})
0378 
0379         string(REPLACE "." "_" _TMP_LSB_RELEASE_OUTPUT_VER ${CMAKE_SYSTEM_VERSION})
0380         string(REPLACE "-" "_" LSB_RELEASE_OUTPUT_VER ${_TMP_LSB_RELEASE_OUTPUT_VER})
0381         
0382         # If it is AIX, then we can extract version from uname
0383         if(${CMAKE_OS_NAME} STREQUAL "AIX")
0384                 execute_process(COMMAND uname -v
0385                         OUTPUT_VARIABLE _TMP_OS_MAJOR_VER OUTPUT_STRIP_TRAILING_WHITESPACE)
0386                 execute_process(COMMAND uname -r
0387                         OUTPUT_VARIABLE _TMP_OS_MINOR_VER OUTPUT_STRIP_TRAILING_WHITESPACE)
0388                 set(LSB_RELEASE_OUTPUT_VER ${_TMP_OS_MAJOR_VER}_${_TMP_OS_MINOR_VER})
0389         endif()
0390         
0391 endif()
0392 
0393 message("LSB_RELEASE OS  = ${LSB_RELEASE_OUTPUT_OS}")
0394 message("LSB_RELEASE VER = ${LSB_RELEASE_OUTPUT_VER}")
0395 set(EX_LSB_RELEASE_VER ${LSB_RELEASE_OUTPUT_VER})
0396 
0397 string(REPLACE "_" ";" LSB_VERSION_LIST ${LSB_RELEASE_OUTPUT_VER})
0398 
0399 list( LENGTH LSB_VERSION_LIST TMP_LIST_LEN ) 
0400 
0401 if (TMP_LIST_LEN LESS 1)
0402         # No version at all!!
0403         set(EX_LSB_RELEASE_VER_MAJOR "0")
0404         set(EX_LSB_RELEASE_VER_MINOR "0")
0405 elseif (TMP_LIST_LEN LESS 2)
0406         # Bug #198 - FedoraCore do not have minor version numbers
0407         list(GET LSB_VERSION_LIST 0 EX_LSB_RELEASE_VER_MAJOR)
0408         set(EX_LSB_RELEASE_VER_MINOR "0")
0409 
0410 else ()
0411         list(GET LSB_VERSION_LIST 0 EX_LSB_RELEASE_VER_MAJOR)
0412         list(GET LSB_VERSION_LIST 1 EX_LSB_RELEASE_VER_MINOR)
0413 endif()
0414 
0415 MESSAGE( "EX_LSB_RELEASE_VER_MAJOR = " ${EX_LSB_RELEASE_VER_MAJOR} )
0416 MESSAGE( "EX_LSB_RELEASE_VER_MINOR = " ${EX_LSB_RELEASE_VER_MINOR} )
0417 
0418 # Support only for Linux
0419 MESSAGE( "CPack:Debug: CMAKE_SYSTEM_NAME = " ${CMAKE_SYSTEM_NAME} )
0420 MESSAGE( "CPack:Debug: CMAKE_SYSTEM_PROCESSOR = " ${CMAKE_SYSTEM_PROCESSOR} )
0421 set(CPACK_MONOLITHIC_INSTALL 1)
0422 
0423 #
0424 # Generate configuration 
0425 #
0426 configure_file ("${PROJECT_SOURCE_DIR}/include/ndrx_config.h.in"
0427                 "${PROJECT_BINARY_DIR}/include/ndrx_config.h" )
0428 
0429 # Test the available generators and then configure output
0430 find_program(RPMPROG "rpmbuild")
0431 find_program(APTPROG "dpkg")
0432 
0433 # avoid file /usr/share/man from install of endurox-3.5.1-1.x86_64 conflicts with file from package filesystem-3.2-21.el7.x86_64
0434 # problems...
0435 set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/share/man
0436                 /usr/share/man/man3
0437                 /usr/share/man/man5
0438                 /usr/share/man/man8
0439                 /usr/lib64/pkgconfig
0440                 /usr/lib/pkgconfig)
0441 message("Excl: ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION}")
0442 
0443 set(CPACK_GENERATOR "TGZ")
0444 if(RPMPROG)
0445         message("Outputting RPM")
0446         set(CPACK_GENERATOR "${CPACK_GENERATOR};RPM")
0447 endif()
0448 
0449 if(APTPROG)
0450         message("Outputting DEB")
0451         set(CPACK_GENERATOR "${CPACK_GENERATOR};DEB")
0452 endif()
0453 
0454 set(CPACK_PACKAGE_CONTACT "madars.vitolins@gmail.com")
0455 set(CPACK_PACKAGE_VERSION ${VERSION})
0456 #set(CPACK_DEBIAN_PACKAGE_DEPENDS "libxml2,openssl,libgpgme11")
0457 #set(CPACK_RPM_PACKAGE_REQUIRES "libxml2,openssl,libssl,libgpgme11")
0458 string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LO)
0459 message("CPack:Debug: PROJECT NAME = ${PROJECT_NAME_LO}")
0460 set(CPACK_PACKAGE_FILE_NAME         ${PROJECT_NAME_LO}-${VERSION}-${RELEASE}.${LSB_RELEASE_OUTPUT_OS}${LSB_RELEASE_OUTPUT_VER}_${CMAKE_C_COMPILER_ID}.${CMAKE_SYSTEM_PROCESSOR})
0461 message("CPack:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
0462 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Enduro/X Middleware Platform")
0463 set(CPACK_DEBIAN_PACKAGE_DESCRIPTION  ${CPACK_PACKAGE_DESCRIPTION})
0464 set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
0465 #set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/Debian/postinst")
0466 
0467 include(CPack)
0468 ################################################################################
0469 
0470 
0471