Back to home page

Enduro/X

 
 

    


0001 ##
0002 ## @brief `ndrx' EnduroX Administration utility.
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 a minimum version
0036 cmake_minimum_required(VERSION 3.5)
0037 
0038 
0039 # Add debug options
0040 # By default if RELEASE_BUILD is not defined, then we run in debug!
0041 IF ($ENV{RELEASE_BUILD})
0042         # do nothing
0043 ELSE ($ENV{RELEASE_BUILD})
0044         ADD_DEFINITIONS("-D NDRX_DEBUG")
0045 ENDIF ($ENV{RELEASE_BUILD})
0046 
0047 # Make sure the compiler can find inclndrxe files from UBF library
0048 include_directories (${ENDUROX_SOURCE_DIR}/include ${ENDUROX_SOURCE_DIR}/libnstd
0049                                          ${ENDUROX_SOURCE_DIR}/xadmin)
0050 
0051 # Make sure the linker can find the UBF library once it is built.
0052 #link_directories (${ENDUROX_BINARY_DIR}/libubf) 
0053 
0054 include(pscript)
0055 
0056 set(SCRIPTS "")
0057 
0058 IF (NOT DEFINE_DISABLEPSCRIPT)
0059     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/provision.pscript provision)
0060     list(APPEND SCRIPTS provision.c)
0061 
0062     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen_go_server.pscript gen_go_server)
0063     list(APPEND SCRIPTS gen_go_server.c)
0064 
0065     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen_go_client.pscript gen_go_client)
0066     list(APPEND SCRIPTS gen_go_client.c)
0067 
0068     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen_ubf_tab.pscript gen_ubf_tab)
0069     list(APPEND SCRIPTS gen_ubf_tab.c)
0070 
0071     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen_c_client.pscript gen_c_client)
0072     list(APPEND SCRIPTS gen_c_client.c)
0073 
0074     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen_c_server.pscript gen_c_server)
0075     list(APPEND SCRIPTS gen_c_server.c)
0076 
0077     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen_java_client.pscript gen_java_client)
0078     list(APPEND SCRIPTS gen_java_client.c)
0079 
0080     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen_java_server.pscript gen_java_server)
0081     list(APPEND SCRIPTS gen_java_server.c)
0082 
0083     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen_test_local.pscript gen_test_local)
0084     list(APPEND SCRIPTS gen_test_local.c)
0085 
0086     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen_python_client.pscript gen_python_client)
0087     list(APPEND SCRIPTS gen_python_client.c)
0088 
0089     pscript_embed(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen_python_server.pscript gen_python_server)
0090     list(APPEND SCRIPTS gen_python_server.c)
0091 
0092 ENDIF()
0093 
0094 add_custom_command(
0095   OUTPUT Exfields.c
0096   COMMAND exembedfile ${CMAKE_CURRENT_SOURCE_DIR}/../include/Exfields Exfields
0097   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../include/Exfields)
0098 
0099 add_custom_command(
0100   OUTPUT ndrx_config.c
0101   COMMAND exembedfile ../include/ndrx_config.h ndrx_config
0102   DEPENDS ../include/ndrx_config.h)
0103 
0104 if(DEFINED EX_USE_SYSVQ OR DEFINED EX_USE_SVAPOLL)
0105     SET(SOURCE1 "cmd_svmaps.c")
0106 endif()
0107 
0108   
0109 # Exectuables
0110 add_executable (xadmin xadmin.c exec.c config.c
0111     cmd_config.c utils.c cmd_startstop.c cmd_psc.c cmd_fdown.c
0112     cmd_at.c cmd_reload.c cmd_unadv.c cmd_ppm.c
0113     cmd_shm_psvc.c cmd_shm_psrv.c cmd_readv.c cmd_pq.c cmd_pqa.c
0114     cmd_pt.c cmd_abort.c cmd_commit.c cmd_env.c cmd_pc.c
0115     cmd_mqlq.c cmd_mqlc.c cmd_mqlm.c cmd_mqdm.c cmd_mqrc.c
0116     cmd_mqch.c cmd_mqrm.c cmd_mqmv.c cmd_killall.c cmd_qrm.c
0117     ${SCRIPTS} Exfields.c cmd_provision.c cmd_gen.c
0118     cmd_cs.c cmd_cd.c cmd_ci.c
0119     cmd_pubfdb.c ${SOURCE1} cmd_svids.c ndrx_config.c cmd_util.c
0120     cmd_appconfig.c cmd_dping.c linenoise.c cmd_tranlocal.c
0121     cmd_tmib.c taboutput.c cmd_lcf.c cmd_prtsvc.c cmd_psg.c)
0122 
0123 set_target_properties(xadmin PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0124 
0125 # Link the executable to the UBF library & others...
0126 
0127 # add pscript, if not disabled...
0128 IF (NOT DEFINE_DISABLEPSCRIPT)
0129     SET(PS_LIB psstdlib ps)
0130 ENDIF()
0131 
0132 target_link_libraries (xadmin tpadm ${PS_LIB} atmi nstd ubf ${RT_LIB} pthread m)
0133 
0134 # Install bin
0135 install (TARGETS 
0136     xadmin 
0137     DESTINATION bin)
0138 
0139 # Install bin, scripts
0140 install (PROGRAMS 
0141     tmadmin
0142     tmboot
0143     tmshutdown
0144     DESTINATION bin)
0145 # vim: set ts=4 sw=4 et smartindent: