0001 ##
0002 ## @brief Enduro Execution platform's ATMI library
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
0035 # Set minimum version
0036 cmake_minimum_required(VERSION 3.5)
0037
0038 # Add debug options
0039 # By default if RELEASE_BUILD is not defined, then we run in debug!
0040 IF (ENV{RELEASE_BUILD})
0041 # do nothing
0042 ELSE (ENV{RELEASE_BUILD})
0043 ADD_DEFINITIONS("-D NDRX_DEBUG")
0044 ENDIF (ENV{RELEASE_BUILD})
0045
0046 # Make sure the compiler can find include files from our UBF library.
0047 include_directories (. ${ENDUROX_SOURCE_DIR}/include ${ENDUROX_SOURCE_DIR}/libnstd
0048 ${ENDUROX_SOURCE_DIR}/libubf)
0049 include_directories (/opt/freeware/include)
0050 # Create a library called "ATMI" which includes the source files.
0051 # The extension is already found. Any number of sources could be listed here.
0052 add_library (objatmi OBJECT
0053 atmi.c
0054 tperror.c
0055 tpcall.c
0056 typed_buf.c
0057 typed_ubf.c
0058 typed_tpinit.c
0059 typed_null.c
0060 typed_string.c
0061 typed_json.c
0062 typed_carray.c
0063 typed_view.c
0064 atmiutils.c
0065 init.c
0066 conversation.c
0067 tpevents.c
0068 shm.c
0069 sem.c
0070 brsupport.c
0071 xa.c
0072 xautils.c
0073 exparson.c
0074 ubf2exjson.c
0075 view2exjson.c
0076 newenv.c
0077 typed_xcvt.c
0078 ubfutil.c
0079 qcommon.c
0080 sysutil.c
0081 atmi_tls.c
0082 atmi_tplog.c
0083 oatmi.c
0084 oubf.c
0085 ondebug.c
0086 onerror.c
0087 tpnotify.c
0088 identifiers.c
0089 atmi_cache_init.c
0090 atmi_cache_edb.c
0091 atmi_cache_ops.c
0092 atmi_cache_ubf.c
0093 atmi_cache_events.c
0094 atmi_cache_inval.c
0095 atmi_cache_mgt.c
0096 atmi_cache_keygrp.c
0097 tpimport.c
0098 tpexport.c
0099 tx.c
0100 cltshm.c
0101 tmnull_switch.c
0102 tpcrypto.c
0103 multibuf.c
0104 ddr_atmi.c
0105 txsinglegrp.c
0106 )
0107
0108 # shared libraries need PIC
0109 set_property(TARGET objatmi PROPERTY POSITION_INDEPENDENT_CODE 1)
0110
0111 # shared and static libraries built from the same object files
0112 add_library(atmi SHARED $<TARGET_OBJECTS:objatmi>)
0113
0114 if(CMAKE_OS_NAME STREQUAL "CYGWIN")
0115 target_link_libraries(atmi ubf nstd dl)
0116 elseif(CMAKE_OS_NAME STREQUAL "DARWIN")
0117 target_link_libraries(atmi ubf nstd dl)
0118 elseif(CMAKE_OS_NAME STREQUAL "FREEBSD")
0119 target_link_libraries(atmi ubf nstd pthread)
0120 elseif(CMAKE_OS_NAME STREQUAL "AIX")
0121 #
0122 # linking lib against pthread for XL C on aix, otherwise we get error like:
0123 # ld: 0711-768 WARNING: Object CMakeFiles/ubf.dir/ferror.c.o, section 1, function .__tls_get_addr:
0124 # The branch at address 0x154 is not followed by a rec
0125 # Or
0126 # ld: 0711-768 WARNING: Object CMakeFiles/ubf.dir/ferror.c.o, section 1, function .__tls_get_addr:
0127 # The branch at address 0x154 is not followed by a rec
0128 target_link_libraries(atmi ubf nstd pthread)
0129 endif()
0130
0131 install (TARGETS
0132 atmi
0133 DESTINATION "${INSTALL_LIB_DIR}"
0134 PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
0135 COMPONENT libraries)
0136
0137 # vim: set ts=4 sw=4 et smartindent: