Back to home page

Enduro/X

 
 

    


0001 ##
0002 ## @brief `ndrxd' EnduroX Monitor Daemon
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 # 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 find_package(LibXml2 REQUIRED)
0047 
0048 ex_comp_find_flexbison()
0049 
0050 # some issues on Solaris 10, cmake 3.14, and LIBXML2_LIBRARY specified in cmake command
0051 if( (CMAKE_SYSTEM_NAME STREQUAL "SunOS") AND (NOT LIBXML2_LIBRARIES STREQUAL ""))
0052     set(LIBXML2_LIBRARIES "xml2")
0053 ENDIF()
0054 
0055 # Make sure the compiler can find include files from UBF library
0056 include_directories (${ENDUROX_SOURCE_DIR}/libubf
0057                         ${ENDUROX_SOURCE_DIR}/libatmi
0058                         ${ENDUROX_SOURCE_DIR}/libatmiclt
0059                         ${ENDUROX_SOURCE_DIR}/include
0060                         ${ENDUROX_SOURCE_DIR}/libnstd
0061                         ${LIBXML2_INCLUDE_DIR})
0062 # Make sure the linker can find the UBF library once it is built.
0063 link_directories (${ENDUROX_BINARY_DIR}/libubf)
0064 
0065 if(DEFINED EX_USE_SYSVQ)
0066     SET(ADDSANITY1 "sanity_sysv.c")
0067 endif()
0068 
0069 BISON_TARGET(EXPRPARSER ddr_range.y ${CMAKE_CURRENT_BINARY_DIR}/expr_range.tab.c)
0070 FLEX_TARGET(EXPRSCANNER ddr_range.l ${CMAKE_CURRENT_BINARY_DIR}/expr_range.lex.c)
0071 
0072 # Executables
0073 add_executable (ndrxd  
0074             ndrxd.c
0075             appconfig.c
0076             pmodel.c
0077             admerror.c
0078             cmd_processor.c
0079             cmd_config.c
0080             cmd_reply.c
0081             cmd_startstop.c
0082             cmd_srvinfo.c
0083             cmd_psc.c
0084             cmd_at.c
0085             cmd_reload.c
0086             sanity.c
0087             respawn.c
0088             restart.c
0089             cmd_unadv.c
0090             cmd_readv.c
0091             cmd_adv.c
0092             cmd_ppm.c
0093             cmd_shm_psvc.c
0094             cmd_shm_psrv.c
0095             svc_q_remove.c
0096             bridge.c
0097             cmd_bridge.c
0098             cmd_ping.c
0099             cmd_pq.c
0100             cmd_env.c
0101             cmd_appconfig.c
0102             cmd_dping.c
0103             reloadonchange.c
0104             ${ADDSANITY1}
0105             cmd_blist.c
0106             ddr_ndrxd.c
0107             expr_range.lex.c
0108             expr_range.tab.c
0109             )
0110 
0111 # Link the executable to the UBF library & others...
0112 target_link_libraries (ndrxd atmi ndrxconf ubf nstd m 
0113         ${RT_LIB} ${LIBXML2_LIBRARIES} pthread)
0114 set_target_properties(ndrxd PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0115 
0116 # Install bin
0117 install (TARGETS 
0118     ndrxd 
0119     DESTINATION bin)
0120 
0121 # vim: set ts=4 sw=4 et smartindent: