Back to home page

Enduro/X

 
 

    


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