Back to home page

Enduro/X

 
 

    


0001 ##
0002 ## @brief Enduro Execution platform's UBF library
0003 ##   We are using flex & bison for boolean expressions!
0004 ##
0005 ## @file CMakeLists.txt
0006 ##
0007 ## -----------------------------------------------------------------------------
0008 ## Enduro/X Middleware Platform for Distributed Transaction Processing
0009 ## Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
0010 ## Copyright (C) 2017-2023, Mavimax, Ltd. All Rights Reserved.
0011 ## This software is released under one of the following licenses:
0012 ## AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
0013 ## See LICENSE file for full text.
0014 ## -----------------------------------------------------------------------------
0015 ## AGPL license:
0016 ##
0017 ## This program is free software; you can redistribute it and/or modify it under
0018 ## the terms of the GNU Affero General Public License, version 3 as published
0019 ## by the Free Software Foundation;
0020 ##
0021 ## This program is distributed in the hope that it will be useful, but WITHOUT ANY
0022 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0023 ## PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
0024 ## for more details.
0025 ##
0026 ## You should have received a copy of the GNU Affero General Public License along 
0027 ## with this program; if not, write to the Free Software Foundation, Inc.,
0028 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0029 ##
0030 ## -----------------------------------------------------------------------------
0031 ## A commercial use license is available from Mavimax, Ltd
0032 ## contact@mavimax.com
0033 ## -----------------------------------------------------------------------------
0034 ##
0035 
0036 # Set minimum version
0037 cmake_minimum_required(VERSION 3.5)
0038 
0039 ex_comp_find_flexbison()
0040 
0041 BISON_TARGET(EXPRPARSER expr.y ${CMAKE_CURRENT_BINARY_DIR}/expr.tab.c)
0042 FLEX_TARGET(EXPRSCANNER expr.l ${CMAKE_CURRENT_BINARY_DIR}/expr.lex.c)
0043 
0044 #set(CMAKE_C_FLAGS_DEBUG "-DUBF_DEBUG" ${CMAKE_C_FLAGS_DEBUG})
0045 
0046 # Add debug options
0047 # By default if RELEASE_BUILD is not defined, then we run in debug!
0048 IF (ENV{RELEASE_BUILD})
0049         # do nothing
0050 ELSE (ENV{RELEASE_BUILD})
0051         ADD_DEFINITIONS("-D UBF_DEBUG")
0052 ENDIF (ENV{RELEASE_BUILD})
0053 
0054 # Make sure the compiler can find include files from our UBF library.
0055 include_directories (. ${ENDUROX_SOURCE_DIR}/include ${ENDUROX_SOURCE_DIR}/libnstd)
0056 
0057 # Create a library called "UBF" which includes the source files.
0058 # The extension is already found. Any number of sources could be listed here. 
0059 add_library (objubf OBJECT
0060                 ubf_impl.c
0061                 ubf.c
0062                 fproj_impl.c
0063                 find_impl.c
0064                 get_impl.c
0065                 bprint_impl.c
0066                 fmerge.c
0067                 ferror.c 
0068                 fdatatype.c
0069                 fieldtable.c
0070                 cf.c 
0071                 expr_funcs.c
0072                 utils.c
0073                 b_readwrite.c
0074                 ubf_tls.c
0075                 view_null.c
0076                 view_parser.c
0077                 view_plot.c
0078                 view_struct.c
0079                 view_ubf.c
0080                 view_access.c
0081                 view_print.c
0082                 view_cmp.c
0083                 ${BISON_EXPRPARSER_OUTPUTS} 
0084                 ${FLEX_EXPRSCANNER_OUTPUTS}
0085                 bcmp.c
0086                 fielddb.c
0087                 fld_ptr.c
0088                 fld_ubf.c
0089                 fld_view.c
0090                 recursive.c
0091                 fml.c
0092         )
0093 
0094 set_property(TARGET objubf PROPERTY POSITION_INDEPENDENT_CODE 1)
0095 
0096 # shared and static libraries built from the same object files
0097 add_library(ubf SHARED $<TARGET_OBJECTS:objubf>)
0098 
0099 if(CMAKE_OS_NAME STREQUAL "CYGWIN")
0100     target_link_libraries(ubf nstd)
0101 elseif(CMAKE_OS_NAME STREQUAL "DARWIN")
0102     target_link_libraries(ubf nstd)
0103 elseif(CMAKE_OS_NAME STREQUAL "AIX")
0104     # for XL tls
0105     target_link_libraries(ubf nstd pthread)
0106 endif()
0107 
0108 install (TARGETS 
0109     ubf 
0110     DESTINATION "${INSTALL_LIB_DIR}"
0111     PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
0112     COMPONENT libraries
0113     )
0114 # vim: set ts=4 sw=4 et smartindent: