diff --git a/CMakeLists.txt b/CMakeLists.txt index 17e0bd05a..f7161f166 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ include(${AREG_CMAKE_CONFIG_DIR}/setup.cmake) # AREG SDK project name and version set(AREG_PROJECT_NAME "areg-sdk") -set(AREG_PROJECT_VERSION "1.5.0") +set(AREG_PROJECT_VERSION "1.9.99.111") # Project's properties set(PROJECT_NAME ${AREG_PROJECT_NAME}) @@ -35,17 +35,22 @@ include(${AREG_CMAKE_CONFIG_DIR}/common.cmake) # this ensures that the commands to create directories are called first. add_custom_target(areg-dummy ALL COMMAND ${CMAKE_COMMAND} VERBATIM) add_custom_command( TARGET areg-dummy PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${AREG_OUTPUT_DIR}" - COMMAND ${CMAKE_COMMAND} -E make_directory "${AREG_OUTPUT_BIN}" - COMMAND ${CMAKE_COMMAND} -E make_directory "${AREG_OUTPUT_LIB}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}" VERBATIM) include_directories(${AREG_BASE}) include_directories(${AREG_THIRDPARTY}) + # build AREG Framework thirdparty software include(${AREG_THIRDPARTY}/CMakeLists.txt) +if (NOT AREG_SQLITE_FOUND) + add_dependencies(aregsqlite3 areg-dummy) +endif() + # build AREG Framework software include(${AREG_BASE}/CMakeLists.txt) +add_dependencies(areg areg-dummy) # build optional AREG project examples, if required if(AREG_BUILD_EXAMPLES) @@ -55,9 +60,16 @@ endif() # build optional AREG Framework unit tests, if required if(AREG_BUILD_TESTS) include(${AREG_TESTS}/CMakeLists.txt) + if (NOT AREG_GTEST_FOUND) + add_dependencies(areg-unit-tests areg-dummy) + endif() endif() -include(${AREG_CMAKE_CONFIG_DIR}/install.cmake) +if (AREG_INSTALL AND AREG_SQLITE_FOUND) + include(${AREG_CMAKE_CONFIG_DIR}/install.cmake) +elseif(AREG_INSTALL) + option(AREG_INSTALL "Enable install AREG SDK" OFF) +endif() # Print the configuration status message(STATUS "=======================================================================================") @@ -65,14 +77,15 @@ message(STATUS "----------------------> AREG project CMake Status Report Begin < message(STATUS "=======================================================================================") message(STATUS "AREG: >>> CMAKE_SOURCE_DIR = \'${CMAKE_SOURCE_DIR}\', build type \'${CMAKE_BUILD_TYPE}\'") message(STATUS "AREG: >>> Build ...........: \'${CMAKE_SYSTEM_NAME}\' system, \'${AREG_BITNESS}\'-bit platform, \'${AREG_PROCESSOR}\' CPU") -message(STATUS "AREG: >>> Compiler ........: \'${CMAKE_CXX_COMPILER}\', ID \'${AREG_COMPILER_FAMILY}\'") -message(STATUS "AREG: >>> Binary output ...: \'${AREG_OUTPUT_BIN}\', extension '${CMAKE_EXECUTABLE_SUFFIX}'") +message(STATUS "AREG: >>> Compiler ........: \'${CMAKE_CXX_COMPILER}\', ID \'${AREG_COMPILER_FAMILY}\', C++${CMAKE_CXX_STANDARD}") +message(STATUS "AREG: >>> Binary output ...: \'${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\', extension '${CMAKE_EXECUTABLE_SUFFIX}'") message(STATUS "AREG: >>> Generated files .: \'${AREG_GENERATE_DIR}\' directory") message(STATUS "AREG: >>> Packages ........: \'${FETCHCONTENT_BASE_DIR}\' directory") +message(STATUS "AREG: >>> Build libraries .: areg is \'${AREG_BINARY}\', aregextend is static, areglogger is \'${AREG_LOGGER_LIB}\' library") message(STATUS "AREG: >>> Java version ....: \'${Java_VERSION_STRING}\' of version \'${Java_JAVA_EXECUTABLE}\'. Minimum should be 17") message(STATUS "AREG: >>> Use of packages .: SQLite3 package use is \'${AREG_SQLITE_PACKAGE}\', GTest package use is \'${AREG_GTEST_PACKAGE}\' ") message(STATUS "AREG: >>> Other options ...: Examples = \'${AREG_BUILD_EXAMPLES}\', Unit Tests = \'${AREG_BUILD_TESTS}\', AREG Extended = \'${AREG_EXTENDED}\', Logs = \'${AREG_LOGS}\'") -message(STATUS "AREG: >>> Installation ....: is '${AREG_INSTALL}', Thirdparty is '${AREG_INSTALL_DEPENDS}', location \'${CMAKE_INSTALL_PREFIX}\'") +message(STATUS "AREG: >>> Installation ....: is '${AREG_INSTALL}', location \'${CMAKE_INSTALL_PREFIX}\'") message(STATUS "=======================================================================================") message(STATUS "-----------------------> AREG project CMake Status Report End <------------------------") message(STATUS "=======================================================================================") diff --git a/areg-sdk.sln b/areg-sdk.sln index bf9f05fa8..7f7aa2c2b 100644 --- a/areg-sdk.sln +++ b/areg-sdk.sln @@ -536,7 +536,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logger", "framework\logger. {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} = {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "areg-extend", "framework\areg-extend.vcxproj", "{FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aregextend", "framework\aregextend.vcxproj", "{FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "22_generated", "examples\22_pubsub\22_generated.vcxproj", "{73EC875E-F233-4FA9-B3AF-E2981EA59B3A}" ProjectSection(ProjectDependencies) = postProject @@ -630,7 +630,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "24_subscribermulti", "examp {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} = {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logobserverapi", "framework\logobserverapi.vcxproj", "{B29F438E-904C-4929-903C-F4673182A417}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "areglogger", "framework\areglogger.vcxproj", "{B29F438E-904C-4929-903C-F4673182A417}" ProjectSection(ProjectDependencies) = postProject {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} = {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} = {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} @@ -666,6 +666,27 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "res", "res", "{11AEF28F-83C examples\24_pubsubmulti\res\PubSub.siml = examples\24_pubsubmulti\res\PubSub.siml EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "exports", "exports", "{60EE7204-7D44-4087-8880-900D00536202}" + ProjectSection(SolutionItems) = preProject + conf\exports\areg.pc.in = conf\exports\areg.pc.in + conf\exports\aregextend.pc.in = conf\exports\aregextend.pc.in + conf\exports\areglogger.pc.in = conf\exports\areglogger.pc.in + conf\exports\config.cmake.in = conf\exports\config.cmake.in + conf\exports\logger.service.in = conf\exports\logger.service.in + conf\exports\logger.service.install.bat.in = conf\exports\logger.service.install.bat.in + conf\exports\logger.service.uninstall.bat.in = conf\exports\logger.service.uninstall.bat.in + conf\exports\mcrouter.service.in = conf\exports\mcrouter.service.in + conf\exports\mcrouter.service.install.bat.in = conf\exports\mcrouter.service.install.bat.in + conf\exports\mcrouter.service.uninstall.bat.in = conf\exports\mcrouter.service.uninstall.bat.in + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "example", "example", "{31AB3D1E-3F6C-4415-B3A5-BB8AA449A1E2}" + ProjectSection(SolutionItems) = preProject + conf\exports\example\CMakeLists.txt = conf\exports\example\CMakeLists.txt + conf\exports\example\example.cpp = conf\exports\example\example.cpp + conf\exports\example\README.md = conf\exports\example\README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -1328,6 +1349,8 @@ Global {98743716-82FC-4B02-96AF-E6F649403A0A} = {07BFF46A-D4BC-4FAD-9727-D959755BFBAC} {85EF9AE6-92A6-4DD9-833C-455EEAEA186D} = {FD549A95-E734-4E26-A5B2-2330FC310C8D} {11AEF28F-83CA-493A-B507-F271FCB35DBA} = {7B7FB883-C82B-45F1-BCEA-0E97E8BAD476} + {60EE7204-7D44-4087-8880-900D00536202} = {A9875C78-1248-4693-9310-5C46C73DDCEB} + {31AB3D1E-3F6C-4415-B3A5-BB8AA449A1E2} = {60EE7204-7D44-4087-8880-900D00536202} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {1034084F-74DD-4B33-86E3-D8038C748F48} diff --git a/conf/cmake/clang.cmake b/conf/cmake/clang.cmake index b8f54da12..85d2f2737 100644 --- a/conf/cmake/clang.cmake +++ b/conf/cmake/clang.cmake @@ -20,6 +20,7 @@ if (AREG_OS STREQUAL "Windows") list(APPEND AREG_COMPILER_OPTIONS -Wall -c) # Linker flags (-l is not necessary) list(APPEND AREG_LDFLAGS advapi32 psapi shell32 ws2_32) + set(AREG_LDFLAGS_STR "-ladvapi32 -lpsapi -lshell32 -lws2_32") else(AREG_OS STREQUAL "Posix") @@ -38,11 +39,12 @@ else(AREG_OS STREQUAL "Posix") list(APPEND AREG_COMPILER_OPTIONS -pthread -Wall -c -fmessage-length=0) # Linker flags (-l is not necessary) list(APPEND AREG_LDFLAGS stdc++ m pthread rt) + set(AREG_LDFLAGS_STR "-lstdc++ -lm -lpthread -lrt") set(AREG_COMPILER_VERSION -stdlib=libstdc++) endif(AREG_OS STREQUAL "Windows") -if(AREG_BITNESS MATCHES "32") +if(${AREG_BITNESS} EQUAL 32) list(APPEND AREG_COMPILER_OPTIONS -m32) else() list(APPEND AREG_COMPILER_OPTIONS -m64) @@ -66,7 +68,7 @@ list(APPEND AREG_OPT_DISABLE_WARN_COMMON -Wno-undefined-func-template -Wno-unknown-warning-option -Wno-unsafe-buffer-usage - ) +) # disable framework warnings list(APPEND AREG_OPT_DISABLE_WARN_FRAMEWORK @@ -74,13 +76,13 @@ list(APPEND AREG_OPT_DISABLE_WARN_FRAMEWORK -Wno-cast-function-type -Wno-format-nonliteral -Wno-null-pointer-subtraction - ) +) # disable tools warnings list(APPEND AREG_OPT_DISABLE_WARN_TOOLS -Wno-format-nonliteral -Wno-unused-parameter - ) +) # disable example warnings (example 17 with MFC) list(APPEND AREG_OPT_DISABLE_WARN_EXAMPLES @@ -93,7 +95,7 @@ list(APPEND AREG_OPT_DISABLE_WARN_EXAMPLES -Wno-unused-local-typedef -Wno-unused-macros -Wno-unused-parameter - ) +) # disable warnings for generated codes list(APPEND AREG_OPT_DISABLE_WARN_CODEGEN diff --git a/conf/cmake/common.cmake b/conf/cmake/common.cmake index e4369e8dc..c3b4f113d 100644 --- a/conf/cmake/common.cmake +++ b/conf/cmake/common.cmake @@ -3,6 +3,12 @@ # Copyright 2022-2023 Aregtech # ########################################################################### +set(AREG_PACKAGE_NAME "areg") + +if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "") + set(AREG_BUILD_TYPE "${CMAKE_BUILD_TYPE}") +endif() + if ("${AREG_COMPILER_FAMILY}" STREQUAL "") set(AREG_CXX_COMPILER "${CMAKE_CXX_COMPILER}") set(AREG_C_COMPILER "${CMAKE_C_COMPILER}") @@ -43,16 +49,20 @@ set(AREG_CC_TOOLCHAIN "${CMAKE_CC_COMPILER}") set(AREG_DEVELOP_ENV) # The linker flags set(AREG_LDFLAGS) -# The compiler options -set(AREG_COMPILER_OPTIONS) +set(AREG_LDFLAGS_STR "") # set areg extended static library dependencies set(AREG_EXTENDED_LIBS) +set(AREG_EXTENDED_LIBS_STR "") +# The compiler options +set(AREG_COMPILER_OPTIONS) # set areg compiler version set(AREG_COMPILER_VERSION) set(AREG_TARGET_COMPILER_OPTIONS) # Set the SQLite library reference -set(AREG_SQLITE_LIB_REF sqlite3) -option(AREG_SQLITE_FOUND "SQLite3 package" OFF) +set(AREG_SQLITE_LIB_REF) +set(AREG_SQLITE_LIB sqlite3) +option(AREG_SQLITE_FOUND "SQLite3 package found flag" FALSE) +option(AREG_GTEST_FOUND "GTest package found flag" FALSE) # Adding common definition add_definitions(-DUNICODE -D_UNICODE) @@ -97,6 +107,7 @@ if (AREG_EXTENDED) add_definitions(-DAREG_EXTENDED=1) if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") list(APPEND AREG_EXTENDED_LIBS ncurses) + set(AREG_EXTENDED_LIBS_STR "-lncurses") endif() else() add_definitions(-DAREG_EXTENDED=0) @@ -108,21 +119,29 @@ else() add_definitions(-DAREG_LOGS=0) endif() -if ( "${CMAKE_BUILD_TYPE}" STREQUAL "") - set(CMAKE_BUILD_TYPE Debug CACHE STRING "AREG build type") -endif() - # ------------------------------------------------------- # Setup product paths # ------------------------------------------------------- -# The output directory -if (NOT DEFINED AREG_OUTPUT_DIR OR "${AREG_OUTPUT_DIR}" STREQUAL "") - # Relative path of the output folder for the builds - set(AREG_PRODUCT_PATH "build/${AREG_COMPILER_FAMILY}-${AREG_COMPILER_SHORT}/${AREG_OS}-${AREG_BITNESS}-${AREG_PROCESSOR}-${CMAKE_BUILD_TYPE}-${AREG_BINARY}") - string(TOLOWER "${AREG_PRODUCT_PATH}" AREG_PRODUCT_PATH) - # The absolute path of 'AREG_OUTPUT_DIR' for builds if it is not set. - set(AREG_OUTPUT_DIR "${AREG_BUILD_ROOT}/${AREG_PRODUCT_PATH}") +if (AREG_ENABLE_OUTPUTS) + + # The output directory + if (NOT DEFINED AREG_OUTPUT_DIR OR "${AREG_OUTPUT_DIR}" STREQUAL "") + # Relative path of the output folder for the builds + set(_product_path "build/${AREG_COMPILER_FAMILY}-${AREG_COMPILER_SHORT}/${AREG_OS}-${AREG_BITNESS}-${AREG_PROCESSOR}-${CMAKE_BUILD_TYPE}-${AREG_BINARY}") + string(TOLOWER "${_product_path}" _product_path) + # The absolute path of 'AREG_OUTPUT_DIR' for builds if it is not set. + set(AREG_OUTPUT_DIR "${AREG_BUILD_ROOT}/${_product_path}") + unset(_product_path) + endif() + +else() + + # The output directory + if (NOT DEFINED AREG_OUTPUT_DIR OR "${AREG_OUTPUT_DIR}" STREQUAL "") + set(AREG_OUTPUT_DIR "${AREG_BUILD_ROOT}") + endif() + endif() # The directory to output static libraries @@ -163,7 +182,7 @@ set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${AREG_OUTPUT_DIR} include_directories(BEFORE "${AREG_BASE}" "${AREG_BUILD_ROOT}" "${AREG_GENERATE_DIR}" "${AREG_THIRDPARTY}") # Adding library search paths -link_directories(BEFORE "${AREG_OUTPUT_BIN}" "${AREG_OUTPUT_LIB}") +link_directories(BEFORE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}") # Only for Linux if(UNIX AND NOT CYGWIN) @@ -182,7 +201,11 @@ if (NOT ${Java_FOUND}) find_package(Java COMPONENTS Development) endif() +# Check and setup variables for installation if (AREG_INSTALL) - set(CMAKE_INSTALL_PREFIX "${AREG_INSTALL_PATH}") option(INSTALL_GTEST "Disable Googletest installation" OFF) + + if (NOT "${AREG_INSTALL_PATH}" STREQUAL "") + set(CMAKE_INSTALL_PREFIX "${AREG_INSTALL_PATH}") + endif() endif() diff --git a/conf/cmake/functions.cmake b/conf/cmake/functions.cmake index bcbabaa6c..61d3a9871 100644 --- a/conf/cmake/functions.cmake +++ b/conf/cmake/functions.cmake @@ -3,6 +3,30 @@ # Copyright 2022-2023 Aregtech # ########################################################################### +# --------------------------------------------------------------------------- +# Description : Checks and sets the C++ standard. +# The variable \'AREG_CXX_STANDARD\' should be already set +# before calling this macro. +# Macro ...: macro_check_fix_cxx_standard +# Usage ......: macro_check_fix_cxx_standard() +# --------------------------------------------------------------------------- +macro(macro_check_fix_cxx_standard) + + if (NOT DEFINED AREG_CXX_STANDARD) + message(WARNING "AREG: >>> Cannot check and set C++ standard, variable \'AREG_CXX_STANDARD\' is not defined") + return() + endif() + + if (NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD ${AREG_CXX_STANDARD}) + elseif(${CMAKE_CXX_STANDARD} LESS ${AREG_CXX_STANDARD}) + message(WARNING "AREG: >>> AREG requires minimum C++${AREG_CXX_STANDARD}, \ + current is C++${CMAKE_CXX_STANDARD}. \ + Change to avoid compilation errors. Example: \'set(CMAKE_CXX_STANDARD ${AREG_CXX_STANDARD})\'") + endif() + +endmacro(macro_check_fix_cxx_standard) + # --------------------------------------------------------------------------- # Description : Sets the compiler and the linker options of the executable applications. # Adds libraries to link. The AREG library is automatically added. @@ -17,11 +41,7 @@ function(setAppOptions item library_list) target_compile_options(${item} PRIVATE "${AREG_OPT_DISABLE_WARN_COMMON}") # Linking flags - target_link_libraries(${item} areg-extend ${library_list} areg ${AREG_EXTENDED_LIBS} ${AREG_LDFLAGS}) - - # Adjusting CPP standard for target - set_target_properties(${item} PROPERTIES CXX_STANDARD ${AREG_CXX_STANDARD} CXX_STANDARD_REQUIRED ON ) - set_property(TARGET ${item} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${AREG_OUTPUT_BIN}) + target_link_libraries(${item} ${AREG_PACKAGE_NAME}::aregextend ${library_list} ${AREG_PACKAGE_NAME}::areg ${AREG_EXTENDED_LIBS} ${AREG_LDFLAGS}) endfunction(setAppOptions) # --------------------------------------------------------------------------- @@ -34,15 +54,17 @@ endfunction(setAppOptions) # ${library_list} -- The list of libraries to link executable. # usage ......: addExecutableEx( ) # --------------------------------------------------------------------------- -function(addExecutableEx target_name source_list library_list) +function(addExecutableEx target_name target_namespace source_list library_list) set(exList "${ARGN}") foreach(item IN LISTS exList) list(APPEND library_list "${item}") endforeach() add_executable(${target_name} ${source_list}) + if (NOT "${target_namespace}" STREQUAL "") + add_executable(${target_namespace}::${target_name} ALIAS ${target_name}) + endif() setAppOptions(${target_name} "${library_list}") target_include_directories(${target_name} BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}) - add_dependencies(${target_name} areg-dummy) endfunction(addExecutableEx) # --------------------------------------------------------------------------- @@ -54,7 +76,7 @@ endfunction(addExecutableEx) # usage ......: addExecutable( ) # --------------------------------------------------------------------------- function(addExecutable target_name source_list) - addExecutableEx(${target_name} "${source_list}" "") + addExecutableEx(${target_name} "" "${source_list}" "") endfunction(addExecutable) @@ -78,12 +100,7 @@ function(setStaticLibOptions item library_list) target_compile_options(${item} PRIVATE -fPIC) endif() - target_link_libraries(${item} ${library_list} areg ${AREG_LDFLAGS}) - - # Adjusting CPP standard for target - set_target_properties(${item} PROPERTIES CXX_STANDARD ${AREG_CXX_STANDARD} CXX_STANDARD_REQUIRED ON ) - set_property(TARGET ${item} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${AREG_OUTPUT_LIB}) - + target_link_libraries(${item} ${library_list} ${AREG_PACKAGE_NAME}::areg ${AREG_LDFLAGS}) endfunction(setStaticLibOptions) # --------------------------------------------------------------------------- @@ -96,15 +113,17 @@ endfunction(setStaticLibOptions) # ${library_list} -- The list of libraries to link the static library. # usage ......: addStaticLibEx( ) # --------------------------------------------------------------------------- -function(addStaticLibEx target_name source_list library_list) +function(addStaticLibEx target_name target_namespace source_list library_list) set(exList "${ARGN}") foreach(item IN LISTS exList) list(APPEND library_list "${item}") endforeach() add_library(${target_name} STATIC ${source_list}) + if (NOT "${target_namespace}" STREQUAL "") + add_library(${target_namespace}::${target_name} ALIAS ${target_name}) + endif() setStaticLibOptions(${target_name} "${library_list}") target_include_directories(${target_name} BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}) - add_dependencies(${target_name} areg-dummy) endfunction(addStaticLibEx) # --------------------------------------------------------------------------- @@ -116,7 +135,7 @@ endfunction(addStaticLibEx) # usage ......: addStaticLib( ) # --------------------------------------------------------------------------- function(addStaticLib target_name source_list) - addStaticLibEx(${target_name} "${source_list}" "") + addStaticLibEx(${target_name} "" "${source_list}" "") endfunction(addStaticLib) # --------------------------------------------------------------------------- @@ -129,12 +148,16 @@ endfunction(addStaticLib) # ${library_list} -- The list of libraries to link the static library. # usage ......: addStaticLibEx_C( ) # --------------------------------------------------------------------------- -function(addStaticLibEx_C target_name source_list library_list) +function(addStaticLibEx_C target_name target_namespace source_list library_list) set(exList "${ARGN}") foreach(item IN LISTS exList) list(APPEND library_list "${item}") endforeach() add_library(${target_name} STATIC ${source_list}) + if (NOT "${target_namespace}" STREQUAL "") + add_library(${target_namespace}::${target_name} ALIAS ${target_name}) + endif() + target_compile_options(${target_name} PRIVATE "${AREG_OPT_DISABLE_WARN_COMMON}") # Set common compile definition @@ -145,13 +168,7 @@ function(addStaticLibEx_C target_name source_list library_list) target_compile_options(${target_name} PRIVATE -fPIC) endif() - target_link_libraries(${target_name} ${library_list} areg ${AREG_LDFLAGS}) - - # Adjusting CPP standard for target - # set_target_properties(${target_name} PROPERTIES CXX_STANDARD ${AREG_CXX_STANDARD} CXX_STANDARD_REQUIRED ON ) - set_property(TARGET ${target_name} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${AREG_OUTPUT_LIB}) - target_include_directories(${target_name} BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}) - add_dependencies(${target_name} areg-dummy) + target_link_libraries(${target_name} ${library_list} ${AREG_PACKAGE_NAME}::areg ${AREG_LDFLAGS}) endfunction(addStaticLibEx_C) # --------------------------------------------------------------------------- @@ -163,7 +180,7 @@ endfunction(addStaticLibEx_C) # usage ......: addStaticLib_C( ) # --------------------------------------------------------------------------- function(addStaticLib_C target_name source_list) - addStaticLibEx_C(${target_name} "${source_list}" "") + addStaticLibEx_C(${target_name} "" "${source_list}" "") endfunction(addStaticLib_C) # --------------------------------------------------------------------------- @@ -180,17 +197,12 @@ function(setSharedLibOptions item library_list) target_compile_options(${item} PRIVATE "${AREG_OPT_DISABLE_WARN_COMMON}") # Linking flags - target_link_libraries(${item} areg-extend ${library_list} areg ${AREG_EXTENDED_LIBS} ${AREG_LDFLAGS}) + target_link_libraries(${item} ${AREG_PACKAGE_NAME}::aregextend ${library_list} ${AREG_PACKAGE_NAME}::areg ${AREG_EXTENDED_LIBS} ${AREG_LDFLAGS}) if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") target_compile_options(${item} PRIVATE -fPIC) target_compile_options(${item} PRIVATE "-Bdynamic") endif() - - # Adjusting CPP standard for target - set_target_properties(${item} PROPERTIES CXX_STANDARD ${AREG_CXX_STANDARD} CXX_STANDARD_REQUIRED ON) - set_property(TARGET ${item} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${AREG_OUTPUT_BIN}) - endfunction(setSharedLibOptions) # --------------------------------------------------------------------------- @@ -203,15 +215,17 @@ endfunction(setSharedLibOptions) # ${library_list} -- The list of libraries to link the shared library. # usage ......: addSharedLibEx( ) # --------------------------------------------------------------------------- -function(addSharedLibEx target_name source_list library_list) +function(addSharedLibEx target_name target_namespace source_list library_list) set(exList "${ARGN}") foreach(item IN LISTS exList) list(APPEND library_list "${item}") endforeach() add_library(${target_name} SHARED ${source_list}) + if (NOT "${target_namespace}" STREQUAL "") + add_library(${target_namespace}::${target_name} ALIAS ${target_name}) + endif() setSharedLibOptions(${target_name} "${library_list}") target_include_directories(${target_name} BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}) - add_dependencies(${target_name} areg-dummy) endfunction(addSharedLibEx) # --------------------------------------------------------------------------- @@ -223,7 +237,7 @@ endfunction(addSharedLibEx) # usage ......: addSharedLib( ) # --------------------------------------------------------------------------- function(addSharedLib target_name target_source_list) - addSharedLibEx(${target_name} "${target_source_list}" "") + addSharedLibEx(${target_name} "" "${target_source_list}" "") endfunction(addSharedLib) # --------------------------------------------------------------------------- @@ -534,82 +548,139 @@ macro(macro_declare_project project_name project_alias) macro_declare_project_ex(${project_name} ${project_alias} ${project_alias}) endmacro(macro_declare_project) +# --------------------------------------------------------------------------- +# Description : For CYGWIN builds, windows specific paths converts to +# to 'cygwin' path. In all other cases, nothing is changed. +# +# NOTE: This macro does not fix the OS specific issues +# of path separator. +# Parameters .: ${normal_path} -- Normalized path as a result. +# ${os_path} -- OS specific path. +# Macro ......: macro_normalize_path +# Usage ......: macro_normalize_path( ) +# --------------------------------------------------------------------------- macro(macro_normalize_path normal_path os_path) if (CYGWIN) execute_process(COMMAND cygpath.exe -m ${os_path} OUTPUT_VARIABLE ${normal_path}) string (STRIP ${${normal_path}} ${normal_path}) else() - set(${normal_path} ${os_path}) + set(${normal_path} "${os_path}") endif() endmacro(macro_normalize_path) # --------------------------------------------------------------------------- -# Description : This function calls service interface code generator to -# generate codes, includes the generated codes either in the -# new static library, if it does not exist, or adds to the -# list to the static library, if the library already exists. -# As parameters, the function receives the name of the static library, -# the root folder of the source codes, the relative path to the -# project or service interface files, which is included in the path -# of generate files, the sub-directory relative to "relative path", -# where the service interface files are located, but the path will not -# included in file paths of generate files, and the name of service interface, -# which should be the same as the file name of the service interface. -# For example if developer creates a service interface files of -# HelloWorld.siml and WeHaveFun.siml service interfaces, by first call of -# addServiceInterfaceEx with project name 'fun_library', by first call of -# addServiceInterfaceEx(fun_library ... HelloWorld), this generates files of HelloWorld -# service interface. In second call addServiceInterfaceEx(fun_library ... WeHaveFun), -# it generates the source files and include them in the list of existing 'fun_library' static library. -# Function ...: addServiceInterfaceEx -# Parameters .: ${gen_project_name} -- The name of the generated static library. -# ${source_root} -- The root directory of the sources. -# All relative paths, inclusive generated, are relative to this parameter. -# ${relative_path} -- The relative path to the Service Interface. -# Same path is used to generate files. -# ${sub_dir} -- The sub-directory of Service Interface file location. -# The path is excluded from generated files. -# ${interface_name} -- The name of the Service Interface, which is the name of the Service Interface file without '.siml' extension. -# Usage ......: addServiceInterfaceEx( ) -# Example ....: addServiceInterfaceEx("fun_library" "~/project/my-fun/sources" "my/service/interfaces" "" FunInterface) -# --------------------------------------------------------------------------- -function(addServiceInterfaceEx gen_project_name source_root relative_path sub_dir interface_name) +# Description : This function invokes the service interface code generator +# to produce source files and either adds them to a new static +# library (if it doesn't exist) or includes them in an existing +# one. It accepts the static library name, full paths to +# Service Interface file, Service Interface name and paths for generated files. +# The service interface name must match the file name (without the .siml extension). +# +# Example: +# For a project 'fun_library' with 'HelloWorld.siml' and 'WeHaveFun.siml' interfaces, +# calling macro_add_service_interface("fun_library" ... HelloWorld ...) generates +# source files for HelloWorld and includes them in the static library. +# A subsequent call for WeHaveFun adds it to the same library. +# +# macro name : macro_add_service_interface +# Parameters : ${lib_name} -- Name of the static library. +# ${interface_doc} -- Full path to the Service Interface document file. +# ${interface_name} -- Name of the Service Interface (without '.siml'). +# ${codegen_root} -- Root directory for generating files. +# ${output_path} -- Relative path for generated files. +# ${codegen_tool} -- Full path to the code generator tool. +# +# Usage : macro_add_service_interface( .siml ) +# Example : macro_add_service_interface("fun_library" "~/project/my-fun/sources/service/interfaces/FunInterface.siml" FunInterface "~/project/my-fun/" "generate/service/interfaces" /tools/areg/codegen.jar) +# --------------------------------------------------------------------------- +macro(macro_add_service_interface lib_name interface_doc interface_name codegen_root output_path codegen_tool) if (NOT ${Java_FOUND}) - message(FATAL_ERROR "AREG Setup: No Java found, cannot run code generator. Install Java 17 or higher and try again!") + message(FATAL_ERROR "AREG Setup: Java not found! Install Java 17 or higher to run the code generator.") return() endif() - set(interface_doc) - if (${sub_dir} STREQUAL "") - macro_normalize_path(interface_doc "${source_root}/${relative_path}/${interface_name}.siml") + # Run the code generator tool + execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -jar ${codegen_tool} --root=${codegen_root} --doc=${interface_doc} --target=${output_path}) + + # Set paths for generated files + set(generate_dir "${codegen_root}/${output_path}") + + # List of generated source and header files + list(APPEND private_files + "${generate_dir}/private/${interface_name}ClientBase.cpp" + "${generate_dir}/private/${interface_name}Events.cpp" + "${generate_dir}/private/${interface_name}Proxy.cpp" + "${generate_dir}/private/${interface_name}Stub.cpp" + "${generate_dir}/private/NE${interface_name}.cpp" + "${generate_dir}/private/${interface_name}Events.hpp" + "${generate_dir}/private/${interface_name}Proxy.hpp" + "${generate_dir}/${interface_name}ClientBase.hpp" + "${generate_dir}/${interface_name}Stub.hpp" + "${generate_dir}/NE${interface_name}.hpp" + ) + + # Add generated files to an existing or new static library + if (TARGET ${lib_name}) + target_sources(${lib_name} PRIVATE "${private_files}") else() - macro_normalize_path(interface_doc "${source_root}/${relative_path}/${sub_dir}/${interface_name}.siml") + message(STATUS "AREG Setup: Adding new service interface library ${lib_name}") + addStaticLib(${lib_name} "${private_files}") + target_compile_options(${lib_name} PRIVATE "${AREG_OPT_DISABLE_WARN_CODEGEN}") endif() - macro_normalize_path(root_path "${AREG_BUILD_ROOT}") - macro_normalize_path(interface_out "${AREG_GENERATE}/${relative_path}") - macro_normalize_path(codegen_path "${AREG_SDK_TOOLS}/codegen.jar") - execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -jar ${codegen_path} --root=${root_path} --doc=${interface_doc} --target=${interface_out}) +endmacro(macro_add_service_interface) - set(generate_dir "${AREG_GENERATE_DIR}/${relative_path}") - set(proj_src) - list(APPEND proj_src - ${generate_dir}/private/${interface_name}ClientBase.cpp - ${generate_dir}/private/${interface_name}Events.cpp - ${generate_dir}/private/${interface_name}Proxy.cpp - ${generate_dir}/private/${interface_name}Stub.cpp - ${generate_dir}/private/NE${interface_name}.cpp - ) +# --------------------------------------------------------------------------- +# Description : This function generates code for a service interface using a code +# generator. The generated files are either added to a new static +# library (if it doesn't exist) or included in an existing one. +# +# The function accepts the static library name, the root directory of +# the source files, the relative path to the service interface files, +# an optional sub-directory, and the name of the service interface (which +# should match the file name without the '.siml' extension). +# +# Example: +# If the project 'fun_library' contains service interfaces 'HelloWorld.siml' +# and 'WeHaveFun.siml', calling addServiceInterfaceEx("fun_library" ... HelloWorld) +# generates the HelloWorld interface files and includes them in the library. +# Another call for WeHaveFun adds its files to the same library. +# +# Function : addServiceInterfaceEx +# Parameters : ${lib_name} -- Name of the static library. +# ${source_root} -- Root directory of the source files. All paths +# are relative to this directory. +# ${relative_path} -- Relative path to the Service Interface document. +# This path is also used for generating files. +# ${sub_dir} -- Optional sub-directory where the interface files are located. +# This path is excluded from the generated file paths. +# ${interface_name} -- Name of the Service Interface, matching the file name +# without the '.siml' extension. +# +# Usage : addServiceInterfaceEx( ) +# Example : addServiceInterfaceEx("fun_library" "~/project/my-fun/sources" "my/service/interfaces" "" FunInterface) +# --------------------------------------------------------------------------- +function(addServiceInterfaceEx lib_name source_root relative_path sub_dir interface_name) + + macro_normalize_path(codegen_root "${AREG_BUILD_ROOT}") + macro_normalize_path(output_path "${AREG_GENERATE}/${relative_path}") + macro_normalize_path(codegen_tool "${AREG_SDK_TOOLS}/codegen.jar") - if (TARGET ${gen_project_name}) - target_sources(${gen_project_name} PRIVATE "${proj_src}") + if (${sub_dir} STREQUAL "") + macro_normalize_path(interface_doc "${source_root}/${relative_path}/${interface_name}.siml") else() - message(STATUS "AREG Setup: Add service interface library ${gen_project_name}") - addStaticLib(${gen_project_name} "${proj_src}") - target_compile_options(${gen_project_name} PRIVATE "${AREG_OPT_DISABLE_WARN_CODEGEN}") + macro_normalize_path(interface_doc "${source_root}/${relative_path}/${sub_dir}/${interface_name}.siml") endif() + macro_add_service_interface( ${lib_name} + "${interface_doc}" + "${interface_name}" + "${codegen_root}" + "${output_path}" + "${codegen_tool}" + ) + endfunction(addServiceInterfaceEx) # --------------------------------------------------------------------------- @@ -626,33 +697,18 @@ endfunction(addServiceInterfaceEx) # of sources is ${CMAKE_SOURCE_DIR} and the relative path is the location # of current 'CMakeLists.txt' file, i.e. ${CMAKE_CURRENT_LIST_DIR}. # Function ...: addServiceInterface -# Parameters .: ${gen_project_name} -- The name of the generated static library. +# Parameters .: ${lib_name} -- The name of the generated static library. # ${sub_dir} -- The sub-directory of Service Interface file location. # The path is excluded from generated files and relative to the location of the current 'CMakeLists.txt' file # ${interface_name} -- The name of the Service Interface, which is the name of the Service Interface file without '.siml' extension. # Usage ......: addServiceInterface( ) # Example ....: addServiceInterface("fun_library" "resources" FunInterface) # --------------------------------------------------------------------------- -function(addServiceInterface gen_project_name sub_dir interface_name) +function(addServiceInterface lib_name sub_dir interface_name) file(RELATIVE_PATH relative ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_LIST_DIR}) - addServiceInterfaceEx(${gen_project_name} ${CMAKE_SOURCE_DIR} ${relative} ${sub_dir} ${interface_name}) + addServiceInterfaceEx(${lib_name} ${CMAKE_SOURCE_DIR} ${relative} ${sub_dir} ${interface_name}) endfunction(addServiceInterface) -# --------------------------------------------------------------------------- -# Description : This macro generates the codes and adds generated files to -# the list of sources to build 'gen_project_name' static library. -# It assumes that the location of the Service Interface file is -# same as the location of current 'CMakeLists.txt' and the root directory -# of sources is ${CMAKE_SOURCE_DIR}. -# Macro ......: macro_add_service_interface -# Parameters .: ${gen_project_name} -- The name of the generated static library. -# ${interface_name} -- The name of the Service Interface, which is the name of the Service Interface file without '.siml' extension. -# Example ....: macro_add_service_interface(fun_library FunInterface) -# --------------------------------------------------------------------------- -macro(macro_add_service_interface gen_project_name interface_name) - addServiceInterface(${gen_project_name} "" ${interface_name}) -endmacro(macro_add_service_interface) - # --------------------------------------------------------------------------- # Description : This function creates a single test executable discovered by CTest. # Function ...: addTest @@ -662,7 +718,7 @@ endmacro(macro_add_service_interface) # --------------------------------------------------------------------------- function(addTest test_name test_source) list(APPEND google_test_libs "GTest::gtest_main" "GTest::gtest") - addExecutableEx(${test_name} "${test_source}" "${google_test_libs}") + addExecutableEx(${test_name} "" "${test_source}" "${google_test_libs}") gtest_discover_tests(${test_name} DISCOVERY_TIMEOUT 60) endfunction(addTest) @@ -685,7 +741,7 @@ function(addUnitTestEx test_project test_sources library_list) target_sources(${test_project} PRIVATE "${test_sources}") else() list(APPEND google_test_libs "GTest::gtest_main" "GTest::gtest" "${library_list}") - addExecutableEx(${test_project} "${test_sources}" "${google_test_libs}") + addExecutableEx(${test_project} "" "${test_sources}" "${google_test_libs}") gtest_discover_tests(${test_project} DISCOVERY_TIMEOUT 60) endif() endfunction(addUnitTestEx) @@ -755,3 +811,35 @@ macro(macro_create_option var_name var_value var_describe) set(${var_name} ${_VAR_TEMP} CACHE BOOL "${var_describe}" FORCE) endif() endmacro(macro_create_option) + +# --------------------------------------------------------------------------- +# Description : Recursively removes empty directories. +# The function checks whether the given \'dir_name\' is an +# existing directory and queries list of files and sub-directories +# in the given directory. If the result is empty list, it removes +# the directory. Otherwise, it loops the sub-directories searching +# and removing empty directories. +# Function ...: removeEmptyDirs +# Parameters .: ${dir_name} -- The path of directory to check and remove. +# Usage ......: removeEmptyDirs( ) +# --------------------------------------------------------------------------- +function(removeEmptyDirs dir_name) + if (EXISTS "${dir_name}" AND IS_DIRECTORY "${dir_name}") + file(GLOB dir_to_remove "${dir_name}/*") + if ("${dir_to_remove}" STREQUAL "") + # The directory is empty, can be removed. + file(REMOVE_RECURSE "${dir_name}") + else() + foreach (entry IN LISTS dir_to_remove) + removeEmptyDirs("${entry}") + endforeach() + + # After recursive check and possible remove, check one more time + # is the directory and remove if it is empty. + file(GLOB dir_to_remove "${dir_name}/*") + if ("${dir_to_remove}" STREQUAL "") + file(REMOVE_RECURSE "${dir_name}") + endif() + endif() + endif() +endfunction(removeEmptyDirs) diff --git a/conf/cmake/gnu.cmake b/conf/cmake/gnu.cmake index 00d86f609..5ff90c235 100644 --- a/conf/cmake/gnu.cmake +++ b/conf/cmake/gnu.cmake @@ -23,7 +23,7 @@ else() list(APPEND AREG_COMPILER_OPTIONS -O0 -g3) endif() -if(AREG_BITNESS MATCHES "32") +if(${AREG_BITNESS} EQUAL 32) list(APPEND AREG_COMPILER_OPTIONS -m32) else() list(APPEND AREG_COMPILER_OPTIONS -m64) @@ -31,9 +31,10 @@ endif() # Linker flags (-l is not necessary) list(APPEND AREG_LDFLAGS stdc++ m pthread rt) +set(AREG_LDFLAGS_STR "-lstdc++ -lm -lpthread -lrt") # disable SQLite warnings list(APPEND AREG_OPT_DISABLE_WARN_THIRDPARTY -Wno-everything -Wno-unused-function - ) \ No newline at end of file +) diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index 0e9ee299f..a79cf547e 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -3,90 +3,183 @@ # Copyright 2022-2023 Aregtech # ########################################################################### -if (AREG_INSTALL) +message(STATUS "AREG: >>> Preparing AREG SDK installation settings, CMAKE_PACKAGE_NAME = ${CMAKE_PACKAGE_NAME}") - message(STATUS "AREG: >>> Preparing AREG SDK installation settings") +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) +set(AREG_EXPORTS_DIR "${AREG_CMAKE_CONFIG_DIR}/../exports") +set(AREG_INSTALL_DST "${CMAKE_INSTALL_PREFIX}") - set(AREG_PACKAGE_NAME "areg-sdk") +# Setup AREG SDK exporting targets. +target_include_directories(areg PUBLIC $) +target_include_directories(aregextend PUBLIC $) +target_include_directories(areglogger PUBLIC $) +target_include_directories(logger PUBLIC $) +target_include_directories(logobserver PUBLIC $) +target_include_directories(mcrouter PUBLIC $) - # copy compiled binaries in the bin and lib directories - install(TARGETS areg mcrouter logger logobserver areg-extend - RUNTIME DESTINATION bin COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE - LIBRARY DESTINATION bin COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - ARCHIVE DESTINATION lib COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - ) +target_link_directories(areg PUBLIC $ $) +target_link_directories(aregextend PUBLIC $ $) +target_link_directories(areglogger PUBLIC $ $) +target_link_directories(logger PUBLIC $ $) +target_link_directories(logobserver PUBLIC $ $) +target_link_directories(mcrouter PUBLIC $ $) - # Copy AREG SDK all headers - install(DIRECTORY framework/ - DESTINATION framework COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} - FILES_MATCHING - PATTERN "*.h" - PATTERN "*.hpp" - PATTERN "*.md" - PATTERN "logger" EXCLUDE - PATTERN "logobserver/app" EXCLUDE - PATTERN "mcrouter" EXCLUDE - ) +# Copy all header files of AREG Framework +install(DIRECTORY framework/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Development + CONFIGURATIONS Release + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hpp" + PATTERN "logger" EXCLUDE + PATTERN "logobserver" EXCLUDE + PATTERN "mcrouter" EXCLUDE +) - # Copy all CMake and MSVC configuration files. - install(DIRECTORY conf/ - DESTINATION conf COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} - ) - - # Copy all tools - install(DIRECTORY tools/ - DESTINATION tools COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} - ) +# Copy compiled binaries in the bin and lib directories +install(TARGETS areg aregextend areglogger + EXPORT ${AREG_PACKAGE_NAME} + RUNTIME DESTINATION bin COMPONENT Development COMPONENT Runtime + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE + LIBRARY DESTINATION bin COMPONENT Development COMPONENT Runtime + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ARCHIVE DESTINATION lib COMPONENT Development COMPONENT Runtime + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +) - # Copy AREG SDK license - install(FILES LICENSE.txt - DESTINATION licenses COMPONENT Development COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} - RENAME AREG.copyright - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - ) +# Copy AREG configuration file +install(FILES "${AREG_BASE}/areg/resources/areg.init" + DESTINATION share/${AREG_PACKAGE_NAME} + COMPONENT Development COMPONENT Runtime + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ + CONFIGURATIONS Release +) + +# Copy AREG SDK open source license +install(FILES LICENSE.txt + DESTINATION share/${AREG_PACKAGE_NAME} + COMPONENT Development COMPONENT Runtime + RENAME copyright + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + CONFIGURATIONS Release +) + +# Copy all CMake and MSVC configuration files. +install(DIRECTORY ${AREG_SDK_ROOT}/conf/ + DESTINATION share/${AREG_PACKAGE_NAME}/conf + COMPONENT Development COMPONENT Runtime + CONFIGURATIONS Release +) + +# Copy all tools +install(DIRECTORY tools/ + DESTINATION tools/${AREG_PACKAGE_NAME} + COMPONENT Development + DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE + CONFIGURATIONS Release +) + +# Copy compiled AREG SDK tools: logger, logobserver and mcrouter +install(TARGETS logger logobserver mcrouter + EXPORT ${AREG_PACKAGE_NAME} + RUNTIME DESTINATION tools/${AREG_PACKAGE_NAME} + COMPONENT Development COMPONENT Runtime + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE + CONFIGURATIONS Release +) + +# Copy additionally areg and areglogger dynamic libraries +install(TARGETS areg areglogger + LIBRARY DESTINATION tools/${AREG_PACKAGE_NAME} + COMPONENT Development COMPONENT Runtime + CONFIGURATIONS Release +) + +# Copy AREG configuration file +install(FILES "${AREG_BASE}/areg/resources/areg.init" + DESTINATION tools/${AREG_PACKAGE_NAME}/config + COMPONENT Development COMPONENT Runtime + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ + CONFIGURATIONS Release +) - # Copy AREG configuration file - install(DIRECTORY ${AREG_OUTPUT_BIN}/config - DESTINATION bin COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} +# Configure and install `pkg_config` files +configure_file("${AREG_EXPORTS_DIR}/areg.pc.in" exports/areg.pc @ONLY) +configure_file("${AREG_EXPORTS_DIR}/aregextend.pc.in" exports/aregextend.pc @ONLY) +configure_file("${AREG_EXPORTS_DIR}/areglogger.pc.in" exports/areglogger.pc @ONLY) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/exports/areg.pc" + "${CMAKE_CURRENT_BINARY_DIR}/exports/aregextend.pc" + "${CMAKE_CURRENT_BINARY_DIR}/exports/areglogger.pc" + DESTINATION lib/pkgconfig + COMPONENT Development COMPONENT Runtime +) + +# configure and copy servicing script files. +if ((WIN32) OR (CYGWIN)) + + configure_file("${AREG_EXPORTS_DIR}/logger.service.install.bat.in" "exports/logger.service.install.bat" @ONLY) + configure_file("${AREG_EXPORTS_DIR}/logger.service.uninstall.bat.in" "exports/logger.service.uninstall.bat" @ONLY) + configure_file("${AREG_EXPORTS_DIR}/mcrouter.service.install.bat.in" "exports/mcrouter.service.install.bat" @ONLY) + configure_file("${AREG_EXPORTS_DIR}/mcrouter.service.uninstall.bat.in" "exports/mcrouter.service.uninstall.bat" @ONLY) + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/exports/logger.service.install.bat" + "${CMAKE_CURRENT_BINARY_DIR}/exports/logger.service.uninstall.bat" + "${CMAKE_CURRENT_BINARY_DIR}/exports/mcrouter.service.install.bat" + "${CMAKE_CURRENT_BINARY_DIR}/exports/mcrouter.service.uninstall.bat" + DESTINATION share/${AREG_PACKAGE_NAME}/service + COMPONENT Development COMPONENT Runtime + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ + CONFIGURATIONS Release ) - - # Copy 'logger' and 'mcrouter' service configuration files. - install(DIRECTORY ${AREG_OUTPUT_BIN}/ - DESTINATION bin/config COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} - FILES_MATCHING - PATTERN "mcrouter.service*" - PATTERN "logger.service*" - PATTERN "config" EXCLUDE + +else() + + configure_file("${AREG_EXPORTS_DIR}/logger.service.in" "exports/logger.service" @ONLY) + configure_file("${AREG_EXPORTS_DIR}/mcrouter.service.in" "exports/mcrouter.service" @ONLY) + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/exports/logger.service" + "${CMAKE_CURRENT_BINARY_DIR}/exports/mcrouter.service" + DESTINATION share/${AREG_PACKAGE_NAME}/service + COMPONENT Development COMPONENT Runtime + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ + CONFIGURATIONS Release ) - # Check and install thirdparty dependencies if needed - if (AREG_INSTALL_DEPENDS) - - # Check how SQLite was built - if (NOT AREG_SQLITE_FOUND) - # copy compiled binaries in the bin and lib directories - install( TARGETS sqlite3 - ARCHIVE DESTINATION lib COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - ) - - # Copy thirdparty sources with headers - install(DIRECTORY thirdparty/ - DESTINATION thirdparty COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} - PATTERN "*.vcxproj*" EXCLUDE - ) - - # Copy thirdparty licenses - install(FILES ${AREG_THIRDPARTY}/sqlite3/LICENSE.txt - DESTINATION licenses COMPONENT Development COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} - RENAME SQLITE.copyright - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - ) - endif(NOT AREG_SQLITE_FOUND) - - endif(AREG_INSTALL_DEPENDS) - -endif(AREG_INSTALL) +endif() + +# Create and export 'cmake' configuration and version files. +write_basic_package_version_file(exports/${AREG_PACKAGE_NAME}-config-version.cmake VERSION ${AREG_PROJECT_VERSION} COMPATIBILITY AnyNewerVersion) +configure_package_config_file("${AREG_EXPORTS_DIR}/config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/exports/${AREG_PACKAGE_NAME}-config.cmake" + INSTALL_DESTINATION share/${AREG_PACKAGE_NAME}) + +export(TARGETS areg aregextend areglogger + NAMESPACE ${AREG_PACKAGE_NAME}:: + FILE ${AREG_PACKAGE_NAME}-targets.cmake + EXPORT_LINK_INTERFACE_LIBRARIES +) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/exports/${AREG_PACKAGE_NAME}-config-version.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/exports/${AREG_PACKAGE_NAME}-config.cmake" + DESTINATION share/${AREG_PACKAGE_NAME} + COMPONENT Development +) + +install(EXPORT ${AREG_PACKAGE_NAME} + DESTINATION share/${AREG_PACKAGE_NAME} + COMPONENT Development + NAMESPACE ${AREG_PACKAGE_NAME}:: + FILE ${AREG_PACKAGE_NAME}-targets.cmake + EXPORT_LINK_INTERFACE_LIBRARIES +) + +# Copy an example to create 'areg' based project. +install(DIRECTORY ${AREG_EXPORTS_DIR}/example + DESTINATION share/${AREG_PACKAGE_NAME} + COMPONENT Development COMPONENT Runtime + CONFIGURATIONS Release +) diff --git a/conf/cmake/msvc.cmake b/conf/cmake/msvc.cmake index 3e6a5e485..235eca5e6 100644 --- a/conf/cmake/msvc.cmake +++ b/conf/cmake/msvc.cmake @@ -12,8 +12,8 @@ add_definitions(-DWINDOWS -D_WINDOWS -DWIN32 -D_WIN32) if(NOT CMAKE_BUILD_TYPE MATCHES Release) list(APPEND AREG_COMPILER_OPTIONS -Od -RTC1 -c) endif() - -if (${AREG_BITNESS} MATCHES "64") + +if (${AREG_BITNESS} EQUAL 64) add_definitions(-DWIN64 -D_WIN64) endif() @@ -21,3 +21,4 @@ endif() list(APPEND AREG_COMPILER_OPTIONS) # Linker flags (-l is not necessary) list(APPEND AREG_LDFLAGS advapi32 psapi shell32 ws2_32) +set(AREG_LDFLAGS_STR "-ladvapi32 -lpsapi -lshell32 -lws2_32") diff --git a/conf/cmake/setup.cmake b/conf/cmake/setup.cmake index 4dc34c2fc..ac3698a1b 100644 --- a/conf/cmake/setup.cmake +++ b/conf/cmake/setup.cmake @@ -60,5 +60,10 @@ endif() # set CMake tool settings set(CMAKE_BUILD_TYPE ${AREG_BUILD_TYPE}) set(CMAKE_BUILD_TYPE ${AREG_BUILD_TYPE} CACHE STRING "Configuration Type" FORCE) -set(CXX_STANDARD ${AREG_CXX_STANDARD}) -set(FETCHCONTENT_BASE_DIR "${AREG_PACKAGES}" CACHE PATH "Location of AREG thirdparty packages" FORCE) + +# check and fix CXX standard +macro_check_fix_cxx_standard() + +if (NOT "${AREG_PACKAGES}" STREQUAL "") + set(FETCHCONTENT_BASE_DIR "${AREG_PACKAGES}" CACHE PATH "Location of AREG thirdparty packages" FORCE) +endif() diff --git a/conf/cmake/user.cmake b/conf/cmake/user.cmake index 80252d12f..28d3e3c97 100644 --- a/conf/cmake/user.cmake +++ b/conf/cmake/user.cmake @@ -4,74 +4,71 @@ # ########################################################################### # --------------------------------------------------------------------------- -# Pass the compiler options in command line or use the defaults: -# 1. AREG_COMPILER_FAMILY -- Simple way to set CMAKE_CXX_COMPILER and CMAKE_C_COMPILER compilers. -# 2. AREG_COMPILER -- Specifies one compiler name to set for CXX and CC projects. -# 3. AREG_BINARY -- Specifies the AREG Framework library type ('shared' or 'static'). By default it is 'shared'. -# 4. AREG_LOGOBSERVER_LIB -- Specifies the Log Observer API library type ('shared' or 'static'). By default it is 'shared'. -# 5. AREG_BUILD_TYPE -- Build configurations ('Debug' or 'Release'). -# 6. AREG_BUILD_TESTS -- Flag to enable or disable AREG Framework unit tests. -# 7. AREG_BUILD_EXAMPLES -- Flag to enable or disable AREG Framework examples. -# 8. AREG_EXTENDED -- Flag to enable or disable to compile AREG SDK project with AREG Framework extended features. This may require additional dependencies. -# 9. AREG_LOGS -- Flag to enable or disable compilation with logs. By default, it is enabled. -# 10. AREG_INSTALL -- Flag to enable or disable AREG SDK installation. By default, it is enabled. -# 11. AREG_INSTALL_DEPENDS -- Flag to enable or disable AREG SDK to install thirdparty dependencies. The flag is ignored if AREG_INSTALL is 'OFF'. By default, it is disabled. -# 12. AREG_USE_PACKAGES -- Flag to enable or disable using installed packages in the system. If set, automatically forces 'AREG_SQLITE_PACKGE' and 'AREG_GTEST_PACKAGE' to be 'ON or 'OFF'. -# 13. AREG_SQLITE_PACKAGE -- Flag, indicating whether should use SQLite3 package available in the system or compile the library from sources. -# 14. AREG_GTEST_PACKAGE -- Flag, indicating whether should use GTest package available in the system or should compile the libraries from sources. -# 15. AREG_BUILD_ROOT -- The root directory to build or create generated files. By default is the './product' directory of 'areg-sdk' root. -# 16. AREG_OUTPUT_DIR -- The output directory of build binaries. -# 17. AREG_OUTPUT_BIN -- The output directory of build executables or runtime binaries (shared libraries). -# 18. AREG_OUTPUT_LIB -- The output directory of static libraries. -# 19. AREG_PACKAGES -- The location to install thirdparty packages. -# 20. AREG_INSTALL_PATH -- The location to install AREG SDK binaries, headers, configuration files and tools. By default, it is created in the user home directory. +# This CMake file allows configuration of various AREG Framework build options. +# You can pass these options via the command line, or the system will use default values. # -# The default values are: +# Available Options: +# 1. AREG_COMPILER_FAMILY -- A quick way to set the C++ and C compilers (CMAKE_CXX_COMPILER and CMAKE_C_COMPILER). +# 2. AREG_COMPILER -- Sets a specific compiler for both C++ and C projects. +# 3. AREG_BINARY -- Specifies the library type for the AREG Framework ('shared' or 'static'). Defaults to 'shared'. +# 4. AREG_LOGGER_LIB -- Specifies the type of the Log Observer API library ('shared' or 'static'). Defaults to 'shared'. +# 5. AREG_BUILD_TYPE -- Specifies the build configuration ('Debug' or 'Release'). +# 6. AREG_BUILD_TESTS -- Enables or disables building unit tests for the AREG Framework. +# 7. AREG_BUILD_EXAMPLES -- Enables or disables building examples for the AREG Framework. +# 8. AREG_EXTENDED -- Enables or disables extended AREG Framework features. May require additional dependencies. +# 9. AREG_LOGS -- Enables or disables logging during compilation. Defaults to 'enabled'. +# 10. AREG_INSTALL -- Enables or disables the installation of the AREG SDK. Defaults to 'enabled'. If enabled, any dependent libraries such as 'sqlite3' and 'ncurses' must also be installed. +# 11. AREG_USE_PACKAGES -- Enables or disables using installed packages. Controls other package options like SQLite and GTest. +# 12. AREG_SQLITE_PACKAGE -- Determines if the system's SQLite3 package should be used or compiled from source. +# 13. AREG_GTEST_PACKAGE -- Determines if the system's GTest package should be used or compiled from source. +# 14. AREG_BUILD_ROOT -- Specifies the root directory for build files. Defaults to './product' within the AREG SDK root. +# 15. AREG_OUTPUT_DIR -- Directory where build outputs are placed. +# 16. AREG_OUTPUT_BIN -- Directory for output binaries (executables and shared libraries). +# 17. AREG_OUTPUT_LIB -- Directory for output static libraries. +# 18. AREG_PACKAGES -- Location for fetching third-party packages such as GTest. +# 19. AREG_INSTALL_PATH -- Location where AREG SDK binaries, headers, and tools are installed. Defaults to the user’s home directory. +# 20. AREG_ENABLE_OUTPUTS -- If disabled, output directories will match the CMake binary directory. +# +# Default Values: # 1. AREG_COMPILER_FAMILY = (possible values: gnu, cygwin, llvm, msvc) # 2. AREG_COMPILER = (possible values: g++, gcc, c++, cc, clang++, clang, clang-cl, cl) # 3. AREG_BINARY = shared (possible values: shared, static) -# 4. AREG_LOGOBSERVER_LIB = shared (possible values: shared, static) +# 4. AREG_LOGGER_LIB = shared (possible values: shared, static) # 5. AREG_BUILD_TYPE = Release (possible values: Release, Debug) # 6. AREG_BUILD_TESTS = OFF (possible values: ON, OFF) # 7. AREG_BUILD_EXAMPLES = ON (possible values: ON, OFF) # 8. AREG_EXTENDED = OFF (possible values: ON, OFF) # 9. AREG_LOGS = ON (possible values: ON, OFF) # 10. AREG_INSTALL = ON (possible values: ON, OFF) -# 11. AREG_INSTALL_DEPENDS = OFF (possible values: ON, OFF) -# 12. AREG_USE_PACKAGES = ON (possible values: ON, OFF) -# 13. AREG_SQLITE_PACKAGE = ON (possible values: ON, OFF) -# 14. AREG_GTEST_PACKAGE = ON (possible values: ON, OFF) -# 15. AREG_BUILD_ROOT = '/product' (possible values: any valid path for outputs for product and generated files) -# 16. AREG_OUTPUT_DIR = '/product/build/gnu-gcc/---release-' (possible values: any valid path for build outputs) -# 17. AREG_OUTPUT_BIN = '/product/build/gnu-gcc/---release-/bin' (possible values: any valid path for binary outputs) -# 18. AREG_OUTPUT_LIB = '/product/build/gnu-gcc/---release-/lib' (possible values: any valid path for library outputs) -# 19. AREG_PACKAGES = '${AREG_BUILD_ROOT}/packages' (possible values: any valid path for package location) -# 20. AREG_INSTALL_PATH = '${HOOME}/areg-sdk'; if '${HOOME}' is empty, use '${USERPROFILE}' or current dir. (possible values: any valid path to install AREG SDK outputs) +# 11. AREG_USE_PACKAGES = ON (possible values: ON, OFF) +# 12. AREG_SQLITE_PACKAGE = ON (possible values: ON, OFF) +# 13. AREG_GTEST_PACKAGE = ON (possible values: ON, OFF) +# 14. AREG_BUILD_ROOT = '/product' (path for output and generated files) +# 15. AREG_OUTPUT_DIR = '/product/build//---release-' +# 16. AREG_OUTPUT_BIN = '/product/build//---release-/bin' +# 17. AREG_OUTPUT_LIB = '/product/build//---release-/lib' +# 18. AREG_PACKAGES = '${AREG_BUILD_ROOT}/packages' +# 19. AREG_INSTALL_PATH = '${HOME}/areg-sdk' (or '${USERPROFILE}' on Windows, defaults to current directory if unset) +# 20. AREG_ENABLE_OUTPUTS = ON (possible values: ON, OFF) # # Hints: +# - AREG_COMPILER_FAMILY is an easy way to set compilers: +# - 'gnu' sets g++ and gcc for C++ and C. +# - 'cygwin' sets g++ and gcc for C++ and C under Cygwin. +# - 'llvm' sets clang++, clang, and clang-cl (on Windows) for C++ and C. +# - 'msvc' sets Microsoft Visual C++ (cl) for C++ and C. # -# Hint #1: -# AREG_COMPILER_FAMILY is a simple and short way to specify the compiler. -# - The value 'gnu' will set g++ and gcc compilers for C++ and C. -# - The value 'cygwin' will set g++ and gcc compilers for C++ and C. -# - The value 'llvm' will set clang++, clang and clang-cl (under windows) compilers for C++ and C. -# - The value 'msvc' will set Microsoft Visual C++ compiler for C++ and C. -# -# Example: +# Example Command: # $ cmake -B ./build -DCMAKE_BUILD_TYPE=Debug -DAREG_COMPILER_FAMILY=llvm -DAREG_BUILD_TESTS=ON -DAREG_BUILD_EXAMPLES=ON -# -# NOTE: if in command line specify AREG_CXX_COMPILER, the AREG_C_COMPILER -# must be specified as well. The both options must be specified -# either together or none should be specified to use defaults. # -# Hint #2: -# To integrate the AREG SDK in any other project, it might be enough to specify -# the AREG_BUILD_ROOT, which should indicate the root path of the project. -# In this case, if the areg output paths are not directly pointed, then -# they are build relative to the AREG_BUILD_ROOT variable. +# Notes: +# - To integrate manually build binaries of AREG SDK into another project, you can simply set `AREG_BUILD_ROOT` to the project's root directory. +# +# Example Command with AREG_BUILD_ROOT to output binaries in custom directory: +# $ cmake -B ./build -DAREG_BUILD_ROOT="/home/developer/projects/my_project/product" # -# Example: -# $ cmake -B ./build -D=AREG_BUILD_ROOT="~/projects/my_project/product" +# Integration: +# - Visit https://github.com/aregtech/areg-sdk-demo repository to see various ways of AREG Framework integration. # --------------------------------------------------------------------------- # CPP compiler, possible values: g++, gcc, c++, cc, clang++, clang, clang-cl, cl @@ -174,10 +171,27 @@ if (NOT "${AREG_BUILD_TYPE}" STREQUAL "Debug") endif() # Set the AREG binary library type to compile. Set "shared" if not "static" -if (NOT DEFINED AREG_BINARY OR NOT ${AREG_BINARY} STREQUAL "static") +if (NOT DEFINED AREG_BINARY) + if (DEFINED VCPKG_LIBRARY_LINKAGE AND "${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static") + set(AREG_BINARY "static") + else() + set(AREG_BINARY "shared") + endif() +elseif (NOT "${AREG_BINARY}" STREQUAL "static") set(AREG_BINARY "shared") endif() +# Set the areg log observer API library type. +if (NOT DEFINED AREG_LOGGER_LIB) + if (DEFINED VCPKG_LIBRARY_LINKAGE AND "${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static") + set(AREG_LOGGER_LIB "static") + else() + set(AREG_LOGGER_LIB "shared") + endif() +elseif (NOT "${AREG_LOGGER_LIB}" STREQUAL "static") + set(AREG_LOGGER_LIB "shared") +endif() + # Build tests. By default it is disabled. To enable, set ON macro_create_option(AREG_BUILD_TESTS ON "Build unit tests") @@ -193,9 +207,6 @@ macro_create_option(AREG_LOGS ON "Compile with logs") # Modify 'AREG_INSTALL' to enable or disable installation of AREG SDK macro_create_option(AREG_INSTALL ON "Enable installation") -# Escape installing third-party dependencies -macro_create_option(AREG_INSTALL_DEPENDS OFF "Disable installation of thirdparty dependencies") - # Check the request of using installed packages if (NOT DEFINED AREG_USE_PACKAGES) # Set default values @@ -212,47 +223,41 @@ else() macro_create_option(AREG_USE_PACKAGES OFF "Enable using installed packages") macro_create_option(AREG_SQLITE_PACKAGE OFF "Use SQLite3 installed package") macro_create_option(AREG_GTEST_PACKAGE OFF "Use GTest installed package") + macro_create_option(AREG_INSTALL OFF "Enable installation") endif() -# Set the areg-sdk build root folder to output files. -if (NOT DEFINED AREG_BUILD_ROOT OR "${AREG_BUILD_ROOT}" STREQUAL "") - set(AREG_BUILD_ROOT "${AREG_SDK_ROOT}/product") -endif() +# CPP standard for the projects +set(AREG_CXX_STANDARD 17) -# Set the areg log observer API library type. -if (NOT DEFINED AREG_LOGOBSERVER_LIB OR NOT "${AREG_LOGOBSERVER_LIB}" STREQUAL "static") - set(AREG_LOGOBSERVER_LIB "shared") -endif() +# Specify default bitness, the system bitness is detected in 'common.cmake' +set(AREG_BITNESS "64") -if (NOT DEFINED AREG_PACKAGES OR "${AREG_PACKAGES}" STREQUAL "") - set(AREG_PACKAGES "${AREG_BUILD_ROOT}/packages") -endif() +# Specify CPU platform here, the system CPU platform is detected in 'commmon.cmake' +set(AREG_PROCESSOR "x86_64") -if (NOT DEFINED AREG_INSTALL_PATH OR "${AREG_INSTALL_PATH}" STREQUAL "") - set(INST_PATH "${AREG_BUILD_ROOT}") - set(TEMP1_VAL "$ENV{HOME}") - if (NOT "${TEMP1_VAL}" STREQUAL "") - file(TO_CMAKE_PATH "${TEMP1_VAL}" INST_PATH) - else() - set(TEMP1_VAL "$ENV{USERPROFILE}") - if (NOT "${TEMP1_VAL}" STREQUAL "") - file(TO_CMAKE_PATH "${TEMP1_VAL}" INST_PATH) - endif() +if (NOT DEFINED AREG_ENABLE_OUTPUTS OR AREG_ENABLE_OUTPUTS) + option(AREG_ENABLE_OUTPUTS "Enable changing output directories" TRUE) + # Set the areg-sdk build root folder to output files. + if (NOT DEFINED AREG_BUILD_ROOT OR "${AREG_BUILD_ROOT}" STREQUAL "") + set(AREG_BUILD_ROOT "${AREG_SDK_ROOT}/product") endif() - set(AREG_INSTALL_PATH "${INST_PATH}/areg-sdk") + if (NOT DEFINED AREG_PACKAGES OR "${AREG_PACKAGES}" STREQUAL "") + set(AREG_PACKAGES "${AREG_BUILD_ROOT}/packages") + endif() +else() + option(AREG_ENABLE_OUTPUTS "Enable changing output directories" FALSE) + if (NOT DEFINED AREG_BUILD_ROOT OR "${AREG_BUILD_ROOT}" STREQUAL "") + set(AREG_BUILD_ROOT "${CMAKE_BINARY_DIR}") + endif() endif() -# The absolute path for generated files -set(AREG_GENERATE "generate") -set(AREG_GENERATE_DIR "${AREG_BUILD_ROOT}/${AREG_GENERATE}") - -# CPP standard for the projects -set(AREG_CXX_STANDARD 17) - -# Specify default bitness, the system bitness is detected in 'common.cmake' -set(AREG_BITNESS "64") +# The relative path for generated files +if ("${AREG_GENERATE}" STREQUAL "") + set(AREG_GENERATE "generate") +endif() -# Specify CPU platform here, the system CPU platform is detected in 'commmon.cmake' -set(AREG_PROCESSOR "x86_64") +if ("${AREG_GENERATE_DIR}" STREQUAL "") + set(AREG_GENERATE_DIR "${AREG_BUILD_ROOT}/${AREG_GENERATE}") +endif() diff --git a/conf/exports/areg.pc.in b/conf/exports/areg.pc.in new file mode 100644 index 000000000..c80023afd --- /dev/null +++ b/conf/exports/areg.pc.in @@ -0,0 +1,12 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix}/tools/areg +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: areg +Description: AREG communication framework +Version: @PROJECT_VERSION@ +URL: https://github.com/aregtech/areg-sdk +Libs: -L${libdir} -lareg +Libs.private: @AREG_LDFLAGS_STR@ +Cflags: -I${includedir} diff --git a/conf/exports/aregextend.pc.in b/conf/exports/aregextend.pc.in new file mode 100644 index 000000000..7248c423b --- /dev/null +++ b/conf/exports/aregextend.pc.in @@ -0,0 +1,13 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix}/tools/areg +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: aregextend +Description: Extended objects of AREG communication framework +Version: @PROJECT_VERSION@ +URL: https://github.com/aregtech/areg-sdk +Requires: areg >= @PROJECT_VERSION@ +Libs: -L${libdir} -laregextend -lareg +Libs.private: @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ +Cflags: -I${includedir} diff --git a/conf/exports/areglogger.pc.in b/conf/exports/areglogger.pc.in new file mode 100644 index 000000000..0275ba576 --- /dev/null +++ b/conf/exports/areglogger.pc.in @@ -0,0 +1,14 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix}/tools/areg +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: areglogger +Description: Log observer client of AREG communication framework +Version: @PROJECT_VERSION@ +URL: https://github.com/aregtech/areg-sdk +Requires: areg >= @PROJECT_VERSION@ +Requires.private: aregextend >= @PROJECT_VERSION@ +Libs: -L${libdir} -lareglogger -lareg +Libs.private: -lsqlite3 -laregextend @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ +Cflags: -I${includedir} diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in new file mode 100644 index 000000000..7a3fd99a2 --- /dev/null +++ b/conf/exports/config.cmake.in @@ -0,0 +1,105 @@ +@PACKAGE_INIT@ +include(CMakeFindDependencyMacro) + +# ################################################## +# Set AREG SDK essentials +# ################################################## + +# Root folder of the SDK +set(AREG_SDK_ROOT "@CMAKE_INSTALL_PREFIX@") +# Location of 'areg', 'aregextend' and 'areglogger' header files +set(AREG_BASE "@CMAKE_INSTALL_FULL_INCLUDEDIR@") +# Location of configuration, initialization and other shared files of AREG SDK +set(AREG_SHARE_DIR "@CMAKE_INSTALL_PREFIX@/share/@AREG_PACKAGE_NAME@") +# Location of initialization file to copy as a template in the processes +set(AREG_SHARE_INIT "${AREG_SHARE_DIR}/areg.init") +# Location of cmake configuration directory +set(AREG_CMAKE_CONFIG_DIR "${AREG_SHARE_DIR}/conf/cmake") +# Location of AREG SDK tools. +set(AREG_SDK_TOOLS "@CMAKE_INSTALL_PREFIX@/tools/@AREG_PACKAGE_NAME@") +# Location of the AREG SDK code generator +set(AREG_TOOL_CODEGEN "${AREG_SDK_TOOLS}/codegen.jar") + +# The build type of AREG libraries. +set(AREG_BUILD_TYPE "@AREG_BUILD_TYPE@") +# The library type of 'areg'. Static or dynamic +set(AREG_BINARY "@AREG_BINARY@") +# The library type of 'areglogger'. Static or dynamic. +set(AREG_LOGGER_LIB "@AREG_LOGGER_LIB@") + +# set platform specific variables. +set(AREG_OS "@AREG_OS@") +set(AREG_DEVELOP_ENV "@AREG_DEVELOP_ENV@") +set(AREG_BITNESS @AREG_BITNESS@) + +# Specify whether 'aregextend' is compiled with enabled extended objects flag +option(AREG_EXTENDED "AREG Extended object flag" @AREG_EXTENDED@) +# Specify whether the libraries where compiled with enabled logging. +option(AREG_LOGS "AREG logging enable flag" @AREG_LOGS@) + +# include the exported targets +include("${CMAKE_CURRENT_LIST_DIR}/@AREG_PACKAGE_NAME@-targets.cmake") +check_required_components("@AREG_PACKAGE_NAME@") + +# Minimum C++ standard to use +set(AREG_CXX_STANDARD ${AREG_CXX_STANDARD}) +if (NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD ${AREG_CXX_STANDARD}) +elseif (${CMAKE_CXX_STANDARD} LESS ${AREG_CXX_STANDARD}) + message(WARNING "AREG: >>> AREG requires minimum C++${AREG_CXX_STANDARD}, current is C++${CMAKE_CXX_STANDARD}. Forcing to change to avoid compilation errors.") + set(CMAKE_CXX_STANDARD ${AREG_CXX_STANDARD}) +endif() + +# Unit tests are ignored +option(AREG_BUILD_TESTS "No AREG Unit Tests" OFF) +# Examples are ignored +option(AREG_BUILD_EXAMPLES "No AREG Examples" OFF) + +# Change the build root directory if compiled fines are copied somewhere else. +# set to 'CMAKE_CURRENT_BINARY_DIR' if it should be in the compiled binaries directory +set(AREG_BUILD_ROOT "${CMAKE_SOURCE_DIR}/product") + +# Add '${AREG_BASE}' path in the includes +include_directories(${AREG_BASE}) +# Pass the path to the shared 'areg.init' file to the source codes. + +# Pass path to the 'areg.init' file as a preprocessor definition +add_definitions(-DAREG_SHARE_INIT="${AREG_SHARE_INIT}") + +# Indicate the import flag of 'areg' library +if (AREG_BINARY MATCHES "shared") + add_definitions(-DIMP_AREG_DLL) +else() + add_definitions(-DIMP_AREG_LIB) +endif() + +# Indicate the import flag of 'areg' library +if (AREG_LOGGER_LIB MATCHES "shared") + add_definitions(-DIMP_LOGGER_DLL) +else() + add_definitions(-DIMP_LOGGER_LIB) +endif() + +# Indicate the areg extended objects availability. +if (AREG_EXTENDED) + add_definitions(-DAREG_EXTENDED=1) +else() + add_definitions(-DAREG_EXTENDED=0) +endif() + +# Indicate the areg logging availability. +if (AREG_LOGS) + add_definitions(-DAREG_LOGS=1) +else() + add_definitions(-DAREG_LOGS=0) +endif() + +# Set the Platform API and the platform bitness. +if (AREG_DEVELOP_ENV STREQUAL "Win32") + add_definitions(-DWINDOWS -DWIN32) + if (${AREG_BITNESS} EQUAL 64) + add_definitions(-DWIN64) + endif() +else() + add_definitions(-DPOSIX) +endif() diff --git a/conf/exports/example/CMakeLists.txt b/conf/exports/example/CMakeLists.txt new file mode 100644 index 000000000..fc6ad012d --- /dev/null +++ b/conf/exports/example/CMakeLists.txt @@ -0,0 +1,9 @@ +# CMakeList.txt : include source and link with 'areg::areg' +cmake_minimum_required(VERSION 3.20.0) + +project ("example" CXX) + +find_package(areg CONFIG REQUIRED) +# Add source to this project's executable. +add_executable (example example.cpp) +target_link_libraries(example PRIVATE areg::areg) diff --git a/conf/exports/example/ReadMe.md b/conf/exports/example/ReadMe.md new file mode 100644 index 000000000..40827cdd0 --- /dev/null +++ b/conf/exports/example/ReadMe.md @@ -0,0 +1,36 @@ +### Project Overview +This `example` is a small project that demonstrates linking with the `areg` library. It also outputs the `AREG_SHARE_INIT` constant, which shows the location of the `areg.init` file template. + +> **Note:** AREG requires a minimum of C++17. + +--- + +### Build and Run Instructions + +Follow the steps below to build and run the project: + +#### **Step 1: Copy the Example** + +Make a copy of the `example` directory to any location on your computer, and open a terminal in that directory. + +#### **Step 2: Configure the Project** + +In the terminal, run the following command, replacing `` with the correct path to your vcpkg installation: + +```bash +cmake -B ./build -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake +``` + +If this command runs without errors, it means the `areg` package has been successfully installed. + +#### **Step 3: Compile the Code** + +Next, compile the code by running the following command in the terminal: + +```bash +cmake --build ./build +``` + +If the compilation is successful and there are no errors, you have the correct C++ compiler (C++17 or higher), and the linking with the `areg` library was successful. + +You can now run the `example` binary located in the `./build` directory to see the results. diff --git a/conf/exports/example/example.cpp b/conf/exports/example/example.cpp new file mode 100644 index 000000000..ccd6adc4c --- /dev/null +++ b/conf/exports/example/example.cpp @@ -0,0 +1,17 @@ +// example.cpp : Checks availability and compilation with 'areg' library. +// + +#include +#include "areg/base/String.hpp" + +int main() +{ + String hello("Hello from AREG SDK ..."); + std::cout << hello.getData() << std::endl; + + hello = "\'areg.init\' location -> "; + hello += AREG_SHARE_INIT; // <== 'areg.init' file location + std::cout << hello.getData() << std::endl; + + return 0; +} diff --git a/conf/exports/logger.service.in b/conf/exports/logger.service.in new file mode 100644 index 000000000..2be858d12 --- /dev/null +++ b/conf/exports/logger.service.in @@ -0,0 +1,20 @@ +[Unit] +Description=AREG TCP/IP Logging Service to collect application logs +StartLimitIntervalSec=1 + +[Service] +# Set the full path to logger.out file and start with option '--service' +ExecStart=@AREG_INSTALL_DST@/tools/@AREG_PACKAGE_NAME@/logger.out --service +Type=simple +Restart=on-failure +RestartSec=1 + +[Install] +WantedBy=multi-user.target +Alias=logger.service + +# Run this file under Linux with admin rights to enable, start or stop AREG Log Collector Service. +# Example: +# Enable service: sudo systemctl enable logger.service +# Start service: sudo systemctl start logger.service +# Stop service: sudo systemctl stop logger.service diff --git a/conf/exports/logger.service.install.bat.in b/conf/exports/logger.service.install.bat.in new file mode 100644 index 000000000..d4c99aac3 --- /dev/null +++ b/conf/exports/logger.service.install.bat.in @@ -0,0 +1,8 @@ +@echo off + +rem : To install the AREG Log Collector Service on local machine +rem : run this file under Windows with Administrator rights + +@AREG_INSTALL_DST@/tools/@AREG_PACKAGE_NAME@/logger.exe --install + +exit diff --git a/conf/exports/logger.service.uninstall.bat.in b/conf/exports/logger.service.uninstall.bat.in new file mode 100644 index 000000000..59e968c31 --- /dev/null +++ b/conf/exports/logger.service.uninstall.bat.in @@ -0,0 +1,8 @@ +@echo off + +rem : To uninstall the AREG Log Collector Service on local machine +rem : run this file under Windows with Administrator rights + +@AREG_INSTALL_DST@/tools/@AREG_PACKAGE_NAME@/logger.exe --uninstall + +exit diff --git a/conf/exports/mcrouter.service.in b/conf/exports/mcrouter.service.in new file mode 100644 index 000000000..6adaad30c --- /dev/null +++ b/conf/exports/mcrouter.service.in @@ -0,0 +1,20 @@ +[Unit] +Description=AREG TCP/IP Multicast Router Service to automate messaging +StartLimitIntervalSec=1 + +[Service] +# Set the full path to mcrouter.out file and start with option '--service' +ExecStart=@AREG_INSTALL_DST@/tools/@AREG_PACKAGE_NAME@/mcrouter.out --service +Type=simple +Restart=on-failure +RestartSec=1 + +[Install] +WantedBy=multi-user.target +Alias=mcrouter.service + +# Run this file under Linux with admin rights to enable, start or stop AREG Multicast Router Service. +# Example: +# Enable service: sudo systemctl enable mcrouter.service +# Start service: sudo systemctl start mcrouter.service +# Stop service: sudo systemctl stop mcrouter.service diff --git a/conf/exports/mcrouter.service.install.bat.in b/conf/exports/mcrouter.service.install.bat.in new file mode 100644 index 000000000..300b289f4 --- /dev/null +++ b/conf/exports/mcrouter.service.install.bat.in @@ -0,0 +1,8 @@ +@echo off + +rem : To install the AREG Multicast Router Service on local machine +rem : run this file under Windows with Administrator rights + +@AREG_INSTALL_DST@/tools/@AREG_PACKAGE_NAME@/mcrouter.exe --install + +exit diff --git a/conf/exports/mcrouter.service.uninstall.bat.in b/conf/exports/mcrouter.service.uninstall.bat.in new file mode 100644 index 000000000..9294cfcfc --- /dev/null +++ b/conf/exports/mcrouter.service.uninstall.bat.in @@ -0,0 +1,8 @@ +@echo off + +rem : To uninstall the AREG Multicast Router Service on local machine +rem : run this file under Windows with Administrator rights + +@AREG_INSTALL_DST@/tools/@AREG_PACKAGE_NAME@/mcrouter.exe --uninstall + +exit diff --git a/examples/00_helloservice/CMakeLists.txt b/examples/00_helloservice/CMakeLists.txt index 65d382650..24d70831e 100644 --- a/examples/00_helloservice/CMakeLists.txt +++ b/examples/00_helloservice/CMakeLists.txt @@ -9,7 +9,7 @@ macro_declare_project_ex(00_onethread "onethread" "onethread") macro_declare_project_ex(00_twothreads "twothreads" "twothreads") # add executables -addExecutableEx(${project_clientproc} "${clientproc_src}" 00_generated) -addExecutableEx(${project_serviceproc} "${serviceproc_src}" 00_generated) -addExecutableEx(${project_onethread} "${onethread_src}" 00_generated) -addExecutableEx(${project_twothreads} "${twothreads_src}" 00_generated) +addExecutableEx(${project_clientproc} "" "${clientproc_src}" 00_generated) +addExecutableEx(${project_serviceproc} "" "${serviceproc_src}" 00_generated) +addExecutableEx(${project_onethread} "" "${onethread_src}" 00_generated) +addExecutableEx(${project_twothreads} "" "${twothreads_src}" 00_generated) diff --git a/examples/10_locsvc/CMakeLists.txt b/examples/10_locsvc/CMakeLists.txt index 324179834..22d151f19 100644 --- a/examples/10_locsvc/CMakeLists.txt +++ b/examples/10_locsvc/CMakeLists.txt @@ -6,4 +6,4 @@ addServiceInterface(10_generated res HelloWorld) macro_declare_project(10_locservice "locservice") # create executable -addExecutableEx(${project_locservice} "${locservice_src}" "10_generated") +addExecutableEx(${project_locservice} "" "${locservice_src}" "10_generated") diff --git a/examples/11_locmesh/CMakeLists.txt b/examples/11_locmesh/CMakeLists.txt index a184a71af..78f7ade06 100644 --- a/examples/11_locmesh/CMakeLists.txt +++ b/examples/11_locmesh/CMakeLists.txt @@ -6,4 +6,4 @@ addServiceInterface(11_generated res HelloWorld) macro_declare_project(11_locmesh "locsvcmesh") # create exicutable -addExecutableEx(${project_locsvcmesh} "${locsvcmesh_src}" 11_generated) +addExecutableEx(${project_locsvcmesh} "" "${locsvcmesh_src}" 11_generated) diff --git a/examples/12_pubsvc/CMakeLists.txt b/examples/12_pubsvc/CMakeLists.txt index a515e614a..fdd25229a 100644 --- a/examples/12_pubsvc/CMakeLists.txt +++ b/examples/12_pubsvc/CMakeLists.txt @@ -7,5 +7,5 @@ macro_declare_project(12_pubclient "pubclient") macro_declare_project(12_pubservice "pubservice") # add executables -addExecutableEx(${project_pubclient} "${pubclient_src}" 12_generated) -addExecutableEx(${project_pubservice} "${pubservice_src}" 12_generated) +addExecutableEx(${project_pubclient} "" "${pubclient_src}" 12_generated) +addExecutableEx(${project_pubservice} "" "${pubservice_src}" 12_generated) diff --git a/examples/13_pubmesh/CMakeLists.txt b/examples/13_pubmesh/CMakeLists.txt index 9c24a3c95..d1f27ebfc 100644 --- a/examples/13_pubmesh/CMakeLists.txt +++ b/examples/13_pubmesh/CMakeLists.txt @@ -10,7 +10,7 @@ macro_declare_project(13_pubservice "pubservice") macro_declare_project(13_pubsvcmesh "pubsvcmesh") # add a static library -addStaticLibEx(${project_common} "${common_src}" 13_generated) -addExecutableEx(${project_pubclients} "${pubclients_src}" 13_generated "${project_common}") -addExecutableEx(${project_pubservice} "${pubservice_src}" 13_generated "${project_common}") -addExecutableEx(${project_pubsvcmesh} "${pubsvcmesh_src}" 13_generated "${project_common}") +addStaticLibEx(${project_common} "" "${common_src}" 13_generated) +addExecutableEx(${project_pubclients} "" "${pubclients_src}" 13_generated "${project_common}") +addExecutableEx(${project_pubservice} "" "${pubservice_src}" 13_generated "${project_common}") +addExecutableEx(${project_pubsvcmesh} "" "${pubsvcmesh_src}" 13_generated "${project_common}") diff --git a/examples/14_pubtraffic/CMakeLists.txt b/examples/14_pubtraffic/CMakeLists.txt index 2dec98220..06dfc7d35 100644 --- a/examples/14_pubtraffic/CMakeLists.txt +++ b/examples/14_pubtraffic/CMakeLists.txt @@ -7,5 +7,5 @@ macro_declare_project(14_pubclient "pubclient") macro_declare_project(14_pubservice "pubservice") # add executables -addExecutableEx(${project_pubclient} "${pubclient_src}" 14_generated) -addExecutableEx(${project_pubservice} "${pubservice_src}" 14_generated) +addExecutableEx(${project_pubclient} "" "${pubclient_src}" 14_generated) +addExecutableEx(${project_pubservice} "" "${pubservice_src}" 14_generated) diff --git a/examples/14_pubtraffic/pubclient/src/main.cpp b/examples/14_pubtraffic/pubclient/src/main.cpp index 8a6fece01..38846f6e2 100644 --- a/examples/14_pubtraffic/pubclient/src/main.cpp +++ b/examples/14_pubtraffic/pubclient/src/main.cpp @@ -19,14 +19,14 @@ #include "areg/component/ComponentLoader.hpp" #include "areg/trace/GETrace.h" #include "areg/base/NEUtilities.hpp" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include "common/NECommon.hpp" #include "pubclient/src/TrafficLightClient.hpp" #ifdef WIN32 #pragma comment(lib, "areg.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #pragma comment(lib, "14_generated.lib") #endif // WIN32 diff --git a/examples/14_pubtraffic/pubservice/src/main.cpp b/examples/14_pubtraffic/pubservice/src/main.cpp index d814dfc4b..6f84450db 100644 --- a/examples/14_pubtraffic/pubservice/src/main.cpp +++ b/examples/14_pubtraffic/pubservice/src/main.cpp @@ -19,14 +19,14 @@ #include "areg/appbase/Application.hpp" #include "areg/component/ComponentLoader.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include "common/NECommon.hpp" #include "pubservice/src/TrafficLightService.hpp" #ifdef WINDOWS #pragma comment(lib, "areg.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #pragma comment(lib, "14_generated.lib") #endif // WINDOWS diff --git a/examples/15_pubworker/CMakeLists.txt b/examples/15_pubworker/CMakeLists.txt index e0c5c3436..78f3bbab0 100644 --- a/examples/15_pubworker/CMakeLists.txt +++ b/examples/15_pubworker/CMakeLists.txt @@ -7,5 +7,5 @@ macro_declare_project(15_pubclient "pubclient") macro_declare_project(15_pubservice "pubservice") # add executables -addExecutableEx(${project_pubclient} "${pubclient_src}" 15_generated) -addExecutableEx(${project_pubservice} "${pubservice_src}" 15_generated) +addExecutableEx(${project_pubclient} "" "${pubclient_src}" 15_generated) +addExecutableEx(${project_pubservice} "" "${pubservice_src}" 15_generated) diff --git a/examples/16_pubfsm/CMakeLists.txt b/examples/16_pubfsm/CMakeLists.txt index 890042286..9d45de9f7 100644 --- a/examples/16_pubfsm/CMakeLists.txt +++ b/examples/16_pubfsm/CMakeLists.txt @@ -8,6 +8,6 @@ macro_declare_project(16_pubclient "pubclient") macro_declare_project(16_pubservice "pubservice") # add executables -addExecutableEx(${project_pubclient} "${pubclient_src}" 16_generated) -addExecutableEx(${project_pubservice} "${pubservice_src}" 16_generated) +addExecutableEx(${project_pubclient} "" "${pubclient_src}" 16_generated) +addExecutableEx(${project_pubservice} "" "${pubservice_src}" 16_generated) target_compile_options(${project_pubservice} PRIVATE "${AREG_OPT_DISABLE_WARN_EXAMPLES}") \ No newline at end of file diff --git a/examples/17_winchat/CMakeLists.txt b/examples/17_winchat/CMakeLists.txt index aa44d9a8e..f307819b3 100644 --- a/examples/17_winchat/CMakeLists.txt +++ b/examples/17_winchat/CMakeLists.txt @@ -22,7 +22,7 @@ set_source_files_properties(${chatter_resources} PROPERTIES LANGUAGE RC) list(APPEND chatter_src "${chatter_resources}") # 'chatter' project, compile for Windows system, set options -addExecutableEx(${project_chatter} "${chatter_src}" 17_generated) +addExecutableEx(${project_chatter} "" "${chatter_src}" 17_generated) # Set compile definitions to link MFC DLL set_target_properties(${project_chatter} PROPERTIES WIN32_EXECUTABLE TRUE) target_compile_definitions(${project_chatter} PRIVATE "${MFC_DEFINES}") @@ -39,7 +39,7 @@ macro_declare_project(17_register "register") set_source_files_properties(${register_resources} PROPERTIES LANGUAGE RC) list(APPEND register_src ${register_resources}) # 'register' project, compile for Windows system, set options -addExecutableEx(${project_register} "${register_src}" 17_generated) +addExecutableEx(${project_register} "" "${register_src}" 17_generated) # Set compile definitions to link MFC DLL set_target_properties(${project_register} PROPERTIES WIN32_EXECUTABLE TRUE) target_compile_definitions(${project_register} PRIVATE "${MFC_DEFINES}") diff --git a/examples/18_locwatchdog/CMakeLists.txt b/examples/18_locwatchdog/CMakeLists.txt index db6a3f2d6..cc0a7784f 100644 --- a/examples/18_locwatchdog/CMakeLists.txt +++ b/examples/18_locwatchdog/CMakeLists.txt @@ -6,4 +6,4 @@ addServiceInterface(18_generated res HelloWatchdog) macro_declare_project(18_locservice "locservice") # add executable -addExecutableEx(${project_locservice} "${locservice_src}" 18_generated) +addExecutableEx(${project_locservice} "" "${locservice_src}" 18_generated) diff --git a/examples/19_pubwatchdog/CMakeLists.txt b/examples/19_pubwatchdog/CMakeLists.txt index cb0474320..dd488f41d 100644 --- a/examples/19_pubwatchdog/CMakeLists.txt +++ b/examples/19_pubwatchdog/CMakeLists.txt @@ -8,5 +8,5 @@ macro_declare_project(19_pubservice "pubservice") # add executables -addExecutableEx(${project_pubclient} "${pubclient_src}" 19_generated) -addExecutableEx(${project_pubservice} "${pubservice_src}" 19_generated) +addExecutableEx(${project_pubclient} "" "${pubclient_src}" 19_generated) +addExecutableEx(${project_pubservice} "" "${pubservice_src}" 19_generated) diff --git a/examples/20_pubdatarate/CMakeLists.txt b/examples/20_pubdatarate/CMakeLists.txt index efa0771ca..7fb330ab6 100644 --- a/examples/20_pubdatarate/CMakeLists.txt +++ b/examples/20_pubdatarate/CMakeLists.txt @@ -7,5 +7,5 @@ macro_declare_project(20_pubclient "pubclient") macro_declare_project(20_pubservice "pubservice") # add executables -addExecutableEx(${project_pubclient} "${pubclient_src}" 20_generated) -addExecutableEx(${project_pubservice} "${pubservice_src}" 20_generated) +addExecutableEx(${project_pubclient} "" "${pubclient_src}" 20_generated) +addExecutableEx(${project_pubservice} "" "${pubservice_src}" 20_generated) diff --git a/examples/20_pubdatarate/pubclient/src/ServiceClient.cpp b/examples/20_pubdatarate/pubclient/src/ServiceClient.cpp index 336e12684..2bea2a0d6 100644 --- a/examples/20_pubdatarate/pubclient/src/ServiceClient.cpp +++ b/examples/20_pubdatarate/pubclient/src/ServiceClient.cpp @@ -12,7 +12,7 @@ #include "pubclient/src/ServiceClient.hpp" #include "areg/trace/GETrace.h" #include "areg/appbase/Application.hpp" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" DEF_TRACE_SCOPE(examples_20_clientdatarate_ServiceClient_startupComponent); DEF_TRACE_SCOPE(examples_20_clientdatarate_ServiceClient_serviceConnected); diff --git a/examples/20_pubdatarate/pubclient/src/ServiceClient.hpp b/examples/20_pubdatarate/pubclient/src/ServiceClient.hpp index cc47460ed..4054ec96c 100644 --- a/examples/20_pubdatarate/pubclient/src/ServiceClient.hpp +++ b/examples/20_pubdatarate/pubclient/src/ServiceClient.hpp @@ -18,7 +18,7 @@ #include "areg/component/IETimerConsumer.hpp" #include "areg/component/Timer.hpp" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include "common/NELargeData.hpp" #include "common/SimpleBitmap.hpp" diff --git a/examples/20_pubdatarate/pubclient/src/main.cpp b/examples/20_pubdatarate/pubclient/src/main.cpp index 405214315..024dd68d1 100644 --- a/examples/20_pubdatarate/pubclient/src/main.cpp +++ b/examples/20_pubdatarate/pubclient/src/main.cpp @@ -22,7 +22,7 @@ #ifdef WINDOWS #pragma comment(lib, "areg.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #pragma comment(lib, "20_generated.lib") #endif // WINDOWS diff --git a/examples/20_pubdatarate/pubservice/src/ServicingComponent.cpp b/examples/20_pubdatarate/pubservice/src/ServicingComponent.cpp index 02e57ec09..45f61c665 100644 --- a/examples/20_pubdatarate/pubservice/src/ServicingComponent.cpp +++ b/examples/20_pubdatarate/pubservice/src/ServicingComponent.cpp @@ -14,7 +14,7 @@ #include "areg/appbase/Application.hpp" #include "areg/component/ComponentThread.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include diff --git a/examples/20_pubdatarate/pubservice/src/ServicingComponent.hpp b/examples/20_pubdatarate/pubservice/src/ServicingComponent.hpp index 71e7e49a2..06c217cc2 100644 --- a/examples/20_pubdatarate/pubservice/src/ServicingComponent.hpp +++ b/examples/20_pubdatarate/pubservice/src/ServicingComponent.hpp @@ -22,7 +22,7 @@ #include "areg/base/SynchObjects.hpp" #include "areg/base/Thread.hpp" #include "areg/component/Timer.hpp" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include "common/SimpleBitmap.hpp" #include "common/NELargeData.hpp" diff --git a/examples/20_pubdatarate/pubservice/src/main.cpp b/examples/20_pubdatarate/pubservice/src/main.cpp index 9c070bf6d..c980ec5a3 100644 --- a/examples/20_pubdatarate/pubservice/src/main.cpp +++ b/examples/20_pubdatarate/pubservice/src/main.cpp @@ -16,7 +16,7 @@ #ifdef WIN32 #pragma comment(lib, "areg.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #pragma comment(lib, "20_generated.lib") #endif // WINDOWS diff --git a/examples/21_pubunblock/CMakeLists.txt b/examples/21_pubunblock/CMakeLists.txt index c01f7f175..e54dcafd7 100644 --- a/examples/21_pubunblock/CMakeLists.txt +++ b/examples/21_pubunblock/CMakeLists.txt @@ -7,5 +7,5 @@ macro_declare_project(21_pubclient "pubclient") macro_declare_project(21_pubservice "pubservice") # add executables -addExecutableEx(${project_pubclient} "${pubclient_src}" 21_generated) -addExecutableEx(${project_pubservice} "${pubservice_src}" 21_generated) +addExecutableEx(${project_pubclient} "" "${pubclient_src}" 21_generated) +addExecutableEx(${project_pubservice} "" "${pubservice_src}" 21_generated) diff --git a/examples/22_pubsub/CMakeLists.txt b/examples/22_pubsub/CMakeLists.txt index 96072dd71..9558dc3a8 100644 --- a/examples/22_pubsub/CMakeLists.txt +++ b/examples/22_pubsub/CMakeLists.txt @@ -7,5 +7,5 @@ macro_declare_project(22_publisher "publisher") macro_declare_project(22_subscriber "subscriber") # add executables -addExecutableEx(${project_publisher} "${publisher_src}" 22_generated) -addExecutableEx(${project_subscriber} "${subscriber_src}" 22_generated) +addExecutableEx(${project_publisher} "" "${publisher_src}" 22_generated) +addExecutableEx(${project_subscriber} "" "${subscriber_src}" 22_generated) diff --git a/examples/22_pubsub/publisher/src/Publisher.cpp b/examples/22_pubsub/publisher/src/Publisher.cpp index c422715a4..6ad0b8ee0 100644 --- a/examples/22_pubsub/publisher/src/Publisher.cpp +++ b/examples/22_pubsub/publisher/src/Publisher.cpp @@ -14,7 +14,7 @@ #include "areg/appbase/Application.hpp" #include "areg/component/ComponentThread.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" ////////////////////////////////////////////////////////////////////////// // Log scopes diff --git a/examples/22_pubsub/publisher/src/Publisher.hpp b/examples/22_pubsub/publisher/src/Publisher.hpp index 27dea0b3f..6600a3918 100644 --- a/examples/22_pubsub/publisher/src/Publisher.hpp +++ b/examples/22_pubsub/publisher/src/Publisher.hpp @@ -18,7 +18,7 @@ #include "areg/base/Thread.hpp" #include "areg/component/Timer.hpp" -#include "extend/console/OptionParser.hpp" +#include "aregextend/console/OptionParser.hpp" /** * \brief This service provider contains attributes (data) that send notifications on update. diff --git a/examples/22_pubsub/publisher/src/main.cpp b/examples/22_pubsub/publisher/src/main.cpp index a6fea4816..2da532e39 100644 --- a/examples/22_pubsub/publisher/src/main.cpp +++ b/examples/22_pubsub/publisher/src/main.cpp @@ -17,7 +17,7 @@ #ifdef WIN32 #pragma comment(lib, "areg.lib") #pragma comment(lib, "22_generated.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #endif // WINDOWS ////////////////////////////////////////////////////////////////////////// diff --git a/examples/22_pubsub/subscriber/src/Subscriber.cpp b/examples/22_pubsub/subscriber/src/Subscriber.cpp index e885fa257..1d42ef9bd 100644 --- a/examples/22_pubsub/subscriber/src/Subscriber.cpp +++ b/examples/22_pubsub/subscriber/src/Subscriber.cpp @@ -12,7 +12,7 @@ #include "areg/appbase/Application.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include diff --git a/examples/22_pubsub/subscriber/src/main.cpp b/examples/22_pubsub/subscriber/src/main.cpp index f569539ea..f463a578c 100644 --- a/examples/22_pubsub/subscriber/src/main.cpp +++ b/examples/22_pubsub/subscriber/src/main.cpp @@ -20,7 +20,7 @@ #ifdef WINDOWS #pragma comment(lib, "areg") #pragma comment(lib, "22_generated.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #endif // WINDOWS constexpr char const _modelName[] { "PubSub_model" }; //!< The name of model diff --git a/examples/23_pubsubmix/CMakeLists.txt b/examples/23_pubsubmix/CMakeLists.txt index b877b644f..698a5fc47 100644 --- a/examples/23_pubsubmix/CMakeLists.txt +++ b/examples/23_pubsubmix/CMakeLists.txt @@ -8,8 +8,8 @@ macro_declare_project(23_pubsubctrl "pubsubctrl") macro_declare_project(23_pubsubdyn "pubsubdyn") # add static library -addStaticLibEx(${project_common} "${common_src}" 23_generated) +addStaticLibEx(${project_common} "" "${common_src}" 23_generated) # add executable -addExecutableEx(${project_pubsubctrl} "${pubsubctrl_src}" 23_generated "${project_common}") -addExecutableEx(${project_pubsubdyn} "${pubsubdyn_src}" 23_generated "${project_common}") +addExecutableEx(${project_pubsubctrl} "" "${pubsubctrl_src}" 23_generated "${project_common}") +addExecutableEx(${project_pubsubdyn} "" "${pubsubdyn_src}" 23_generated "${project_common}") diff --git a/examples/23_pubsubmix/common/src/NECommon.hpp b/examples/23_pubsubmix/common/src/NECommon.hpp index 8c63d9475..6dfdb2463 100644 --- a/examples/23_pubsubmix/common/src/NECommon.hpp +++ b/examples/23_pubsubmix/common/src/NECommon.hpp @@ -14,7 +14,7 @@ #include "areg/base/GEGlobal.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include /** diff --git a/examples/23_pubsubmix/common/src/Publisher.cpp b/examples/23_pubsubmix/common/src/Publisher.cpp index d0d293b6a..74fd8ed12 100644 --- a/examples/23_pubsubmix/common/src/Publisher.cpp +++ b/examples/23_pubsubmix/common/src/Publisher.cpp @@ -15,7 +15,7 @@ #include "areg/component/Component.hpp" #include "areg/component/ComponentThread.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" ////////////////////////////////////////////////////////////////////////// // Log scopes diff --git a/examples/23_pubsubmix/common/src/Publisher.hpp b/examples/23_pubsubmix/common/src/Publisher.hpp index 0c59d1212..4acfeecef 100644 --- a/examples/23_pubsubmix/common/src/Publisher.hpp +++ b/examples/23_pubsubmix/common/src/Publisher.hpp @@ -16,7 +16,7 @@ #include "generate/examples/23_pubsubmix/PubSubMixStub.hpp" #include "areg/component/Timer.hpp" -#include "extend/console/OptionParser.hpp" +#include "aregextend/console/OptionParser.hpp" /** * \brief This service provider contains attributes (data) that send notifications on update. diff --git a/examples/23_pubsubmix/common/src/Subscriber.cpp b/examples/23_pubsubmix/common/src/Subscriber.cpp index 042292dc1..7fe2f37d8 100644 --- a/examples/23_pubsubmix/common/src/Subscriber.cpp +++ b/examples/23_pubsubmix/common/src/Subscriber.cpp @@ -13,7 +13,7 @@ #include "areg/appbase/Application.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include "common/src/NECommon.hpp" #include diff --git a/examples/23_pubsubmix/pubsubctrl/src/PubSubController.cpp b/examples/23_pubsubmix/pubsubctrl/src/PubSubController.cpp index 4593d3b95..0997e6e90 100644 --- a/examples/23_pubsubmix/pubsubctrl/src/PubSubController.cpp +++ b/examples/23_pubsubmix/pubsubctrl/src/PubSubController.cpp @@ -14,7 +14,7 @@ #include "areg/appbase/Application.hpp" #include "areg/component/ComponentThread.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include "common/src/NECommon.hpp" diff --git a/examples/23_pubsubmix/pubsubctrl/src/PubSubController.hpp b/examples/23_pubsubmix/pubsubctrl/src/PubSubController.hpp index c9a2d69d0..9461eb6d8 100644 --- a/examples/23_pubsubmix/pubsubctrl/src/PubSubController.hpp +++ b/examples/23_pubsubmix/pubsubctrl/src/PubSubController.hpp @@ -15,7 +15,7 @@ #include "areg/component/Component.hpp" #include "areg/base/Thread.hpp" -#include "extend/console/OptionParser.hpp" +#include "aregextend/console/OptionParser.hpp" #include "common/src/Publisher.hpp" #include "common/src/Subscriber.hpp" diff --git a/examples/23_pubsubmix/pubsubctrl/src/main.cpp b/examples/23_pubsubmix/pubsubctrl/src/main.cpp index 0ec001b24..8fd9dc6eb 100644 --- a/examples/23_pubsubmix/pubsubctrl/src/main.cpp +++ b/examples/23_pubsubmix/pubsubctrl/src/main.cpp @@ -11,7 +11,7 @@ #include "areg/appbase/Application.hpp" #include "areg/component/ComponentLoader.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include "common/src/NECommon.hpp" #include "common/src/PubSubMixed.hpp" @@ -21,7 +21,7 @@ #pragma comment(lib, "areg.lib") #pragma comment(lib, "23_generated.lib") #pragma comment(lib, "23_common.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #endif // WINDOWS namespace diff --git a/examples/23_pubsubmix/pubsubdyn/src/main.cpp b/examples/23_pubsubmix/pubsubdyn/src/main.cpp index 50c394947..697182e3c 100644 --- a/examples/23_pubsubmix/pubsubdyn/src/main.cpp +++ b/examples/23_pubsubmix/pubsubdyn/src/main.cpp @@ -22,7 +22,7 @@ #pragma comment(lib, "areg") #pragma comment(lib, "23_generated.lib") #pragma comment(lib, "23_common.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #endif // WINDOWS namespace diff --git a/examples/24_pubsubmulti/CMakeLists.txt b/examples/24_pubsubmulti/CMakeLists.txt index 2bc4fb77b..0c710d051 100644 --- a/examples/24_pubsubmulti/CMakeLists.txt +++ b/examples/24_pubsubmulti/CMakeLists.txt @@ -7,5 +7,5 @@ macro_declare_project(24_publisher "publisher") macro_declare_project(24_subscribermulti "subscribermulti") # add executables -addExecutableEx(${project_publisher} "${publisher_src}" 24_generated) -addExecutableEx(${project_subscribermulti} "${subscribermulti_src}" 24_generated) +addExecutableEx(${project_publisher} "" "${publisher_src}" 24_generated) +addExecutableEx(${project_subscribermulti} "" "${subscribermulti_src}" 24_generated) diff --git a/examples/24_pubsubmulti/publisher/src/Publisher.cpp b/examples/24_pubsubmulti/publisher/src/Publisher.cpp index 1dc86e254..cfde13e4b 100644 --- a/examples/24_pubsubmulti/publisher/src/Publisher.cpp +++ b/examples/24_pubsubmulti/publisher/src/Publisher.cpp @@ -14,7 +14,7 @@ #include "areg/appbase/Application.hpp" #include "areg/component/ComponentThread.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" ////////////////////////////////////////////////////////////////////////// // Log scopes diff --git a/examples/24_pubsubmulti/publisher/src/Publisher.hpp b/examples/24_pubsubmulti/publisher/src/Publisher.hpp index d881a32fc..74959e24f 100644 --- a/examples/24_pubsubmulti/publisher/src/Publisher.hpp +++ b/examples/24_pubsubmulti/publisher/src/Publisher.hpp @@ -18,7 +18,7 @@ #include "areg/base/Thread.hpp" #include "areg/component/Timer.hpp" -#include "extend/console/OptionParser.hpp" +#include "aregextend/console/OptionParser.hpp" /** * \brief This service provider contains attributes (data) that send notifications on update. diff --git a/examples/24_pubsubmulti/publisher/src/main.cpp b/examples/24_pubsubmulti/publisher/src/main.cpp index 10d7829f1..444140279 100644 --- a/examples/24_pubsubmulti/publisher/src/main.cpp +++ b/examples/24_pubsubmulti/publisher/src/main.cpp @@ -17,7 +17,7 @@ #ifdef WIN32 #pragma comment(lib, "areg.lib") #pragma comment(lib, "24_generated.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #endif // WINDOWS ////////////////////////////////////////////////////////////////////////// diff --git a/examples/24_pubsubmulti/subscribermulti/src/NECommon.hpp b/examples/24_pubsubmulti/subscribermulti/src/NECommon.hpp index d020208b4..8d0df0f43 100644 --- a/examples/24_pubsubmulti/subscribermulti/src/NECommon.hpp +++ b/examples/24_pubsubmulti/subscribermulti/src/NECommon.hpp @@ -12,7 +12,7 @@ * Include files. ************************************************************************/ #include "areg/base/GEGlobal.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include diff --git a/examples/24_pubsubmulti/subscribermulti/src/main.cpp b/examples/24_pubsubmulti/subscribermulti/src/main.cpp index 8ec90d81b..eaede5cf8 100644 --- a/examples/24_pubsubmulti/subscribermulti/src/main.cpp +++ b/examples/24_pubsubmulti/subscribermulti/src/main.cpp @@ -20,7 +20,7 @@ #ifdef WINDOWS #pragma comment(lib, "areg") #pragma comment(lib, "24_generated.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #endif // WINDOWS constexpr char const _modelName[] { "PubSub_model" }; //!< The name of model diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index 67743d4f6..dcebec7e9 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -3,7 +3,8 @@ # User specific settings # ########################################################################### include("${AREG_BASE}/areg/CMakeLists.txt") -include("${AREG_BASE}/extend/CMakeLists.txt") -include("${AREG_BASE}/mcrouter/CMakeLists.txt") +include("${AREG_BASE}/aregextend/CMakeLists.txt") +include("${AREG_BASE}/areglogger/CMakeLists.txt") include("${AREG_BASE}/logger/CMakeLists.txt") include("${AREG_BASE}/logobserver/CMakeLists.txt") +include("${AREG_BASE}/mcrouter/CMakeLists.txt") diff --git a/framework/areg-extend.vcxproj b/framework/areg-extend.vcxproj deleted file mode 100644 index 9adcd784c..000000000 --- a/framework/areg-extend.vcxproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} - areg-extend - areg-extend - Win32Proj - - - - StaticLibrary - - - - - - - $(OutLibDir)\ - - - - IMPORT_SHARED_SYMBOLS;%(PreprocessorDefinitions) - - - - - true - true - IMPORT_SHARED_SYMBOLS;%(PreprocessorDefinitions) - - - Windows - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/framework/areg-extend.vcxproj.filters b/framework/areg-extend.vcxproj.filters deleted file mode 100644 index eafb13faa..000000000 --- a/framework/areg-extend.vcxproj.filters +++ /dev/null @@ -1,137 +0,0 @@ - - - - - {2C133C75-00C8-4D74-B8DC-F929EE455976} - cpp;c;cc;cxx;def;odl;idl;hpj;asm;asmx - - - {BE002776-D9B0-46FA-B0D0-07E3F27F4BDB} - h;hpp;hxx;hm;inl;inc;xsd - - - {F0F65A7F-5D02-4E30-A86E-6BD40224135E} - bat;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/framework/areg.vcxproj b/framework/areg.vcxproj index e8a200f00..76300790c 100644 --- a/framework/areg.vcxproj +++ b/framework/areg.vcxproj @@ -382,6 +382,7 @@ + @@ -407,15 +408,11 @@ - - - + + + - - - - @@ -435,6 +432,9 @@ + + + diff --git a/framework/areg.vcxproj.filters b/framework/areg.vcxproj.filters index 70e9c930a..365261dca 100644 --- a/framework/areg.vcxproj.filters +++ b/framework/areg.vcxproj.filters @@ -572,10 +572,10 @@ - + Header Files - + Header Files @@ -725,7 +725,7 @@ Header Files - + Header Files @@ -746,9 +746,6 @@ Header Files - - Header Files - Header Files @@ -1133,6 +1130,9 @@ Header Files + + Header Files + @@ -1143,11 +1143,6 @@ Resource Files - - - Resource Files - - @@ -1162,4 +1157,9 @@ + + + Resource Files + + \ No newline at end of file diff --git a/framework/areg/CMakeLists.txt b/framework/areg/CMakeLists.txt index 6c28abf03..5984b99a3 100644 --- a/framework/areg/CMakeLists.txt +++ b/framework/areg/CMakeLists.txt @@ -8,29 +8,40 @@ include("${areg_BASE}/ipc/private/CMakeLists.txt") include("${areg_BASE}/persist/private/CMakeLists.txt") include("${areg_BASE}/trace/private/CMakeLists.txt") +if (${AREG_DEVELOP_ENV} MATCHES "Win32") + set_source_files_properties("${areg_BASE}/resources/areg.rc" PROPERTIES LANGUAGE RC) + list(APPEND areg_SRC ${areg_BASE}/resources/areg.rc) +endif() + # build areg library if(AREG_BINARY MATCHES "shared") # Shared Library add_library(areg SHARED ${areg_SRC}) + if (NOT "${AREG_PACKAGE_NAME}" STREQUAL "") + add_library(${AREG_PACKAGE_NAME}::areg ALIAS areg) + endif() + target_compile_definitions(areg PRIVATE EXP_AREG_DLL _USRDLL) if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") target_compile_options(areg PRIVATE "-Bdynamic") endif() - set_property(TARGET areg PROPERTY LIBRARY_OUTPUT_DIRECTORY ${AREG_OUTPUT_BIN}) + # set_property(TARGET areg PROPERTY LIBRARY_OUTPUT_DIRECTORY ${AREG_OUTPUT_BIN}) -else(AREG_BINARY MATCHES "static") +else() # Static Library add_library(areg STATIC ${areg_SRC}) + if (NOT "${AREG_PACKAGE_NAME}" STREQUAL "") + add_library(${AREG_PACKAGE_NAME}::areg ALIAS areg) + endif() + target_compile_definitions(areg PRIVATE EXP_AREG_LIB _LIB) if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") target_compile_options(areg PRIVATE "-Bstatic") endif() - set_property(TARGET areg PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${AREG_OUTPUT_LIB}) + # set_property(TARGET areg PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${AREG_OUTPUT_LIB}) -endif() -# add a dependency to make sure that output folders exist during build time. -add_dependencies(areg areg-dummy) +endif(AREG_BINARY MATCHES "shared") if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") target_compile_options(areg PRIVATE -fPIC) @@ -40,11 +51,8 @@ target_compile_options(areg PRIVATE "${AREG_OPT_DISABLE_WARN_COMMON}" "${AREG_OP # Linker options target_link_libraries(areg PRIVATE ${AREG_LDFLAGS}) -# Library configuration -set_target_properties(areg PROPERTIES CXX_STANDARD ${AREG_CXX_STANDARD} CXX_STANDARD_REQUIRED ON ) - # copying log and router init files to 'bin/config' add_custom_command( TARGET areg POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory ${AREG_OUTPUT_BIN}/config - COMMAND ${CMAKE_COMMAND} -E copy ${AREG_BASE}/areg/resources/areg.init ${AREG_OUTPUT_BIN}/config/areg.init + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/config + COMMAND ${CMAKE_COMMAND} -E copy ${AREG_BASE}/areg/resources/areg.init ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/config/areg.init VERBATIM) diff --git a/framework/areg/base/GEGlobal.h b/framework/areg/base/GEGlobal.h index ccf43c984..2457a5cf6 100644 --- a/framework/areg/base/GEGlobal.h +++ b/framework/areg/base/GEGlobal.h @@ -28,7 +28,7 @@ * should be included and/or defined here. **/ -#include "system/GEPlatform.h" +#include "areg/system/GEPlatform.h" #define OUTPUT_DEBUG_LEVEL_DEBUG 4 #define OUTPUT_DEBUG_LEVEL_INFO 3 diff --git a/framework/areg/base/GETypes.h b/framework/areg/base/GETypes.h index e5897e969..3bd636e2e 100644 --- a/framework/areg/base/GETypes.h +++ b/framework/areg/base/GETypes.h @@ -24,7 +24,7 @@ * everywhere instead of the default types. * included from GGlobal.h **/ -#include "system/GEPlatform.h" +#include "areg/system/GEPlatform.h" #if defined(_MSC_VER) && (_MSC_VER < 1600 ) // MS express/studio 2008 or earlier diff --git a/framework/areg/base/private/posix/ProcessPosix.cpp b/framework/areg/base/private/posix/ProcessPosix.cpp index 362e6feb3..b8b3d76ce 100644 --- a/framework/areg/base/private/posix/ProcessPosix.cpp +++ b/framework/areg/base/private/posix/ProcessPosix.cpp @@ -17,7 +17,6 @@ #if defined(_POSIX) || defined(POSIX) -#include "system/GEPlatform.h" #include "areg/base/File.hpp" #include diff --git a/framework/areg/resources/areg.rc b/framework/areg/resources/areg.rc index 1e61f1da3..01295a9a6 100644 Binary files a/framework/areg/resources/areg.rc and b/framework/areg/resources/areg.rc differ diff --git a/framework/areg/resources/resource.hpp b/framework/areg/resources/resource.h similarity index 99% rename from framework/areg/resources/resource.hpp rename to framework/areg/resources/resource.h index 2567466ba..cac7b35e0 100644 --- a/framework/areg/resources/resource.hpp +++ b/framework/areg/resources/resource.h @@ -1,6 +1,7 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by areg.rc +// // Next default values for new objects // diff --git a/framework/system/GEPlatform.h b/framework/areg/system/GEPlatform.h similarity index 92% rename from framework/system/GEPlatform.h rename to framework/areg/system/GEPlatform.h index 5868bab70..acf365041 100644 --- a/framework/system/GEPlatform.h +++ b/framework/areg/system/GEPlatform.h @@ -1,7 +1,7 @@ #ifndef AREG_SYSTEM_GEPLATFORM_H #define AREG_SYSTEM_GEPLATFORM_H /************************************************************************ - * \file system/GEPlatform.h + * \file areg/system/GEPlatform.h * \ingroup platform dependent files * \author Artak Avetyan * \brief AREG Framework, platform dependent includes @@ -46,11 +46,11 @@ #undef WINDOWS #undef _WINDOWS - #include "system/posix/GEPosix.h" + #include "areg/system/posix/GEPosix.h" #elif (defined(_WINDOWS) || defined(WINDOWS)) - #include "system/windows/GEWindows.h" + #include "areg/system/windows/GEWindows.h" #else // !(defined(_WINDOWS) || defined(WINDOWS)) diff --git a/framework/system/posix/GEPosix.h b/framework/areg/system/posix/GEPosix.h similarity index 98% rename from framework/system/posix/GEPosix.h rename to framework/areg/system/posix/GEPosix.h index 4ce2337c7..8ff72f6d3 100644 --- a/framework/system/posix/GEPosix.h +++ b/framework/areg/system/posix/GEPosix.h @@ -2,7 +2,7 @@ #define AREG_SYSTEM_POSIX_GEPOSIX_H /************************************************************************ -* \file system/posix/GEPosix.h +* \file areg/system/posix/GEPosix.h * \ingroup Framework globals * \author Artak Avetyan * \brief AREG Framework, platform dependent includes. POSIX specific directives diff --git a/framework/system/windows/GEWindows.h b/framework/areg/system/windows/GEWindows.h similarity index 98% rename from framework/system/windows/GEWindows.h rename to framework/areg/system/windows/GEWindows.h index f567ab5e8..7f8647881 100644 --- a/framework/system/windows/GEWindows.h +++ b/framework/areg/system/windows/GEWindows.h @@ -2,7 +2,7 @@ #define AREG_SYSTEM_WINDOWS_GEWINDOWS_H /************************************************************************ - * \file system/windows/GEWindows.h + * \file areg/system/windows/GEWindows.h * \ingroup Framework globals * \author Artak Avetyan * \brief AREG Framework, platform dependent includes. Win32 specific directives diff --git a/framework/aregextend.vcxproj b/framework/aregextend.vcxproj new file mode 100644 index 000000000..eb3a69902 --- /dev/null +++ b/framework/aregextend.vcxproj @@ -0,0 +1,94 @@ + + + + + + + + + + {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} + aregextend + aregextend + Win32Proj + + + + StaticLibrary + + + + + + + $(OutLibDir)\ + + + + IMPORT_SHARED_SYMBOLS;%(PreprocessorDefinitions) + + + + + true + true + IMPORT_SHARED_SYMBOLS;%(PreprocessorDefinitions) + + + Windows + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/framework/aregextend.vcxproj.filters b/framework/aregextend.vcxproj.filters new file mode 100644 index 000000000..7b7e05dc8 --- /dev/null +++ b/framework/aregextend.vcxproj.filters @@ -0,0 +1,145 @@ + + + + + {2C133C75-00C8-4D74-B8DC-F929EE455976} + cpp;c;cc;cxx;def;odl;idl;hpj;asm;asmx + + + {BE002776-D9B0-46FA-B0D0-07E3F27F4BDB} + h;hpp;hxx;hm;inl;inc;xsd + + + {F0F65A7F-5D02-4E30-A86E-6BD40224135E} + bat;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/framework/aregextend/CMakeLists.txt b/framework/aregextend/CMakeLists.txt new file mode 100644 index 000000000..1e7244802 --- /dev/null +++ b/framework/aregextend/CMakeLists.txt @@ -0,0 +1,16 @@ +set(extend_BASE "${AREG_BASE}/aregextend") +set(extend_SRC) + +include("${extend_BASE}/console/private/CMakeLists.txt") +include("${extend_BASE}/db/private/CMakeLists.txt") +include("${extend_BASE}/service/private/CMakeLists.txt") + +if (${AREG_DEVELOP_ENV} MATCHES "Win32") + set_source_files_properties("${extend_BASE}/resources/aregextend.rc" PROPERTIES LANGUAGE RC) + list(APPEND extend_SRC ${extend_BASE}/resources/aregextend.rc) +endif() + + +# build areg extended static library +addStaticLibEx(aregextend ${AREG_PACKAGE_NAME} "${extend_SRC}" "") +target_compile_options(aregextend PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") diff --git a/framework/extend/Readme.md b/framework/aregextend/Readme.md similarity index 66% rename from framework/extend/Readme.md rename to framework/aregextend/Readme.md index 8e59e39e7..6ff970bea 100644 --- a/framework/extend/Readme.md +++ b/framework/aregextend/Readme.md @@ -1,6 +1,6 @@ # Content -This folder contains the AREG extended library that can is compiled with or without extended features, which may require additional libraries and resources, which are considered additional and optional features. The extensions are compiled as `areg-extend` static library to link with projects that may use them. To compile project with the additional features, define `AREG_EXTENDED=1`. Otherwise, ignore or specify `AREG_EXTENDED=0`. If specify `AREG_EXTENDED=0`, the project is compiled as a static library, which can be linked, but no guarantee that all extended features will be available or will work as it is initially designed. +This folder contains the AREG extended library that can is compiled with or without extended features, which may require additional libraries and resources, which are considered additional and optional features. The extensions are compiled as `aregextend` static library to link with projects that may use them. To compile project with the additional features, define `AREG_EXTENDED=1`. Otherwise, ignore or specify `AREG_EXTENDED=0`. If specify `AREG_EXTENDED=0`, the project is compiled as a static library, which can be linked, but no guarantee that all extended features will be available or will work as it is initially designed. This project contains following folders: diff --git a/framework/extend/console/Console.hpp b/framework/aregextend/console/Console.hpp similarity index 98% rename from framework/extend/console/Console.hpp rename to framework/aregextend/console/Console.hpp index a3b36c88b..320f99c5d 100644 --- a/framework/extend/console/Console.hpp +++ b/framework/aregextend/console/Console.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_UTILITIES_CONSOLE_CONSOLE_HPP -#define AREG_UTILITIES_CONSOLE_CONSOLE_HPP +#ifndef AREG_AREGEXTEND_CONSOLE_CONSOLE_HPP +#define AREG_AREGEXTEND_CONSOLE_CONSOLE_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/console/Console.hpp + * \file aregextend/console/Console.hpp * \author Artak Avetyan * \ingroup AREG platform, Console with or without extended features ************************************************************************/ @@ -503,4 +503,4 @@ inline void Console::clearScreen( void ) const _osClearScreen(); } -#endif // AREG_UTILITIES_CONSOLE_CONSOLE_HPP +#endif // AREG_AREGEXTEND_CONSOLE_CONSOLE_HPP diff --git a/framework/extend/console/OptionParser.hpp b/framework/aregextend/console/OptionParser.hpp similarity index 99% rename from framework/extend/console/OptionParser.hpp rename to framework/aregextend/console/OptionParser.hpp index 3666d6714..60f0c9fe3 100644 --- a/framework/extend/console/OptionParser.hpp +++ b/framework/aregextend/console/OptionParser.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_UTILITIES_CONSOLE_OPTIONPARSER_HPP -#define AREG_UTILITIES_CONSOLE_OPTIONPARSER_HPP +#ifndef AREG_AREGEXTEND_CONSOLE_OPTIONPARSER_HPP +#define AREG_AREGEXTEND_CONSOLE_OPTIONPARSER_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/console/OptionParser.hpp + * \file aregextend/console/OptionParser.hpp * \author Artak Avetyan * \ingroup AREG platform, Console option parser extension. ************************************************************************/ @@ -561,4 +561,4 @@ inline const String & OptionParser::getInput(void) const return mCmdLine; } -#endif // AREG_UTILITIES_CONSOLE_OPTIONPARSER_HPP +#endif // AREG_AREGEXTEND_CONSOLE_OPTIONPARSER_HPP diff --git a/framework/extend/console/SystemServiceConsole.hpp b/framework/aregextend/console/SystemServiceConsole.hpp similarity index 97% rename from framework/extend/console/SystemServiceConsole.hpp rename to framework/aregextend/console/SystemServiceConsole.hpp index 55a62a3ee..0ce279672 100644 --- a/framework/extend/console/SystemServiceConsole.hpp +++ b/framework/aregextend/console/SystemServiceConsole.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_EXTEND_CONSOLE_SYSTEMSERVICECONSOLE_HPP -#define AREG_EXTEND_CONSOLE_SYSTEMSERVICECONSOLE_HPP +#ifndef AREG_AREGEXTEND_CONSOLE_SYSTEMSERVICECONSOLE_HPP +#define AREG_AREGEXTEND_CONSOLE_SYSTEMSERVICECONSOLE_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/console/SystemServiceConsole.hpp + * \file aregextend/console/SystemServiceConsole.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, System service console to output statistics. @@ -188,4 +188,4 @@ inline SystemServiceConsole & SystemServiceConsole::self( void ) return (*this); } -#endif // AREG_EXTEND_CONSOLE_SYSTEMSERVICECONSOLE_HPP +#endif // AREG_AREGEXTEND_CONSOLE_SYSTEMSERVICECONSOLE_HPP diff --git a/framework/extend/console/private/CMakeLists.txt b/framework/aregextend/console/private/CMakeLists.txt similarity index 100% rename from framework/extend/console/private/CMakeLists.txt rename to framework/aregextend/console/private/CMakeLists.txt diff --git a/framework/extend/console/private/Console.cpp b/framework/aregextend/console/private/Console.cpp similarity index 96% rename from framework/extend/console/private/Console.cpp rename to framework/aregextend/console/private/Console.cpp index 0842db9ac..d395b1f2a 100644 --- a/framework/extend/console/private/Console.cpp +++ b/framework/aregextend/console/private/Console.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/console/private/Console.cpp + * \file aregextend/console/private/Console.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Console extension. @@ -16,7 +16,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" ////////////////////////////////////////////////////////////////////////// // Console class implementations. diff --git a/framework/extend/console/private/OptionParser.cpp b/framework/aregextend/console/private/OptionParser.cpp similarity index 99% rename from framework/extend/console/private/OptionParser.cpp rename to framework/aregextend/console/private/OptionParser.cpp index c60e34b66..2a21b9bc6 100644 --- a/framework/extend/console/private/OptionParser.cpp +++ b/framework/aregextend/console/private/OptionParser.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/console/OptionParser.cpp + * \file aregextend/console/OptionParser.cpp * \author Artak Avetyan * \ingroup AREG platform, Console option parser extension. ************************************************************************/ @@ -15,7 +15,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/console/OptionParser.hpp" +#include "aregextend/console/OptionParser.hpp" namespace { diff --git a/framework/extend/console/private/SystemServiceConsole.cpp b/framework/aregextend/console/private/SystemServiceConsole.cpp similarity index 94% rename from framework/extend/console/private/SystemServiceConsole.cpp rename to framework/aregextend/console/private/SystemServiceConsole.cpp index 735bab9db..e731f83e0 100644 --- a/framework/extend/console/private/SystemServiceConsole.cpp +++ b/framework/aregextend/console/private/SystemServiceConsole.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/console/private/SystemServiceConsole.cpp + * \file aregextend/console/private/SystemServiceConsole.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, System service console to output statistics. @@ -16,12 +16,12 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/console/SystemServiceConsole.hpp" +#include "aregextend/console/SystemServiceConsole.hpp" #include "areg/component/ComponentThread.hpp" -#include "extend/console/Console.hpp" -#include "extend/service/DataRateHelper.hpp" -#include "extend/service/NESystemService.hpp" +#include "aregextend/console/Console.hpp" +#include "aregextend/service/DataRateHelper.hpp" +#include "aregextend/service/NESystemService.hpp" ////////////////////////////////////////////////////////////////////////// // SystemServiceConsole class implementation diff --git a/framework/extend/console/private/ansi/ConsoleAnsi.cpp b/framework/aregextend/console/private/ansi/ConsoleAnsi.cpp similarity index 98% rename from framework/extend/console/private/ansi/ConsoleAnsi.cpp rename to framework/aregextend/console/private/ansi/ConsoleAnsi.cpp index 5b552859e..8b9548f80 100644 --- a/framework/extend/console/private/ansi/ConsoleAnsi.cpp +++ b/framework/aregextend/console/private/ansi/ConsoleAnsi.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/console/private/posix/ConsolePosix.cpp + * \file aregextend/console/private/posix/ConsolePosix.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Basic OS specific console implementation @@ -17,7 +17,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #if !(AREG_EXTENDED) diff --git a/framework/extend/console/private/ncurses/ConsoleNcurses.cpp b/framework/aregextend/console/private/ncurses/ConsoleNcurses.cpp similarity index 97% rename from framework/extend/console/private/ncurses/ConsoleNcurses.cpp rename to framework/aregextend/console/private/ncurses/ConsoleNcurses.cpp index 5425afa3e..642e0d8d1 100644 --- a/framework/extend/console/private/ncurses/ConsoleNcurses.cpp +++ b/framework/aregextend/console/private/ncurses/ConsoleNcurses.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/console/private/ncurses/ConsoleNcurses.cpp + * \file aregextend/console/private/ncurses/ConsoleNcurses.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, OS specific console implementation @@ -18,7 +18,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #if defined(POSIX) && (AREG_EXTENDED) diff --git a/framework/extend/console/private/win32/ConsoleWin32.cpp b/framework/aregextend/console/private/win32/ConsoleWin32.cpp similarity index 98% rename from framework/extend/console/private/win32/ConsoleWin32.cpp rename to framework/aregextend/console/private/win32/ConsoleWin32.cpp index ac3009a3f..5e4c26329 100644 --- a/framework/extend/console/private/win32/ConsoleWin32.cpp +++ b/framework/aregextend/console/private/win32/ConsoleWin32.cpp @@ -8,7 +8,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/console/private/win32/Console.cpp + * \file aregextend/console/private/win32/Console.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Basic OS specific console implementation. @@ -19,7 +19,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #if defined(WINDOWS) && (AREG_EXTENDED) diff --git a/framework/extend/db/LogSqliteDatabase.hpp b/framework/aregextend/db/LogSqliteDatabase.hpp similarity index 98% rename from framework/extend/db/LogSqliteDatabase.hpp rename to framework/aregextend/db/LogSqliteDatabase.hpp index 3d756388d..b0183e49a 100644 --- a/framework/extend/db/LogSqliteDatabase.hpp +++ b/framework/aregextend/db/LogSqliteDatabase.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_UTILITIES_DB_LOGSQLITEDATABASE_HPP -#define AREG_UTILITIES_DB_LOGSQLITEDATABASE_HPP +#ifndef AREG_AREGEXTEND_DB_LOGSQLITEDATABASE_HPP +#define AREG_AREGEXTEND_DB_LOGSQLITEDATABASE_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/db/LogSqliteDatabase.hpp + * \file aregextend/db/LogSqliteDatabase.hpp * \author Artak Avetyan * \ingroup AREG platform, extended library, SQLite Database log file. ************************************************************************/ @@ -260,4 +260,4 @@ inline void LogSqliteDatabase::setDatabaseLoggingEnabled(bool enable) mDbLogEnabled = enable; } -#endif // AREG_UTILITIES_DB_LOGSQLITEDATABASE_HPP +#endif // AREG_AREGEXTEND_DB_LOGSQLITEDATABASE_HPP diff --git a/framework/extend/db/SqliteDatabase.hpp b/framework/aregextend/db/SqliteDatabase.hpp similarity index 96% rename from framework/extend/db/SqliteDatabase.hpp rename to framework/aregextend/db/SqliteDatabase.hpp index 3c254cc4a..8c79f7229 100644 --- a/framework/extend/db/SqliteDatabase.hpp +++ b/framework/aregextend/db/SqliteDatabase.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_UTILITIES_DB_SQLITEDATABASE_HPP -#define AREG_UTILITIES_DB_SQLITEDATABASE_HPP +#ifndef AREG_AREGEXTEND_DB_SQLITEDATABASE_HPP +#define AREG_AREGEXTEND_DB_SQLITEDATABASE_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/db/SqliteDatabase.hpp + * \file aregextend/db/SqliteDatabase.hpp * \author Artak Avetyan * \ingroup AREG platform, extended library, SQLite Database ************************************************************************/ @@ -155,4 +155,4 @@ inline const String& SqliteDatabase::getPath(void) const return mDbPath; } -#endif // AREG_UTILITIES_DB_SQLITEDATABASE_HPP +#endif // AREG_AREGEXTEND_DB_SQLITEDATABASE_HPP diff --git a/framework/extend/db/private/CMakeLists.txt b/framework/aregextend/db/private/CMakeLists.txt similarity index 100% rename from framework/extend/db/private/CMakeLists.txt rename to framework/aregextend/db/private/CMakeLists.txt diff --git a/framework/extend/db/private/LogSqliteDatabase.cpp b/framework/aregextend/db/private/LogSqliteDatabase.cpp similarity index 99% rename from framework/extend/db/private/LogSqliteDatabase.cpp rename to framework/aregextend/db/private/LogSqliteDatabase.cpp index 08eb1d13c..202d56e39 100644 --- a/framework/extend/db/private/LogSqliteDatabase.cpp +++ b/framework/aregextend/db/private/LogSqliteDatabase.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/db/private/LogSqliteDatabase.cpp + * \file aregextend/db/private/LogSqliteDatabase.cpp * \author Artak Avetyan * \ingroup AREG platform, extended library, SQLite Database log file. ************************************************************************/ @@ -15,7 +15,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/db/LogSqliteDatabase.hpp" +#include "aregextend/db/LogSqliteDatabase.hpp" #include "areg/base/DateTime.hpp" #include "areg/base/File.hpp" diff --git a/framework/extend/db/private/SqliteDatabase.cpp b/framework/aregextend/db/private/SqliteDatabase.cpp similarity index 97% rename from framework/extend/db/private/SqliteDatabase.cpp rename to framework/aregextend/db/private/SqliteDatabase.cpp index c9074b840..4b4ef9b0a 100644 --- a/framework/extend/db/private/SqliteDatabase.cpp +++ b/framework/aregextend/db/private/SqliteDatabase.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/db/private/SqliteDatabase.cpp + * \file aregextend/db/private/SqliteDatabase.cpp * \author Artak Avetyan * \ingroup AREG platform, extended library, SQLite database ************************************************************************/ @@ -15,7 +15,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/db/SqliteDatabase.hpp" +#include "aregextend/db/SqliteDatabase.hpp" #include "areg/base/File.hpp" diff --git a/framework/aregextend/resources/aregextend.rc b/framework/aregextend/resources/aregextend.rc new file mode 100644 index 000000000..ac6cbeccd Binary files /dev/null and b/framework/aregextend/resources/aregextend.rc differ diff --git a/framework/aregextend/resources/resource.h b/framework/aregextend/resources/resource.h new file mode 100644 index 000000000..09b60d198 --- /dev/null +++ b/framework/aregextend/resources/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by aregextend.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/framework/extend/service/DataRateHelper.hpp b/framework/aregextend/service/DataRateHelper.hpp similarity index 94% rename from framework/extend/service/DataRateHelper.hpp rename to framework/aregextend/service/DataRateHelper.hpp index 382916e89..425b65f97 100644 --- a/framework/extend/service/DataRateHelper.hpp +++ b/framework/aregextend/service/DataRateHelper.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_EXTEND_SERVICE_DATARATEHELPER_HPP -#define AREG_EXTEND_SERVICE_DATARATEHELPER_HPP +#ifndef AREG_AREGEXTEND_SERVICE_DATARATEHELPER_HPP +#define AREG_AREGEXTEND_SERVICE_DATARATEHELPER_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/DataRateHelper.hpp + * \file aregextend/service/DataRateHelper.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Extended features. @@ -21,8 +21,8 @@ ************************************************************************/ #include "areg/base/GEGlobal.h" -#include "extend/service/private/ServerSendThread.hpp" -#include "extend/service/private/ServerReceiveThread.hpp" +#include "aregextend/service/private/ServerSendThread.hpp" +#include "aregextend/service/private/ServerReceiveThread.hpp" /************************************************************************ * Dependencies. @@ -155,4 +155,4 @@ inline DataRateHelper::DataRate DataRateHelper::queryBytesReceivedWithLiterals(v return DataRateHelper::DataRateHelper::convertDataRateLiterals(queryBytesReceived()); } -#endif // AREG_EXTEND_SERVICE_DATARATEHELPER_HPP +#endif // AREG_AREGEXTEND_SERVICE_DATARATEHELPER_HPP diff --git a/framework/extend/service/IEServiceConnectionHandler.hpp b/framework/aregextend/service/IEServiceConnectionHandler.hpp similarity index 93% rename from framework/extend/service/IEServiceConnectionHandler.hpp rename to framework/aregextend/service/IEServiceConnectionHandler.hpp index 0bc4492e5..e721668f3 100644 --- a/framework/extend/service/IEServiceConnectionHandler.hpp +++ b/framework/aregextend/service/IEServiceConnectionHandler.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_EXTEND_SERVICE_IESERVICECONNECTIONHANDLER_HPP -#define AREG_EXTEND_SERVICE_IESERVICECONNECTIONHANDLER_HPP +#ifndef AREG_AREGEXTEND_SERVICE_IESERVICECONNECTIONHANDLER_HPP +#define AREG_AREGEXTEND_SERVICE_IESERVICECONNECTIONHANDLER_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/IEServiceConnectionHandler.hpp + * \file aregextend/service/IEServiceConnectionHandler.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Interface of service connection handler @@ -91,4 +91,4 @@ class IEServiceConnectionHandler DECLARE_NOCOPY_NOMOVE( IEServiceConnectionHandler ); }; -#endif // AREG_EXTEND_SERVICE_IESERVICECONNECTIONHANDLER_HPP +#endif // AREG_AREGEXTEND_SERVICE_IESERVICECONNECTIONHANDLER_HPP diff --git a/framework/extend/service/NESystemService.hpp b/framework/aregextend/service/NESystemService.hpp similarity index 97% rename from framework/extend/service/NESystemService.hpp rename to framework/aregextend/service/NESystemService.hpp index 923175a16..33010e94d 100644 --- a/framework/extend/service/NESystemService.hpp +++ b/framework/aregextend/service/NESystemService.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_EXTEND_SERVICE_NESYSTEMSERVICE_HPP -#define AREG_EXTEND_SERVICE_NESYSTEMSERVICE_HPP +#ifndef AREG_AREGEXTEND_SERVICE_NESYSTEMSERVICE_HPP +#define AREG_AREGEXTEND_SERVICE_NESYSTEMSERVICE_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/NESystemService.hpp + * \file aregextend/service/NESystemService.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, The system service basic settings. @@ -21,8 +21,8 @@ #include "areg/base/GEGlobal.h" #include "areg/base/NEString.hpp" -#include "extend/console/Console.hpp" -#include "extend/console/OptionParser.hpp" +#include "aregextend/console/Console.hpp" +#include "aregextend/console/OptionParser.hpp" /** * \brief The system service common data. @@ -264,4 +264,4 @@ inline void NESystemService::deleteArguments(char** argv, int argc) } } -#endif // AREG_EXTEND_SERVICE_NESYSTEMSERVICE_HPP +#endif // AREG_AREGEXTEND_SERVICE_NESYSTEMSERVICE_HPP diff --git a/framework/extend/service/ServerConnection.hpp b/framework/aregextend/service/ServerConnection.hpp similarity index 98% rename from framework/extend/service/ServerConnection.hpp rename to framework/aregextend/service/ServerConnection.hpp index 472c67143..06a7eae36 100644 --- a/framework/extend/service/ServerConnection.hpp +++ b/framework/aregextend/service/ServerConnection.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_EXTEND_SERVICE_SERVERCONNECTION_HPP -#define AREG_EXTEND_SERVICE_SERVERCONNECTION_HPP +#ifndef AREG_AREGEXTEND_SERVICE_SERVERCONNECTION_HPP +#define AREG_AREGEXTEND_SERVICE_SERVERCONNECTION_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/ServerConnection.hpp + * \file aregextend/service/ServerConnection.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, service server connection class. @@ -230,4 +230,4 @@ inline int ServerConnection::receiveMessage(RemoteMessage & out_message, const I return SocketConnectionBase::receiveMessage(out_message,getClientByCookie(clientCookie)); } -#endif // AREG_EXTEND_SERVICE_SERVERCONNECTION_HPP +#endif // AREG_AREGEXTEND_SERVICE_SERVERCONNECTION_HPP diff --git a/framework/extend/service/ServiceApplicationBase.hpp b/framework/aregextend/service/ServiceApplicationBase.hpp similarity index 97% rename from framework/extend/service/ServiceApplicationBase.hpp rename to framework/aregextend/service/ServiceApplicationBase.hpp index 268b14a7b..1cebe4d47 100644 --- a/framework/extend/service/ServiceApplicationBase.hpp +++ b/framework/aregextend/service/ServiceApplicationBase.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_EXTEND_SERVICE_SERVICEAPPLICATIONBASE_HPP -#define AREG_EXTEND_SERVICE_SERVICEAPPLICATIONBASE_HPP +#ifndef AREG_AREGEXTEND_SERVICE_SERVICEAPPLICATIONBASE_HPP +#define AREG_AREGEXTEND_SERVICE_SERVICEAPPLICATIONBASE_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/ServiceApplicationBase.hpp + * \file aregextend/service/ServiceApplicationBase.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Service application base class. @@ -19,8 +19,8 @@ * Include files. ************************************************************************/ #include "areg/base/GEGlobal.h" -#include "extend/service/SystemServiceBase.hpp" #include "areg/persist/IEConfigurationListener.hpp" +#include "aregextend/service/SystemServiceBase.hpp" /************************************************************************ * Dependencies @@ -313,4 +313,4 @@ class ServiceApplicationBase : public SystemServiceBase DECLARE_NOCOPY_NOMOVE(ServiceApplicationBase); }; -#endif // AREG_EXTEND_SERVICE_SERVICEAPPLICATIONBASE_HPP +#endif // AREG_AREGEXTEND_SERVICE_SERVICEAPPLICATIONBASE_HPP diff --git a/framework/extend/service/ServiceCommunicatonBase.hpp b/framework/aregextend/service/ServiceCommunicatonBase.hpp similarity index 98% rename from framework/extend/service/ServiceCommunicatonBase.hpp rename to framework/aregextend/service/ServiceCommunicatonBase.hpp index 389a8f97d..42999d88a 100644 --- a/framework/extend/service/ServiceCommunicatonBase.hpp +++ b/framework/aregextend/service/ServiceCommunicatonBase.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_EXTEND_SERVICE_SERVICECOMMUNICATONBASE_HPP -#define AREG_EXTEND_SERVICE_SERVICECOMMUNICATONBASE_HPP +#ifndef AREG_AREGEXTEND_SERVICE_SERVICECOMMUNICATONBASE_HPP +#define AREG_AREGEXTEND_SERVICE_SERVICECOMMUNICATONBASE_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/ServiceCommunicatonBase.hpp + * \file aregextend/service/ServiceCommunicatonBase.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Service communication base class @@ -24,16 +24,16 @@ #include "areg/ipc/IEServiceConnectionConsumer.hpp" #include "areg/ipc/IEServiceConnectionProvider.hpp" #include "areg/ipc/ServiceEventConsumerBase.hpp" -#include "extend/service/DataRateHelper.hpp" -#include "extend/service/IEServiceConnectionHandler.hpp" +#include "aregextend/service/DataRateHelper.hpp" +#include "aregextend/service/IEServiceConnectionHandler.hpp" #include "areg/base/TEMap.hpp" #include "areg/base/SynchObjects.hpp" #include "areg/component/Timer.hpp" #include "areg/ipc/NERemoteService.hpp" -#include "extend/service/ServerConnection.hpp" -#include "extend/service/private/ServerReceiveThread.hpp" -#include "extend/service/private/ServerSendThread.hpp" +#include "aregextend/service/ServerConnection.hpp" +#include "aregextend/service/private/ServerReceiveThread.hpp" +#include "aregextend/service/private/ServerSendThread.hpp" /************************************************************************ * Dependencies @@ -618,4 +618,4 @@ inline void ServiceCommunicatonBase::disconnectService( Event::eEventPriority ev , eventPrio ); } -#endif // AREG_EXTEND_SERVICE_SERVICECOMMUNICATONBASE_HPP +#endif // AREG_AREGEXTEND_SERVICE_SERVICECOMMUNICATONBASE_HPP diff --git a/framework/extend/service/SystemServiceBase.hpp b/framework/aregextend/service/SystemServiceBase.hpp similarity index 97% rename from framework/extend/service/SystemServiceBase.hpp rename to framework/aregextend/service/SystemServiceBase.hpp index a8acc4fc6..d6599bd52 100644 --- a/framework/extend/service/SystemServiceBase.hpp +++ b/framework/aregextend/service/SystemServiceBase.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_EXTEND_SERVICE_SYSTEMSERVICEBASE_HPP -#define AREG_EXTEND_SERVICE_SYSTEMSERVICEBASE_HPP +#ifndef AREG_AREGEXTEND_SERVICE_SYSTEMSERVICEBASE_HPP +#define AREG_AREGEXTEND_SERVICE_SYSTEMSERVICEBASE_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/SystemServiceBase.hpp + * \file aregextend/service/SystemServiceBase.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, base class to create system services. @@ -20,8 +20,8 @@ ************************************************************************/ #include "areg/base/GEGlobal.h" -#include "extend/service/NESystemService.hpp" -#include "extend/service/ServiceCommunicatonBase.hpp" +#include "aregextend/service/NESystemService.hpp" +#include "aregextend/service/ServiceCommunicatonBase.hpp" /************************************************************************ * Dependencies @@ -364,4 +364,4 @@ inline void SystemServiceBase::setCurrentOption( NESystemService::eServiceOption mSystemServiceOption = optService; } -#endif // AREG_EXTEND_SERVICE_SYSTEMSERVICEBASE_HPP +#endif // AREG_AREGEXTEND_SERVICE_SYSTEMSERVICEBASE_HPP diff --git a/framework/extend/service/private/CMakeLists.txt b/framework/aregextend/service/private/CMakeLists.txt similarity index 100% rename from framework/extend/service/private/CMakeLists.txt rename to framework/aregextend/service/private/CMakeLists.txt diff --git a/framework/extend/service/private/DataRateHelper.cpp b/framework/aregextend/service/private/DataRateHelper.cpp similarity index 95% rename from framework/extend/service/private/DataRateHelper.cpp rename to framework/aregextend/service/private/DataRateHelper.cpp index b1a5c3af9..efe5cc8e5 100644 --- a/framework/extend/service/private/DataRateHelper.cpp +++ b/framework/aregextend/service/private/DataRateHelper.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/DataRateHelper.cpp + * \file aregextend/service/private/DataRateHelper.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Extended features. @@ -17,7 +17,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/service/DataRateHelper.hpp" +#include "aregextend/service/DataRateHelper.hpp" ////////////////////////////////////////////////////////////////////////// // DataRateHelper class implementation diff --git a/framework/extend/service/private/IEServiceConnectionHandler.cpp b/framework/aregextend/service/private/IEServiceConnectionHandler.cpp similarity index 85% rename from framework/extend/service/private/IEServiceConnectionHandler.cpp rename to framework/aregextend/service/private/IEServiceConnectionHandler.cpp index d2712c39d..8a23df1b7 100644 --- a/framework/extend/service/private/IEServiceConnectionHandler.cpp +++ b/framework/aregextend/service/private/IEServiceConnectionHandler.cpp @@ -7,9 +7,9 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/IEServiceConnectionHandler.cpp + * \file aregextend/service/private/IEServiceConnectionHandler.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Interface of service connection handler ************************************************************************/ -#include "extend/service/IEServiceConnectionHandler.hpp" +#include "aregextend/service/IEServiceConnectionHandler.hpp" diff --git a/framework/extend/service/private/NESystemService.cpp b/framework/aregextend/service/private/NESystemService.cpp similarity index 87% rename from framework/extend/service/private/NESystemService.cpp rename to framework/aregextend/service/private/NESystemService.cpp index 2f870ae6c..657f0b6ca 100644 --- a/framework/extend/service/private/NESystemService.cpp +++ b/framework/aregextend/service/private/NESystemService.cpp @@ -7,9 +7,9 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/NESystemService.cpp + * \file aregextend/service/private/NESystemService.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, The system service basic settings. ************************************************************************/ -#include "extend/service/NESystemService.hpp" +#include "aregextend/service/NESystemService.hpp" diff --git a/framework/extend/service/private/ServerConnection.cpp b/framework/aregextend/service/private/ServerConnection.cpp similarity index 96% rename from framework/extend/service/private/ServerConnection.cpp rename to framework/aregextend/service/private/ServerConnection.cpp index 5809e4694..74eaa8e0c 100644 --- a/framework/extend/service/private/ServerConnection.cpp +++ b/framework/aregextend/service/private/ServerConnection.cpp @@ -7,12 +7,12 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/ServerConnection.cpp + * \file aregextend/service/private/ServerConnection.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, service server connection class. ************************************************************************/ -#include "extend/service/ServerConnection.hpp" +#include "aregextend/service/ServerConnection.hpp" #include "areg/ipc/NERemoteService.hpp" #include "areg/component/NEService.hpp" #include "areg/base/RemoteMessage.hpp" diff --git a/framework/extend/service/private/ServerReceiveThread.cpp b/framework/aregextend/service/private/ServerReceiveThread.cpp similarity index 95% rename from framework/extend/service/private/ServerReceiveThread.cpp rename to framework/aregextend/service/private/ServerReceiveThread.cpp index d178abe6a..64d55d18a 100644 --- a/framework/extend/service/private/ServerReceiveThread.cpp +++ b/framework/aregextend/service/private/ServerReceiveThread.cpp @@ -7,12 +7,12 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/ServerReceiveThread.cpp + * \file aregextend/service/private/ServerReceiveThread.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Service connectivity server receive message Thread ************************************************************************/ -#include "extend/service/private/ServerReceiveThread.hpp" +#include "aregextend/service/private/ServerReceiveThread.hpp" #include "areg/base/RemoteMessage.hpp" #include "areg/base/SocketAccepted.hpp" @@ -20,11 +20,11 @@ #include "areg/ipc/IERemoteMessageHandler.hpp" #include "areg/trace/GETrace.h" -#include "extend/service/IEServiceConnectionHandler.hpp" -#include "extend/service/ServerConnection.hpp" +#include "aregextend/service/IEServiceConnectionHandler.hpp" +#include "aregextend/service/ServerConnection.hpp" -DEF_TRACE_SCOPE(areg_extend_service_ServerReceiveThread_runDispatcher); +DEF_TRACE_SCOPE(areg_aregextend_service_ServerReceiveThread_runDispatcher); ServerReceiveThread::ServerReceiveThread( IEServiceConnectionHandler & connectHandler, IERemoteMessageHandler & remoteService, ServerConnection & connection ) : DispatcherThread ( NEConnection::SERVER_RECEIVE_MESSAGE_THREAD ) @@ -38,7 +38,7 @@ ServerReceiveThread::ServerReceiveThread( IEServiceConnectionHandler & connectHa bool ServerReceiveThread::runDispatcher(void) { - TRACE_SCOPE( areg_extend_service_ServerReceiveThread_runDispatcher ); + TRACE_SCOPE( areg_aregextend_service_ServerReceiveThread_runDispatcher ); TRACE_DBG("Starting dispatcher [ %s ]", getName().getString()); readyForEvents(true); diff --git a/framework/extend/service/private/ServerReceiveThread.hpp b/framework/aregextend/service/private/ServerReceiveThread.hpp similarity index 95% rename from framework/extend/service/private/ServerReceiveThread.hpp rename to framework/aregextend/service/private/ServerReceiveThread.hpp index 1b075bf80..9bee55104 100644 --- a/framework/extend/service/private/ServerReceiveThread.hpp +++ b/framework/aregextend/service/private/ServerReceiveThread.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_EXTEND_SERVICE_PRIVATE_SERVERRECEIVETHREAD_HPP -#define AREG_EXTEND_SERVICE_PRIVATE_SERVERRECEIVETHREAD_HPP +#ifndef AREG_AREGEXTEND_SERVICE_PRIVATE_SERVERRECEIVETHREAD_HPP +#define AREG_AREGEXTEND_SERVICE_PRIVATE_SERVERRECEIVETHREAD_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/ServerReceiveThread.hpp + * \file aregextend/service/private/ServerReceiveThread.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Service connectivity server receive message Thread @@ -149,4 +149,4 @@ inline bool ServerReceiveThread::isCalculateDataEnabled(void) const return mSaveDataReceive; } -#endif // AREG_EXTEND_SERVICE_PRIVATE_SERVERRECEIVETHREAD_HPP +#endif // AREG_AREGEXTEND_SERVICE_PRIVATE_SERVERRECEIVETHREAD_HPP diff --git a/framework/extend/service/private/ServerSendThread.cpp b/framework/aregextend/service/private/ServerSendThread.cpp similarity index 92% rename from framework/extend/service/private/ServerSendThread.cpp rename to framework/aregextend/service/private/ServerSendThread.cpp index 265abaef5..31e7a4494 100644 --- a/framework/extend/service/private/ServerSendThread.cpp +++ b/framework/aregextend/service/private/ServerSendThread.cpp @@ -7,21 +7,21 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/ServerSendThread.cpp + * \file aregextend/service/private/ServerSendThread.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Service connectivity server send message thread ************************************************************************/ -#include "extend/service/private/ServerSendThread.hpp" +#include "aregextend/service/private/ServerSendThread.hpp" #include "areg/component/NEService.hpp" #include "areg/ipc/private/NEConnection.hpp" #include "areg/ipc/IERemoteMessageHandler.hpp" #include "areg/trace/GETrace.h" -#include "extend/service/ServerConnection.hpp" +#include "aregextend/service/ServerConnection.hpp" -DEF_TRACE_SCOPE(areg_extend_service_ServerSendThread_processEvent); +DEF_TRACE_SCOPE(areg_aregextend_service_ServerSendThread_processEvent); ServerSendThread::ServerSendThread(IERemoteMessageHandler& remoteService, ServerConnection & connection) : DispatcherThread ( NEConnection::SERVER_SEND_MESSAGE_THREAD ) @@ -51,7 +51,7 @@ void ServerSendThread::readyForEvents( bool isReady ) void ServerSendThread::processEvent( const SendMessageEventData & data ) { - TRACE_SCOPE( areg_extend_service_ServerSendThread_processEvent ); + TRACE_SCOPE( areg_aregextend_service_ServerSendThread_processEvent ); if (data.isForwardMessage()) { const RemoteMessage & msgSend = data.getRemoteMessage( ); diff --git a/framework/extend/service/private/ServerSendThread.hpp b/framework/aregextend/service/private/ServerSendThread.hpp similarity index 96% rename from framework/extend/service/private/ServerSendThread.hpp rename to framework/aregextend/service/private/ServerSendThread.hpp index 2d76c5bf7..3745d8611 100644 --- a/framework/extend/service/private/ServerSendThread.hpp +++ b/framework/aregextend/service/private/ServerSendThread.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_EXTEND_SERVICE_PRIVATE_SERVERSENDTHREAD_HPP -#define AREG_EXTEND_SERVICE_PRIVATE_SERVERSENDTHREAD_HPP +#ifndef AREG_AREGEXTEND_SERVICE_PRIVATE_SERVERSENDTHREAD_HPP +#define AREG_AREGEXTEND_SERVICE_PRIVATE_SERVERSENDTHREAD_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/ServerSendThread.hpp + * \file aregextend/service/private/ServerSendThread.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Service connectivity server send message thread @@ -169,4 +169,4 @@ inline bool ServerSendThread::isCalculateDataEnabled(void) const return mSaveDataSend; } -#endif // AREG_EXTEND_SERVICE_PRIVATE_SERVERSENDTHREAD_HPP +#endif // AREG_AREGEXTEND_SERVICE_PRIVATE_SERVERSENDTHREAD_HPP diff --git a/framework/extend/service/private/ServiceApplicationBase.cpp b/framework/aregextend/service/private/ServiceApplicationBase.cpp similarity index 87% rename from framework/extend/service/private/ServiceApplicationBase.cpp rename to framework/aregextend/service/private/ServiceApplicationBase.cpp index d6f9f673f..12755f246 100644 --- a/framework/extend/service/private/ServiceApplicationBase.cpp +++ b/framework/aregextend/service/private/ServiceApplicationBase.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/ServiceApplicationBase.cpp + * \file aregextend/service/private/ServiceApplicationBase.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Service application base class. @@ -16,18 +16,18 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/service/ServiceApplicationBase.hpp" +#include "aregextend/service/ServiceApplicationBase.hpp" -#include "extend/service/ServiceCommunicatonBase.hpp" +#include "aregextend/service/ServiceCommunicatonBase.hpp" #include "areg/appbase/Application.hpp" #include "areg/appbase/NEApplication.hpp" #include "areg/trace/GETrace.h" -DEF_TRACE_SCOPE(areg_extend_service_ServiceApplicationBase_serviceStart); -DEF_TRACE_SCOPE(areg_extend_service_ServiceApplicationBase_servicePause); -DEF_TRACE_SCOPE(areg_extend_service_ServiceApplicationBase_serviceContinue); -DEF_TRACE_SCOPE(areg_extend_service_ServiceApplicationBase_serviceStop); -DEF_TRACE_SCOPE(areg_extend_service_ServiceApplicationBase_setState); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceApplicationBase_serviceStart); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceApplicationBase_servicePause); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceApplicationBase_serviceContinue); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceApplicationBase_serviceStop); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceApplicationBase_setState); ServiceApplicationBase::ServiceApplicationBase(ServiceCommunicatonBase& commBase) : SystemServiceBase ( commBase ) @@ -124,7 +124,7 @@ bool ServiceApplicationBase::serviceOpen(void) bool ServiceApplicationBase::serviceStart(void) { - TRACE_SCOPE(areg_extend_service_ServiceApplicationBase_serviceStart); + TRACE_SCOPE(areg_aregextend_service_ServiceApplicationBase_serviceStart); TRACE_DBG("Starting [ %s ] system service", getServiceNameA()); bool result{ false }; NERemoteService::eRemoteServices serviceType = getServiceType(); @@ -147,7 +147,7 @@ bool ServiceApplicationBase::serviceStart(void) void ServiceApplicationBase::servicePause(void) { - TRACE_SCOPE(areg_extend_service_ServiceApplicationBase_servicePause); + TRACE_SCOPE(areg_aregextend_service_ServiceApplicationBase_servicePause); TRACE_DBG("Pausing [ %s ] system service", getServiceNameA()); setState(NESystemService::eSystemServiceState::ServicePausing); @@ -158,7 +158,7 @@ void ServiceApplicationBase::servicePause(void) bool ServiceApplicationBase::serviceContinue(void) { - TRACE_SCOPE(areg_extend_service_ServiceApplicationBase_serviceContinue); + TRACE_SCOPE(areg_aregextend_service_ServiceApplicationBase_serviceContinue); TRACE_DBG("Resume and continuing paused [ %s ] system service", getServiceNameA()); bool result = false; @@ -179,7 +179,7 @@ bool ServiceApplicationBase::serviceContinue(void) void ServiceApplicationBase::serviceStop(void) { - TRACE_SCOPE(areg_extend_service_ServiceApplicationBase_serviceStop); + TRACE_SCOPE(areg_aregextend_service_ServiceApplicationBase_serviceStop); TRACE_WARN("Stopping [ %s ] system service", getServiceNameA()); setState(NESystemService::eSystemServiceState::ServiceStopping); mCommunication.disconnectServiceHost(); @@ -194,7 +194,7 @@ void ServiceApplicationBase::serviceShutdown(void) bool ServiceApplicationBase::setState(NESystemService::eSystemServiceState newState) { - TRACE_SCOPE(areg_extend_service_ServiceApplicationBase_setState); + TRACE_SCOPE(areg_aregextend_service_ServiceApplicationBase_setState); TRACE_DBG( "Changing [ %s ] system service state. Old state [ %s ], new state [ %s ]" , getServiceNameA() , NESystemService::getString( mSystemServiceState ) diff --git a/framework/extend/service/private/ServiceCommunicatonBase.cpp b/framework/aregextend/service/private/ServiceCommunicatonBase.cpp similarity index 87% rename from framework/extend/service/private/ServiceCommunicatonBase.cpp rename to framework/aregextend/service/private/ServiceCommunicatonBase.cpp index 1680286bc..4809292c7 100644 --- a/framework/extend/service/private/ServiceCommunicatonBase.cpp +++ b/framework/aregextend/service/private/ServiceCommunicatonBase.cpp @@ -7,12 +7,12 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/ServiceCommunicatonBase.cpp + * \file aregextend/service/private/ServiceCommunicatonBase.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Service communication base class ************************************************************************/ -#include "extend/service/ServiceCommunicatonBase.hpp" +#include "aregextend/service/ServiceCommunicatonBase.hpp" #include "areg/base/DateTime.hpp" #include "areg/ipc/NERemoteService.hpp" @@ -20,25 +20,25 @@ #include "areg/ipc/private/NEConnection.hpp" #include "areg/trace/GETrace.h" -#include "extend/service/NESystemService.hpp" +#include "aregextend/service/NESystemService.hpp" -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_connectServiceHost); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_reconnectServiceHost); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_disconnectServiceHost); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_connectionLost); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_processReceivedMessage); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_connectServiceHost); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_reconnectServiceHost); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_disconnectServiceHost); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_connectionLost); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_processReceivedMessage); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_onServiceStart); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_onServiceStop); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_onServiceRestart); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_onServiceExit); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_onServiceStart); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_onServiceStop); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_onServiceRestart); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_onServiceExit); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_startConnection); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_restartConnection); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_stopConnection); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_startConnection); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_restartConnection); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_stopConnection); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_failedSendMessage); -DEF_TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_failedReceiveMessage); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_failedSendMessage); +DEF_TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_failedReceiveMessage); ////////////////////////////////////////////////////////////////////////// // ServiceCommunicatonBase class implementation @@ -119,7 +119,7 @@ void ServiceCommunicatonBase::applyServiceConnectionData(const String & hostName bool ServiceCommunicatonBase::connectServiceHost(void) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_connectServiceHost); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_connectServiceHost); Lock lock(mLock); @@ -145,7 +145,7 @@ bool ServiceCommunicatonBase::connectServiceHost(void) bool ServiceCommunicatonBase::reconnectServiceHost(void) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_reconnectServiceHost); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_reconnectServiceHost); Lock lock(mLock); bool result = true; @@ -169,7 +169,7 @@ bool ServiceCommunicatonBase::reconnectServiceHost(void) void ServiceCommunicatonBase::disconnectServiceHost(void) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_disconnectServiceHost); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_disconnectServiceHost); if ( isRunning() ) { sendCommand( ServiceEventData::eServiceEventCommands::CMD_ServiceExit, Event::eEventPriority::EventPriorityHigh ); @@ -206,7 +206,7 @@ bool ServiceCommunicatonBase::canAcceptConnection(const SocketAccepted & clientS void ServiceCommunicatonBase::connectionLost( SocketAccepted & clientSocket ) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_connectionLost); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_connectionLost); const ITEM_ID & cookie { mServerConnection.getCookie(clientSocket) }; const ITEM_ID & channel{ mServerConnection.getChannelId() }; @@ -247,7 +247,7 @@ void ServiceCommunicatonBase::onServiceReconnectTimerExpired( void ) void ServiceCommunicatonBase::onServiceStart(void) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_onServiceStart); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_onServiceStart); Lock lock( mLock ); mEventSendStop.resetEvent(); startConnection(); @@ -255,7 +255,7 @@ void ServiceCommunicatonBase::onServiceStart(void) void ServiceCommunicatonBase::onServiceStop(void) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_onServiceStop); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_onServiceStop); do { @@ -268,13 +268,13 @@ void ServiceCommunicatonBase::onServiceStop(void) void ServiceCommunicatonBase::onServiceRestart( void ) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_onServiceRestart); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_onServiceRestart); restartConnection(); } void ServiceCommunicatonBase::onServiceExit( void ) { - TRACE_SCOPE( areg_extend_service_ServiceCommunicatonBase_onServiceExit ); + TRACE_SCOPE( areg_aregextend_service_ServiceCommunicatonBase_onServiceExit ); onServiceStop( ); triggerExit( ); } @@ -285,7 +285,7 @@ void ServiceCommunicatonBase::onChannelConnected(const ITEM_ID& /*cookie*/) bool ServiceCommunicatonBase::startConnection(void) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_startConnection); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_startConnection); TRACE_DBG("Going to start connection. Address [ %s ], port [ %d ]" , mServerConnection.getAddress().getHostAddress().getString() , mServerConnection.getAddress().getHostPort()); @@ -329,7 +329,7 @@ bool ServiceCommunicatonBase::startConnection(void) bool ServiceCommunicatonBase::restartConnection( void ) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_restartConnection); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_restartConnection); TRACE_DBG("Going to start connection. Address [ %s ], port [ %d ]" , mServerConnection.getAddress().getHostAddress().getString() , mServerConnection.getAddress().getHostPort()); @@ -340,7 +340,7 @@ bool ServiceCommunicatonBase::restartConnection( void ) void ServiceCommunicatonBase::stopConnection(void) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_stopConnection); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_stopConnection); TRACE_WARN("Stopping remote servicing connection"); mThreadReceive.triggerExit(); @@ -370,7 +370,7 @@ bool ServiceCommunicatonBase::startReceiveThread( void ) void ServiceCommunicatonBase::failedSendMessage(const RemoteMessage & msgFailed, Socket & whichTarget ) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_failedSendMessage); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_failedSendMessage); #ifdef DEBUG @@ -392,7 +392,7 @@ void ServiceCommunicatonBase::failedSendMessage(const RemoteMessage & msgFailed, void ServiceCommunicatonBase::failedReceiveMessage(Socket & whichSource) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_failedReceiveMessage); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_failedReceiveMessage); SocketAccepted client = mServerConnection.getClientByHandle(whichSource.getHandle()); TRACE_WARN("Failed to receive message from [ %s ] client [ %d ], probably the connection with socket [ %d ] is lost, closing connection" @@ -408,7 +408,7 @@ void ServiceCommunicatonBase::failedReceiveMessage(Socket & whichSource) void ServiceCommunicatonBase::processReceivedMessage(const RemoteMessage & msgReceived, Socket & whichSource) { - TRACE_SCOPE(areg_extend_service_ServiceCommunicatonBase_processReceivedMessage); + TRACE_SCOPE(areg_aregextend_service_ServiceCommunicatonBase_processReceivedMessage); if ( msgReceived.isValid() ) { const ITEM_ID & cookie = mServerConnection.getCookie(whichSource.getHandle()); diff --git a/framework/extend/service/private/SystemServiceBase.cpp b/framework/aregextend/service/private/SystemServiceBase.cpp similarity index 97% rename from framework/extend/service/private/SystemServiceBase.cpp rename to framework/aregextend/service/private/SystemServiceBase.cpp index 43dde36d9..c7fdcec96 100644 --- a/framework/extend/service/private/SystemServiceBase.cpp +++ b/framework/aregextend/service/private/SystemServiceBase.cpp @@ -7,15 +7,15 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/SystemServiceBase.cpp + * \file aregextend/service/private/SystemServiceBase.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, base class to create system services. ************************************************************************/ -#include "extend/service/SystemServiceBase.hpp" +#include "aregextend/service/SystemServiceBase.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" ////////////////////////////////////////////////////////////////////////// diff --git a/framework/extend/service/private/posix/ServiceApplicationBasePosix.cpp b/framework/aregextend/service/private/posix/ServiceApplicationBasePosix.cpp similarity index 95% rename from framework/extend/service/private/posix/ServiceApplicationBasePosix.cpp rename to framework/aregextend/service/private/posix/ServiceApplicationBasePosix.cpp index 2e1e992d3..f50bd6248 100644 --- a/framework/extend/service/private/posix/ServiceApplicationBasePosix.cpp +++ b/framework/aregextend/service/private/posix/ServiceApplicationBasePosix.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/ServiceApplicationBasePosix.cpp + * \file aregextend/service/private/ServiceApplicationBasePosix.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Service application base class. @@ -17,7 +17,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/service/ServiceApplicationBase.hpp" +#include "aregextend/service/ServiceApplicationBase.hpp" #ifdef _POSIX diff --git a/framework/extend/service/private/win32/ServiceApplicationBaseWin32.cpp b/framework/aregextend/service/private/win32/ServiceApplicationBaseWin32.cpp similarity index 98% rename from framework/extend/service/private/win32/ServiceApplicationBaseWin32.cpp rename to framework/aregextend/service/private/win32/ServiceApplicationBaseWin32.cpp index 06c666b4d..21a9b478f 100644 --- a/framework/extend/service/private/win32/ServiceApplicationBaseWin32.cpp +++ b/framework/aregextend/service/private/win32/ServiceApplicationBaseWin32.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file extend/service/private/ServiceApplicationBaseWin32.cpp + * \file aregextend/service/private/ServiceApplicationBaseWin32.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Service application base class. @@ -17,7 +17,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "extend/service/ServiceApplicationBase.hpp" +#include "aregextend/service/ServiceApplicationBase.hpp" #ifdef WINDOWS diff --git a/framework/logobserverapi.vcxproj b/framework/areglogger.vcxproj similarity index 61% rename from framework/logobserverapi.vcxproj rename to framework/areglogger.vcxproj index ee89b68f0..bb5ac65e8 100644 --- a/framework/logobserverapi.vcxproj +++ b/framework/areglogger.vcxproj @@ -8,8 +8,8 @@ {B29F438E-904C-4929-903C-F4673182A417} - logobserverapi - logobserverapi + areglogger + areglogger Win32Proj @@ -21,7 +21,7 @@ - $(ProjectCommonDefines);_USRDLL;IMP_AREG_DLL;EXP_LOGOBSERVER_DLL;%(PreprocessorDefinitions) + $(ProjectCommonDefines);_USRDLL;IMP_AREG_DLL;EXP_LOGGER_DLL;%(PreprocessorDefinitions) Windows @@ -34,23 +34,27 @@ - + + + + + - - - - + + + - - - + + + - - - + + + + diff --git a/framework/logobserverapi.vcxproj.filters b/framework/areglogger.vcxproj.filters similarity index 55% rename from framework/logobserverapi.vcxproj.filters rename to framework/areglogger.vcxproj.filters index e9a54bf98..8a7fa2dc3 100644 --- a/framework/logobserverapi.vcxproj.filters +++ b/framework/areglogger.vcxproj.filters @@ -15,38 +15,50 @@ - - Source Files - - - - + + Header Files + + Header Files - + Header Files - + Header Files - + Header Files - + Source Files - + Source Files - + Source Files - - - + + Resource Files + + + Resource Files + + + + + + Source Files + + + + + Resource Files + \ No newline at end of file diff --git a/framework/areglogger/CMakeLists.txt b/framework/areglogger/CMakeLists.txt new file mode 100644 index 000000000..a28208906 --- /dev/null +++ b/framework/areglogger/CMakeLists.txt @@ -0,0 +1,49 @@ +set(areglogger_BASE "${AREG_BASE}/areglogger") +set(areglogger_SRC) + +include("${areglogger_BASE}/client/private/CMakeLists.txt") + +# add .rc file to the list of sources +if("${AREG_DEVELOP_ENV}" STREQUAL "Win32") + set_source_files_properties("${areglogger_BASE}/resources/areglogger.rc" PROPERTIES LANGUAGE RC) + list(APPEND areglogger_SRC ${areglogger_BASE}/resources/areglogger.rc) +endif() + +# ################################################################## +# build log observer API library +# ################################################################## +if (AREG_LOGGER_LIB MATCHES "shared") + + # add .def file to the list of sources + if("${AREG_DEVELOP_ENV}" STREQUAL "Win32") + list(APPEND areglogger_SRC ${areglogger_BASE}/resources/areglogger.def) + endif() + + # build log observer API shared library + addSharedLibEx(areglogger ${AREG_PACKAGE_NAME} "${areglogger_SRC}" ${AREG_SQLITE_LIB_REF}) + target_compile_options(areglogger PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") + + if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") + target_compile_options(areglogger PRIVATE -fPIC) + endif() + + # log observer API shared library + target_compile_definitions(areglogger PRIVATE EXP_LOGGER_DLL) + + # add MSVC linker option + if (MSVC) + target_link_options(areglogger PRIVATE "/DEF:${areglogger_BASE}/resources/logobserver.def") + endif() + +else() + # build log observer API static library + addStaticLibEx(areglogger ${AREG_PACKAGE_NAME} "${areglogger_SRC}" "") + target_compile_options(areglogger PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") + + if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") + target_compile_options(areglogger PRIVATE -fPIC) + endif() + # log observer API static library + target_compile_definitions(areglogger PRIVATE EXP_LOGGER_LIB) + +endif(AREG_LOGGER_LIB MATCHES "shared") diff --git a/framework/logobserver/lib/LogObserverApi.h b/framework/areglogger/client/LogObserverApi.h similarity index 93% rename from framework/logobserver/lib/LogObserverApi.h rename to framework/areglogger/client/LogObserverApi.h index a8ad37f6f..df2417537 100644 --- a/framework/logobserver/lib/LogObserverApi.h +++ b/framework/areglogger/client/LogObserverApi.h @@ -1,5 +1,5 @@ -#ifndef AREG_LOGOBSERVER_LIB_LOGOBSERVERAPI_H -#define AREG_LOGOBSERVER_LIB_LOGOBSERVERAPI_H +#ifndef AREG_AREGLOGGER_CLIENT_LOGOBSERVERAPI_H +#define AREG_AREGLOGGER_CLIENT_LOGOBSERVERAPI_H /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file logobserver/lib/LogObserverApi.h + * \file areglogger/client/LogObserverApi.h * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Log Observer library API. @@ -19,7 +19,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "logobserver/lib/LogObserverSwitches.h" +#include "areglogger/client/LogObserverSwitches.h" /** * \brief The message source is a client application. @@ -298,14 +298,14 @@ struct sObserverEvents * If NULL, it uses the default location of the config file './config/areg.init' * \returns Returns true, if succeeded to initialize internals. Otherwise, returns false. **/ -LOGOBSERVER_API bool logObserverInitialize(const sObserverEvents * callbacks, const char * configFilePath /* = NULL */); +LOGGER_API bool logObserverInitialize(const sObserverEvents * callbacks, const char * configFilePath /* = NULL */); /** * \brief Call to release the log observer internals and release resources. This function should * be called at the end of application run. Once the observer is uninitialized, it will be * not possible to use any other API and trigger remote methods. **/ -LOGOBSERVER_API void logObserverRelease(); +LOGGER_API void logObserverRelease(); /** * \brief Call to trigger TCP/IP connection with the logger service. Either specify the IP address and the port number @@ -321,13 +321,13 @@ LOGOBSERVER_API void logObserverRelease(); * \note The 'ipAddress' and 'portNr' parameters should be either both valid or they are ignored and the default values * indicated in the configuration file are used. **/ -LOGOBSERVER_API bool logObserverConnectLogger(const char * dbPath /* = NULL */, const char* ipAddress /* = NULL */, uint16_t portNr /* = NULL */); +LOGGER_API bool logObserverConnectLogger(const char * dbPath /* = NULL */, const char* ipAddress /* = NULL */, uint16_t portNr /* = NULL */); /** * \brief Call to trigger disconnect from logger service. * After disconnecting the callback of FuncServiceConnected type is triggered. **/ -LOGOBSERVER_API void logObserverDisconnectLogger(); +LOGGER_API void logObserverDisconnectLogger(); /** * \brief Call to start paused log observer. By default, when log observer is connected, it is in started state. @@ -336,49 +336,49 @@ LOGOBSERVER_API void logObserverDisconnectLogger(); * \param doPause The flag to set to indicate whether the log observer should pause or resume writing logs. * \return Returns true if processed with success. Otherwise, returns false. **/ -LOGOBSERVER_API bool logObserverPauseLogging(bool doPause); +LOGGER_API bool logObserverPauseLogging(bool doPause); /** * \brief Call to get the current state of the log observer. **/ -LOGOBSERVER_API eObserverStates logObserverCurrentState(); +LOGGER_API eObserverStates logObserverCurrentState(); /** * \brief Returns true if log observer is initialized and the logger service connection is triggered. * Otherwise, it returns false. * The method does not indicate whether the observer is connected to the logger service or not. **/ -LOGOBSERVER_API bool logObserverIsInitialized(); +LOGGER_API bool logObserverIsInitialized(); /** * \brief Returns true if log observer is initialize and connected to the logger service. * Otherwise, it returns false. **/ -LOGOBSERVER_API bool logObserverIsConnected(); +LOGGER_API bool logObserverIsConnected(); /** * \brief Returns true, if log observer is initialized, connected, receives and writes or forwards logs. * In all other cases it returns false. **/ -LOGOBSERVER_API bool logObserverIsStarted(); +LOGGER_API bool logObserverIsStarted(); /** * \brief Returns the current IP address of the logger service to connect. * Returns empty string, if not configured or the IP address is unknown **/ -LOGOBSERVER_API const char * logObserverLoggerAddress(); +LOGGER_API const char * logObserverLoggerAddress(); /** * \brief Returns the current IP port of the logger service to connect. * Return 0 (invalid port), if not configured or the port number is unknown **/ -LOGOBSERVER_API uint16_t logObserverLoggerPort(); +LOGGER_API uint16_t logObserverLoggerPort(); /** * \brief Return true if logger TCP/IP connection is enabled in the configuration file. * Otherwise, returns false. **/ -LOGOBSERVER_API bool logObserverConfigLoggerEnabled(); +LOGGER_API bool logObserverConfigLoggerEnabled(); /** * \brief On exit, the addrBuffer contains the IP address of the logger registered in the configuration file. @@ -387,21 +387,21 @@ LOGOBSERVER_API bool logObserverConfigLoggerEnabled(); * \return Returns true, if succeeds to write the address. Returns false, if the log observer is not configured, * or the address is not specified in the configuration, or the buffer is not big enough to write address. **/ -LOGOBSERVER_API bool logObserverConfigLoggerAddress(char * addrBuffer, uint32_t space); +LOGGER_API bool logObserverConfigLoggerAddress(char * addrBuffer, uint32_t space); /** * \brief Returns the configured IP port of the logger service to connect, * i.e. the IP port saved in configuration file. Returns 0 (invalid port), * if the log observer is not configured or the port number is not specified in configuration. **/ -LOGOBSERVER_API unsigned short logObserverConfigLoggerPort(); +LOGGER_API unsigned short logObserverConfigLoggerPort(); /** * \brief Call to request the list of connected instances. * The callback of FuncLogInstances type is triggered when receive the list of connected instances. * \return Returns true if processed with success. Otherwise, returns false. **/ -LOGOBSERVER_API bool logObserverRequestInstances(); +LOGGER_API bool logObserverRequestInstances(); /** * \brief Call to receive the list of registered scopes of the specified connected instance. @@ -410,7 +410,7 @@ LOGOBSERVER_API bool logObserverRequestInstances(); * Otherwise, should be indicated the valid cookie ID of the connected log instance. * \return Returns true if processed with success. Otherwise, returns false. **/ -LOGOBSERVER_API bool logObserverRequestScopes(ITEM_ID target); +LOGGER_API bool logObserverRequestScopes(ITEM_ID target); /** * \brief Call to update the priority of the logging message to receive. @@ -423,7 +423,7 @@ LOGOBSERVER_API bool logObserverRequestScopes(ITEM_ID target); * \param count The number of scope entries in the list. * \return Returns true if processed with success. Otherwise, returns false. **/ -LOGOBSERVER_API bool logObserverRequestChangeScopePrio(ITEM_ID target, const sLogScope* scopes, uint32_t count); +LOGGER_API bool logObserverRequestChangeScopePrio(ITEM_ID target, const sLogScope* scopes, uint32_t count); /** * \brief Call to save current configuration of the specified target. This is normally called when update the log priority of the instance, @@ -433,7 +433,7 @@ LOGOBSERVER_API bool logObserverRequestChangeScopePrio(ITEM_ID target, const sLo * Otherwise, should be indicated the valid cookie ID of the connected log instance. * \return Returns true if processed with success. Otherwise, returns false. **/ -LOGOBSERVER_API bool logObserverRequestSaveConfig(ITEM_ID target); +LOGGER_API bool logObserverRequestSaveConfig(ITEM_ID target); -#endif // AREG_LOGOBSERVER_LIB_LOGOBSERVERAPI_H +#endif // AREG_AREGLOGGER_CLIENT_LOGOBSERVERAPI_H diff --git a/framework/areglogger/client/LogObserverSwitches.h b/framework/areglogger/client/LogObserverSwitches.h new file mode 100644 index 000000000..0b08fe0bf --- /dev/null +++ b/framework/areglogger/client/LogObserverSwitches.h @@ -0,0 +1,135 @@ +#ifndef AREG_AREGLOGGER_CLIENT_LOGOBSERVERSWITCHES_H +#define AREG_AREGLOGGER_CLIENT_LOGOBSERVERSWITCHES_H +/************************************************************************ + * This file is part of the AREG SDK core engine. + * AREG SDK is dual-licensed under Free open source (Apache version 2.0 + * License) and Commercial (with various pricing models) licenses, depending + * on the nature of the project (commercial, research, academic or free). + * You should have received a copy of the AREG SDK license description in LICENSE.txt. + * If not, please contact to info[at]aregtech.com + * + * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. + * \file areglogger/client/LogObserverSwitches.h + * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit + * \author Artak Avetyan + * \brief AREG Platform, Log Observer Switches. + * This header should be included before using AREG Log Observer API. + * + * 1. To build library as a shared (export symbols), define EXP_LOGGER_D + * + * 2. To build library as a static (export symbols), define EXP_LOGGER_LIB + * + * 3. To link application with shared library (import symbols), define IMP_LOGGER_DLL + * + * 3. To link application with static library (import symbols), define IMP_LOGGER_LIB + * + * If none of these is defined, by default it will assume "IMP_LOGGER_DLL" + * + ************************************************************************/ + +/** + * Do not define LOGGER_API , this is the job of switcher + */ +#ifdef LOGGER_API + #error "LOGGER_API is already defined. Undefine before include this file!" +#endif + +#ifdef IMP_LOGGER_DLL + + #undef IMP_LOGGER_DLL + #undef IMP_LOGGER_LIB + #undef EXP_LOGGER_DLL + #undef EXP_LOGGER_LIB + + #define IMP_LOGGER_DLL + +#endif // IMP_LOGGER_DLL + +#ifdef IMP_LOGGER_LIB + + #undef IMP_LOGGER_DLL + #undef IMP_LOGGER_LIB + #undef EXP_LOGGER_DLL + #undef EXP_LOGGER_LIB + + #define IMP_LOGGER_LIB + +#endif // IMP_LOGGER_LIB + +#ifdef EXP_LOGGER_DLL + + #undef IMP_LOGGER_DLL + #undef IMP_LOGGER_LIB + #undef EXP_LOGGER_DLL + #undef EXP_LOGGER_LIB + + #define EXP_LOGGER_DLL + +#endif // EXP_LOGGER_DLL + +#ifdef EXP_LOGGER_LIB + + #undef IMP_LOGGER_DLL + #undef IMP_LOGGER_LIB + #undef EXP_LOGGER_DLL + #undef EXP_LOGGER_LIB + + #define EXP_LOGGER_LIB + +#endif // EXP_LOGGER_LIB + +#if !defined(EXP_LOGGER_DLL) && !defined(EXP_LOGGER_LIB) && !defined(IMP_LOGGER_DLL) && !defined(IMP_LOGGER_LIB) + #pragma message ("WARNING: None of log observer preprocessor defines are set. By default sets IMP_LOGGER_DLL. See LogObserverSwitches.h file of AREG API Core") + #define IMP_LOGGER_DLL +#endif // !defined(EXP_LOGGER_DLL) && !defined(EXP_LOGGER_LIB) && !defined(IMP_LOGGER_DLL) && !defined(IMP_LOGGER_LIB) + +/** + * \brief Set Exports / Imports for dynamic and static libraries + **/ +#ifdef EXP_LOGGER_DLL + #if defined(_WIN32) + #define LOGGER_API __declspec(dllexport) + #elif defined(__CYGWIN__) + #define LOGGER_API __attribute__ ((dllexport)) + #elif defined(__GNUC__) && (__GNUC__ >= 4) + #define LOGGER_API __attribute__((visibility("default"))) + #else // !defined(__GNUC__) && (__GNUC__ >= 4) + #define LOGGER_API + #endif // (defined(_WINDOWS) || defined(WINDOWS) || defined(_WIN32)) +#endif // EXP_LOGGER_DLL + +#ifdef IMP_LOGGER_DLL + #if defined(_WIN32) + #define LOGGER_API __declspec(dllimport) + #elif defined(__CYGWIN__) + #define LOGGER_API __attribute__ ((dllimport)) + #elif defined(__GNUC__) && (__GNUC__ >= 4) + #define LOGGER_API __attribute__((visibility("default"))) + #else // !(__GNUC__ >= 4) + #define LOGGER_API + #endif // (defined(_WINDOWS) || defined(WINDOWS) || defined(_WIN32)) +#endif // IMP_LOGGER_DLL + +#if defined(EXP_LOGGER_LIB) || defined(IMP_LOGGER_LIB) + #define LOGGER_API +#endif // defined(EXP_LOGGER_LIB) || defined(IMP_LOGGER_LIB) + + +#ifndef LOGGER_API + #define LOGGER_API +#endif // LOGGER_API + +#ifdef WIN32 + #define LOGGER_API_IMPL LOGGER_API +#else // !WIN32 + #define LOGGER_API_IMPL +#endif // WIN32 + +#if !defined(IMP_AREG_DLL) && !defined(IMP_AREG_LIB) && !defined(IMPORT_SHARED_SYMBOLS) && !defined(IMPORT_STATIC_SYMBOLS) + #pragma message ("WARNING: Neither IMP_AREG_DLL, nor IMP_AREG_LIB is defined. Make proper settings. By default setting IMP_AREG_DLL.") + #define IMP_AREG_DLL +#endif // !defined(IMP_AREG_DLL) && !defined(IMP_AREG_LIB) + +#include "areg/base/GEGlobal.h" + +#endif // AREG_AREGLOGGER_CLIENT_LOGOBSERVERSWITCHES_H diff --git a/framework/areglogger/client/private/CMakeLists.txt b/framework/areglogger/client/private/CMakeLists.txt new file mode 100644 index 000000000..5f22d5bd3 --- /dev/null +++ b/framework/areglogger/client/private/CMakeLists.txt @@ -0,0 +1,5 @@ +list(APPEND areglogger_SRC + ${areglogger_BASE}/client/private/LogObserverApi.cpp + ${areglogger_BASE}/client/private/LoggerClient.cpp + ${areglogger_BASE}/client/private/ObserverMessageProcessor.cpp +) diff --git a/framework/logobserver/lib/private/LogObserverApi.cpp b/framework/areglogger/client/private/LogObserverApi.cpp similarity index 84% rename from framework/logobserver/lib/private/LogObserverApi.cpp rename to framework/areglogger/client/private/LogObserverApi.cpp index f5e64ea5b..704813997 100644 --- a/framework/logobserver/lib/private/LogObserverApi.cpp +++ b/framework/areglogger/client/private/LogObserverApi.cpp @@ -7,26 +7,31 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file logobserver/lib/private/LogObserverApi.cpp + * \file areglogger/client/private/LogObserverApi.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Log Observer library API. * ************************************************************************/ -#include "logobserver/lib/LogObserverApi.h" +#include "areglogger/client/LogObserverApi.h" #include "areg/appbase/Application.hpp" #include "areg/base/SynchObjects.hpp" -#include "logobserver/lib/private/LoggerClient.hpp" +#include "areglogger/client/private/LoggerClient.hpp" #include // Use these options if compile for Windows with MSVC #ifdef WINDOWS #pragma comment(lib, "areg") - #pragma comment(lib, "areg-extend") + #pragma comment(lib, "aregextend") + +#if defined(USE_SQLITE_PACKAGE) && (USE_SQLITE_PACKAGE != 0) #pragma comment(lib, "sqlite3") +#else // defined(USE_SQLITE_PACKAGE) && (USE_SQLITE_PACKAGE != 0) + #pragma comment(lib, "aregsqlite3") +#endif //defined(USE_SQLITE_PACKAGE) && (USE_SQLITE_PACKAGE != 0) #endif // WINDOWS @@ -94,7 +99,7 @@ namespace } } -LOGOBSERVER_API_IMPL bool logObserverInitialize(const sObserverEvents * callbacks, const char* configFilePath /* = nullptr */) +LOGGER_API_IMPL bool logObserverInitialize(const sObserverEvents * callbacks, const char* configFilePath /* = nullptr */) { Lock lock(theObserver.losLock); @@ -110,7 +115,7 @@ LOGOBSERVER_API_IMPL bool logObserverInitialize(const sObserverEvents * callback return _isInitialized(theObserver.losState); } -LOGOBSERVER_API_IMPL bool logObserverConnectLogger(const char* dbPath, const char* ipAddress /*= nullptr*/, uint16_t portNr /* = 0 */) +LOGGER_API_IMPL bool logObserverConnectLogger(const char* dbPath, const char* ipAddress /*= nullptr*/, uint16_t portNr /* = 0 */) { Lock lock(theObserver.losLock); @@ -127,7 +132,7 @@ LOGOBSERVER_API_IMPL bool logObserverConnectLogger(const char* dbPath, const cha return _isConnected(theObserver.losState); } -LOGOBSERVER_API_IMPL void logObserverDisconnectLogger() +LOGGER_API_IMPL void logObserverDisconnectLogger() { Lock lock(theObserver.losLock); @@ -140,7 +145,7 @@ LOGOBSERVER_API_IMPL void logObserverDisconnectLogger() } } -LOGOBSERVER_API_IMPL bool logObserverPauseLogging(bool doPause) +LOGGER_API_IMPL bool logObserverPauseLogging(bool doPause) { Lock lock(theObserver.losLock); @@ -154,13 +159,13 @@ LOGOBSERVER_API_IMPL bool logObserverPauseLogging(bool doPause) return result; } -LOGOBSERVER_API_IMPL eObserverStates logObserverCurrentState() +LOGGER_API_IMPL eObserverStates logObserverCurrentState() { Lock lock(theObserver.losLock); return theObserver.losState; } -LOGOBSERVER_API_IMPL void logObserverRelease() +LOGGER_API_IMPL void logObserverRelease() { Lock lock(theObserver.losLock); @@ -175,13 +180,13 @@ LOGOBSERVER_API_IMPL void logObserverRelease() } } -LOGOBSERVER_API_IMPL bool logObserverIsInitialized() +LOGGER_API_IMPL bool logObserverIsInitialized() { Lock lock(theObserver.losLock); return _isInitialized(theObserver.losState); } -LOGOBSERVER_API_IMPL bool logObserverIsConnected() +LOGGER_API_IMPL bool logObserverIsConnected() { Lock lock(theObserver.losLock); bool result{ false }; @@ -194,13 +199,13 @@ LOGOBSERVER_API_IMPL bool logObserverIsConnected() return result; } -LOGOBSERVER_API_IMPL bool logObserverIsStarted() +LOGGER_API_IMPL bool logObserverIsStarted() { Lock lock(theObserver.losLock); return _isStarted(theObserver.losState); } -LOGOBSERVER_API_IMPL const char* logObserverLoggerAddress() +LOGGER_API_IMPL const char* logObserverLoggerAddress() { Lock lock(theObserver.losLock); const char * result{ nullptr }; @@ -213,7 +218,7 @@ LOGOBSERVER_API_IMPL const char* logObserverLoggerAddress() return result; } -LOGOBSERVER_API_IMPL unsigned short logObserverLoggerPort() +LOGGER_API_IMPL unsigned short logObserverLoggerPort() { Lock lock(theObserver.losLock); unsigned short result{ NESocket::InvalidPort }; @@ -226,7 +231,7 @@ LOGOBSERVER_API_IMPL unsigned short logObserverLoggerPort() return result; } -LOGOBSERVER_API_IMPL bool logObserverConfigLoggerEnabled() +LOGGER_API_IMPL bool logObserverConfigLoggerEnabled() { Lock lock(theObserver.losLock); bool result{ false }; @@ -239,7 +244,7 @@ LOGOBSERVER_API_IMPL bool logObserverConfigLoggerEnabled() return result; } -LOGOBSERVER_API_IMPL bool logObserverConfigLoggerAddress(char* addrBuffer, uint32_t space) +LOGGER_API_IMPL bool logObserverConfigLoggerAddress(char* addrBuffer, uint32_t space) { Lock lock(theObserver.losLock); bool result{ false }; @@ -256,7 +261,7 @@ LOGOBSERVER_API_IMPL bool logObserverConfigLoggerAddress(char* addrBuffer, uint3 return result; } -LOGOBSERVER_API_IMPL unsigned short logObserverConfigLoggerPort() +LOGGER_API_IMPL unsigned short logObserverConfigLoggerPort() { Lock lock(theObserver.losLock); uint16_t result{ NESocket::InvalidPort }; @@ -269,7 +274,7 @@ LOGOBSERVER_API_IMPL unsigned short logObserverConfigLoggerPort() return result; } -LOGOBSERVER_API_IMPL bool logObserverRequestInstances() +LOGGER_API_IMPL bool logObserverRequestInstances() { bool result{ false }; Lock lock(theObserver.losLock); @@ -281,7 +286,7 @@ LOGOBSERVER_API_IMPL bool logObserverRequestInstances() return result; } -LOGOBSERVER_API_IMPL bool logObserverRequestScopes(ITEM_ID target /* = ID_IGNORED */) +LOGGER_API_IMPL bool logObserverRequestScopes(ITEM_ID target /* = ID_IGNORED */) { bool result{ false }; Lock lock(theObserver.losLock); @@ -293,7 +298,7 @@ LOGOBSERVER_API_IMPL bool logObserverRequestScopes(ITEM_ID target /* = ID_IGNORE return result; } -LOGOBSERVER_API_IMPL bool logObserverRequestChangeScopePrio(ITEM_ID target, const sLogScope* scopes, uint32_t count) +LOGGER_API_IMPL bool logObserverRequestChangeScopePrio(ITEM_ID target, const sLogScope* scopes, uint32_t count) { bool result{ false }; Lock lock(theObserver.losLock); @@ -311,7 +316,7 @@ LOGOBSERVER_API_IMPL bool logObserverRequestChangeScopePrio(ITEM_ID target, cons return result; } -LOGOBSERVER_API_IMPL bool logObserverRequestSaveConfig(ITEM_ID target /* = ID_IGNORED */) +LOGGER_API_IMPL bool logObserverRequestSaveConfig(ITEM_ID target /* = ID_IGNORED */) { bool result{ false }; Lock lock(theObserver.losLock); diff --git a/framework/logobserver/lib/private/LoggerClient.cpp b/framework/areglogger/client/private/LoggerClient.cpp similarity index 99% rename from framework/logobserver/lib/private/LoggerClient.cpp rename to framework/areglogger/client/private/LoggerClient.cpp index cac5ce728..d0501fb46 100644 --- a/framework/logobserver/lib/private/LoggerClient.cpp +++ b/framework/areglogger/client/private/LoggerClient.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file logobserver/lib/private/LoggerClient.hpp + * \file areglogger/client/private/LoggerClient.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Log Observer library API. @@ -17,11 +17,11 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "logobserver/lib/private/LoggerClient.hpp" +#include "areglogger/client/private/LoggerClient.hpp" #include "areg/ipc/ConnectionConfiguration.hpp" #include "areg/trace/LogConfiguration.hpp" -#include "logobserver/lib/LogObserverApi.h" +#include "areglogger/client/LogObserverApi.h" LoggerClient& LoggerClient::getInstance(void) { diff --git a/framework/logobserver/lib/private/LoggerClient.hpp b/framework/areglogger/client/private/LoggerClient.hpp similarity index 97% rename from framework/logobserver/lib/private/LoggerClient.hpp rename to framework/areglogger/client/private/LoggerClient.hpp index 80ee24161..e4341a0e4 100644 --- a/framework/logobserver/lib/private/LoggerClient.hpp +++ b/framework/areglogger/client/private/LoggerClient.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_LOGOBSERVER_LIB_PRIVATE_LOGGERCLIENT_HPP -#define AREG_LOGOBSERVER_LIB_PRIVATE_LOGGERCLIENT_HPP +#ifndef AREG_AREGLOGGER_CLIENT_PRIVATE_LOGGERCLIENT_HPP +#define AREG_AREGLOGGER_CLIENT_PRIVATE_LOGGERCLIENT_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file logobserver/lib/private/LoggerClient.hpp + * \file areglogger/client/private/LoggerClient.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Log Observer library API. @@ -19,7 +19,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "logobserver/lib/LogObserverSwitches.h" +#include "areglogger/client/LogObserverSwitches.h" #include "areg/component/NEService.hpp" #include "areg/component/DispatcherThread.hpp" #include "areg/ipc/ServiceClientConnectionBase.hpp" @@ -28,9 +28,9 @@ #include "areg/persist/IEConfigurationListener.hpp" #include "areg/trace/NETrace.hpp" -#include "extend/db/LogSqliteDatabase.hpp" +#include "aregextend/db/LogSqliteDatabase.hpp" -#include "logobserver/lib/private/ObserverMessageProcessor.hpp" +#include "areglogger/client/private/ObserverMessageProcessor.hpp" /************************************************************************ * Dependencies @@ -404,4 +404,4 @@ inline LoggerClient& LoggerClient::self(void) return (*this); } -#endif // AREG_LOGOBSERVER_LIB_PRIVATE_LOGGERCLIENT_HPP +#endif // AREG_AREGLOGGER_CLIENT_PRIVATE_LOGGERCLIENT_HPP diff --git a/framework/logobserver/lib/private/ObserverMessageProcessor.cpp b/framework/areglogger/client/private/ObserverMessageProcessor.cpp similarity index 97% rename from framework/logobserver/lib/private/ObserverMessageProcessor.cpp rename to framework/areglogger/client/private/ObserverMessageProcessor.cpp index 87fb48d9a..624acb582 100644 --- a/framework/logobserver/lib/private/ObserverMessageProcessor.cpp +++ b/framework/areglogger/client/private/ObserverMessageProcessor.cpp @@ -7,7 +7,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file logobserver/lib/private/ObserverMessageProcessor.cpp + * \file areglogger/client/private/ObserverMessageProcessor.cpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Log Observer library API. @@ -17,7 +17,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "logobserver/lib/private/ObserverMessageProcessor.hpp" +#include "areglogger/client/private/ObserverMessageProcessor.hpp" #include "areg/base/DateTime.hpp" #include "areg/base/RemoteMessage.hpp" @@ -25,8 +25,8 @@ #include "areg/ipc/NERemoteService.hpp" #include "areg/trace/TraceScope.hpp" -#include "logobserver/lib/LogObserverApi.h" -#include "logobserver/lib/private/LoggerClient.hpp" +#include "areglogger/client/LogObserverApi.h" +#include "areglogger/client/private/LoggerClient.hpp" ObserverMessageProcessor::ObserverMessageProcessor(LoggerClient& loggerClient) : mLoggerClient (loggerClient) diff --git a/framework/logobserver/lib/private/ObserverMessageProcessor.hpp b/framework/areglogger/client/private/ObserverMessageProcessor.hpp similarity index 92% rename from framework/logobserver/lib/private/ObserverMessageProcessor.hpp rename to framework/areglogger/client/private/ObserverMessageProcessor.hpp index 9a6c984f8..9ba813df3 100644 --- a/framework/logobserver/lib/private/ObserverMessageProcessor.hpp +++ b/framework/areglogger/client/private/ObserverMessageProcessor.hpp @@ -1,5 +1,5 @@ -#ifndef AREG_LOGOBSERVER_LIB_PRIVATE_OBSERVERMESSAGEPROCESSOR_HPP -#define AREG_LOGOBSERVER_LIB_PRIVATE_OBSERVERMESSAGEPROCESSOR_HPP +#ifndef AREG_AREGLOGGER_CLIENT_PRIVATE_OBSERVERMESSAGEPROCESSOR_HPP +#define AREG_AREGLOGGER_CLIENT_PRIVATE_OBSERVERMESSAGEPROCESSOR_HPP /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 @@ -9,7 +9,7 @@ * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file logobserver/lib/private/ObserverMessageProcessor.hpp + * \file areglogger/client/private/ObserverMessageProcessor.hpp * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit * \author Artak Avetyan * \brief AREG Platform, Log Observer library API. @@ -19,7 +19,7 @@ /************************************************************************ * Include files. ************************************************************************/ -#include "logobserver/lib/LogObserverSwitches.h" +#include "areglogger/client/LogObserverSwitches.h" /************************************************************************ * Dependencies @@ -96,4 +96,4 @@ class ObserverMessageProcessor DECLARE_NOCOPY_NOMOVE(ObserverMessageProcessor); }; -#endif // AREG_LOGOBSERVER_LIB_PRIVATE_OBSERVERMESSAGEPROCESSOR_HPP +#endif // AREG_AREGLOGGER_CLIENT_PRIVATE_OBSERVERMESSAGEPROCESSOR_HPP diff --git a/framework/logobserver/lib/resources/logobserverapi.def b/framework/areglogger/resources/areglogger.def similarity index 95% rename from framework/logobserver/lib/resources/logobserverapi.def rename to framework/areglogger/resources/areglogger.def index 554031a2a..4b786e919 100644 --- a/framework/logobserver/lib/resources/logobserverapi.def +++ b/framework/areglogger/resources/areglogger.def @@ -1,4 +1,4 @@ -LIBRARY logobserverapi +LIBRARY areglogger EXPORTS logObserverInitialize diff --git a/framework/areglogger/resources/areglogger.rc b/framework/areglogger/resources/areglogger.rc new file mode 100644 index 000000000..3510541e2 Binary files /dev/null and b/framework/areglogger/resources/areglogger.rc differ diff --git a/framework/areglogger/resources/resource.h b/framework/areglogger/resources/resource.h new file mode 100644 index 000000000..d9173408c --- /dev/null +++ b/framework/areglogger/resources/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by areglogger.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/framework/extend/CMakeLists.txt b/framework/extend/CMakeLists.txt deleted file mode 100644 index faab22b12..000000000 --- a/framework/extend/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(extend_BASE "${AREG_BASE}/extend") -set(extend_SRC) - -include("${extend_BASE}/console/private/CMakeLists.txt") -include("${extend_BASE}/db/private/CMakeLists.txt") -include("${extend_BASE}/service/private/CMakeLists.txt") - -# build areg extended static library -addStaticLib(areg-extend "${extend_SRC}") -target_compile_options(areg-extend PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") diff --git a/framework/logger/CMakeLists.txt b/framework/logger/CMakeLists.txt index 887c5673c..95a212e04 100644 --- a/framework/logger/CMakeLists.txt +++ b/framework/logger/CMakeLists.txt @@ -1,21 +1,25 @@ set(logger_BASE "${AREG_BASE}/logger") -set(logger_RESOURCE "${logger_BASE}/resources") set(logger_SRC) include("${logger_BASE}/app/private/CMakeLists.txt") include("${logger_BASE}/service/private/CMakeLists.txt") +if (${AREG_DEVELOP_ENV} MATCHES "Win32") + set_source_files_properties("${logger_BASE}/resources/logger.rc" PROPERTIES LANGUAGE RC) + list(APPEND logger_SRC ${logger_BASE}/resources/logger.rc) +endif() + # build logger executable -addExecutable(logger "${logger_SRC}") +addExecutableEx(logger ${AREG_PACKAGE_NAME} "${logger_SRC}" "") target_compile_options(logger PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") if("${AREG_DEVELOP_ENV}" STREQUAL "Win32" OR CYGWIN) add_custom_command( TARGET logger POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${logger_RESOURCE}/logger.service.install.bat" "${AREG_OUTPUT_BIN}/logger.service.install.bat" - COMMAND ${CMAKE_COMMAND} -E copy "${logger_RESOURCE}/logger.service.uninstall.bat" "${AREG_OUTPUT_BIN}/logger.service.uninstall.bat" + COMMAND ${CMAKE_COMMAND} -E copy "${logger_BASE}/resources/logger.service.install.bat" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/logger.service.install.bat" + COMMAND ${CMAKE_COMMAND} -E copy "${logger_BASE}/resources/logger.service.uninstall.bat" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/logger.service.uninstall.bat" VERBATIM) else() add_custom_command( TARGET logger POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${logger_RESOURCE}/logger.service" "${AREG_OUTPUT_BIN}/logger.service" + COMMAND ${CMAKE_COMMAND} -E copy "${logger_BASE}/resources/logger.service" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/logger.service" VERBATIM) endif() diff --git a/framework/logger/app/Logger.hpp b/framework/logger/app/Logger.hpp index 55a6899c9..fab87e7f1 100644 --- a/framework/logger/app/Logger.hpp +++ b/framework/logger/app/Logger.hpp @@ -19,12 +19,12 @@ * Include files. ************************************************************************/ #include "areg/base/GEGlobal.h" -#include "extend/service/ServiceApplicationBase.hpp" +#include "aregextend/service/ServiceApplicationBase.hpp" #include "areg/base/SynchObjects.hpp" #include "logger/app/NELoggerSettings.hpp" #include "logger/service/LoggerServerService.hpp" -#include "extend/console/OptionParser.hpp" +#include "aregextend/console/OptionParser.hpp" #include diff --git a/framework/logger/app/private/Logger.cpp b/framework/logger/app/private/Logger.cpp index 77ec298c0..15cf7aa5d 100644 --- a/framework/logger/app/private/Logger.cpp +++ b/framework/logger/app/private/Logger.cpp @@ -23,7 +23,7 @@ #include "areg/base/String.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include diff --git a/framework/logger/app/private/LoggerConsoleService.hpp b/framework/logger/app/private/LoggerConsoleService.hpp index 2cfab3f03..0302583fc 100644 --- a/framework/logger/app/private/LoggerConsoleService.hpp +++ b/framework/logger/app/private/LoggerConsoleService.hpp @@ -19,7 +19,7 @@ * Include files. ************************************************************************/ #include "areg/base/GEGlobal.h" -#include "extend/console/SystemServiceConsole.hpp" +#include "aregextend/console/SystemServiceConsole.hpp" ////////////////////////////////////////////////////////////////////////// // LoggerConsoleService class declaration diff --git a/framework/logger/app/private/win32/LoggerWin32.cpp b/framework/logger/app/private/win32/LoggerWin32.cpp index d1826851b..fce4ef908 100644 --- a/framework/logger/app/private/win32/LoggerWin32.cpp +++ b/framework/logger/app/private/win32/LoggerWin32.cpp @@ -17,7 +17,7 @@ #ifdef WINDOWS #pragma comment(lib, "areg.lib") -#pragma comment(lib, "areg-extend.lib") +#pragma comment(lib, "aregextend.lib") #pragma comment(lib, "advapi32.lib") #pragma comment(lib, "kernel32.lib") diff --git a/framework/logger/service/LoggerServerService.hpp b/framework/logger/service/LoggerServerService.hpp index 15dca24a8..54e30cf78 100644 --- a/framework/logger/service/LoggerServerService.hpp +++ b/framework/logger/service/LoggerServerService.hpp @@ -23,7 +23,7 @@ #include "areg/component/Timer.hpp" #include "areg/trace/NETrace.hpp" -#include "extend/service/ServiceCommunicatonBase.hpp" +#include "aregextend/service/ServiceCommunicatonBase.hpp" #include "logger/service/private/LoggerMessageProcessor.hpp" ////////////////////////////////////////////////////////////////////////// diff --git a/framework/logger/service/private/LoggerMessageProcessor.hpp b/framework/logger/service/private/LoggerMessageProcessor.hpp index 24e19e2a6..ad65ae262 100644 --- a/framework/logger/service/private/LoggerMessageProcessor.hpp +++ b/framework/logger/service/private/LoggerMessageProcessor.hpp @@ -22,7 +22,7 @@ #include "areg/component/NEService.hpp" #include "areg/base/TEArrayList.hpp" -#include "extend/service/ServiceCommunicatonBase.hpp" +#include "aregextend/service/ServiceCommunicatonBase.hpp" /************************************************************************ * Dependencies diff --git a/framework/logobserver.vcxproj b/framework/logobserver.vcxproj index bd9d4b771..82d641e1f 100644 --- a/framework/logobserver.vcxproj +++ b/framework/logobserver.vcxproj @@ -21,7 +21,7 @@ - IMPORT_SHARED_SYMBOLS;IMP_LOGOBSERVER_DLL;%(PreprocessorDefinitions) + IMPORT_SHARED_SYMBOLS;IMP_LOGGER_DLL;%(PreprocessorDefinitions) Console diff --git a/framework/logobserver/CMakeLists.txt b/framework/logobserver/CMakeLists.txt index c5bc86982..93744bdb4 100644 --- a/framework/logobserver/CMakeLists.txt +++ b/framework/logobserver/CMakeLists.txt @@ -1,51 +1,22 @@ set(logobserver_BASE "${AREG_BASE}/logobserver") -set(logobserverapi_SRC) +set(logobserver_SRC) -include("${logobserver_BASE}/lib/CMakeLists.txt") -include("${logobserver_BASE}/app/CMakeLists.txt") +include("${logobserver_BASE}/app/private/CMakeLists.txt") -# ################################################################## -# build log observer API library -# ################################################################## -if (AREG_LOGOBSERVER_LIB MATCHES "shared") - - # build log observer API shared library - addSharedLibEx(logobserverapi "${logobserverapi_SRC}" ${AREG_SQLITE_LIB_REF}) - target_compile_options(logobserverapi PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") - - if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") - target_compile_options(logobserverapi PRIVATE -fPIC) - endif() - - # log observer API shared library - target_compile_definitions(logobserverapi PRIVATE EXP_LOGOBSERVER_DLL) - - # add MSVC linker option - if (MSVC) - target_link_options(logobserverapi PRIVATE "/DEF:${logobserverapi_RESOURCE}/logobserver.def") - endif() - -else(AREG_LOGOBSERVER_LIB MATCHES "static") - # build log observer API static library - addStaticLib(logobserverapi "${logobserverapi_SRC}") - target_compile_options(logobserverapi PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") - - if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") - target_compile_options(logobserverapi PRIVATE -fPIC) - endif() - # log observer API static library - target_compile_definitions(logobserverapi PRIVATE EXP_LOGOBSERVER_LIB) - -endif(AREG_LOGOBSERVER_LIB MATCHES "shared") +if (${AREG_DEVELOP_ENV} MATCHES "Win32") + set_source_files_properties("${logobserver_BASE}/resources/logobserver.rc" PROPERTIES LANGUAGE RC) + list(APPEND logobserver_SRC ${logobserver_BASE}/app/resources/logobserver.rc) +endif() # ################################################################## # build log observer console application # ################################################################## -if (AREG_LOGOBSERVER_LIB MATCHES "shared") - addExecutableEx(logobserver "${logobserverapp_SRC}" logobserverapi) - target_compile_definitions(logobserver PRIVATE IMP_LOGOBSERVER_DLL) -else (AREG_LOGOBSERVER_LIB MATCHES "static") - addExecutableEx(logobserver "${logobserverapp_SRC}" logobserverapi ${AREG_SQLITE_LIB_REF}) - target_compile_definitions(logobserver PRIVATE IMP_LOGOBSERVER_LIB) -endif() +if (AREG_LOGGER_LIB MATCHES "shared") + addExecutableEx(logobserver ${AREG_PACKAGE_NAME} "${logobserver_SRC}" areglogger) + target_compile_definitions(logobserver PRIVATE IMP_LOGGER_DLL) +else () + addExecutableEx(logobserver ${AREG_PACKAGE_NAME} "${logobserver_SRC}" areglogger ${AREG_SQLITE_LIB_REF}) + target_compile_definitions(logobserver PRIVATE IMP_LOGGER_LIB) +endif(AREG_LOGGER_LIB MATCHES "shared") + target_compile_options(logobserver PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") diff --git a/framework/logobserver/app/CMakeLists.txt b/framework/logobserver/app/CMakeLists.txt deleted file mode 100644 index 1ba482e1e..000000000 --- a/framework/logobserver/app/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set(logobserverapp_BASE "${logobserver_BASE}/app") -set(logobserverapp_RESOURCE "${logobserver_BASE}/resources") -set(logobserverapp_SRC) - -include("${logobserverapp_BASE}/private/CMakeLists.txt") diff --git a/framework/logobserver/app/LogObserver.hpp b/framework/logobserver/app/LogObserver.hpp index bba15c96e..45fece349 100644 --- a/framework/logobserver/app/LogObserver.hpp +++ b/framework/logobserver/app/LogObserver.hpp @@ -22,8 +22,8 @@ #include "areg/persist/IEConfigurationListener.hpp" #include "areg/base/SynchObjects.hpp" -#include "extend/console/Console.hpp" -#include "extend/console/OptionParser.hpp" +#include "aregextend/console/Console.hpp" +#include "aregextend/console/OptionParser.hpp" #include diff --git a/framework/logobserver/app/NELogObserverSettings.hpp b/framework/logobserver/app/NELogObserverSettings.hpp index 3f3b0ee09..68bc8a9a2 100644 --- a/framework/logobserver/app/NELogObserverSettings.hpp +++ b/framework/logobserver/app/NELogObserverSettings.hpp @@ -26,13 +26,13 @@ #define IMP_AREG_LIB #endif // !defined(IMP_AREG_DLL) && !defined(IMP_AREG_LIB) && !defined(IMPORT_SHARED_SYMBOLS) && !defined(IMPORT_STATIC_SYMBOLS) -#if !defined(IMP_LOGOBSERVER_DLL) && !defined(IMP_LOGOBSERVER_LIB) - #define IMP_LOGOBSERVER_DLL -#endif // !defined(IMP_LOGOBSERVER_DLL) || !defined(IMP_LOGOBSERVER_LIB) +#if !defined(IMP_LOGGER_DLL) && !defined(IMP_LOGGER_LIB) + #define IMP_LOGGER_DLL +#endif // !defined(IMP_LOGGER_DLL) || !defined(IMP_LOGGER_LIB) /************************************************************************ * Include files. ************************************************************************/ -#include "logobserver/lib/LogObserverSwitches.h" +#include "areglogger/client/LogObserverSwitches.h" #endif // AREG_LOGOBSERVER_APP_NELOGOBSERVERSETTINGS_HPP diff --git a/framework/logobserver/app/private/CMakeLists.txt b/framework/logobserver/app/private/CMakeLists.txt index 82f7483d0..08d673b39 100644 --- a/framework/logobserver/app/private/CMakeLists.txt +++ b/framework/logobserver/app/private/CMakeLists.txt @@ -1,6 +1,6 @@ -list(APPEND logobserverapp_SRC - ${logobserverapp_BASE}/private/LogObserver.cpp - ${logobserverapp_BASE}/private/NELogObserverSettings.cpp - ${logobserverapp_BASE}/private/posix/LogObserverPosix.cpp - ${logobserverapp_BASE}/private/win32/LogObserverWin32.cpp +list(APPEND logobserver_SRC + ${logobserver_BASE}/app/private/LogObserver.cpp + ${logobserver_BASE}/app/private/NELogObserverSettings.cpp + ${logobserver_BASE}/app/private/posix/LogObserverPosix.cpp + ${logobserver_BASE}/app/private/win32/LogObserverWin32.cpp ) diff --git a/framework/logobserver/app/private/LogObserver.cpp b/framework/logobserver/app/private/LogObserver.cpp index 2af03c43f..cf022818f 100644 --- a/framework/logobserver/app/private/LogObserver.cpp +++ b/framework/logobserver/app/private/LogObserver.cpp @@ -23,9 +23,9 @@ #include "areg/base/String.hpp" #include "areg/persist/ConfigManager.hpp" -#include "extend/service/NESystemService.hpp" +#include "aregextend/service/NESystemService.hpp" -#include "logobserver/lib/LogObserverApi.h" +#include "areglogger/client/LogObserverApi.h" #include diff --git a/framework/logobserver/app/private/win32/LogObserverWin32.cpp b/framework/logobserver/app/private/win32/LogObserverWin32.cpp index 64f502c9f..6d5c1a6ad 100644 --- a/framework/logobserver/app/private/win32/LogObserverWin32.cpp +++ b/framework/logobserver/app/private/win32/LogObserverWin32.cpp @@ -21,8 +21,8 @@ #ifdef WINDOWS #pragma comment(lib, "areg.lib") -#pragma comment(lib, "areg-extend.lib") -#pragma comment(lib, "logobserverapi.lib") +#pragma comment(lib, "aregextend.lib") +#pragma comment(lib, "areglogger.lib") #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN diff --git a/framework/logobserver/app/resources/RCa47136 b/framework/logobserver/app/resources/RCa47136 new file mode 100644 index 000000000..c3197384a Binary files /dev/null and b/framework/logobserver/app/resources/RCa47136 differ diff --git a/framework/logobserver/lib/CMakeLists.txt b/framework/logobserver/lib/CMakeLists.txt deleted file mode 100644 index 03e43dcbe..000000000 --- a/framework/logobserver/lib/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(logobserverapi_BASE "${logobserver_BASE}/lib") -set(logobserverapi_RESOURCE "${logobserverapi_BASE}/resources") -set(logobserverapi_SRC) - -include("${logobserverapi_BASE}/private/CMakeLists.txt") - -# add .def file to the list of sources -if("${AREG_DEVELOP_ENV}" STREQUAL "Win32") - list(APPEND logobserverapi_SRC ${logobserverapi_RESOURCE}/logobserverapi.def) -endif() - diff --git a/framework/logobserver/lib/LogObserverSwitches.h b/framework/logobserver/lib/LogObserverSwitches.h deleted file mode 100644 index 2952a1586..000000000 --- a/framework/logobserver/lib/LogObserverSwitches.h +++ /dev/null @@ -1,135 +0,0 @@ -#ifndef AREG_LOGOBSERVER_LIB_LOGOBSERVERSWITCHES_H -#define AREG_LOGOBSERVER_LIB_LOGOBSERVERSWITCHES_H -/************************************************************************ - * This file is part of the AREG SDK core engine. - * AREG SDK is dual-licensed under Free open source (Apache version 2.0 - * License) and Commercial (with various pricing models) licenses, depending - * on the nature of the project (commercial, research, academic or free). - * You should have received a copy of the AREG SDK license description in LICENSE.txt. - * If not, please contact to info[at]aregtech.com - * - * \copyright (c) 2017-2023 Aregtech UG. All rights reserved. - * \file logobserver/lib/LogObserverSwitches.h - * \ingroup AREG SDK, Automated Real-time Event Grid Software Development Kit - * \author Artak Avetyan - * \brief AREG Platform, Log Observer Switches. - * This header should be included before using AREG Log Observer API. - * - * 1. To build library as a shared (export symbols), define EXP_LOGOBSERVER_DLL - * - * 2. To build library as a static (export symbols), define EXP_LOGOBSERVER_LIB - * - * 3. To link application with shared library (import symbols), define IMP_LOGOBSERVER_DLL - * - * 3. To link application with static library (import symbols), define IMP_LOGOBSERVER_LIB - * - * If none of these is defined, by default it will assume "IMP_LOGOBSERVER_DLL" - * - ************************************************************************/ - -/** - * Do not define LOGOBSERVER_API , this is the job of switcher - */ -#ifdef LOGOBSERVER_API - #error "LOGOBSERVER_API is already defined. Undefine before include this file!" -#endif - -#ifdef IMP_LOGOBSERVER_DLL - - #undef IMP_LOGOBSERVER_DLL - #undef IMP_LOGOBSERVER_LIB - #undef EXP_LOGOBSERVER_DLL - #undef EXP_LOGOBSERVER_LIB - - #define IMP_LOGOBSERVER_DLL - -#endif // IMP_LOGOBSERVER_DLL - -#ifdef IMP_LOGOBSERVER_LIB - - #undef IMP_LOGOBSERVER_DLL - #undef IMP_LOGOBSERVER_LIB - #undef EXP_LOGOBSERVER_DLL - #undef EXP_LOGOBSERVER_LIB - - #define IMP_LOGOBSERVER_LIB - -#endif // IMP_LOGOBSERVER_LIB - -#ifdef EXP_LOGOBSERVER_DLL - - #undef IMP_LOGOBSERVER_DLL - #undef IMP_LOGOBSERVER_LIB - #undef EXP_LOGOBSERVER_DLL - #undef EXP_LOGOBSERVER_LIB - - #define EXP_LOGOBSERVER_DLL - -#endif // EXP_LOGOBSERVER_DLL - -#ifdef EXP_LOGOBSERVER_LIB - - #undef IMP_LOGOBSERVER_DLL - #undef IMP_LOGOBSERVER_LIB - #undef EXP_LOGOBSERVER_DLL - #undef EXP_LOGOBSERVER_LIB - - #define EXP_LOGOBSERVER_LIB - -#endif // EXP_LOGOBSERVER_LIB - -#if !defined(EXP_LOGOBSERVER_DLL) && !defined(EXP_LOGOBSERVER_LIB) && !defined(IMP_LOGOBSERVER_DLL) && !defined(IMP_LOGOBSERVER_LIB) - #pragma message ("WARNING: None of log observer preprocessor defines are set. By default sets IMP_LOGOBSERVER_DLL. See LogObserverSwitches.h file of AREG API Core") - #define IMP_LOGOBSERVER_DLL -#endif // !defined(EXP_LOGOBSERVER_DLL) && !defined(EXP_LOGOBSERVER_LIB) && !defined(IMP_LOGOBSERVER_DLL) && !defined(IMP_LOGOBSERVER_LIB) - -/** - * \brief Set Exports / Imports for dynamic and static libraries - **/ -#ifdef EXP_LOGOBSERVER_DLL - #if defined(_WIN32) - #define LOGOBSERVER_API __declspec(dllexport) - #elif defined(__CYGWIN__) - #define LOGOBSERVER_API __attribute__ ((dllexport)) - #elif defined(__GNUC__) && (__GNUC__ >= 4) - #define LOGOBSERVER_API __attribute__((visibility("default"))) - #else // !defined(__GNUC__) && (__GNUC__ >= 4) - #define LOGOBSERVER_API - #endif // (defined(_WINDOWS) || defined(WINDOWS) || defined(_WIN32)) -#endif // EXP_LOGOBSERVER_DLL - -#ifdef IMP_LOGOBSERVER_DLL - #if defined(_WIN32) - #define LOGOBSERVER_API __declspec(dllimport) - #elif defined(__CYGWIN__) - #define LOGOBSERVER_API __attribute__ ((dllimport)) - #elif defined(__GNUC__) && (__GNUC__ >= 4) - #define LOGOBSERVER_API __attribute__((visibility("default"))) - #else // !(__GNUC__ >= 4) - #define LOGOBSERVER_API - #endif // (defined(_WINDOWS) || defined(WINDOWS) || defined(_WIN32)) -#endif // IMP_LOGOBSERVER_DLL - -#if defined(EXP_LOGOBSERVER_LIB) || defined(IMP_LOGOBSERVER_LIB) - #define LOGOBSERVER_API -#endif // defined(EXP_LOGOBSERVER_LIB) || defined(IMP_LOGOBSERVER_LIB) - - -#ifndef LOGOBSERVER_API - #define LOGOBSERVER_API -#endif // LOGOBSERVER_API - -#ifdef WIN32 - #define LOGOBSERVER_API_IMPL LOGOBSERVER_API -#else // !WIN32 - #define LOGOBSERVER_API_IMPL -#endif // WIN32 - -#if !defined(IMP_AREG_DLL) && !defined(IMP_AREG_LIB) && !defined(IMPORT_SHARED_SYMBOLS) && !defined(IMPORT_STATIC_SYMBOLS) - #pragma message ("WARNING: Neither IMP_AREG_DLL, nor IMP_AREG_LIB is defined. Make proper settings. By default setting IMP_AREG_DLL.") - #define IMP_AREG_DLL -#endif // !defined(IMP_AREG_DLL) && !defined(IMP_AREG_LIB) - -#include "areg/base/GEGlobal.h" - -#endif // AREG_LOGOBSERVER_LIB_LOGOBSERVERSWITCHES_H diff --git a/framework/logobserver/lib/private/CMakeLists.txt b/framework/logobserver/lib/private/CMakeLists.txt deleted file mode 100644 index ef72f9e60..000000000 --- a/framework/logobserver/lib/private/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -list(APPEND logobserverapi_SRC - ${logobserverapi_BASE}/private/LogObserverApi.cpp - ${logobserverapi_BASE}/private/LoggerClient.cpp - ${logobserverapi_BASE}/private/ObserverMessageProcessor.cpp -) diff --git a/framework/mcrouter/CMakeLists.txt b/framework/mcrouter/CMakeLists.txt index 5727590ed..3b0003943 100644 --- a/framework/mcrouter/CMakeLists.txt +++ b/framework/mcrouter/CMakeLists.txt @@ -1,21 +1,25 @@ set(mcrouter_BASE "${AREG_BASE}/mcrouter") -set(mcrouter_RESOURCE "${mcrouter_BASE}/resources") set(mcrouter_SRC) include("${mcrouter_BASE}/app/private/CMakeLists.txt") include("${mcrouter_BASE}/service/private/CMakeLists.txt") +if (${AREG_DEVELOP_ENV} MATCHES "Win32") + set_source_files_properties("${mcrouter_BASE}/resources/mcrouter.rc" PROPERTIES LANGUAGE RC) + list(APPEND mcrouter_SRC ${mcrouter_BASE}/resources/mcrouter.rc) +endif() + # build mcrouter executable -addExecutable(mcrouter "${mcrouter_SRC}") +addExecutableEx(mcrouter ${AREG_PACKAGE_NAME} "${mcrouter_SRC}" "") target_compile_options(mcrouter PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") if("${AREG_DEVELOP_ENV}" STREQUAL "Win32" OR CYGWIN) add_custom_command( TARGET mcrouter POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${mcrouter_RESOURCE}/mcrouter.service.install.bat" "${AREG_OUTPUT_BIN}/mcrouter.service.install.bat" - COMMAND ${CMAKE_COMMAND} -E copy "${mcrouter_RESOURCE}/mcrouter.service.uninstall.bat" "${AREG_OUTPUT_BIN}/mcrouter.service.uninstall.bat" + COMMAND ${CMAKE_COMMAND} -E copy "${mcrouter_BASE}/resources/mcrouter.service.install.bat" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mcrouter.service.install.bat" + COMMAND ${CMAKE_COMMAND} -E copy "${mcrouter_BASE}/resources/mcrouter.service.uninstall.bat" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mcrouter.service.uninstall.bat" VERBATIM) else() add_custom_command( TARGET mcrouter POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${mcrouter_RESOURCE}/mcrouter.service" "${AREG_OUTPUT_BIN}/mcrouter.service" + COMMAND ${CMAKE_COMMAND} -E copy "${mcrouter_BASE}/resources/mcrouter.service" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mcrouter.service" VERBATIM) endif() diff --git a/framework/mcrouter/app/MulticastRouter.hpp b/framework/mcrouter/app/MulticastRouter.hpp index cb18a1ccb..e53189da3 100644 --- a/framework/mcrouter/app/MulticastRouter.hpp +++ b/framework/mcrouter/app/MulticastRouter.hpp @@ -19,12 +19,12 @@ * Include files. ************************************************************************/ #include "areg/base/GEGlobal.h" -#include "extend/service/ServiceApplicationBase.hpp" +#include "aregextend/service/ServiceApplicationBase.hpp" #include "areg/base/SynchObjects.hpp" #include "mcrouter/app/NEMulticastRouterSettings.hpp" #include "mcrouter/service/RouterServerService.hpp" -#include "extend/console/OptionParser.hpp" +#include "aregextend/console/OptionParser.hpp" #include diff --git a/framework/mcrouter/app/private/MulticastRouter.cpp b/framework/mcrouter/app/private/MulticastRouter.cpp index 301096e39..a92ea596e 100644 --- a/framework/mcrouter/app/private/MulticastRouter.cpp +++ b/framework/mcrouter/app/private/MulticastRouter.cpp @@ -23,7 +23,7 @@ #include "areg/base/String.hpp" #include "areg/trace/GETrace.h" -#include "extend/console/Console.hpp" +#include "aregextend/console/Console.hpp" #include diff --git a/framework/mcrouter/app/private/RouterConsoleService.hpp b/framework/mcrouter/app/private/RouterConsoleService.hpp index 2229f99cc..dd7c767bc 100644 --- a/framework/mcrouter/app/private/RouterConsoleService.hpp +++ b/framework/mcrouter/app/private/RouterConsoleService.hpp @@ -19,7 +19,7 @@ * Include files. ************************************************************************/ #include "areg/base/GEGlobal.h" -#include "extend/console/SystemServiceConsole.hpp" +#include "aregextend/console/SystemServiceConsole.hpp" ////////////////////////////////////////////////////////////////////////// // RouterConsoleService class declaration diff --git a/framework/mcrouter/app/private/win32/MulticastRouterWin32.cpp b/framework/mcrouter/app/private/win32/MulticastRouterWin32.cpp index 003f203f9..852131686 100644 --- a/framework/mcrouter/app/private/win32/MulticastRouterWin32.cpp +++ b/framework/mcrouter/app/private/win32/MulticastRouterWin32.cpp @@ -17,7 +17,7 @@ #ifdef WINDOWS #pragma comment(lib, "areg.lib") -#pragma comment(lib, "areg-extend.lib") +#pragma comment(lib, "aregextend.lib") #pragma comment(lib, "advapi32.lib") #pragma comment(lib, "kernel32.lib") diff --git a/framework/mcrouter/service/RouterServerService.hpp b/framework/mcrouter/service/RouterServerService.hpp index 244bc3171..b6ecdaa5a 100644 --- a/framework/mcrouter/service/RouterServerService.hpp +++ b/framework/mcrouter/service/RouterServerService.hpp @@ -22,7 +22,7 @@ #include "areg/ipc/IEServiceRegisterConsumer.hpp" #include "areg/ipc/IEServiceRegisterProvider.hpp" -#include "extend/service/ServiceCommunicatonBase.hpp" +#include "aregextend/service/ServiceCommunicatonBase.hpp" #include "mcrouter/service/private/ServiceRegistry.hpp" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 00feea9dc..4564f9410 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,6 @@ if (AREG_BUILD_TESTS) # local variables - option(AREG_GTEST_FOUND "GTest library found flag" FALSE) set(AREG_GTEST_INCLUDES) set(AREG_GTEST_LIBRARY) @@ -17,6 +16,7 @@ if (AREG_BUILD_TESTS) if (AREG_GTEST_FOUND) # Google Test package found, make no actions on it, the libraries can be used. + option(AREG_GTEST_FOUND "GTest package found flag" TRUE) message(STATUS "AREG: >>> Will use existing googletest package") if (NOT "${AREG_GTEST_INCLUDES}" STREQUAL "") include_directories("${AREG_GTEST_INCLUDES}") @@ -24,6 +24,7 @@ if (AREG_BUILD_TESTS) else(AREG_GTEST_FOUND) + option(AREG_GTEST_FOUND "GTest package found flag" FALSE) message(STATUS "AREG: >>> Will compile googletest libraries") # Google Test package did not find, fetch sources from repository. set(AREG_GTEST_PACKAGE OFF CACHE BOOL "Use GTest installed package" FORCE) diff --git a/tests/areg-unit-tests.vcxproj b/tests/areg-unit-tests.vcxproj index 2a46268aa..65de134e2 100644 --- a/tests/areg-unit-tests.vcxproj +++ b/tests/areg-unit-tests.vcxproj @@ -68,7 +68,7 @@ {2df8165c-ede2-4f76-8d2c-2ffe82cb6ce5} - + {fbc5beae-01b9-4943-a5cb-0d3de2067eb3} diff --git a/tests/units/GUnitTest.cpp b/tests/units/GUnitTest.cpp index dd87e235b..b79effe1e 100644 --- a/tests/units/GUnitTest.cpp +++ b/tests/units/GUnitTest.cpp @@ -21,7 +21,7 @@ #ifdef WINDOWS #pragma comment(lib, "areg.lib") - #pragma comment(lib, "areg-extend.lib") + #pragma comment(lib, "aregextend.lib") #endif // WINDOWS diff --git a/tests/units/OptionParserTest.cpp b/tests/units/OptionParserTest.cpp index f5167174b..a22e5b9af 100644 --- a/tests/units/OptionParserTest.cpp +++ b/tests/units/OptionParserTest.cpp @@ -17,7 +17,7 @@ * Include files. ************************************************************************/ #include "units/GUnitTest.hpp" -#include "extend/console/OptionParser.hpp" +#include "aregextend/console/OptionParser.hpp" #include #include diff --git a/thirdparty/sqlite3.vcxproj b/thirdparty/sqlite3.vcxproj index 0f55b4c8e..7a1b65a43 100644 --- a/thirdparty/sqlite3.vcxproj +++ b/thirdparty/sqlite3.vcxproj @@ -8,8 +8,8 @@ {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} - sqlite3 - sqlite3 + aregsqlite3 + aregsqlite3 Win32Proj diff --git a/thirdparty/sqlite3/CMakeLists.txt b/thirdparty/sqlite3/CMakeLists.txt index da13d753d..f1568ae13 100644 --- a/thirdparty/sqlite3/CMakeLists.txt +++ b/thirdparty/sqlite3/CMakeLists.txt @@ -1,5 +1,5 @@ # ########################################################################### -# Either build 'sqlite3' static library or use system available build +# Either build 'aregsqlite3' static library or use system available 'sqlite3' build # ########################################################################### @@ -16,6 +16,7 @@ if (AREG_SQLITE_FOUND) message(STATUS "AREG: >>> Will use existing sqlite3 package") # If SQLite3 package found set appropriate preprocessor option to include right header. set(AREG_SQLITE_LIB_REF SQLite::SQLite3) + set(AREG_SQLITE_LIB sqlite3) add_definitions(-DUSE_SQLITE_PACKAGE=1) if (NOT "${AREG_SQLITE_INCLUDES}" STREQUAL "") @@ -24,7 +25,7 @@ if (AREG_SQLITE_FOUND) else(AREG_SQLITE_FOUND) - message(STATUS "AREG: >>> Will compile sqlite3 library") + message(STATUS "AREG: >>> Will compile aregsqlite3 library") # The SQLite3 package did not find, compile from available sources. set(AREG_SQLITE_PACKAGE OFF CACHE BOOL "Use SQLite3 installed package" FORCE) set(sqlite_BASE "${AREG_THIRDPARTY}/sqlite3") @@ -34,8 +35,9 @@ else(AREG_SQLITE_FOUND) include_directories(${sqlite_BASE}) - set(AREG_SQLITE_LIB_REF sqlite3) - addStaticLib_C(${AREG_SQLITE_LIB_REF} "${sqlite_SRC}") - target_compile_options(${AREG_SQLITE_LIB_REF} PRIVATE -DUSE_SQLITE_PACKAGE=0 "${AREG_OPT_DISABLE_WARN_THIRDPARTY}") + set(AREG_SQLITE_LIB_REF ${AREG_PACKAGE_NAME}::aregsqlite3) + set(AREG_SQLITE_LIB aregsqlite3) + addStaticLibEx_C(${AREG_SQLITE_LIB} ${AREG_PACKAGE_NAME} "${sqlite_SRC}" "") + target_compile_options(${AREG_SQLITE_LIB} PRIVATE -DUSE_SQLITE_PACKAGE=0 "${AREG_OPT_DISABLE_WARN_THIRDPARTY}") endif(AREG_SQLITE_FOUND) diff --git a/thirdparty/sqlite3/Readme.md b/thirdparty/sqlite3/Readme.md index eeed440e7..1d727aeaf 100644 --- a/thirdparty/sqlite3/Readme.md +++ b/thirdparty/sqlite3/Readme.md @@ -1,6 +1,6 @@ # SQLite Sources in AREG SDK -The AREG SDK uses SQLite to save log files in both the `logobserver` executable and the `logobserverapi` library. SQLite is used to create the database file and save logs. You can link SQLite in your application in two ways: +The AREG SDK uses SQLite to save log files in both the `logobserver` executable and the `areglogger` library. SQLite is used to create the database file and save logs. You can link SQLite in your application in two ways: 1. Build a **static** library from the SQLite source provided in the AREG SDK. 2. Use an SQLite package already available in your system.