0001 ##
0002 ## @brief Persisted Queue Server
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-2023, Mavimax, Ltd. All Rights Reserved.
0010 ## This software is released under one of the following licenses:
0011 ## AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
0012 ## See LICENSE file for full text.
0013 ## -----------------------------------------------------------------------------
0014 ## AGPL license:
0015 ##
0016 ## This program is free software; you can redistribute it and/or modify it under
0017 ## the terms of the GNU Affero General Public License, version 3 as published
0018 ## by the Free Software Foundation;
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 Affero General Public License, version 3
0023 ## for more details.
0024 ##
0025 ## You should have received a copy of the GNU Affero General Public License along
0026 ## with this program; if not, write to the Free Software Foundation, Inc.,
0027 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0028 ##
0029 ## -----------------------------------------------------------------------------
0030 ## A commercial use license is available from Mavimax, Ltd
0031 ## contact@mavimax.com
0032 ## -----------------------------------------------------------------------------
0033 ##
0034 cmake_minimum_required(VERSION 3.5)
0035
0036 # Make sure the compiler can find include files from UBF library
0037 include_directories (${ENDUROX_SOURCE_DIR}/libubf
0038 ${ENDUROX_SOURCE_DIR}/include
0039 ${ENDUROX_SOURCE_DIR}/libnstd
0040 ${ENDUROX_SOURCE_DIR}/ubftest
0041 )
0042
0043
0044 # Add debug options
0045 # By default if RELEASE_BUILD is not defined, then we run in debug!
0046 IF (ENV{RELEASE_BUILD})
0047 # do nothing
0048 ELSE (ENV{RELEASE_BUILD})
0049 ADD_DEFINITIONS("-D NDRX_DEBUG")
0050 ENDIF (ENV{RELEASE_BUILD})
0051
0052 # Make sure the linker can find the UBF library once it is built.
0053 link_directories (${ENDUROX_BINARY_DIR}/libubf)
0054
0055 ############################# Libraries ########################################
0056
0057 add_library (ndrxxaqdisk SHARED
0058 tmqutil.c
0059 qdisk_xa.c
0060 qtran.c
0061 )
0062
0063 add_library (ndrxxaqdisks SHARED
0064 tmqutil.c
0065 qdisk_xa_s.c
0066 qdisk_xa_common.c
0067 )
0068
0069 add_library (ndrxxaqdiskd SHARED
0070 tmqutil.c
0071 qdisk_xa_d.c
0072 qdisk_xa_common.c
0073 )
0074 ############################# Executables ######################################
0075 add_executable (tmqueue tmqueue.c qspace.c tmqutil.c forward.c tmqapi.c
0076 tmqsrvmain.c corhandle.c fwdstat.c rbtsupp.c inflight.c)
0077
0078 SET (TMQUEUE_ADD_DEP "")
0079 if(${CMAKE_OS_NAME} STREQUAL "AIX")
0080 SET (TMQUEUE_ADD_DEP "bsd")
0081 endif()
0082
0083 target_link_libraries (tmqueue ndrxxaqdisk atmisrvinteg atmi ubf
0084 nstd ${TMQUEUE_ADD_DEP} ${RT_LIB} pthread)
0085
0086 if(CMAKE_OS_NAME STREQUAL "CYGWIN")
0087 target_link_libraries (ndrxxaqdisk nstd atmi ubf)
0088 target_link_libraries (ndrxxaqdisks nstd atmi ubf)
0089 target_link_libraries (ndrxxaqdiskd nstd atmi ubf)
0090 elseif(CMAKE_OS_NAME STREQUAL "DARWIN")
0091 target_link_libraries (ndrxxaqdisk nstd atmi ubf)
0092 target_link_libraries (ndrxxaqdisks nstd atmi ubf)
0093 target_link_libraries (ndrxxaqdiskd nstd atmi ubf)
0094 elseif(CMAKE_OS_NAME STREQUAL "AIX")
0095 target_link_libraries (ndrxxaqdisk pthread)
0096 target_link_libraries (ndrxxaqdisks pthread)
0097 target_link_libraries (ndrxxaqdiskd pthread)
0098 endif()
0099
0100 set_target_properties(tmqueue PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0101 ################################################################################
0102
0103 # Install libs
0104 install (TARGETS
0105 ndrxxaqdisk
0106 DESTINATION "${INSTALL_LIB_DIR}"
0107 PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
0108 COMPONENT libraries
0109 )
0110
0111 install (TARGETS
0112 ndrxxaqdiskd
0113 DESTINATION "${INSTALL_LIB_DIR}"
0114 PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
0115 COMPONENT libraries
0116 )
0117
0118 install (TARGETS
0119 ndrxxaqdisks
0120 DESTINATION "${INSTALL_LIB_DIR}"
0121 PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
0122 COMPONENT libraries
0123 )
0124
0125 # Install bin
0126 install (TARGETS
0127 tmqueue
0128 DESTINATION bin)
0129 # vim: set ts=4 sw=4 et smartindent: