From fd74355eea3d8e2465c09397f5513ca99a34ab75 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Thu, 3 Oct 2024 19:02:01 +0200 Subject: [PATCH 01/24] Slight refactoring of installation --- conf/cmake/common.cmake | 5 ++++ conf/cmake/install.cmake | 2 +- conf/cmake/user.cmake | 24 +++++++++++-------- framework/areg.vcxproj | 6 ++--- framework/areg.vcxproj.filters | 6 ++--- framework/areg/base/GEGlobal.h | 2 +- framework/areg/base/GETypes.h | 2 +- .../areg/base/private/posix/ProcessPosix.cpp | 1 - framework/{ => areg}/system/GEPlatform.h | 6 ++--- framework/{ => areg}/system/posix/GEPosix.h | 2 +- .../{ => areg}/system/windows/GEWindows.h | 2 +- 11 files changed, 33 insertions(+), 25 deletions(-) rename framework/{ => areg}/system/GEPlatform.h (92%) rename framework/{ => areg}/system/posix/GEPosix.h (98%) rename framework/{ => areg}/system/windows/GEWindows.h (98%) diff --git a/conf/cmake/common.cmake b/conf/cmake/common.cmake index e4369e8dc..29df9a4f2 100644 --- a/conf/cmake/common.cmake +++ b/conf/cmake/common.cmake @@ -3,6 +3,10 @@ # Copyright 2022-2023 Aregtech # ########################################################################### +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}") @@ -185,4 +189,5 @@ endif() if (AREG_INSTALL) set(CMAKE_INSTALL_PREFIX "${AREG_INSTALL_PATH}") option(INSTALL_GTEST "Disable Googletest installation" OFF) + include(GNUInstallDirs) endif() diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index 0e9ee299f..a3b1027ff 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -21,7 +21,7 @@ if (AREG_INSTALL) # Copy AREG SDK all headers install(DIRECTORY framework/ - DESTINATION framework COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" diff --git a/conf/cmake/user.cmake b/conf/cmake/user.cmake index 80252d12f..c9aa52719 100644 --- a/conf/cmake/user.cmake +++ b/conf/cmake/user.cmake @@ -228,20 +228,24 @@ if (NOT DEFINED AREG_PACKAGES OR "${AREG_PACKAGES}" STREQUAL "") set(AREG_PACKAGES "${AREG_BUILD_ROOT}/packages") endif() -if (NOT DEFINED AREG_INSTALL_PATH OR "${AREG_INSTALL_PATH}" STREQUAL "") - set(INST_PATH "${AREG_BUILD_ROOT}") - set(TEMP1_VAL "$ENV{HOME}") +if ("${AREG_INSTALL_PATH}" STREQUAL "") + if ("${CMAKE_INSTALL_PREFIX}" 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) + 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() endif() - endif() - set(AREG_INSTALL_PATH "${INST_PATH}/areg-sdk") + set(AREG_INSTALL_PATH "${INST_PATH}/areg-sdk") + else() + set(AREG_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}") + endif() endif() # The absolute path for generated files diff --git a/framework/areg.vcxproj b/framework/areg.vcxproj index e8a200f00..aa8f8749d 100644 --- a/framework/areg.vcxproj +++ b/framework/areg.vcxproj @@ -407,9 +407,9 @@ - - - + + + diff --git a/framework/areg.vcxproj.filters b/framework/areg.vcxproj.filters index 70e9c930a..4dfe999c0 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 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/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 From 84f279b3aa66a84fe4be365976272c820967fade Mon Sep 17 00:00:00 2001 From: Aregtech Date: Thu, 3 Oct 2024 22:19:10 +0200 Subject: [PATCH 02/24] Another try to fix vcpkg --- conf/cmake/common.cmake | 8 ++++++-- conf/cmake/user.cmake | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/conf/cmake/common.cmake b/conf/cmake/common.cmake index 29df9a4f2..040c6d038 100644 --- a/conf/cmake/common.cmake +++ b/conf/cmake/common.cmake @@ -187,7 +187,11 @@ if (NOT ${Java_FOUND}) endif() if (AREG_INSTALL) - set(CMAKE_INSTALL_PREFIX "${AREG_INSTALL_PATH}") - option(INSTALL_GTEST "Disable Googletest installation" OFF) include(GNUInstallDirs) + include(CMakePackageConfigHelpers) + 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/user.cmake b/conf/cmake/user.cmake index c9aa52719..641541e7d 100644 --- a/conf/cmake/user.cmake +++ b/conf/cmake/user.cmake @@ -228,6 +228,7 @@ if (NOT DEFINED AREG_PACKAGES OR "${AREG_PACKAGES}" STREQUAL "") set(AREG_PACKAGES "${AREG_BUILD_ROOT}/packages") endif() +#[===[ if ("${AREG_INSTALL_PATH}" STREQUAL "") if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "") set(INST_PATH "${AREG_BUILD_ROOT}") @@ -247,6 +248,7 @@ if ("${AREG_INSTALL_PATH}" STREQUAL "") set(AREG_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}") endif() endif() +#]===] # The absolute path for generated files set(AREG_GENERATE "generate") From 3de658206c9dd798a52f2871abf8d59a63c478f1 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Fri, 4 Oct 2024 01:09:11 +0200 Subject: [PATCH 03/24] additional changes to copy tools --- CMakeLists.txt | 6 +- conf/cmake/common.cmake | 2 - conf/cmake/install.cmake | 146 +++++++++++++++++++-------------------- 3 files changed, 76 insertions(+), 78 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17e0bd05a..b55806290 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}) @@ -57,7 +57,9 @@ if(AREG_BUILD_TESTS) include(${AREG_TESTS}/CMakeLists.txt) endif() -include(${AREG_CMAKE_CONFIG_DIR}/install.cmake) +if (AREG_INSTALL) + include(${AREG_CMAKE_CONFIG_DIR}/install.cmake) +endif(AREG_INSTALL) # Print the configuration status message(STATUS "=======================================================================================") diff --git a/conf/cmake/common.cmake b/conf/cmake/common.cmake index 040c6d038..2ddf5eed1 100644 --- a/conf/cmake/common.cmake +++ b/conf/cmake/common.cmake @@ -187,8 +187,6 @@ if (NOT ${Java_FOUND}) endif() if (AREG_INSTALL) - include(GNUInstallDirs) - include(CMakePackageConfigHelpers) option(INSTALL_GTEST "Disable Googletest installation" OFF) if (NOT "${AREG_INSTALL_PATH}" STREQUAL "") diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index a3b1027ff..a3bcc466b 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -3,90 +3,88 @@ # 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_PACKAGE_NAME "areg-sdk") - set(AREG_PACKAGE_NAME "areg-sdk") +# 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 +) - # 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 - ) +# Copy AREG SDK all headers +install(DIRECTORY framework/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hpp" + PATTERN "logger" EXCLUDE + PATTERN "logobserver/app" EXCLUDE + PATTERN "mcrouter" EXCLUDE +) - # Copy AREG SDK all headers - install(DIRECTORY framework/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 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 CMake and MSVC configuration files. - install(DIRECTORY conf/ - DESTINATION conf COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} - ) +# 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 all tools +install(DIRECTORY tools/ + DESTINATION tools/${AREG_PACKAGE_NAME} COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} + DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE +) - # 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 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(DIRECTORY ${AREG_OUTPUT_BIN}/config - DESTINATION bin COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} - ) +# Copy AREG configuration file +install(DIRECTORY ${AREG_OUTPUT_BIN}/config + DESTINATION bin COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} +) - # 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 - ) +# 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 +) - # Check and install thirdparty dependencies if needed - if (AREG_INSTALL_DEPENDS) +# 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 - ) + # 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 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) + # 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) +endif(AREG_INSTALL_DEPENDS) From 3f69b2d5fc0a109e26eca02e84630452be2c0b20 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Fri, 4 Oct 2024 01:19:24 +0200 Subject: [PATCH 04/24] Fixing copying tools --- conf/cmake/install.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index a3bcc466b..8139af963 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -37,7 +37,7 @@ install(DIRECTORY conf/ # Copy all tools install(DIRECTORY tools/ - DESTINATION tools/${AREG_PACKAGE_NAME} COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} + DESTINATION ${AREG_PACKAGE_NAME}-tools COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE ) From 25bb6c8c2cdb980be3b5c5cb92d3a4da5e881d2b Mon Sep 17 00:00:00 2001 From: Aregtech Date: Fri, 4 Oct 2024 12:43:11 +0200 Subject: [PATCH 05/24] Fixing vcpkg installation. --- CMakeLists.txt | 2 +- conf/cmake/areg.pc.in | 13 +++++++++ conf/cmake/functions.cmake | 32 +++++++++++++++++++++ conf/cmake/install.cmake | 59 ++++++++++++++++---------------------- conf/cmake/user.cmake | 2 +- 5 files changed, 71 insertions(+), 37 deletions(-) create mode 100644 conf/cmake/areg.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index b55806290..567b3da1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,7 @@ message(STATUS "AREG: >>> Packages ........: \'${FETCHCONTENT_BASE_DIR}\' direct 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/conf/cmake/areg.pc.in b/conf/cmake/areg.pc.in new file mode 100644 index 000000000..683cb69ca --- /dev/null +++ b/conf/cmake/areg.pc.in @@ -0,0 +1,13 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix}/tools/areg +libdir=${prefix}/lib +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: areg +Description: AREG communication framework +Version: @PKGCONFIG_VERSION@ +URL: https://github.com/aregtech/areg-sdk +Libs: -L${libdir} -lareg -lareg-extend +Requires: areg = @PROJECT_VERSION@ +Libs.private: @PKGCONFIG_LIBS_PRIVATE@ +Cflags: -I${includedir} diff --git a/conf/cmake/functions.cmake b/conf/cmake/functions.cmake index bcbabaa6c..1ba112faa 100644 --- a/conf/cmake/functions.cmake +++ b/conf/cmake/functions.cmake @@ -755,3 +755,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/install.cmake b/conf/cmake/install.cmake index 8139af963..ddc94bd5c 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -7,21 +7,33 @@ message(STATUS "AREG: >>> Preparing AREG SDK installation settings, CMAKE_PACKAG include(GNUInstallDirs) include(CMakePackageConfigHelpers) -set(AREG_PACKAGE_NAME "areg-sdk") +set(AREG_PACKAGE_NAME "areg") + +target_include_directories(areg 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} +install(TARGETS areg logobserverapi areg-extend + EXPORT ${AREG_PACKAGE_NAME} + RUNTIME DESTINATION bin COMPONENT Development 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} + LIBRARY DESTINATION bin COMPONENT Development 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 ) +install(TARGETS mcrouter logger logobserver + EXPORT ${AREG_PACKAGE_NAME} + RUNTIME DESTINATION tools/${AREG_PACKAGE_NAME}-dbg COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE +) + # Copy AREG SDK all headers install(DIRECTORY framework/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} + CONFIGURATIONS Release FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" @@ -31,20 +43,20 @@ install(DIRECTORY framework/ ) # Copy all CMake and MSVC configuration files. -install(DIRECTORY conf/ +install(DIRECTORY ${AREG_CMAKE_CONFIG_DIR} DESTINATION conf COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} ) - + # Copy all tools install(DIRECTORY tools/ - DESTINATION ${AREG_PACKAGE_NAME}-tools COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} + DESTINATION tools/${AREG_PACKAGE_NAME} COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE ) # Copy AREG SDK license install(FILES LICENSE.txt - DESTINATION licenses COMPONENT Development COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} - RENAME AREG.copyright + DESTINATION share/${AREG_PACKAGE_NAME} COMPONENT Development COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} + RENAME copyright PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) @@ -62,29 +74,6 @@ install(DIRECTORY ${AREG_OUTPUT_BIN}/ PATTERN "config" EXCLUDE ) -# 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) +configure_file("${AREG_CMAKE_CONFIG_DIR}/areg.pc.in" areg.pc @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/areg.pc" DESTINATION lib/pkgconfig) +install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} NAMESPACE areg:: FILE ${AREG_PACKAGE_NAME}.cmake EXPORT_LINK_INTERFACE_LIBRARIES) diff --git a/conf/cmake/user.cmake b/conf/cmake/user.cmake index 641541e7d..3dab49e58 100644 --- a/conf/cmake/user.cmake +++ b/conf/cmake/user.cmake @@ -194,7 +194,7 @@ macro_create_option(AREG_LOGS ON "Compile with logs") 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") +# 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) From baf8a4ab58a3b8d09e4651a56e3ee58196cf0b32 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Fri, 4 Oct 2024 17:41:23 +0200 Subject: [PATCH 06/24] another try to enable vcpkg --- conf/cmake/user.cmake | 41 ++++++++++++---------------- framework/areg/CMakeLists.txt | 1 + framework/extend/CMakeLists.txt | 1 + framework/logger/CMakeLists.txt | 1 + framework/logobserver/CMakeLists.txt | 3 ++ framework/mcrouter/CMakeLists.txt | 1 + 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/conf/cmake/user.cmake b/conf/cmake/user.cmake index 3dab49e58..cd8414746 100644 --- a/conf/cmake/user.cmake +++ b/conf/cmake/user.cmake @@ -15,16 +15,15 @@ # 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. +# 11. 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'. +# 12. AREG_SQLITE_PACKAGE -- Flag, indicating whether should use SQLite3 package available in the system or compile the library from sources. +# 13. AREG_GTEST_PACKAGE -- Flag, indicating whether should use GTest package available in the system or should compile the libraries from sources. +# 14. AREG_BUILD_ROOT -- The root directory to build or create generated files. By default is the './product' directory of 'areg-sdk' root. +# 15. AREG_OUTPUT_DIR -- The output directory of build binaries. +# 16. AREG_OUTPUT_BIN -- The output directory of build executables or runtime binaries (shared libraries). +# 17. AREG_OUTPUT_LIB -- The output directory of static libraries. +# 18. AREG_PACKAGES -- The location to install thirdparty packages. +# 19. 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. # # The default values are: # 1. AREG_COMPILER_FAMILY = (possible values: gnu, cygwin, llvm, msvc) @@ -37,16 +36,15 @@ # 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' (possible values: any valid path for outputs for product and generated files) +# 15. AREG_OUTPUT_DIR = '/product/build/gnu-gcc/---release-' (possible values: any valid path for build outputs) +# 16. AREG_OUTPUT_BIN = '/product/build/gnu-gcc/---release-/bin' (possible values: any valid path for binary outputs) +# 17. AREG_OUTPUT_LIB = '/product/build/gnu-gcc/---release-/lib' (possible values: any valid path for library outputs) +# 18. AREG_PACKAGES = '${AREG_BUILD_ROOT}/packages' (possible values: any valid path for package location) +# 19. 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) # # Hints: # @@ -193,9 +191,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 diff --git a/framework/areg/CMakeLists.txt b/framework/areg/CMakeLists.txt index 6c28abf03..a6a44652f 100644 --- a/framework/areg/CMakeLists.txt +++ b/framework/areg/CMakeLists.txt @@ -42,6 +42,7 @@ target_link_libraries(areg PRIVATE ${AREG_LDFLAGS}) # Library configuration set_target_properties(areg PROPERTIES CXX_STANDARD ${AREG_CXX_STANDARD} CXX_STANDARD_REQUIRED ON ) +set_target_properties(areg PROPERTIES VERSION ${AREG_PROJECT_VERSION}) # copying log and router init files to 'bin/config' add_custom_command( TARGET areg POST_BUILD diff --git a/framework/extend/CMakeLists.txt b/framework/extend/CMakeLists.txt index faab22b12..56cece023 100644 --- a/framework/extend/CMakeLists.txt +++ b/framework/extend/CMakeLists.txt @@ -7,4 +7,5 @@ include("${extend_BASE}/service/private/CMakeLists.txt") # build areg extended static library addStaticLib(areg-extend "${extend_SRC}") +set_target_properties(areg-extend PROPERTIES VERSION ${AREG_PROJECT_VERSION}) 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..49cd878e0 100644 --- a/framework/logger/CMakeLists.txt +++ b/framework/logger/CMakeLists.txt @@ -8,6 +8,7 @@ include("${logger_BASE}/service/private/CMakeLists.txt") # build logger executable addExecutable(logger "${logger_SRC}") target_compile_options(logger PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") +set_target_properties(logger PROPERTIES VERSION ${AREG_PROJECT_VERSION}) if("${AREG_DEVELOP_ENV}" STREQUAL "Win32" OR CYGWIN) add_custom_command( TARGET logger POST_BUILD diff --git a/framework/logobserver/CMakeLists.txt b/framework/logobserver/CMakeLists.txt index c5bc86982..e0706a601 100644 --- a/framework/logobserver/CMakeLists.txt +++ b/framework/logobserver/CMakeLists.txt @@ -37,6 +37,7 @@ else(AREG_LOGOBSERVER_LIB MATCHES "static") target_compile_definitions(logobserverapi PRIVATE EXP_LOGOBSERVER_LIB) endif(AREG_LOGOBSERVER_LIB MATCHES "shared") +set_target_properties(logobserverapi PROPERTIES VERSION ${AREG_PROJECT_VERSION}) # ################################################################## # build log observer console application @@ -48,4 +49,6 @@ else (AREG_LOGOBSERVER_LIB MATCHES "static") addExecutableEx(logobserver "${logobserverapp_SRC}" logobserverapi ${AREG_SQLITE_LIB_REF}) target_compile_definitions(logobserver PRIVATE IMP_LOGOBSERVER_LIB) endif() + +set_target_properties(logobserver PROPERTIES VERSION ${AREG_PROJECT_VERSION}) target_compile_options(logobserver PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") diff --git a/framework/mcrouter/CMakeLists.txt b/framework/mcrouter/CMakeLists.txt index 5727590ed..7f5740d89 100644 --- a/framework/mcrouter/CMakeLists.txt +++ b/framework/mcrouter/CMakeLists.txt @@ -8,6 +8,7 @@ include("${mcrouter_BASE}/service/private/CMakeLists.txt") # build mcrouter executable addExecutable(mcrouter "${mcrouter_SRC}") target_compile_options(mcrouter PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") +set_target_properties(mcrouter PROPERTIES VERSION ${AREG_PROJECT_VERSION}) if("${AREG_DEVELOP_ENV}" STREQUAL "Win32" OR CYGWIN) add_custom_command( TARGET mcrouter POST_BUILD From af6de8a030a13e75b4f103b11c293ad27a2d4321 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Sat, 5 Oct 2024 12:25:06 +0200 Subject: [PATCH 07/24] Refactoring the extended directory, separated areg logging api library. --- areg-sdk.sln | 4 +- conf/cmake/areg.pc.in | 6 +- conf/cmake/aregextend.pc.in | 13 ++ conf/cmake/areglogger.pc.in | 13 ++ conf/cmake/functions.cmake | 4 +- conf/cmake/install.cmake | 16 +- conf/cmake/user.cmake | 8 +- examples/14_pubtraffic/pubclient/src/main.cpp | 4 +- .../14_pubtraffic/pubservice/src/main.cpp | 4 +- .../pubclient/src/ServiceClient.cpp | 2 +- .../pubclient/src/ServiceClient.hpp | 2 +- .../20_pubdatarate/pubclient/src/main.cpp | 2 +- .../pubservice/src/ServicingComponent.cpp | 2 +- .../pubservice/src/ServicingComponent.hpp | 2 +- .../20_pubdatarate/pubservice/src/main.cpp | 2 +- .../22_pubsub/publisher/src/Publisher.cpp | 2 +- .../22_pubsub/publisher/src/Publisher.hpp | 2 +- examples/22_pubsub/publisher/src/main.cpp | 2 +- .../22_pubsub/subscriber/src/Subscriber.cpp | 2 +- examples/22_pubsub/subscriber/src/main.cpp | 2 +- examples/23_pubsubmix/common/src/NECommon.hpp | 2 +- .../23_pubsubmix/common/src/Publisher.cpp | 2 +- .../23_pubsubmix/common/src/Publisher.hpp | 2 +- .../23_pubsubmix/common/src/Subscriber.cpp | 2 +- .../pubsubctrl/src/PubSubController.cpp | 2 +- .../pubsubctrl/src/PubSubController.hpp | 2 +- examples/23_pubsubmix/pubsubctrl/src/main.cpp | 4 +- examples/23_pubsubmix/pubsubdyn/src/main.cpp | 2 +- .../publisher/src/Publisher.cpp | 2 +- .../publisher/src/Publisher.hpp | 2 +- .../24_pubsubmulti/publisher/src/main.cpp | 2 +- .../subscribermulti/src/NECommon.hpp | 2 +- .../subscribermulti/src/main.cpp | 2 +- framework/CMakeLists.txt | 5 +- framework/areg-extend.vcxproj | 90 ----------- framework/areg-extend.vcxproj.filters | 137 ----------------- framework/areg.vcxproj | 5 +- framework/areg.vcxproj.filters | 13 +- framework/areg/CMakeLists.txt | 5 + framework/areg/resources/areg.rc | Bin 2721 -> 4726 bytes framework/areg/resources/resource.h | 15 ++ framework/aregextend.vcxproj | 94 ++++++++++++ framework/aregextend.vcxproj.filters | 145 ++++++++++++++++++ framework/aregextend/CMakeLists.txt | 17 ++ framework/{extend => aregextend}/Readme.md | 2 +- .../console/Console.hpp | 8 +- .../console/OptionParser.hpp | 8 +- .../console/SystemServiceConsole.hpp | 8 +- .../console/private/CMakeLists.txt | 0 .../console/private/Console.cpp | 4 +- .../console/private/OptionParser.cpp | 4 +- .../console/private/SystemServiceConsole.cpp | 10 +- .../console/private/ansi/ConsoleAnsi.cpp | 4 +- .../private/ncurses/ConsoleNcurses.cpp | 4 +- .../console/private/win32/ConsoleWin32.cpp | 4 +- .../db/LogSqliteDatabase.hpp | 8 +- .../db/SqliteDatabase.hpp | 8 +- .../db/private/CMakeLists.txt | 0 .../db/private/LogSqliteDatabase.cpp | 4 +- .../db/private/SqliteDatabase.cpp | 4 +- framework/aregextend/resources/aregextend.rc | Bin 0 -> 4648 bytes framework/aregextend/resources/resource.h | 15 ++ .../service/DataRateHelper.hpp | 12 +- .../service/IEServiceConnectionHandler.hpp | 8 +- .../service/NESystemService.hpp | 12 +- .../service/ServerConnection.hpp | 8 +- .../service/ServiceApplicationBase.hpp | 10 +- .../service/ServiceCommunicatonBase.hpp | 18 +-- .../service/SystemServiceBase.hpp | 12 +- .../service/private/CMakeLists.txt | 0 .../service/private/DataRateHelper.cpp | 4 +- .../private/IEServiceConnectionHandler.cpp | 4 +- .../service/private/NESystemService.cpp | 4 +- .../service/private/ServerConnection.cpp | 4 +- .../service/private/ServerReceiveThread.cpp | 12 +- .../service/private/ServerReceiveThread.hpp | 8 +- .../service/private/ServerSendThread.cpp | 10 +- .../service/private/ServerSendThread.hpp | 8 +- .../private/ServiceApplicationBase.cpp | 26 ++-- .../private/ServiceCommunicatonBase.cpp | 62 ++++---- .../service/private/SystemServiceBase.cpp | 6 +- .../posix/ServiceApplicationBasePosix.cpp | 4 +- .../win32/ServiceApplicationBaseWin32.cpp | 4 +- ...observerapi.vcxproj => areglogger.vcxproj} | 31 ++-- ...roj.filters => areglogger.vcxproj.filters} | 45 ++++-- framework/areglogger/CMakeLists.txt | 50 ++++++ .../client}/LogObserverApi.h | 46 +++--- .../areglogger/client/LogObserverSwitches.h | 135 ++++++++++++++++ .../areglogger/client/private/CMakeLists.txt | 5 + .../client}/private/LogObserverApi.cpp | 44 +++--- .../client}/private/LoggerClient.cpp | 6 +- .../client}/private/LoggerClient.hpp | 14 +- .../private/ObserverMessageProcessor.cpp | 8 +- .../private/ObserverMessageProcessor.hpp | 10 +- framework/areglogger/resources/RCa47136 | Bin 0 -> 2990 bytes .../resources/areglogger.def} | 2 +- framework/areglogger/resources/areglogger.rc | Bin 0 -> 4774 bytes framework/areglogger/resources/resource.h | 15 ++ framework/extend/CMakeLists.txt | 11 -- framework/logger/CMakeLists.txt | 12 +- framework/logger/app/Logger.hpp | 4 +- framework/logger/app/private/Logger.cpp | 2 +- .../app/private/LoggerConsoleService.hpp | 2 +- .../logger/app/private/win32/LoggerWin32.cpp | 2 +- .../logger/service/LoggerServerService.hpp | 2 +- .../private/LoggerMessageProcessor.hpp | 2 +- framework/logobserver/CMakeLists.txt | 55 ++----- framework/logobserver/app/CMakeLists.txt | 5 - framework/logobserver/app/LogObserver.hpp | 4 +- .../logobserver/app/NELogObserverSettings.hpp | 8 +- .../logobserver/app/private/CMakeLists.txt | 10 +- .../logobserver/app/private/LogObserver.cpp | 4 +- .../app/private/win32/LogObserverWin32.cpp | 4 +- framework/logobserver/app/resources/RCa47136 | Bin 0 -> 6662 bytes framework/logobserver/lib/CMakeLists.txt | 11 -- .../logobserver/lib/LogObserverSwitches.h | 135 ---------------- .../logobserver/lib/private/CMakeLists.txt | 5 - framework/mcrouter/CMakeLists.txt | 12 +- framework/mcrouter/app/MulticastRouter.hpp | 4 +- .../mcrouter/app/private/MulticastRouter.cpp | 2 +- .../app/private/RouterConsoleService.hpp | 2 +- .../private/win32/MulticastRouterWin32.cpp | 2 +- .../mcrouter/service/RouterServerService.hpp | 2 +- tests/areg-unit-tests.vcxproj | 2 +- tests/units/GUnitTest.cpp | 2 +- tests/units/OptionParserTest.cpp | 2 +- thirdparty/sqlite3/Readme.md | 2 +- 127 files changed, 919 insertions(+), 781 deletions(-) create mode 100644 conf/cmake/aregextend.pc.in create mode 100644 conf/cmake/areglogger.pc.in delete mode 100644 framework/areg-extend.vcxproj delete mode 100644 framework/areg-extend.vcxproj.filters create mode 100644 framework/areg/resources/resource.h create mode 100644 framework/aregextend.vcxproj create mode 100644 framework/aregextend.vcxproj.filters create mode 100644 framework/aregextend/CMakeLists.txt rename framework/{extend => aregextend}/Readme.md (66%) rename framework/{extend => aregextend}/console/Console.hpp (98%) rename framework/{extend => aregextend}/console/OptionParser.hpp (99%) rename framework/{extend => aregextend}/console/SystemServiceConsole.hpp (97%) rename framework/{extend => aregextend}/console/private/CMakeLists.txt (100%) rename framework/{extend => aregextend}/console/private/Console.cpp (96%) rename framework/{extend => aregextend}/console/private/OptionParser.cpp (99%) rename framework/{extend => aregextend}/console/private/SystemServiceConsole.cpp (94%) rename framework/{extend => aregextend}/console/private/ansi/ConsoleAnsi.cpp (98%) rename framework/{extend => aregextend}/console/private/ncurses/ConsoleNcurses.cpp (97%) rename framework/{extend => aregextend}/console/private/win32/ConsoleWin32.cpp (98%) rename framework/{extend => aregextend}/db/LogSqliteDatabase.hpp (98%) rename framework/{extend => aregextend}/db/SqliteDatabase.hpp (96%) rename framework/{extend => aregextend}/db/private/CMakeLists.txt (100%) rename framework/{extend => aregextend}/db/private/LogSqliteDatabase.cpp (99%) rename framework/{extend => aregextend}/db/private/SqliteDatabase.cpp (97%) create mode 100644 framework/aregextend/resources/aregextend.rc create mode 100644 framework/aregextend/resources/resource.h rename framework/{extend => aregextend}/service/DataRateHelper.hpp (94%) rename framework/{extend => aregextend}/service/IEServiceConnectionHandler.hpp (93%) rename framework/{extend => aregextend}/service/NESystemService.hpp (97%) rename framework/{extend => aregextend}/service/ServerConnection.hpp (98%) rename framework/{extend => aregextend}/service/ServiceApplicationBase.hpp (97%) rename framework/{extend => aregextend}/service/ServiceCommunicatonBase.hpp (98%) rename framework/{extend => aregextend}/service/SystemServiceBase.hpp (97%) rename framework/{extend => aregextend}/service/private/CMakeLists.txt (100%) rename framework/{extend => aregextend}/service/private/DataRateHelper.cpp (95%) rename framework/{extend => aregextend}/service/private/IEServiceConnectionHandler.cpp (85%) rename framework/{extend => aregextend}/service/private/NESystemService.cpp (87%) rename framework/{extend => aregextend}/service/private/ServerConnection.cpp (96%) rename framework/{extend => aregextend}/service/private/ServerReceiveThread.cpp (95%) rename framework/{extend => aregextend}/service/private/ServerReceiveThread.hpp (95%) rename framework/{extend => aregextend}/service/private/ServerSendThread.cpp (92%) rename framework/{extend => aregextend}/service/private/ServerSendThread.hpp (96%) rename framework/{extend => aregextend}/service/private/ServiceApplicationBase.cpp (87%) rename framework/{extend => aregextend}/service/private/ServiceCommunicatonBase.cpp (87%) rename framework/{extend => aregextend}/service/private/SystemServiceBase.cpp (97%) rename framework/{extend => aregextend}/service/private/posix/ServiceApplicationBasePosix.cpp (95%) rename framework/{extend => aregextend}/service/private/win32/ServiceApplicationBaseWin32.cpp (98%) rename framework/{logobserverapi.vcxproj => areglogger.vcxproj} (64%) rename framework/{logobserverapi.vcxproj.filters => areglogger.vcxproj.filters} (53%) create mode 100644 framework/areglogger/CMakeLists.txt rename framework/{logobserver/lib => areglogger/client}/LogObserverApi.h (93%) create mode 100644 framework/areglogger/client/LogObserverSwitches.h create mode 100644 framework/areglogger/client/private/CMakeLists.txt rename framework/{logobserver/lib => areglogger/client}/private/LogObserverApi.cpp (85%) rename framework/{logobserver/lib => areglogger/client}/private/LoggerClient.cpp (99%) rename framework/{logobserver/lib => areglogger/client}/private/LoggerClient.hpp (97%) rename framework/{logobserver/lib => areglogger/client}/private/ObserverMessageProcessor.cpp (97%) rename framework/{logobserver/lib => areglogger/client}/private/ObserverMessageProcessor.hpp (92%) create mode 100644 framework/areglogger/resources/RCa47136 rename framework/{logobserver/lib/resources/logobserverapi.def => areglogger/resources/areglogger.def} (95%) create mode 100644 framework/areglogger/resources/areglogger.rc create mode 100644 framework/areglogger/resources/resource.h delete mode 100644 framework/extend/CMakeLists.txt delete mode 100644 framework/logobserver/app/CMakeLists.txt create mode 100644 framework/logobserver/app/resources/RCa47136 delete mode 100644 framework/logobserver/lib/CMakeLists.txt delete mode 100644 framework/logobserver/lib/LogObserverSwitches.h delete mode 100644 framework/logobserver/lib/private/CMakeLists.txt diff --git a/areg-sdk.sln b/areg-sdk.sln index bf9f05fa8..2d99052c5 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} diff --git a/conf/cmake/areg.pc.in b/conf/cmake/areg.pc.in index 683cb69ca..096cc2f0f 100644 --- a/conf/cmake/areg.pc.in +++ b/conf/cmake/areg.pc.in @@ -5,9 +5,9 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: areg Description: AREG communication framework -Version: @PKGCONFIG_VERSION@ +Version: @PROJECT_VERSION@ URL: https://github.com/aregtech/areg-sdk -Libs: -L${libdir} -lareg -lareg-extend +Libs: -L${libdir} @AREG_LDFLAGS@ Requires: areg = @PROJECT_VERSION@ -Libs.private: @PKGCONFIG_LIBS_PRIVATE@ +Libs.private: -lareg Cflags: -I${includedir} diff --git a/conf/cmake/aregextend.pc.in b/conf/cmake/aregextend.pc.in new file mode 100644 index 000000000..60dbe0c4d --- /dev/null +++ b/conf/cmake/aregextend.pc.in @@ -0,0 +1,13 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix}/tools/areg +libdir=${prefix}/lib +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: aregextend +Description: Extended objects of AREG communication framework +Version: @PROJECT_VERSION@ +URL: https://github.com/aregtech/areg-sdk +Libs: -L${libdir} @AREG_EXTENDED_LIBS@ @AREG_LDFLAGS@ +Requires: aregextend = @PROJECT_VERSION@ +Libs.private: -lsqlite3 -laregextend -lareg +Cflags: -I${includedir} diff --git a/conf/cmake/areglogger.pc.in b/conf/cmake/areglogger.pc.in new file mode 100644 index 000000000..1731f5134 --- /dev/null +++ b/conf/cmake/areglogger.pc.in @@ -0,0 +1,13 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix}/tools/areg +libdir=${prefix}/lib +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 +Libs: -L${libdir} @AREG_EXTENDED_LIBS@ @AREG_LDFLAGS@ +Requires: aregextend = @PROJECT_VERSION@ +Libs.private: -lsqlite3 -lareglogger -laregextend -lareg +Cflags: -I${includedir} diff --git a/conf/cmake/functions.cmake b/conf/cmake/functions.cmake index 1ba112faa..4fb1db986 100644 --- a/conf/cmake/functions.cmake +++ b/conf/cmake/functions.cmake @@ -17,7 +17,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}) + target_link_libraries(${item} aregextend ${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 ) @@ -180,7 +180,7 @@ 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} aregextend ${library_list} areg ${AREG_EXTENDED_LIBS} ${AREG_LDFLAGS}) if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") target_compile_options(${item} PRIVATE -fPIC) diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index ddc94bd5c..ebbe5d6da 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -14,7 +14,7 @@ target_include_directories(areg PUBLIC ) # copy compiled binaries in the bin and lib directories -install(TARGETS areg logobserverapi areg-extend +install(TARGETS areg aregextend areglogger EXPORT ${AREG_PACKAGE_NAME} RUNTIME DESTINATION bin COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE @@ -24,7 +24,7 @@ install(TARGETS areg logobserverapi areg-extend PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) -install(TARGETS mcrouter logger logobserver +install(TARGETS logger logobserver mcrouter EXPORT ${AREG_PACKAGE_NAME} RUNTIME DESTINATION tools/${AREG_PACKAGE_NAME}-dbg COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE @@ -38,12 +38,12 @@ install(DIRECTORY framework/ PATTERN "*.h" PATTERN "*.hpp" PATTERN "logger" EXCLUDE - PATTERN "logobserver/app" EXCLUDE + PATTERN "logobserver" EXCLUDE PATTERN "mcrouter" EXCLUDE ) # Copy all CMake and MSVC configuration files. -install(DIRECTORY ${AREG_CMAKE_CONFIG_DIR} +install(DIRECTORY ${AREG_SDK_ROOT}/conf DESTINATION conf COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} ) @@ -76,4 +76,10 @@ install(DIRECTORY ${AREG_OUTPUT_BIN}/ configure_file("${AREG_CMAKE_CONFIG_DIR}/areg.pc.in" areg.pc @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/areg.pc" DESTINATION lib/pkgconfig) -install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} NAMESPACE areg:: FILE ${AREG_PACKAGE_NAME}.cmake EXPORT_LINK_INTERFACE_LIBRARIES) +configure_file("${AREG_CMAKE_CONFIG_DIR}/aregextend.pc.in" aregextend.pc @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/aregextend.pc" DESTINATION lib/pkgconfig) +configure_file("${AREG_CMAKE_CONFIG_DIR}/areglogger.pc.in" areglogger.pc @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/areglogger.pc" DESTINATION lib/pkgconfig) +install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} NAMESPACE ${AREG_PACKAGE_NAME}:: FILE areg.cmake EXPORT_LINK_INTERFACE_LIBRARIES) +install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} NAMESPACE ${AREG_PACKAGE_NAME}:: FILE aregextend.cmake EXPORT_LINK_INTERFACE_LIBRARIES) +install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} NAMESPACE ${AREG_PACKAGE_NAME}:: FILE areglogger.cmake EXPORT_LINK_INTERFACE_LIBRARIES) diff --git a/conf/cmake/user.cmake b/conf/cmake/user.cmake index cd8414746..b94818a46 100644 --- a/conf/cmake/user.cmake +++ b/conf/cmake/user.cmake @@ -8,7 +8,7 @@ # 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'. +# 4. AREG_LOGGER_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. @@ -29,7 +29,7 @@ # 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) @@ -215,8 +215,8 @@ if (NOT DEFINED AREG_BUILD_ROOT OR "${AREG_BUILD_ROOT}" STREQUAL "") endif() # 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") +if (NOT DEFINED AREG_LOGGER_LIB OR NOT "${AREG_LOGGER_LIB}" STREQUAL "static") + set(AREG_LOGGER_LIB "shared") endif() if (NOT DEFINED AREG_PACKAGES OR "${AREG_PACKAGES}" STREQUAL "") 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/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/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/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/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 aa8f8749d..688d610bd 100644 --- a/framework/areg.vcxproj +++ b/framework/areg.vcxproj @@ -382,6 +382,7 @@ + @@ -413,7 +414,6 @@ - @@ -435,6 +435,9 @@ + + + diff --git a/framework/areg.vcxproj.filters b/framework/areg.vcxproj.filters index 4dfe999c0..880bb4e39 100644 --- a/framework/areg.vcxproj.filters +++ b/framework/areg.vcxproj.filters @@ -1133,6 +1133,9 @@ Header Files + + Header Files + @@ -1143,11 +1146,6 @@ Resource Files - - - Resource Files - - @@ -1162,4 +1160,9 @@ + + + Resource Files + + \ No newline at end of file diff --git a/framework/areg/CMakeLists.txt b/framework/areg/CMakeLists.txt index a6a44652f..5c047fe39 100644 --- a/framework/areg/CMakeLists.txt +++ b/framework/areg/CMakeLists.txt @@ -8,6 +8,11 @@ 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 diff --git a/framework/areg/resources/areg.rc b/framework/areg/resources/areg.rc index 1e61f1da37aa1da0f28c2222ea491f39768613a0..01295a9a6562e352a4184168e09fdb1b96645b31 100644 GIT binary patch literal 4726 zcmdUyTTc@~6vxlAiQi!@FA`BG@ZzIDsl-AFy+jj|23x3&(2{N|n)un(-+!jV?sm7B zq9!$)-MO9nZO;Duv1ywY*|80*YhxQ(%zI@M_S)>lHnj`8X0>lGcp~fDr44z<>`xeb z?2Q?PH)Ymk9% zb!3MoTEFLegx34$DSK4d-{zh7$nSk{=j`k8vi4s+iv@{%bWE|8BIydf9~T?J@`3JZ zjX}By?+(eoYdjSb1Cc$)=R;N@4;##UR>rno5Cw56rv}bm&oa5ygW?-IB&vK)HOQY9 z*|iVn4$)QP5#8@R(L&57G|q_O4p=APuRE?ac2C%CF;-oih8+)Ah4vA-`qnm}-2iTn z9gi~)(c#o*wT}SlvN!^iA8j;w2iJrDt`-z$d58&(ddt|X7&3C_d+1(ul|s?y9i z=e9MgzVe^9n6Ok=9>b%k;+HI6Z%TGf-8v_teeF-ATqM!XBPCjv&zh^pJu*!-#y_eN zMfD~hZNW#YRaMf`NJ6c{sJmY`e2m5;{1NtpCT+5>15AZHZ@4@7gtat3B+rDMJ_-B6 zj(|8KuPbvf5fQv$uidL}**zZP6fSk*utgneE`b*~9lAPFMbcyHNrO5N5#e8L2XEG# zZi>*Pf~e9}s6H(+CM$D7$x|rb<6lyhV{G;?{8kEHcb2$jG3vg%&+8S3(@x`#2N`uut8UCgW(;eB=dvg{pNj_vbOTGYVnI}Y;JEq+pj_3_8# z-c$J#bvXO3^oI-y@6`2xglLtH(1GAjBvXuWc@{%qh#Cv`x zTPxbwb$suy$JCx|4mF{s>JZ~C`7fQnx(R$`QoSe>WvaUA{7j@xW;$Qo75tq(J$*y3 z)?C`BUw?l-^cR-zidIXbv^3I8>oET5|G2u;hyTZeEz?r0)?5-Uj`tyTNEI*t_nr5< GDE$KRzc#S| literal 2721 zcmcImZExZ@5dNNDF_(S;EenC}y-BB&0twlOG(m*W?Wqz<69c|YY|csABJGdAao!4B zy1O4(BfuWdo1Yoacrbt)8VR29O%5xX6=4FCckf_J7!hGkVh|+bg@_1bk)Zp$uM7st z6=hLU#01n(knNyh$=X?ex8JJ@@@-OS{3+}2{#GvR*Hyt}9N&iF!uAjZlWh~4?VuC%{eHJSa#ki4{8A-S+|j3>Fettk zEGFjKaGWlD`2xqAOMPLjO*iN^$+*UBydEiz?plFvnII>~U^%w`u?K!IJ|?UKU%A?g zaGQn@@tCal;g)oUqhCj;kFc0-U@)jPUK|6N3#;mS;8amo{<^snwmbEpUdXuuQ`<3X z0*rc^{3tMAct$W;zM@O!siRx|jqcAtdmjGowD1__IIt>xC5zm~U6N$vl&VRpgrFjO zK5~B0H0^^^5tesz6G@|biOALz6daqD?J9s{?0AzIsD3Ue+fHdhY_{QQwbe2mF=~HE z6AxO&Qf{2ENyWjS4tFnOQTlz{n&&VeOp4ARqr(J0JO z5~c#}K5_9Gi~|c(8lheG`I`<)<8`W_;U-J!%2}sFw**z5QjQuUo8?5XFgZS|bouNN z9kLCR3Ev+C-R^RE!gc|js0$-)_#3>Je}A5p_fU?aG3hNHti)C}kbaybX9ebh$3>KX z?HuBn9ayvzobe)q1^KTaS>6CzRZlL!$Da0t`oSQNB;k9R3^1d4?<>69l=xw|YrlRR zanm(Q^qc=W>sO)pR?62gT8fZmn6_0`Y0r2AdN3Smc)@WBXT^2fW6Nj7#h(yWx2zCmJpW!0nm6PB Dd#$}> diff --git a/framework/areg/resources/resource.h b/framework/areg/resources/resource.h new file mode 100644 index 000000000..cac7b35e0 --- /dev/null +++ b/framework/areg/resources/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by areg.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/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..5388f32fc --- /dev/null +++ b/framework/aregextend/CMakeLists.txt @@ -0,0 +1,17 @@ +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 +addStaticLib(aregextend "${extend_SRC}") +set_target_properties(aregextend PROPERTIES VERSION ${AREG_PROJECT_VERSION}) +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 0000000000000000000000000000000000000000..ac6cbeccd8eff4a23f0b54fe012a07bf6ec0aff4 GIT binary patch literal 4648 zcmdUzTTdE66vxkVlYWOSzSPvHs7d3a7o?^rMlNX+6QY3B)`DR%wn;yG+uwhNkzIDN z0ezsEEVFawoHOS>XZiDc!!|6k6T7jt4Q*gC&$W$!HG#!;ZcHMHBI{Y#`aDD6 zBjygUA+zZ2d290?u@bi%y8~z4UfU~9*>Lj;&_27jV0RpDAw$1zU##G;MY-bet{t6t z@7bBvtZofEv}3DU%g(I?^pN*ctJr5CHGWTQA4rAwaK2<%z7eDgb7W=gGHv5)tTeFi z=s&_bvO^uMKk<8v)(7Y*dz650@l1Q<-#&P7_VsjW`!Aoxf z$e#w;b->9jqN~CX-(QSqCS@HS=frRes#EA!-KiCzr$8IbWf!Lb;_=GxJ|>Ms9x}-OH|02s;{& z{K|V_o8#&$|9OjvN_AzCGx92a!Ls$HU>DS_3nJRr{)v>cB-&n3qIu6*arL-Erm4pG zp&F4_Z?e%Ae6(CuB`J+0)H=+%`*p*|Xgt6l0Uk7Il6@_3O5}OX-NC1p4#h|ME>$_kW>4d9Ch&D<>C`ku75O~x9c0wl8PiNG zSEsi*Lqd=DKC|y@XBsP
    i2X{%UQmMI{?2;Zwq>*1{%H0$ECKC%v`GBclB$dEKw zX|jojHDB?Y&hZINUY!cNVQ%6_^*gdb0lC!|-Es5v?I$sK$*K!n_ecRu^)x+qN46jP z%D`!QPIC_0AHpHo(fX_iCsa9G{hDsAWDi^-#&k3L?nHg^0L{MwX#`a+rtN$=wsUu^^}6d* zuIAF90{@=lE}!1vO~qjkuZi7)ByYvb^*D4uDFQMNV zXAQ{vdlvz-EU2%i&YZqabAE0FOz!;<3t31yyPH^R_-MODszo}M>u^&($9O~?Z8GCj zyL~NDh8OX;>ZGruUfzkclQ-?pzQ {B29F438E-904C-4929-903C-F4673182A417} - logobserverapi - logobserverapi + areglogger + areglogger Win32Proj @@ -34,23 +34,28 @@ - + + + + + - - - - + + + - - - + + + + - - - + + + + diff --git a/framework/logobserverapi.vcxproj.filters b/framework/areglogger.vcxproj.filters similarity index 53% rename from framework/logobserverapi.vcxproj.filters rename to framework/areglogger.vcxproj.filters index e9a54bf98..c04dc9c76 100644 --- a/framework/logobserverapi.vcxproj.filters +++ b/framework/areglogger.vcxproj.filters @@ -15,38 +15,53 @@ - - Source Files - - - - + + Header Files + + Header Files - + Header Files - + Header Files - + Header Files - + Source Files - + Source Files - + Source Files - - - + + Resource 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..92b0ee17c --- /dev/null +++ b/framework/areglogger/CMakeLists.txt @@ -0,0 +1,50 @@ +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 "${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(AREG_LOGGER_LIB MATCHES "static") + # build log observer API static library + addStaticLib(areglogger "${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") +set_target_properties(areglogger PROPERTIES VERSION ${AREG_PROJECT_VERSION}) 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 85% rename from framework/logobserver/lib/private/LogObserverApi.cpp rename to framework/areglogger/client/private/LogObserverApi.cpp index f5e64ea5b..9bbba544a 100644 --- a/framework/logobserver/lib/private/LogObserverApi.cpp +++ b/framework/areglogger/client/private/LogObserverApi.cpp @@ -7,25 +7,25 @@ * 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") #pragma comment(lib, "sqlite3") #endif // WINDOWS @@ -94,7 +94,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 +110,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 +127,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 +140,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 +154,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 +175,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 +194,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 +213,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 +226,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 +239,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 +256,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 +269,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 +281,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 +293,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 +311,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/areglogger/resources/RCa47136 b/framework/areglogger/resources/RCa47136 new file mode 100644 index 0000000000000000000000000000000000000000..c41e59b6215265ee01eb57d38b7360146f5383ca GIT binary patch literal 2990 zcmd6p-ER^>6vfZ8iT}e0FE(lw3iacS(n=aBH3b??NC@GhMJt#tO<(-u{oR?}7TB#6 z^|q=iEE@+}Wb8G}TOFIh9mUT_4nA{M5DP`UXDKLXpP?U}IhA74IW`_t*q% zpdaA3%)gG&Wabsv1!K$?^J?}H*bPrZ|7>X1>|H;jpr?AG;tEGYUNf9dU_NBt-20rs z)9D;6!v6ppM>H=O&NHwWjq8H@2yC5;!_K@-iG876zp||p7+8*m_`Jc^a#cv#m$116 zUuRs65wn}z<+`TNYOABJ4t1wBr)p$EqOHF+RX>&c%0Z5bQByQuBzmc#@?oJKj zUC+5y%baR)WcbqOu|w2f$ip#F*NM~eam4p>#tv=XlUtwPu(R2_QNnY=F@IS!M#ip4 zoy~luO~}LF)yk@BLKWsS;v{OjJ9dADUac!d)QHn_YGTG)qT4o4LB)}FGO8qsGq~K> z-o@Ay1v)*8GaLHeh!tx3NEHSRw$WP`HP&I$ry83KTjv+UJ!sj%#~C%>$Et<>j$g3} z+5+uzZ}_@?ua|f!r8t)FFyk0{Mb^%nPR?QY32%qqOaAvX(VIi(S!z$dhswX-x3b>) z2uoxv+tTsHtPb$o@IA!d9_r0Ky@~s??NP|yvP$;i-eA3FyY-5`@2s8=1x`e(u;p%4 z@MmBTG@KLmzKK()-My_j*=f7YN)=V&s;1{1pA)P?oA@{1Mro>todQ E8}m4DivR!s literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..3510541e2aaecf697e6c7fdb3daa782893fc8cdf GIT binary patch literal 4774 zcmdUz%Wl&^6o$_liFYvR1_Yu_VL_L)O+!W6ROBL%kfNq(Lqu^ZJLMwr?7;WWWNJHh z3MnjtEN8~Y=YE^x{QR+Ln-j+rFD!OZSXY3=M#BE|%;5@bab`L3=ZruPH^Y#+#k;AQ(=%3mLt2t~@ZaBOPM#}ypZ&45>>ZE}zelzUq{TkSmk#T91?|EbSrfl3`uGAbP3;r* z&+v}?(8cPv{2pTU9(Kwf4dC0{ixK&K48A!3db*hF?BrQ|?l4~coqQ>eoZJ71NlJ*vopG*?p-=dTBa+8V*}r5%t}zNR|V zPmk)_L-K&^YH^A0cdlqDWfvZA$l(E0$Iw4=Qd>Zef%aINE>8o*<2B)ZNUgrIC-Clo zw+qD6EMg3J>#N#lfNWWw0jiHamb^yl{(sjCs;fNYgjU^kd{&Jax%a!+-gKQp*wOqd zciuYP`h&fR=m}gmjK&6Q~ z|0cji9f5I3Wj7XZB69eN?YLXNb$5A+6Qs1s!ycWey8>O1bl^Hk6HSlkC>=UMM23I0 zXGF8*Y*U72Jw&~(LI3GdGew;Uut> z$voF(x;a5ZkGEZV@4IIaD@d;H1nRYIyerSt&|pUFHK&b<)&$GWiCK)U(}l{c<`ycX z$aTwJV9k!RXvnXh@B(gFZ|4}W`ovKak9<%=Z%sy5oPDuno?)yVcwkTg?y&tET-$4_^L}eXB@pA#LnrDRx(QL-{r)Ie-fHuB(HGV!KDu)GbH;uKcXj1-CHqg{JB8ad`prr)R!%A= z`gR*3e-+ObIsa{rW-~{~)-t5nS^D@SxrygpI#sdSx^Po3N%45*ZC`CVH+&yccd3(w z>e0T3dwnx)vz^{ApCSIuT%SMB*K059^S3{3Z~JO1&rs`SQC=HarsuH!?f1K8TK^rM g{i9O+eh 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/CMakeLists.txt b/framework/logobserver/CMakeLists.txt index e0706a601..8609bcbca 100644 --- a/framework/logobserver/CMakeLists.txt +++ b/framework/logobserver/CMakeLists.txt @@ -1,53 +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") -set_target_properties(logobserverapi PROPERTIES VERSION ${AREG_PROJECT_VERSION}) +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) +if (AREG_LOGGER_LIB MATCHES "shared") + addExecutableEx(logobserver "${logobserver_SRC}" areglogger) + target_compile_definitions(logobserver PRIVATE IMP_LOGGER_DLL) +else (AREG_LOGGER_LIB MATCHES "static") + addExecutableEx(logobserver "${logobserver_SRC}" areglogger ${AREG_SQLITE_LIB_REF}) + target_compile_definitions(logobserver PRIVATE IMP_LOGGER_LIB) endif() set_target_properties(logobserver PROPERTIES VERSION ${AREG_PROJECT_VERSION}) 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 0000000000000000000000000000000000000000..c3197384a24ef97f7a75f496094f5a345165da1b GIT binary patch literal 6662 zcmdU!TTkOg6vxkVrG5uDymZwqkU&}5H?G;J*#wcxwh|J`0%2)^pg1gBsUN<-|BNTL z6X&MwLy+azo;l~txt}wW4ZF8Hd$b#itZXGavfu22>&b>Tu)i3;vXRAZtjE}m-P+H5 zU)$eqtj}1_9vFWCewd8j^M1?y3CJ5pzqnt~?Lqm;VTx7^%ro;>?p^c6n41o!WZ&C& zwvpplBU@aNeL#*Y;0BIrAFdZQPJ$8z2BjDJht1U zzl`vVq4UI15*?G)mycd!x&D%te2+B8PL4*Q6*rt0t;v}1yD)>_HoAs1Da2MgHk9eXi7UKbt{YX4K@)dGpi#MMs zV|!B&A#tL?)aDh-W~|75NaDp;nrl`#uu~$?=bskQ(jgNa!O0~aT<6j{|8hk$G275M zC*Ci?YJmU7aZzWq!DxqPm6-@ye#FC7`L2=I-rHN|TEHF7gt%mOIX z1ZKqeBj2j^g7#g2{N>7d)}7-na^G1#eKvjoMxGOc={bw}7AK-AeuN{c_gt#n|0J^y zJbmpJ$2EMVj;~d@53%eC{?m285m@=FhBr3xr2OdYuUQ?yW+Ic%tAUFa74`sL>I>+v z&P7a}^LogyoVT|3U{!>)pID}nt!E|+IXwG}sP08IepUqR+OCU$G8QSujNJSoRI7MW z!+n(sx&`0EUD$R~OO>5MACP9qUGr5@9mgu`d7CZYe_X)f1<~RCuSC>O_pT*kXm&SJ z0)LW5+M7(zE$TSu^$ye2inuN6T8g-wU(r|LW05uYu(mvFXGLpH%DZ@-J-5z=%Y42& z3^_^OzidC6`r%&Uhp#EJ)sJXrrmjWN(_^1`k49$2_PZpuwevZ5v0LTsz*YVehn0_N zW$6~RLK*Rlr}hbLa<#gNqN~KL-&d$3QGQU@p&hVxnnS*t6FcFwjtv~=vnpa*HI7!O zT_sj8s&bxMaX#8-_aF4Pp1u&c3s3FtrCs#`*`7i3*=o0MK4!YkroP^{u&Ap0rSpbU z-bGFQK$ua6*SM&i0wwF`A#`5ymbmw~*WMWvns`r#?xDQ|e4u;^ef6upFKDrMjG+9L ze9~veOO&nE>XJ|J-wrrg4pTZFzdXji!OwISGY@(@1D)M_1}>ZM=jrakovz&kBS5q{ zJ2->0{OV!WciVZGux362)sr{Tq4ZE<)imBuv9@BpM)dcwyZ7mN*y3`VET`uuev2@= zt{dw(&UFT+(}E}R$|Id*gQw27N^Zwc0#ZHfEj;OLOuezJ;Hl>61YVDU%$_EBe@*Fy zoYBInlGx{tZ_OITyyRmh@KB~p-X7mYvPj>Oc*s-z<)l_-@mxf!?(`=r()1HLRyMyy zm!q+kr)RV;J#zcP3cOaZW)baXLQB;_D+C+pD{DpVXQodmH{t9ncM;_?C=b|;K4bOK zl>9#PYezZXhKngLZ=p1kr*HYl=_2)Ttb=(mllPW3Sn~cD4Ql6~^;qR4A5q#tm$8I0 zf$~bqMf#S_#ATp;*E_p^`G3wL*0X|%E1%2L{!9AvJC9X6dr?|%IfJ}@GiN_T0YYxS0x{^#I7cJEwc literal 0 HcmV?d00001 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 7f5740d89..a861cfc80 100644 --- a/framework/mcrouter/CMakeLists.txt +++ b/framework/mcrouter/CMakeLists.txt @@ -1,10 +1,14 @@ 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}") target_compile_options(mcrouter PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") @@ -12,11 +16,11 @@ set_target_properties(mcrouter PROPERTIES VERSION ${AREG_PROJECT_VERSION}) 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" "${AREG_OUTPUT_BIN}/mcrouter.service.install.bat" + COMMAND ${CMAKE_COMMAND} -E copy "${mcrouter_BASE}/resources/mcrouter.service.uninstall.bat" "${AREG_OUTPUT_BIN}/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" "${AREG_OUTPUT_BIN}/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/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/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. From 148ffcdfd4a554cf7e2d36c6cef43c247af70435 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Sun, 6 Oct 2024 00:12:32 +0200 Subject: [PATCH 08/24] Making fixes in --- conf/cmake/clang.cmake | 3 +- conf/cmake/common.cmake | 7 +- conf/cmake/functions.cmake | 77 ++++---- conf/cmake/gnu.cmake | 3 +- conf/cmake/install.cmake | 165 +++++++++++++----- conf/cmake/msvc.cmake | 1 + conf/{cmake => exports}/areg.pc.in | 2 +- conf/{cmake => exports}/aregextend.pc.in | 2 +- conf/{cmake => exports}/areglogger.pc.in | 2 +- conf/exports/config.cmake.in | 23 +++ conf/exports/logger.service.in | 20 +++ conf/exports/logger.service.install.bat.in | 8 + conf/exports/logger.service.uninstall.bat.in | 8 + conf/exports/mcrouter.service.in | 20 +++ conf/exports/mcrouter.service.install.bat.in | 8 + .../exports/mcrouter.service.uninstall.bat.in | 8 + 16 files changed, 272 insertions(+), 85 deletions(-) rename conf/{cmake => exports}/areg.pc.in (89%) rename conf/{cmake => exports}/aregextend.pc.in (86%) rename conf/{cmake => exports}/areglogger.pc.in (86%) create mode 100644 conf/exports/config.cmake.in create mode 100644 conf/exports/logger.service.in create mode 100644 conf/exports/logger.service.install.bat.in create mode 100644 conf/exports/logger.service.uninstall.bat.in create mode 100644 conf/exports/mcrouter.service.in create mode 100644 conf/exports/mcrouter.service.install.bat.in create mode 100644 conf/exports/mcrouter.service.uninstall.bat.in diff --git a/conf/cmake/clang.cmake b/conf/cmake/clang.cmake index b8f54da12..a9d07f7c1 100644 --- a/conf/cmake/clang.cmake +++ b/conf/cmake/clang.cmake @@ -20,7 +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") if(CMAKE_BUILD_TYPE MATCHES Release) @@ -38,6 +38,7 @@ 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") diff --git a/conf/cmake/common.cmake b/conf/cmake/common.cmake index 2ddf5eed1..c0c97171a 100644 --- a/conf/cmake/common.cmake +++ b/conf/cmake/common.cmake @@ -47,10 +47,12 @@ 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) @@ -101,6 +103,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) diff --git a/conf/cmake/functions.cmake b/conf/cmake/functions.cmake index 4fb1db986..d7bfb1922 100644 --- a/conf/cmake/functions.cmake +++ b/conf/cmake/functions.cmake @@ -543,6 +543,46 @@ macro(macro_normalize_path normal_path os_path) endif() endmacro(macro_normalize_path) +function(addServiceInterface_full gen_project_name source_root relative_path sub_dir interface_name build_root_path interface_output_path codegen_tool_path) + + if (NOT ${Java_FOUND}) + message(FATAL_ERROR "AREG Setup: No Java found, cannot run code generator. Install Java 17 or higher and try again!") + return() + endif() + + set(interface_doc) + if (${sub_dir} STREQUAL "") + macro_normalize_path(interface_doc "${source_root}/${relative_path}/${interface_name}.siml") + else() + macro_normalize_path(interface_doc "${source_root}/${relative_path}/${sub_dir}/${interface_name}.siml") + endif() + + execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -jar ${codegen_tool_path} --root=${build_root_path} --doc=${interface_doc} --target=${interface_output_path}) + + 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 + ${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 + ) + + if (TARGET ${gen_project_name}) + target_sources(${gen_project_name} PRIVATE "${proj_src}") + 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}") + endif() +endfunction(addServiceInterface_full) + # --------------------------------------------------------------------------- # Description : This function calls service interface code generator to # generate codes, includes the generated codes either in the @@ -575,40 +615,11 @@ endmacro(macro_normalize_path) # --------------------------------------------------------------------------- function(addServiceInterfaceEx gen_project_name source_root relative_path sub_dir interface_name) - if (NOT ${Java_FOUND}) - message(FATAL_ERROR "AREG Setup: No Java found, cannot run code generator. Install Java 17 or higher and try again!") - return() - endif() - - set(interface_doc) - if (${sub_dir} STREQUAL "") - macro_normalize_path(interface_doc "${source_root}/${relative_path}/${interface_name}.siml") - else() - macro_normalize_path(interface_doc "${source_root}/${relative_path}/${sub_dir}/${interface_name}.siml") - 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}) - - 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 - ) + macro_normalize_path(build_root_path "${AREG_BUILD_ROOT}") + macro_normalize_path(interface_output_path "${AREG_GENERATE}/${relative_path}") + macro_normalize_path(codegen_tool_path "${AREG_SDK_TOOLS}/codegen.jar") - if (TARGET ${gen_project_name}) - target_sources(${gen_project_name} PRIVATE "${proj_src}") - 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}") - endif() + addServiceInterface_full(${gen_project_name} "${source_root}" "${relative_path}" "${sub_dir}" "${interface_name}" "${build_root_path}" "${interface_output_path}" "${codegen_tool_path}") endfunction(addServiceInterfaceEx) diff --git a/conf/cmake/gnu.cmake b/conf/cmake/gnu.cmake index 00d86f609..652617606 100644 --- a/conf/cmake/gnu.cmake +++ b/conf/cmake/gnu.cmake @@ -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 ebbe5d6da..bb1e9ce1a 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -8,78 +8,153 @@ message(STATUS "AREG: >>> Preparing AREG SDK installation settings, CMAKE_PACKAG include(GNUInstallDirs) include(CMakePackageConfigHelpers) set(AREG_PACKAGE_NAME "areg") +set(AREG_EXPORTS_DIR "${AREG_CMAKE_CONFIG_DIR}/../exports") +set(AREG_INSTALL_DST "${CMAKE_INSTALL_PREFIX}") -target_include_directories(areg PUBLIC - $ +target_include_directories(areg PUBLIC $) + +# Copy AREG SDK all headers +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 compiled binaries in the bin and lib directories install(TARGETS areg aregextend areglogger EXPORT ${AREG_PACKAGE_NAME} - RUNTIME DESTINATION bin COMPONENT Development COMPONENT ${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 ${AREG_PACKAGE_NAME} + LIBRARY DESTINATION bin COMPONENT Development COMPONENT Runtime PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - ARCHIVE DESTINATION lib COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} + ARCHIVE DESTINATION lib COMPONENT Development COMPONENT Runtime PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) -install(TARGETS logger logobserver mcrouter - EXPORT ${AREG_PACKAGE_NAME} - RUNTIME DESTINATION tools/${AREG_PACKAGE_NAME}-dbg COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ GROUP_EXECUTE WORLD_EXECUTE +# Copy AREG configuration file +install(DIRECTORY "${AREG_OUTPUT_BIN}/config" + DESTINATION bin + COMPONENT Development COMPONENT Runtime ) -# Copy AREG SDK all headers -install(DIRECTORY framework/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} +# Copy AREG SDK 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 - FILES_MATCHING - PATTERN "*.h" - PATTERN "*.hpp" - PATTERN "logger" EXCLUDE - PATTERN "logobserver" EXCLUDE - PATTERN "mcrouter" EXCLUDE ) # Copy all CMake and MSVC configuration files. -install(DIRECTORY ${AREG_SDK_ROOT}/conf - DESTINATION conf COMPONENT Development COMPONENT ${AREG_PACKAGE_NAME} +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 COMPONENT ${AREG_PACKAGE_NAME} + 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 AREG SDK license -install(FILES LICENSE.txt - DESTINATION share/${AREG_PACKAGE_NAME} COMPONENT Development COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} - RENAME copyright - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +# 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 library +install(TARGETS areg + 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 AREG configuration file -install(DIRECTORY ${AREG_OUTPUT_BIN}/config - DESTINATION bin COMPONENT Runtime COMPONENT ${AREG_PACKAGE_NAME} +install(DIRECTORY "${AREG_OUTPUT_BIN}/config" + DESTINATION tools/${AREG_PACKAGE_NAME} + COMPONENT Development COMPONENT Runtime + 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 + + +configure_file("${AREG_EXPORTS_DIR}/areg.pc.in" areg.pc @ONLY) +configure_file("${AREG_EXPORTS_DIR}/aregextend.pc.in" aregextend.pc @ONLY) +configure_file("${AREG_EXPORTS_DIR}/areglogger.pc.in" areglogger.pc @ONLY) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/areg.pc" + "${CMAKE_CURRENT_BINARY_DIR}/aregextend.pc" + "${CMAKE_CURRENT_BINARY_DIR}/areglogger.pc" + DESTINATION lib/pkgconfig + COMPONENT Development COMPONENT Runtime ) -configure_file("${AREG_CMAKE_CONFIG_DIR}/areg.pc.in" areg.pc @ONLY) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/areg.pc" DESTINATION lib/pkgconfig) -configure_file("${AREG_CMAKE_CONFIG_DIR}/aregextend.pc.in" aregextend.pc @ONLY) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/aregextend.pc" DESTINATION lib/pkgconfig) -configure_file("${AREG_CMAKE_CONFIG_DIR}/areglogger.pc.in" areglogger.pc @ONLY) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/areglogger.pc" DESTINATION lib/pkgconfig) -install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} NAMESPACE ${AREG_PACKAGE_NAME}:: FILE areg.cmake EXPORT_LINK_INTERFACE_LIBRARIES) -install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} NAMESPACE ${AREG_PACKAGE_NAME}:: FILE aregextend.cmake EXPORT_LINK_INTERFACE_LIBRARIES) -install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} NAMESPACE ${AREG_PACKAGE_NAME}:: FILE areglogger.cmake EXPORT_LINK_INTERFACE_LIBRARIES) +if ((WIN32) OR (CYGWIN)) + + configure_file("${AREG_EXPORTS_DIR}/logger.service.install.bat.in" "logger.service.install.bat" @ONLY) + configure_file("${AREG_EXPORTS_DIR}/logger.service.uninstall.bat.in" "logger.service.uninstall.bat" @ONLY) + configure_file("${AREG_EXPORTS_DIR}/mcrouter.service.install.bat.in" "mcrouter.service.install.bat" @ONLY) + configure_file("${AREG_EXPORTS_DIR}/mcrouter.service.uninstall.bat.in" "mcrouter.service.uninstall.bat" @ONLY) + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/logger.service.install.bat" + "${CMAKE_CURRENT_BINARY_DIR}/logger.service.uninstall.bat" + "${CMAKE_CURRENT_BINARY_DIR}/mcrouter.service.install.bat" + "${CMAKE_CURRENT_BINARY_DIR}/mcrouter.service.uninstall.bat" + DESTINATION tools/${AREG_PACKAGE_NAME} + COMPONENT Development COMPONENT Runtime + CONFIGURATIONS Release + ) + +else() + + configure_file("${AREG_EXPORTS_DIR}/logger.service.in" "logger.service" @ONLY) + configure_file("${AREG_EXPORTS_DIR}/mcrouter.service.in" "mcrouter.service" @ONLY) + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/logger.service" + "${CMAKE_CURRENT_BINARY_DIR}/mcrouter.service" + DESTINATION share/${AREG_PACKAGE_NAME}/service + COMPONENT Development COMPONENT Runtime + CONFIGURATIONS Release + ) + +endif() + +write_basic_package_version_file(${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}/${AREG_PACKAGE_NAME}-config.cmake" INSTALL_DESTINATION share/${AREG_PACKAGE_NAME}) + +export(TARGETS areg aregextend areglogger + NAMESPACE ${AREG_PACKAGE_NAME}:: + FILE ${AREG_PACKAGE_NAME}-export.cmake + EXPORT_LINK_INTERFACE_LIBRARIES +) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-config-version.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-config.cmake" + DESTINATION share/${AREG_PACKAGE_NAME} + COMPONENT Development + CONFIGURATIONS Release +) + +install(EXPORT ${AREG_PACKAGE_NAME} + DESTINATION share/${AREG_PACKAGE_NAME} + COMPONENT Development + NAMESPACE ${AREG_PACKAGE_NAME}:: + FILE areg.cmake + EXPORT_LINK_INTERFACE_LIBRARIES + CONFIGURATIONS Release +) diff --git a/conf/cmake/msvc.cmake b/conf/cmake/msvc.cmake index 3e6a5e485..ea72368c0 100644 --- a/conf/cmake/msvc.cmake +++ b/conf/cmake/msvc.cmake @@ -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/areg.pc.in b/conf/exports/areg.pc.in similarity index 89% rename from conf/cmake/areg.pc.in rename to conf/exports/areg.pc.in index 096cc2f0f..77b928679 100644 --- a/conf/cmake/areg.pc.in +++ b/conf/exports/areg.pc.in @@ -7,7 +7,7 @@ Name: areg Description: AREG communication framework Version: @PROJECT_VERSION@ URL: https://github.com/aregtech/areg-sdk -Libs: -L${libdir} @AREG_LDFLAGS@ +Libs: -L${libdir} @AREG_LDFLAGS_STR@ Requires: areg = @PROJECT_VERSION@ Libs.private: -lareg Cflags: -I${includedir} diff --git a/conf/cmake/aregextend.pc.in b/conf/exports/aregextend.pc.in similarity index 86% rename from conf/cmake/aregextend.pc.in rename to conf/exports/aregextend.pc.in index 60dbe0c4d..c101f0f9c 100644 --- a/conf/cmake/aregextend.pc.in +++ b/conf/exports/aregextend.pc.in @@ -7,7 +7,7 @@ Name: aregextend Description: Extended objects of AREG communication framework Version: @PROJECT_VERSION@ URL: https://github.com/aregtech/areg-sdk -Libs: -L${libdir} @AREG_EXTENDED_LIBS@ @AREG_LDFLAGS@ +Libs: -L${libdir} @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ Requires: aregextend = @PROJECT_VERSION@ Libs.private: -lsqlite3 -laregextend -lareg Cflags: -I${includedir} diff --git a/conf/cmake/areglogger.pc.in b/conf/exports/areglogger.pc.in similarity index 86% rename from conf/cmake/areglogger.pc.in rename to conf/exports/areglogger.pc.in index 1731f5134..44d74f3f6 100644 --- a/conf/cmake/areglogger.pc.in +++ b/conf/exports/areglogger.pc.in @@ -7,7 +7,7 @@ Name: areglogger Description: Log observer client of AREG communication framework Version: @PROJECT_VERSION@ URL: https://github.com/aregtech/areg-sdk -Libs: -L${libdir} @AREG_EXTENDED_LIBS@ @AREG_LDFLAGS@ +Libs: -L${libdir} @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ Requires: aregextend = @PROJECT_VERSION@ Libs.private: -lsqlite3 -lareglogger -laregextend -lareg Cflags: -I${includedir} diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in new file mode 100644 index 000000000..707f5fe42 --- /dev/null +++ b/conf/exports/config.cmake.in @@ -0,0 +1,23 @@ +@PACKAGE_INIT@ +include(CMakeFindDependencyMacro) + +set(AREG_SDK_ROOT "@CMAKE_INSTALL_PREFIX@") +set(AREG_BASE "@CMAKE_INSTALL_FULL_INCLUDEDIR@") +set(AREG_CMAKE_CONFIG_DIR "@CMAKE_INSTALL_PREFIX@/share/@AREG_PACKAGE_NAME@/conf/cmake") +set(AREG_SDK_TOOLS "@CMAKE_INSTALL_PREFIX@/tools/@AREG_PACKAGE_NAME@) + +set(AREG_BINARY "@AREG_BINARY@") +set(AREG_BUILD_TYPE "@AREG_BUILD_TYPE@") +set(AREG_LOGS "@AREG_LOGS@") +set(AREG_LOGGER_LIB "@AREG_LOGGER_LIB@") + +option(AREG_BUILD_TESTS "No AREG Unit Tests" OFF) +option(AREG_BUILD_EXAMPLES "No AREG Examples" OFF) + +include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") +check_required_components("@PROJECT_NAME@") + +# Change the generated directory if the output should be somewhere else +set(AREG_GENERATE "${CMAKE_BINARY_DIR}/generate") +# Change the build root directory if compiled fines are copied somewhere else. +set(AREG_BUILD_ROOT "${CMAKE_CURRENT_BINARY_DIR}") 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 From bfd1a04d8149776f2f21f6d59d649ef4eddd6aa7 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Sun, 6 Oct 2024 00:28:09 +0200 Subject: [PATCH 09/24] fixing vcpkg errors --- conf/cmake/install.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index bb1e9ce1a..29ad7598f 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -145,9 +145,9 @@ export(TARGETS areg aregextend areglogger install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-config-version.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-export.cmake" DESTINATION share/${AREG_PACKAGE_NAME} COMPONENT Development - CONFIGURATIONS Release ) install(EXPORT ${AREG_PACKAGE_NAME} @@ -156,5 +156,4 @@ install(EXPORT ${AREG_PACKAGE_NAME} NAMESPACE ${AREG_PACKAGE_NAME}:: FILE areg.cmake EXPORT_LINK_INTERFACE_LIBRARIES - CONFIGURATIONS Release ) From e99e38ed6c959843360183734c1c762f89b0e2bd Mon Sep 17 00:00:00 2001 From: Aregtech Date: Sun, 6 Oct 2024 00:51:51 +0200 Subject: [PATCH 10/24] fixed cmake script bug --- conf/cmake/install.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index 29ad7598f..325140d25 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -145,7 +145,6 @@ export(TARGETS areg aregextend areglogger install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-config-version.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-export.cmake" DESTINATION share/${AREG_PACKAGE_NAME} COMPONENT Development ) @@ -154,6 +153,6 @@ install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} COMPONENT Development NAMESPACE ${AREG_PACKAGE_NAME}:: - FILE areg.cmake + FILE areg-export.cmake EXPORT_LINK_INTERFACE_LIBRARIES ) From e397caa321de297561a9934e7c9933b90b167d49 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Sun, 6 Oct 2024 01:16:08 +0200 Subject: [PATCH 11/24] fixing vcpkg --- conf/cmake/install.cmake | 4 ++-- conf/exports/config.cmake.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index 325140d25..bf4290b4b 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -138,7 +138,7 @@ configure_package_config_file("${AREG_EXPORTS_DIR}/config.cmake.in" "${CMAKE_CUR export(TARGETS areg aregextend areglogger NAMESPACE ${AREG_PACKAGE_NAME}:: - FILE ${AREG_PACKAGE_NAME}-export.cmake + FILE ${AREG_PACKAGE_NAME}-targets.cmake EXPORT_LINK_INTERFACE_LIBRARIES ) @@ -153,6 +153,6 @@ install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} COMPONENT Development NAMESPACE ${AREG_PACKAGE_NAME}:: - FILE areg-export.cmake + FILE ${AREG_PACKAGE_NAME}-targets.cmake EXPORT_LINK_INTERFACE_LIBRARIES ) diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in index 707f5fe42..58477e203 100644 --- a/conf/exports/config.cmake.in +++ b/conf/exports/config.cmake.in @@ -14,7 +14,7 @@ set(AREG_LOGGER_LIB "@AREG_LOGGER_LIB@") option(AREG_BUILD_TESTS "No AREG Unit Tests" OFF) option(AREG_BUILD_EXAMPLES "No AREG Examples" OFF) -include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/${AREG_PACKAGE_NAME}-targets.cmake") check_required_components("@PROJECT_NAME@") # Change the generated directory if the output should be somewhere else From 57193ecdbf9180de753e740dcbdeaaddffe34c5b Mon Sep 17 00:00:00 2001 From: Aregtech Date: Sun, 6 Oct 2024 21:47:23 +0200 Subject: [PATCH 12/24] Fixing vcpkg integration --- CMakeLists.txt | 8 +++++ conf/cmake/common.cmake | 2 ++ conf/cmake/functions.cmake | 43 +++++++++++++++---------- conf/cmake/install.cmake | 26 +++++++++++++-- conf/exports/areg.pc.in | 35 ++++++++++++++++++-- conf/exports/config.cmake.in | 8 ++--- examples/00_helloservice/CMakeLists.txt | 8 ++--- examples/10_locsvc/CMakeLists.txt | 2 +- examples/11_locmesh/CMakeLists.txt | 2 +- examples/12_pubsvc/CMakeLists.txt | 4 +-- examples/13_pubmesh/CMakeLists.txt | 8 ++--- examples/14_pubtraffic/CMakeLists.txt | 4 +-- examples/15_pubworker/CMakeLists.txt | 4 +-- examples/16_pubfsm/CMakeLists.txt | 4 +-- examples/17_winchat/CMakeLists.txt | 4 +-- examples/18_locwatchdog/CMakeLists.txt | 2 +- examples/19_pubwatchdog/CMakeLists.txt | 4 +-- examples/20_pubdatarate/CMakeLists.txt | 4 +-- examples/21_pubunblock/CMakeLists.txt | 4 +-- examples/22_pubsub/CMakeLists.txt | 4 +-- examples/23_pubsubmix/CMakeLists.txt | 6 ++-- examples/24_pubsubmulti/CMakeLists.txt | 4 +-- framework/areg/CMakeLists.txt | 9 ++++-- framework/aregextend/CMakeLists.txt | 3 +- framework/areglogger/CMakeLists.txt | 4 +-- framework/logger/CMakeLists.txt | 2 +- framework/logobserver/CMakeLists.txt | 4 +-- framework/mcrouter/CMakeLists.txt | 2 +- 28 files changed, 145 insertions(+), 69 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 567b3da1e..5d0231b9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,14 @@ if(AREG_BUILD_TESTS) include(${AREG_TESTS}/CMakeLists.txt) endif() +# add a dependency to make sure that output folders exist during build time. +if (NOT AREG_SQLITE_FOUND) + add_dependencies(sqlite3 areg-dummy) +endif() +add_dependencies(areg areg-dummy) +add_dependencies(areg-unit-tests areg-dummy) + + if (AREG_INSTALL) include(${AREG_CMAKE_CONFIG_DIR}/install.cmake) endif(AREG_INSTALL) diff --git a/conf/cmake/common.cmake b/conf/cmake/common.cmake index c0c97171a..d6cb575eb 100644 --- a/conf/cmake/common.cmake +++ b/conf/cmake/common.cmake @@ -3,6 +3,8 @@ # Copyright 2022-2023 Aregtech # ########################################################################### +set(AREG_PACKAGE_NAME "areg") + if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "") set(AREG_BUILD_TYPE "${CMAKE_BUILD_TYPE}") endif() diff --git a/conf/cmake/functions.cmake b/conf/cmake/functions.cmake index d7bfb1922..3eca6de64 100644 --- a/conf/cmake/functions.cmake +++ b/conf/cmake/functions.cmake @@ -17,7 +17,7 @@ function(setAppOptions item library_list) target_compile_options(${item} PRIVATE "${AREG_OPT_DISABLE_WARN_COMMON}") # Linking flags - target_link_libraries(${item} aregextend ${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}) # Adjusting CPP standard for target set_target_properties(${item} PROPERTIES CXX_STANDARD ${AREG_CXX_STANDARD} CXX_STANDARD_REQUIRED ON ) @@ -34,15 +34,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 +56,7 @@ endfunction(addExecutableEx) # usage ......: addExecutable( ) # --------------------------------------------------------------------------- function(addExecutable target_name source_list) - addExecutableEx(${target_name} "${source_list}" "") + addExecutableEx(${target_name} "" "${source_list}" "") endfunction(addExecutable) @@ -78,7 +80,7 @@ function(setStaticLibOptions item library_list) target_compile_options(${item} PRIVATE -fPIC) endif() - target_link_libraries(${item} ${library_list} areg ${AREG_LDFLAGS}) + target_link_libraries(${item} ${library_list} ${AREG_PACKAGE_NAME}::areg ${AREG_LDFLAGS}) # Adjusting CPP standard for target set_target_properties(${item} PROPERTIES CXX_STANDARD ${AREG_CXX_STANDARD} CXX_STANDARD_REQUIRED ON ) @@ -96,15 +98,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 +120,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 +133,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 +153,12 @@ 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}) + target_link_libraries(${target_name} ${library_list} ${AREG_PACKAGE_NAME}::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) endfunction(addStaticLibEx_C) # --------------------------------------------------------------------------- @@ -180,7 +187,7 @@ function(setSharedLibOptions item library_list) target_compile_options(${item} PRIVATE "${AREG_OPT_DISABLE_WARN_COMMON}") # Linking flags - target_link_libraries(${item} aregextend ${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) @@ -203,15 +210,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 +232,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) # --------------------------------------------------------------------------- @@ -673,7 +682,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) @@ -696,7 +705,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) diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index bf4290b4b..64be2f702 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -7,11 +7,22 @@ message(STATUS "AREG: >>> Preparing AREG SDK installation settings, CMAKE_PACKAG include(GNUInstallDirs) include(CMakePackageConfigHelpers) -set(AREG_PACKAGE_NAME "areg") set(AREG_EXPORTS_DIR "${AREG_CMAKE_CONFIG_DIR}/../exports") set(AREG_INSTALL_DST "${CMAKE_INSTALL_PREFIX}") -target_include_directories(areg PUBLIC $) +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 $) + +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/ @@ -90,7 +101,7 @@ install(DIRECTORY "${AREG_OUTPUT_BIN}/config" CONFIGURATIONS Release ) - +#[[========================= configure_file("${AREG_EXPORTS_DIR}/areg.pc.in" areg.pc @ONLY) configure_file("${AREG_EXPORTS_DIR}/aregextend.pc.in" aregextend.pc @ONLY) configure_file("${AREG_EXPORTS_DIR}/areglogger.pc.in" areglogger.pc @ONLY) @@ -102,6 +113,15 @@ install(FILES DESTINATION lib/pkgconfig COMPONENT Development COMPONENT Runtime ) +===============]] + +configure_file("${AREG_EXPORTS_DIR}/areg.pc.in" areg.pc @ONLY) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/areg.pc" + DESTINATION lib/pkgconfig + COMPONENT Development COMPONENT Runtime +) if ((WIN32) OR (CYGWIN)) diff --git a/conf/exports/areg.pc.in b/conf/exports/areg.pc.in index 77b928679..813bb3897 100644 --- a/conf/exports/areg.pc.in +++ b/conf/exports/areg.pc.in @@ -1,3 +1,4 @@ +areg.pc: prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix}/tools/areg libdir=${prefix}/lib @@ -7,7 +8,37 @@ Name: areg Description: AREG communication framework Version: @PROJECT_VERSION@ URL: https://github.com/aregtech/areg-sdk -Libs: -L${libdir} @AREG_LDFLAGS_STR@ +Libs: -L${libdir} -lareg Requires: areg = @PROJECT_VERSION@ -Libs.private: -lareg +Libs.private: @AREG_LDFLAGS_STR@ +Cflags: -I${includedir} + +aregextend.pc: +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix}/tools/areg +libdir=${prefix}/lib +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: aregextend +Description: Extended objects of AREG communication framework +Version: @PROJECT_VERSION@ +URL: https://github.com/aregtech/areg-sdk +Libs: -L${libdir} -laregextend -lareg +Requires: aregextend = @PROJECT_VERSION@ +Libs.private: -lsqlite3 @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ +Cflags: -I${includedir} + +areglogger.pc: +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix}/tools/areg +libdir=${prefix}/lib +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 +Libs: -L${libdir} -lareglogger -laregextend -lareg +Requires: aregextend = @PROJECT_VERSION@ +Libs.private: -lsqlite3 @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ Cflags: -I${includedir} diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in index 58477e203..6df15d68f 100644 --- a/conf/exports/config.cmake.in +++ b/conf/exports/config.cmake.in @@ -4,18 +4,18 @@ include(CMakeFindDependencyMacro) set(AREG_SDK_ROOT "@CMAKE_INSTALL_PREFIX@") set(AREG_BASE "@CMAKE_INSTALL_FULL_INCLUDEDIR@") set(AREG_CMAKE_CONFIG_DIR "@CMAKE_INSTALL_PREFIX@/share/@AREG_PACKAGE_NAME@/conf/cmake") -set(AREG_SDK_TOOLS "@CMAKE_INSTALL_PREFIX@/tools/@AREG_PACKAGE_NAME@) +set(AREG_SDK_TOOLS "@CMAKE_INSTALL_PREFIX@/tools/@AREG_PACKAGE_NAME@") set(AREG_BINARY "@AREG_BINARY@") set(AREG_BUILD_TYPE "@AREG_BUILD_TYPE@") -set(AREG_LOGS "@AREG_LOGS@") +set(AREG_LOGS @AREG_LOGS@) set(AREG_LOGGER_LIB "@AREG_LOGGER_LIB@") option(AREG_BUILD_TESTS "No AREG Unit Tests" OFF) option(AREG_BUILD_EXAMPLES "No AREG Examples" OFF) -include("${CMAKE_CURRENT_LIST_DIR}/${AREG_PACKAGE_NAME}-targets.cmake") -check_required_components("@PROJECT_NAME@") +include("${CMAKE_CURRENT_LIST_DIR}/@AREG_PACKAGE_NAME@-targets.cmake") +check_required_components("@AREG_PACKAGE_NAME@") # Change the generated directory if the output should be somewhere else set(AREG_GENERATE "${CMAKE_BINARY_DIR}/generate") 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/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/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/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/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/framework/areg/CMakeLists.txt b/framework/areg/CMakeLists.txt index 5c047fe39..18a0c2980 100644 --- a/framework/areg/CMakeLists.txt +++ b/framework/areg/CMakeLists.txt @@ -17,6 +17,10 @@ endif() 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") @@ -27,6 +31,9 @@ else(AREG_BINARY MATCHES "static") # 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") @@ -34,8 +41,6 @@ else(AREG_BINARY MATCHES "static") 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) if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") target_compile_options(areg PRIVATE -fPIC) diff --git a/framework/aregextend/CMakeLists.txt b/framework/aregextend/CMakeLists.txt index 5388f32fc..fac0bf2df 100644 --- a/framework/aregextend/CMakeLists.txt +++ b/framework/aregextend/CMakeLists.txt @@ -12,6 +12,7 @@ endif() # build areg extended static library -addStaticLib(aregextend "${extend_SRC}") +addStaticLibEx(aregextend ${AREG_PACKAGE_NAME} "${extend_SRC}" "") + set_target_properties(aregextend PROPERTIES VERSION ${AREG_PROJECT_VERSION}) target_compile_options(aregextend PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") diff --git a/framework/areglogger/CMakeLists.txt b/framework/areglogger/CMakeLists.txt index 92b0ee17c..d20610d2b 100644 --- a/framework/areglogger/CMakeLists.txt +++ b/framework/areglogger/CMakeLists.txt @@ -20,7 +20,7 @@ if (AREG_LOGGER_LIB MATCHES "shared") endif() # build log observer API shared library - addSharedLibEx(areglogger "${areglogger_SRC}" ${AREG_SQLITE_LIB_REF}) + 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") @@ -37,7 +37,7 @@ if (AREG_LOGGER_LIB MATCHES "shared") else(AREG_LOGGER_LIB MATCHES "static") # build log observer API static library - addStaticLib(areglogger "${areglogger_SRC}") + addStaticLibEx(areglogger ${AREG_PACKAGE_NAME} "${areglogger_SRC}" "") target_compile_options(areglogger PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") diff --git a/framework/logger/CMakeLists.txt b/framework/logger/CMakeLists.txt index 41e3dcced..ae4739d77 100644 --- a/framework/logger/CMakeLists.txt +++ b/framework/logger/CMakeLists.txt @@ -10,7 +10,7 @@ if (${AREG_DEVELOP_ENV} MATCHES "Win32") 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}") set_target_properties(logger PROPERTIES VERSION ${AREG_PROJECT_VERSION}) diff --git a/framework/logobserver/CMakeLists.txt b/framework/logobserver/CMakeLists.txt index 8609bcbca..ed616dd58 100644 --- a/framework/logobserver/CMakeLists.txt +++ b/framework/logobserver/CMakeLists.txt @@ -12,10 +12,10 @@ endif() # build log observer console application # ################################################################## if (AREG_LOGGER_LIB MATCHES "shared") - addExecutableEx(logobserver "${logobserver_SRC}" areglogger) + addExecutableEx(logobserver ${AREG_PACKAGE_NAME} "${logobserver_SRC}" areglogger) target_compile_definitions(logobserver PRIVATE IMP_LOGGER_DLL) else (AREG_LOGGER_LIB MATCHES "static") - addExecutableEx(logobserver "${logobserver_SRC}" areglogger ${AREG_SQLITE_LIB_REF}) + addExecutableEx(logobserver ${AREG_PACKAGE_NAME} "${logobserver_SRC}" areglogger ${AREG_SQLITE_LIB_REF}) target_compile_definitions(logobserver PRIVATE IMP_LOGGER_LIB) endif() diff --git a/framework/mcrouter/CMakeLists.txt b/framework/mcrouter/CMakeLists.txt index a861cfc80..85865ec88 100644 --- a/framework/mcrouter/CMakeLists.txt +++ b/framework/mcrouter/CMakeLists.txt @@ -10,7 +10,7 @@ if (${AREG_DEVELOP_ENV} MATCHES "Win32") 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}") set_target_properties(mcrouter PROPERTIES VERSION ${AREG_PROJECT_VERSION}) From e89c310ae54a2f41c5ea121fa083e445c9728e5a Mon Sep 17 00:00:00 2001 From: Aregtech Date: Sun, 6 Oct 2024 22:06:37 +0200 Subject: [PATCH 13/24] Fixed configuration failure when GTest package is used --- CMakeLists.txt | 15 +++++++++------ conf/cmake/common.cmake | 3 ++- tests/CMakeLists.txt | 3 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d0231b9e..caee3430a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,10 +42,16 @@ add_custom_command( TARGET areg-dummy PRE_BUILD 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(sqlite3 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,14 +61,11 @@ 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() -# add a dependency to make sure that output folders exist during build time. -if (NOT AREG_SQLITE_FOUND) - add_dependencies(sqlite3 areg-dummy) -endif() -add_dependencies(areg areg-dummy) -add_dependencies(areg-unit-tests areg-dummy) if (AREG_INSTALL) diff --git a/conf/cmake/common.cmake b/conf/cmake/common.cmake index d6cb575eb..5ca18546f 100644 --- a/conf/cmake/common.cmake +++ b/conf/cmake/common.cmake @@ -60,7 +60,8 @@ 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) +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) 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) From 0775f98a5ee62fe3b5a9259efe98f35ba0b9962f Mon Sep 17 00:00:00 2001 From: Aregtech Date: Sun, 6 Oct 2024 22:32:17 +0200 Subject: [PATCH 14/24] fixed searching packages. --- conf/cmake/install.cmake | 12 +----------- conf/exports/areg.pc.in | 32 -------------------------------- conf/exports/aregextend.pc.in | 6 +++--- conf/exports/areglogger.pc.in | 7 ++++--- 4 files changed, 8 insertions(+), 49 deletions(-) diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index 64be2f702..9efeeba34 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -41,7 +41,7 @@ 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 + LIBRARY DESTINATION lib 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 @@ -101,7 +101,6 @@ install(DIRECTORY "${AREG_OUTPUT_BIN}/config" CONFIGURATIONS Release ) -#[[========================= configure_file("${AREG_EXPORTS_DIR}/areg.pc.in" areg.pc @ONLY) configure_file("${AREG_EXPORTS_DIR}/aregextend.pc.in" aregextend.pc @ONLY) configure_file("${AREG_EXPORTS_DIR}/areglogger.pc.in" areglogger.pc @ONLY) @@ -113,15 +112,6 @@ install(FILES DESTINATION lib/pkgconfig COMPONENT Development COMPONENT Runtime ) -===============]] - -configure_file("${AREG_EXPORTS_DIR}/areg.pc.in" areg.pc @ONLY) - -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/areg.pc" - DESTINATION lib/pkgconfig - COMPONENT Development COMPONENT Runtime -) if ((WIN32) OR (CYGWIN)) diff --git a/conf/exports/areg.pc.in b/conf/exports/areg.pc.in index 813bb3897..1d1946a9f 100644 --- a/conf/exports/areg.pc.in +++ b/conf/exports/areg.pc.in @@ -1,4 +1,3 @@ -areg.pc: prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix}/tools/areg libdir=${prefix}/lib @@ -9,36 +8,5 @@ Description: AREG communication framework Version: @PROJECT_VERSION@ URL: https://github.com/aregtech/areg-sdk Libs: -L${libdir} -lareg -Requires: areg = @PROJECT_VERSION@ Libs.private: @AREG_LDFLAGS_STR@ Cflags: -I${includedir} - -aregextend.pc: -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix}/tools/areg -libdir=${prefix}/lib -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ - -Name: aregextend -Description: Extended objects of AREG communication framework -Version: @PROJECT_VERSION@ -URL: https://github.com/aregtech/areg-sdk -Libs: -L${libdir} -laregextend -lareg -Requires: aregextend = @PROJECT_VERSION@ -Libs.private: -lsqlite3 @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ -Cflags: -I${includedir} - -areglogger.pc: -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix}/tools/areg -libdir=${prefix}/lib -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 -Libs: -L${libdir} -lareglogger -laregextend -lareg -Requires: aregextend = @PROJECT_VERSION@ -Libs.private: -lsqlite3 @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ -Cflags: -I${includedir} diff --git a/conf/exports/aregextend.pc.in b/conf/exports/aregextend.pc.in index c101f0f9c..204b82a56 100644 --- a/conf/exports/aregextend.pc.in +++ b/conf/exports/aregextend.pc.in @@ -7,7 +7,7 @@ Name: aregextend Description: Extended objects of AREG communication framework Version: @PROJECT_VERSION@ URL: https://github.com/aregtech/areg-sdk -Libs: -L${libdir} @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ -Requires: aregextend = @PROJECT_VERSION@ -Libs.private: -lsqlite3 -laregextend -lareg +Requires: areg >= @PROJECT_VERSION@ +Libs: -L${libdir} -laregextend -lareg +Libs.private: -lsqlite3 @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ Cflags: -I${includedir} diff --git a/conf/exports/areglogger.pc.in b/conf/exports/areglogger.pc.in index 44d74f3f6..444b7e330 100644 --- a/conf/exports/areglogger.pc.in +++ b/conf/exports/areglogger.pc.in @@ -7,7 +7,8 @@ Name: areglogger Description: Log observer client of AREG communication framework Version: @PROJECT_VERSION@ URL: https://github.com/aregtech/areg-sdk -Libs: -L${libdir} @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ -Requires: aregextend = @PROJECT_VERSION@ -Libs.private: -lsqlite3 -lareglogger -laregextend -lareg +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} From b96201b939707cd9b0e18ea668e73c3622ffdb06 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 7 Oct 2024 03:08:58 +0200 Subject: [PATCH 15/24] changes to make build under linux --- CMakeLists.txt | 22 ++++--- conf/cmake/common.cmake | 31 ++++++--- conf/cmake/functions.cmake | 16 ++--- conf/cmake/install.cmake | 95 ++++++++++++++++++++++------ conf/cmake/setup.cmake | 7 +- conf/cmake/user.cmake | 70 +++++++++----------- conf/exports/aregextend.pc.in | 2 +- conf/exports/areglogger.pc.in | 2 +- conf/exports/aregsqlite3.pc.in | 11 ++++ conf/exports/config.cmake.in | 30 ++++++--- framework/areg/CMakeLists.txt | 13 ++-- framework/aregextend/CMakeLists.txt | 2 +- framework/areglogger/CMakeLists.txt | 2 +- framework/logger/CMakeLists.txt | 8 +-- framework/logobserver/CMakeLists.txt | 2 +- framework/mcrouter/CMakeLists.txt | 8 +-- thirdparty/sqlite3/CMakeLists.txt | 12 ++-- 17 files changed, 214 insertions(+), 119 deletions(-) create mode 100644 conf/exports/aregsqlite3.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index caee3430a..b7c6ed98f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,9 +35,8 @@ 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}) @@ -46,7 +45,7 @@ include_directories(${AREG_THIRDPARTY}) # build AREG Framework thirdparty software include(${AREG_THIRDPARTY}/CMakeLists.txt) if (NOT AREG_SQLITE_FOUND) - add_dependencies(sqlite3 areg-dummy) + add_dependencies(aregsqlite3 areg-dummy) endif() # build AREG Framework software @@ -66,11 +65,16 @@ if(AREG_BUILD_TESTS) endif() endif() - - -if (AREG_INSTALL) +if (AREG_INSTALL AND AREG_SQLITE_FOUND) include(${AREG_CMAKE_CONFIG_DIR}/install.cmake) -endif(AREG_INSTALL) +elseif(AREG_INSTALL) + option(AREG_INSTALL "Enable install AREG SDK" OFF) + message(WARNING "AREG: >>> Forcing to set AREG_INSTALL to OFF, \ + because the project is compiled with local SQLite3 sources.\ + Recompile the project and enable using SQLite package by\ + setting 'AREG_USE_PACKAGES=ON' and specifying 'CMAKE_TOOLCHAIN_FILE' variable.\nExample:\n$ \ + cmake -B ./build -DAREG_USE_PACKAGES=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DAREG_INSTALL=ON") +endif() # Print the configuration status message(STATUS "=======================================================================================") @@ -79,7 +83,7 @@ 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: >>> 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: >>> Java version ....: \'${Java_VERSION_STRING}\' of version \'${Java_JAVA_EXECUTABLE}\'. Minimum should be 17") diff --git a/conf/cmake/common.cmake b/conf/cmake/common.cmake index 5ca18546f..607d1aa1c 100644 --- a/conf/cmake/common.cmake +++ b/conf/cmake/common.cmake @@ -59,7 +59,8 @@ set(AREG_COMPILER_OPTIONS) set(AREG_COMPILER_VERSION) set(AREG_TARGET_COMPILER_OPTIONS) # Set the SQLite library reference -set(AREG_SQLITE_LIB_REF sqlite3) +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) @@ -126,13 +127,25 @@ 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 @@ -173,7 +186,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) diff --git a/conf/cmake/functions.cmake b/conf/cmake/functions.cmake index 3eca6de64..16d6843e9 100644 --- a/conf/cmake/functions.cmake +++ b/conf/cmake/functions.cmake @@ -20,8 +20,8 @@ function(setAppOptions item library_list) target_link_libraries(${item} ${AREG_PACKAGE_NAME}::aregextend ${library_list} ${AREG_PACKAGE_NAME}::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}) + # 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}) endfunction(setAppOptions) # --------------------------------------------------------------------------- @@ -83,8 +83,8 @@ function(setStaticLibOptions item library_list) target_link_libraries(${item} ${library_list} ${AREG_PACKAGE_NAME}::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}) + # 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}) endfunction(setStaticLibOptions) @@ -157,7 +157,7 @@ function(addStaticLibEx_C target_name target_namespace source_list library_list) # 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}) + # set_property(TARGET ${target_name} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${AREG_OUTPUT_LIB}) target_include_directories(${target_name} BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}) endfunction(addStaticLibEx_C) @@ -170,7 +170,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) # --------------------------------------------------------------------------- @@ -195,8 +195,8 @@ function(setSharedLibOptions item library_list) 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}) + # 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) diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index 9efeeba34..671985b48 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -36,21 +36,56 @@ install(DIRECTORY framework/ PATTERN "mcrouter" EXCLUDE ) -# 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 lib 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 +if (NOT AREG_SQLITE_FOUND) + # Copy AREG SDK SQLite dependency library required by 'areglogger' + install(DIRECTORY thirdparty + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Development + CONFIGURATIONS Release + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.c" + ) +endif(NOT AREG_SQLITE_FOUND) + +if (AREG_SQLITE_FOUND) + # 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 lib 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 + ) + +else(AREG_SQLITE_FOUND) + + # copy compiled binaries in the bin and lib directories, include 'aregsqlite3' dependent library + install(TARGETS areg aregextend areglogger aregsqlite3 + 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 lib 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 + ) + +endif(AREG_SQLITE_FOUND) + +# Copy AREG configuration file +install(FILES "${AREG_BASE}/areg/resources/areg.init" + DESTINATION bin/config + COMPONENT Development COMPONENT Runtime ) # Copy AREG configuration file -install(DIRECTORY "${AREG_OUTPUT_BIN}/config" - DESTINATION bin +install(FILES "${AREG_BASE}/areg/resources/areg.init" + DESTINATION share/${AREG_PACKAGE_NAME} COMPONENT Development COMPONENT Runtime + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + CONFIGURATIONS Release ) # Copy AREG SDK license @@ -62,6 +97,17 @@ install(FILES LICENSE.txt CONFIGURATIONS Release ) +if (NOT AREG_SQLITE_FOUND) + # Copy SQLite3 license + install(FILES thirdparty/sqlite3/LICENSE.txt + DESTINATION share/${AREG_PACKAGE_NAME} + COMPONENT Development COMPONENT Runtime + RENAME areg-sqlite3-copyright + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + CONFIGURATIONS Release + ) +endif(NOT AREG_SQLITE_FOUND) + # Copy all CMake and MSVC configuration files. install(DIRECTORY ${AREG_SDK_ROOT}/conf/ DESTINATION share/${AREG_PACKAGE_NAME}/conf @@ -87,7 +133,7 @@ install(TARGETS logger logobserver mcrouter ) # Copy additionally areg library -install(TARGETS areg +install(TARGETS areg areglogger 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 @@ -95,9 +141,10 @@ install(TARGETS areg ) # Copy AREG configuration file -install(DIRECTORY "${AREG_OUTPUT_BIN}/config" - DESTINATION tools/${AREG_PACKAGE_NAME} +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 WORLD_READ CONFIGURATIONS Release ) @@ -146,11 +193,19 @@ endif() write_basic_package_version_file(${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}/${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 -) +if (AREG_SQLITE_FOUND) + export(TARGETS areg aregextend areglogger + NAMESPACE ${AREG_PACKAGE_NAME}:: + FILE ${AREG_PACKAGE_NAME}-export.cmake + EXPORT_LINK_INTERFACE_LIBRARIES + ) +else(AREG_SQLITE_FOUND) + export(TARGETS areg aregextend areglogger aregsqlite3 + NAMESPACE ${AREG_PACKAGE_NAME}:: + FILE ${AREG_PACKAGE_NAME}-export.cmake + EXPORT_LINK_INTERFACE_LIBRARIES + ) +endif(AREG_SQLITE_FOUND) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-config-version.cmake" @@ -163,6 +218,6 @@ install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} COMPONENT Development NAMESPACE ${AREG_PACKAGE_NAME}:: - FILE ${AREG_PACKAGE_NAME}-targets.cmake + FILE ${AREG_PACKAGE_NAME}-export.cmake EXPORT_LINK_INTERFACE_LIBRARIES ) diff --git a/conf/cmake/setup.cmake b/conf/cmake/setup.cmake index 4dc34c2fc..7b59cdc80 100644 --- a/conf/cmake/setup.cmake +++ b/conf/cmake/setup.cmake @@ -60,5 +60,8 @@ 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) +set(CMAKE_CXX_STANDARD ${AREG_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 b94818a46..5a4a406d3 100644 --- a/conf/cmake/user.cmake +++ b/conf/cmake/user.cmake @@ -176,6 +176,11 @@ if (NOT DEFINED AREG_BINARY OR NOT ${AREG_BINARY} STREQUAL "static") set(AREG_BINARY "shared") endif() +# Set the areg log observer API library type. +if (NOT DEFINED AREG_LOGGER_LIB OR 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") @@ -209,51 +214,38 @@ else() macro_create_option(AREG_GTEST_PACKAGE OFF "Use GTest installed package") 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_LOGGER_LIB OR NOT "${AREG_LOGGER_LIB}" STREQUAL "static") - set(AREG_LOGGER_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 ("${AREG_INSTALL_PATH}" STREQUAL "") - if ("${CMAKE_INSTALL_PREFIX}" 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() - 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") - else() - set(AREG_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}") + 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/aregextend.pc.in b/conf/exports/aregextend.pc.in index 204b82a56..5bbd83f57 100644 --- a/conf/exports/aregextend.pc.in +++ b/conf/exports/aregextend.pc.in @@ -9,5 +9,5 @@ Version: @PROJECT_VERSION@ URL: https://github.com/aregtech/areg-sdk Requires: areg >= @PROJECT_VERSION@ Libs: -L${libdir} -laregextend -lareg -Libs.private: -lsqlite3 @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ +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 index 444b7e330..b2e6aacac 100644 --- a/conf/exports/areglogger.pc.in +++ b/conf/exports/areglogger.pc.in @@ -10,5 +10,5 @@ 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@ +Libs.private: -l@AREG_SQLITE_LIB@ -laregextend @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ Cflags: -I${includedir} diff --git a/conf/exports/aregsqlite3.pc.in b/conf/exports/aregsqlite3.pc.in new file mode 100644 index 000000000..cbbdc8b4a --- /dev/null +++ b/conf/exports/aregsqlite3.pc.in @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix}/tools/areg +libdir=${prefix}/lib +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: aregsqlite +Description: This SQLite3 SQL database engine is compiled in AREG SDK project. If you want to compile AREG SDK projects with available sqlite3 package, re-compile AREG-SDK using available sqlite3 package. +Version: @PROJECT_VERSION@ +URL: https://www.sqlite.org +Libs: -L${libdir} +Cflags: -I${includedir} diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in index 6df15d68f..d17a2bed7 100644 --- a/conf/exports/config.cmake.in +++ b/conf/exports/config.cmake.in @@ -3,21 +3,35 @@ include(CMakeFindDependencyMacro) set(AREG_SDK_ROOT "@CMAKE_INSTALL_PREFIX@") set(AREG_BASE "@CMAKE_INSTALL_FULL_INCLUDEDIR@") -set(AREG_CMAKE_CONFIG_DIR "@CMAKE_INSTALL_PREFIX@/share/@AREG_PACKAGE_NAME@/conf/cmake") +set(AREG_SHARE "@CMAKE_INSTALL_PREFIX@/share/@AREG_PACKAGE_NAME@) +set(AREG_SHARE_INIT "${AREG_SHARE}/areg.init") +set(AREG_CMAKE_CONFIG_DIR "${AREG_SHARE}/conf/cmake") set(AREG_SDK_TOOLS "@CMAKE_INSTALL_PREFIX@/tools/@AREG_PACKAGE_NAME@") +set(AREG_SDK) -set(AREG_BINARY "@AREG_BINARY@") set(AREG_BUILD_TYPE "@AREG_BUILD_TYPE@") -set(AREG_LOGS @AREG_LOGS@) +set(AREG_BINARY "@AREG_BINARY@") set(AREG_LOGGER_LIB "@AREG_LOGGER_LIB@") +option(AREG_EXTENDED "AREG Extended object flag" @AREG_EXTENDED@) +option(AREG_LOGS "AREG logging enable flag" @AREG_LOGS@) +option(AREG_SQLITE_PACKAGE "AREG compiled with SQLite package" @AREG_SQLITE_PACKAGE@) + +include("${CMAKE_CURRENT_LIST_DIR}/@AREG_PACKAGE_NAME@-export.cmake") +check_required_components("@AREG_PACKAGE_NAME@") + option(AREG_BUILD_TESTS "No AREG Unit Tests" OFF) option(AREG_BUILD_EXAMPLES "No AREG Examples" OFF) -include("${CMAKE_CURRENT_LIST_DIR}/@AREG_PACKAGE_NAME@-targets.cmake") -check_required_components("@AREG_PACKAGE_NAME@") +# 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") # Change the generated directory if the output should be somewhere else -set(AREG_GENERATE "${CMAKE_BINARY_DIR}/generate") -# Change the build root directory if compiled fines are copied somewhere else. -set(AREG_BUILD_ROOT "${CMAKE_CURRENT_BINARY_DIR}") +# set, for example, to 'CMAKE_BINARY_DIR' if the generated files should be in the compiled object directory +set(AREG_GENERATE "${AREG_BUILD_ROOT}/generate") + +# Add '${AREG_BASE}' path in the includes +include_directories(${AREG_BASE}) +# Pass the path to the shared 'areg.init' file to the source codes. +add_definitions(-DAREG_SHARE_INIT="${AREG_SHARE_INIT}") diff --git a/framework/areg/CMakeLists.txt b/framework/areg/CMakeLists.txt index 18a0c2980..b50dfb5d5 100644 --- a/framework/areg/CMakeLists.txt +++ b/framework/areg/CMakeLists.txt @@ -25,7 +25,7 @@ if(AREG_BINARY MATCHES "shared") 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") @@ -34,11 +34,12 @@ else(AREG_BINARY MATCHES "static") 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() @@ -51,11 +52,11 @@ target_compile_options(areg PRIVATE "${AREG_OPT_DISABLE_WARN_COMMON}" "${AREG_OP target_link_libraries(areg PRIVATE ${AREG_LDFLAGS}) # Library configuration -set_target_properties(areg PROPERTIES CXX_STANDARD ${AREG_CXX_STANDARD} CXX_STANDARD_REQUIRED ON ) -set_target_properties(areg PROPERTIES VERSION ${AREG_PROJECT_VERSION}) +# set_target_properties(areg PROPERTIES CXX_STANDARD ${AREG_CXX_STANDARD} CXX_STANDARD_REQUIRED ON ) +# set_target_properties(areg PROPERTIES VERSION ${AREG_PROJECT_VERSION}) # 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/aregextend/CMakeLists.txt b/framework/aregextend/CMakeLists.txt index fac0bf2df..243aa35a9 100644 --- a/framework/aregextend/CMakeLists.txt +++ b/framework/aregextend/CMakeLists.txt @@ -14,5 +14,5 @@ endif() # build areg extended static library addStaticLibEx(aregextend ${AREG_PACKAGE_NAME} "${extend_SRC}" "") -set_target_properties(aregextend PROPERTIES VERSION ${AREG_PROJECT_VERSION}) +# set_target_properties(aregextend PROPERTIES VERSION ${AREG_PROJECT_VERSION}) target_compile_options(aregextend PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") diff --git a/framework/areglogger/CMakeLists.txt b/framework/areglogger/CMakeLists.txt index d20610d2b..b018d3cd7 100644 --- a/framework/areglogger/CMakeLists.txt +++ b/framework/areglogger/CMakeLists.txt @@ -47,4 +47,4 @@ else(AREG_LOGGER_LIB MATCHES "static") target_compile_definitions(areglogger PRIVATE EXP_LOGGER_LIB) endif(AREG_LOGGER_LIB MATCHES "shared") -set_target_properties(areglogger PROPERTIES VERSION ${AREG_PROJECT_VERSION}) +# set_target_properties(areglogger PROPERTIES VERSION ${AREG_PROJECT_VERSION}) diff --git a/framework/logger/CMakeLists.txt b/framework/logger/CMakeLists.txt index ae4739d77..f1701947c 100644 --- a/framework/logger/CMakeLists.txt +++ b/framework/logger/CMakeLists.txt @@ -12,15 +12,15 @@ endif() # build logger executable addExecutableEx(logger ${AREG_PACKAGE_NAME} "${logger_SRC}" "") target_compile_options(logger PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") -set_target_properties(logger PROPERTIES VERSION ${AREG_PROJECT_VERSION}) +# set_target_properties(logger PROPERTIES VERSION ${AREG_PROJECT_VERSION}) if("${AREG_DEVELOP_ENV}" STREQUAL "Win32" OR CYGWIN) add_custom_command( TARGET logger POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${logger_BASE}/resources/logger.service.install.bat" "${AREG_OUTPUT_BIN}/logger.service.install.bat" - COMMAND ${CMAKE_COMMAND} -E copy "${logger_BASE}/resources/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_BASE}/resources/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/logobserver/CMakeLists.txt b/framework/logobserver/CMakeLists.txt index ed616dd58..be6c9770e 100644 --- a/framework/logobserver/CMakeLists.txt +++ b/framework/logobserver/CMakeLists.txt @@ -19,5 +19,5 @@ else (AREG_LOGGER_LIB MATCHES "static") target_compile_definitions(logobserver PRIVATE IMP_LOGGER_LIB) endif() -set_target_properties(logobserver PROPERTIES VERSION ${AREG_PROJECT_VERSION}) +# set_target_properties(logobserver PROPERTIES VERSION ${AREG_PROJECT_VERSION}) target_compile_options(logobserver PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") diff --git a/framework/mcrouter/CMakeLists.txt b/framework/mcrouter/CMakeLists.txt index 85865ec88..f19dfe039 100644 --- a/framework/mcrouter/CMakeLists.txt +++ b/framework/mcrouter/CMakeLists.txt @@ -12,15 +12,15 @@ endif() # build mcrouter executable addExecutableEx(mcrouter ${AREG_PACKAGE_NAME} "${mcrouter_SRC}" "") target_compile_options(mcrouter PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") -set_target_properties(mcrouter PROPERTIES VERSION ${AREG_PROJECT_VERSION}) +# set_target_properties(mcrouter PROPERTIES VERSION ${AREG_PROJECT_VERSION}) if("${AREG_DEVELOP_ENV}" STREQUAL "Win32" OR CYGWIN) add_custom_command( TARGET mcrouter POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${mcrouter_BASE}/resources/mcrouter.service.install.bat" "${AREG_OUTPUT_BIN}/mcrouter.service.install.bat" - COMMAND ${CMAKE_COMMAND} -E copy "${mcrouter_BASE}/resources/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_BASE}/resources/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/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) From ab81ae90c87de56add86775113b394ff04c9fd9e Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 7 Oct 2024 09:40:04 +0200 Subject: [PATCH 16/24] Fixing failure of finding a package. --- conf/cmake/install.cmake | 78 +++++++--------------------------- conf/exports/areg.pc.in | 2 +- conf/exports/aregextend.pc.in | 2 +- conf/exports/areglogger.pc.in | 4 +- conf/exports/aregsqlite3.pc.in | 11 ----- conf/exports/config.cmake.in | 2 +- 6 files changed, 21 insertions(+), 78 deletions(-) delete mode 100644 conf/exports/aregsqlite3.pc.in diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index 671985b48..981df17d0 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -36,43 +36,16 @@ install(DIRECTORY framework/ PATTERN "mcrouter" EXCLUDE ) -if (NOT AREG_SQLITE_FOUND) - # Copy AREG SDK SQLite dependency library required by 'areglogger' - install(DIRECTORY thirdparty - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Development - CONFIGURATIONS Release - FILES_MATCHING - PATTERN "*.h" - PATTERN "*.c" - ) -endif(NOT AREG_SQLITE_FOUND) - -if (AREG_SQLITE_FOUND) - # 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 lib 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 - ) - -else(AREG_SQLITE_FOUND) - - # copy compiled binaries in the bin and lib directories, include 'aregsqlite3' dependent library - install(TARGETS areg aregextend areglogger aregsqlite3 - 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 lib 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 - ) - -endif(AREG_SQLITE_FOUND) +# 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 lib 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 configuration file install(FILES "${AREG_BASE}/areg/resources/areg.init" @@ -97,17 +70,6 @@ install(FILES LICENSE.txt CONFIGURATIONS Release ) -if (NOT AREG_SQLITE_FOUND) - # Copy SQLite3 license - install(FILES thirdparty/sqlite3/LICENSE.txt - DESTINATION share/${AREG_PACKAGE_NAME} - COMPONENT Development COMPONENT Runtime - RENAME areg-sqlite3-copyright - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - CONFIGURATIONS Release - ) -endif(NOT AREG_SQLITE_FOUND) - # Copy all CMake and MSVC configuration files. install(DIRECTORY ${AREG_SDK_ROOT}/conf/ DESTINATION share/${AREG_PACKAGE_NAME}/conf @@ -193,19 +155,11 @@ endif() write_basic_package_version_file(${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}/${AREG_PACKAGE_NAME}-config.cmake" INSTALL_DESTINATION share/${AREG_PACKAGE_NAME}) -if (AREG_SQLITE_FOUND) - export(TARGETS areg aregextend areglogger - NAMESPACE ${AREG_PACKAGE_NAME}:: - FILE ${AREG_PACKAGE_NAME}-export.cmake - EXPORT_LINK_INTERFACE_LIBRARIES - ) -else(AREG_SQLITE_FOUND) - export(TARGETS areg aregextend areglogger aregsqlite3 - NAMESPACE ${AREG_PACKAGE_NAME}:: - FILE ${AREG_PACKAGE_NAME}-export.cmake - EXPORT_LINK_INTERFACE_LIBRARIES - ) -endif(AREG_SQLITE_FOUND) +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}/${AREG_PACKAGE_NAME}-config-version.cmake" @@ -218,6 +172,6 @@ install(EXPORT ${AREG_PACKAGE_NAME} DESTINATION share/${AREG_PACKAGE_NAME} COMPONENT Development NAMESPACE ${AREG_PACKAGE_NAME}:: - FILE ${AREG_PACKAGE_NAME}-export.cmake + FILE ${AREG_PACKAGE_NAME}-targets.cmake EXPORT_LINK_INTERFACE_LIBRARIES ) diff --git a/conf/exports/areg.pc.in b/conf/exports/areg.pc.in index 1d1946a9f..c80023afd 100644 --- a/conf/exports/areg.pc.in +++ b/conf/exports/areg.pc.in @@ -1,6 +1,6 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix}/tools/areg -libdir=${prefix}/lib +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: areg diff --git a/conf/exports/aregextend.pc.in b/conf/exports/aregextend.pc.in index 5bbd83f57..7248c423b 100644 --- a/conf/exports/aregextend.pc.in +++ b/conf/exports/aregextend.pc.in @@ -1,6 +1,6 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix}/tools/areg -libdir=${prefix}/lib +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: aregextend diff --git a/conf/exports/areglogger.pc.in b/conf/exports/areglogger.pc.in index b2e6aacac..0275ba576 100644 --- a/conf/exports/areglogger.pc.in +++ b/conf/exports/areglogger.pc.in @@ -1,6 +1,6 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix}/tools/areg -libdir=${prefix}/lib +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: areglogger @@ -10,5 +10,5 @@ URL: https://github.com/aregtech/areg-sdk Requires: areg >= @PROJECT_VERSION@ Requires.private: aregextend >= @PROJECT_VERSION@ Libs: -L${libdir} -lareglogger -lareg -Libs.private: -l@AREG_SQLITE_LIB@ -laregextend @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ +Libs.private: -lsqlite3 -laregextend @AREG_EXTENDED_LIBS_STR@ @AREG_LDFLAGS_STR@ Cflags: -I${includedir} diff --git a/conf/exports/aregsqlite3.pc.in b/conf/exports/aregsqlite3.pc.in deleted file mode 100644 index cbbdc8b4a..000000000 --- a/conf/exports/aregsqlite3.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix}/tools/areg -libdir=${prefix}/lib -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ - -Name: aregsqlite -Description: This SQLite3 SQL database engine is compiled in AREG SDK project. If you want to compile AREG SDK projects with available sqlite3 package, re-compile AREG-SDK using available sqlite3 package. -Version: @PROJECT_VERSION@ -URL: https://www.sqlite.org -Libs: -L${libdir} -Cflags: -I${includedir} diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in index d17a2bed7..d98b5c3b2 100644 --- a/conf/exports/config.cmake.in +++ b/conf/exports/config.cmake.in @@ -17,7 +17,7 @@ option(AREG_EXTENDED "AREG Extended object flag" @AREG_EXTENDED@) option(AREG_LOGS "AREG logging enable flag" @AREG_LOGS@) option(AREG_SQLITE_PACKAGE "AREG compiled with SQLite package" @AREG_SQLITE_PACKAGE@) -include("${CMAKE_CURRENT_LIST_DIR}/@AREG_PACKAGE_NAME@-export.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/@AREG_PACKAGE_NAME@-targets.cmake") check_required_components("@AREG_PACKAGE_NAME@") option(AREG_BUILD_TESTS "No AREG Unit Tests" OFF) From c8b35bbed7a91bf7d223b99da084e2e9c8c634d2 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 7 Oct 2024 09:43:21 +0200 Subject: [PATCH 17/24] Fixed cmake error --- conf/exports/config.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in index d98b5c3b2..7fd59afe9 100644 --- a/conf/exports/config.cmake.in +++ b/conf/exports/config.cmake.in @@ -3,7 +3,7 @@ include(CMakeFindDependencyMacro) set(AREG_SDK_ROOT "@CMAKE_INSTALL_PREFIX@") set(AREG_BASE "@CMAKE_INSTALL_FULL_INCLUDEDIR@") -set(AREG_SHARE "@CMAKE_INSTALL_PREFIX@/share/@AREG_PACKAGE_NAME@) +set(AREG_SHARE "@CMAKE_INSTALL_PREFIX@/share/@AREG_PACKAGE_NAME@") set(AREG_SHARE_INIT "${AREG_SHARE}/areg.init") set(AREG_CMAKE_CONFIG_DIR "${AREG_SHARE}/conf/cmake") set(AREG_SDK_TOOLS "@CMAKE_INSTALL_PREFIX@/tools/@AREG_PACKAGE_NAME@") From a12eac297a88744af669edc0cb25fa08663d6c8a Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 7 Oct 2024 10:04:20 +0200 Subject: [PATCH 18/24] Fixed generated path problem. --- conf/exports/config.cmake.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in index 7fd59afe9..b06231d5f 100644 --- a/conf/exports/config.cmake.in +++ b/conf/exports/config.cmake.in @@ -27,9 +27,6 @@ option(AREG_BUILD_EXAMPLES "No AREG Examples" OFF) # set to 'CMAKE_CURRENT_BINARY_DIR' if it should be in the compiled binaries directory set(AREG_BUILD_ROOT "${CMAKE_SOURCE_DIR}/product") -# Change the generated directory if the output should be somewhere else -# set, for example, to 'CMAKE_BINARY_DIR' if the generated files should be in the compiled object directory -set(AREG_GENERATE "${AREG_BUILD_ROOT}/generate") # Add '${AREG_BASE}' path in the includes include_directories(${AREG_BASE}) From 14c96a77ac1606e98fc1cafbe9596fc1febbe19f Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 7 Oct 2024 21:31:07 +0200 Subject: [PATCH 19/24] Final changes to integrate in vcpkg. Test is needed. --- CMakeLists.txt | 1 + conf/cmake/clang.cmake | 9 +- conf/cmake/common.cmake | 5 +- conf/cmake/functions.cmake | 201 ++++++++++++++++++----------------- conf/cmake/install.cmake | 74 +++++++------ conf/cmake/user.cmake | 16 ++- conf/exports/config.cmake.in | 28 ++++- 7 files changed, 181 insertions(+), 153 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7c6ed98f..f3af5ed09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,7 @@ message(STATUS "AREG: >>> Compiler ........: \'${CMAKE_CXX_COMPILER}\', ID \'${A 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}\'") diff --git a/conf/cmake/clang.cmake b/conf/cmake/clang.cmake index a9d07f7c1..7676ecbc1 100644 --- a/conf/cmake/clang.cmake +++ b/conf/cmake/clang.cmake @@ -21,6 +21,7 @@ if (AREG_OS STREQUAL "Windows") # 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") if(CMAKE_BUILD_TYPE MATCHES Release) @@ -67,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 @@ -75,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 @@ -94,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 607d1aa1c..c3b4f113d 100644 --- a/conf/cmake/common.cmake +++ b/conf/cmake/common.cmake @@ -119,10 +119,6 @@ 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 # ------------------------------------------------------- @@ -205,6 +201,7 @@ if (NOT ${Java_FOUND}) find_package(Java COMPONENTS Development) endif() +# Check and setup variables for installation if (AREG_INSTALL) option(INSTALL_GTEST "Disable Googletest installation" OFF) diff --git a/conf/cmake/functions.cmake b/conf/cmake/functions.cmake index 16d6843e9..e886a2c0d 100644 --- a/conf/cmake/functions.cmake +++ b/conf/cmake/functions.cmake @@ -18,10 +18,6 @@ function(setAppOptions item library_list) # Linking flags target_link_libraries(${item} ${AREG_PACKAGE_NAME}::aregextend ${library_list} ${AREG_PACKAGE_NAME}::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}) endfunction(setAppOptions) # --------------------------------------------------------------------------- @@ -81,11 +77,6 @@ function(setStaticLibOptions item library_list) endif() target_link_libraries(${item} ${library_list} ${AREG_PACKAGE_NAME}::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}) - endfunction(setStaticLibOptions) # --------------------------------------------------------------------------- @@ -154,11 +145,6 @@ function(addStaticLibEx_C target_name target_namespace source_list library_list) endif() target_link_libraries(${target_name} ${library_list} ${AREG_PACKAGE_NAME}::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}) endfunction(addStaticLibEx_C) # --------------------------------------------------------------------------- @@ -193,11 +179,6 @@ function(setSharedLibOptions item library_list) 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) # --------------------------------------------------------------------------- @@ -552,83 +533,118 @@ macro(macro_normalize_path normal_path os_path) endif() endmacro(macro_normalize_path) -function(addServiceInterface_full gen_project_name source_root relative_path sub_dir interface_name build_root_path interface_output_path codegen_tool_path) +# --------------------------------------------------------------------------- +# 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") - else() - macro_normalize_path(interface_doc "${source_root}/${relative_path}/${sub_dir}/${interface_name}.siml") - endif() + # Run the code generator tool + execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -jar ${codegen_tool} --root=${codegen_root} --doc=${interface_doc} --target=${output_path}) - execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -jar ${codegen_tool_path} --root=${build_root_path} --doc=${interface_doc} --target=${interface_output_path}) - - 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 - ${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 + # 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" ) - if (TARGET ${gen_project_name}) - target_sources(${gen_project_name} PRIVATE "${proj_src}") + # Add generated files to an existing or new static library + if (TARGET ${lib_name}) + target_sources(${lib_name} PRIVATE "${private_files}") 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}") + 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() -endfunction(addServiceInterface_full) + +endmacro(macro_add_service_interface) # --------------------------------------------------------------------------- -# 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 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") - macro_normalize_path(build_root_path "${AREG_BUILD_ROOT}") - macro_normalize_path(interface_output_path "${AREG_GENERATE}/${relative_path}") - macro_normalize_path(codegen_tool_path "${AREG_SDK_TOOLS}/codegen.jar") + if (${sub_dir} STREQUAL "") + macro_normalize_path(interface_doc "${source_root}/${relative_path}/${interface_name}.siml") + else() + macro_normalize_path(interface_doc "${source_root}/${relative_path}/${sub_dir}/${interface_name}.siml") + endif() - addServiceInterface_full(${gen_project_name} "${source_root}" "${relative_path}" "${sub_dir}" "${interface_name}" "${build_root_path}" "${interface_output_path}" "${codegen_tool_path}") + macro_add_service_interface( ${lib_name} + "${interface_doc}" + "${interface_name}" + "${codegen_root}" + "${output_path}" + "${codegen_tool}" + ) endfunction(addServiceInterfaceEx) @@ -646,33 +662,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 diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index 981df17d0..1d18dca85 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -10,6 +10,7 @@ include(CMakePackageConfigHelpers) set(AREG_EXPORTS_DIR "${AREG_CMAKE_CONFIG_DIR}/../exports") set(AREG_INSTALL_DST "${CMAKE_INSTALL_PREFIX}") +# Setup AREG SDK exporting targets. target_include_directories(areg PUBLIC $) target_include_directories(aregextend PUBLIC $) target_include_directories(areglogger PUBLIC $) @@ -24,7 +25,7 @@ target_link_directories(logger PUBLIC $ $ $) target_link_directories(mcrouter PUBLIC $ $) -# Copy AREG SDK all headers +# Copy all header files of AREG Framework install(DIRECTORY framework/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Development CONFIGURATIONS Release @@ -36,32 +37,26 @@ install(DIRECTORY framework/ PATTERN "mcrouter" EXCLUDE ) -# copy compiled binaries in the bin and lib directories +# 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 lib COMPONENT Development COMPONENT Runtime + 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 configuration file -install(FILES "${AREG_BASE}/areg/resources/areg.init" - DESTINATION bin/config - COMPONENT Development COMPONENT Runtime -) - # 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 WORLD_READ + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ CONFIGURATIONS Release ) -# Copy AREG SDK license +# Copy AREG SDK open source license install(FILES LICENSE.txt DESTINATION share/${AREG_PACKAGE_NAME} COMPONENT Development COMPONENT Runtime @@ -94,11 +89,10 @@ install(TARGETS logger logobserver mcrouter CONFIGURATIONS Release ) -# Copy additionally areg library +# Copy additionally areg and areglogger dynamic libraries install(TARGETS areg areglogger - RUNTIME DESTINATION tools/${AREG_PACKAGE_NAME} + LIBRARY 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 ) @@ -106,54 +100,58 @@ install(TARGETS areg areglogger 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 WORLD_READ + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ CONFIGURATIONS Release ) -configure_file("${AREG_EXPORTS_DIR}/areg.pc.in" areg.pc @ONLY) -configure_file("${AREG_EXPORTS_DIR}/aregextend.pc.in" aregextend.pc @ONLY) -configure_file("${AREG_EXPORTS_DIR}/areglogger.pc.in" areglogger.pc @ONLY) +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}/areg.pc" - "${CMAKE_CURRENT_BINARY_DIR}/aregextend.pc" - "${CMAKE_CURRENT_BINARY_DIR}/areglogger.pc" + "${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 ) if ((WIN32) OR (CYGWIN)) - configure_file("${AREG_EXPORTS_DIR}/logger.service.install.bat.in" "logger.service.install.bat" @ONLY) - configure_file("${AREG_EXPORTS_DIR}/logger.service.uninstall.bat.in" "logger.service.uninstall.bat" @ONLY) - configure_file("${AREG_EXPORTS_DIR}/mcrouter.service.install.bat.in" "mcrouter.service.install.bat" @ONLY) - configure_file("${AREG_EXPORTS_DIR}/mcrouter.service.uninstall.bat.in" "mcrouter.service.uninstall.bat" @ONLY) + 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}/logger.service.install.bat" - "${CMAKE_CURRENT_BINARY_DIR}/logger.service.uninstall.bat" - "${CMAKE_CURRENT_BINARY_DIR}/mcrouter.service.install.bat" - "${CMAKE_CURRENT_BINARY_DIR}/mcrouter.service.uninstall.bat" - DESTINATION tools/${AREG_PACKAGE_NAME} + "${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 ) else() - configure_file("${AREG_EXPORTS_DIR}/logger.service.in" "logger.service" @ONLY) - configure_file("${AREG_EXPORTS_DIR}/mcrouter.service.in" "mcrouter.service" @ONLY) + 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}/logger.service" - "${CMAKE_CURRENT_BINARY_DIR}/mcrouter.service" + "${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 ) endif() -write_basic_package_version_file(${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}/${AREG_PACKAGE_NAME}-config.cmake" INSTALL_DESTINATION share/${AREG_PACKAGE_NAME}) +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}:: @@ -162,8 +160,8 @@ export(TARGETS areg aregextend areglogger ) install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-config-version.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${AREG_PACKAGE_NAME}-config.cmake" + "${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 ) diff --git a/conf/cmake/user.cmake b/conf/cmake/user.cmake index 5a4a406d3..661f997ba 100644 --- a/conf/cmake/user.cmake +++ b/conf/cmake/user.cmake @@ -172,12 +172,24 @@ 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 OR NOT "${AREG_LOGGER_LIB}" STREQUAL "static") +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() diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in index b06231d5f..27f3ccb72 100644 --- a/conf/exports/config.cmake.in +++ b/conf/exports/config.cmake.in @@ -1,26 +1,44 @@ @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@") -set(AREG_SHARE "@CMAKE_INSTALL_PREFIX@/share/@AREG_PACKAGE_NAME@") -set(AREG_SHARE_INIT "${AREG_SHARE}/areg.init") -set(AREG_CMAKE_CONFIG_DIR "${AREG_SHARE}/conf/cmake") +# 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@") -set(AREG_SDK) +# 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@") +# 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@) -option(AREG_SQLITE_PACKAGE "AREG compiled with SQLite package" @AREG_SQLITE_PACKAGE@) +# include the exported targets include("${CMAKE_CURRENT_LIST_DIR}/@AREG_PACKAGE_NAME@-targets.cmake") check_required_components("@AREG_PACKAGE_NAME@") +# 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. From 931ccd1ae8c5a67a8c1474cf0147d4dbac4d2fc7 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Tue, 8 Oct 2024 00:50:17 +0200 Subject: [PATCH 20/24] Created a new small project for vcpkg. Fixed warnings to test examples. --- CMakeLists.txt | 2 +- conf/cmake/functions.cmake | 37 +++++++++++++++++++++++++- conf/cmake/install.cmake | 10 ++++++++ conf/cmake/setup.cmake | 4 ++- conf/exports/config.cmake.in | 40 ++++++++++++++++++++++++++++- conf/exports/example/CMakeLists.txt | 12 +++++++++ conf/exports/example/ReadMe.md | 26 +++++++++++++++++++ conf/exports/example/example.cpp | 17 ++++++++++++ 8 files changed, 144 insertions(+), 4 deletions(-) create mode 100644 conf/exports/example/CMakeLists.txt create mode 100644 conf/exports/example/ReadMe.md create mode 100644 conf/exports/example/example.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index f3af5ed09..815a2d654 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ 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: >>> 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") diff --git a/conf/cmake/functions.cmake b/conf/cmake/functions.cmake index e886a2c0d..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. @@ -524,12 +548,23 @@ 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) diff --git a/conf/cmake/install.cmake b/conf/cmake/install.cmake index 1d18dca85..a79cf547e 100644 --- a/conf/cmake/install.cmake +++ b/conf/cmake/install.cmake @@ -104,6 +104,7 @@ install(FILES "${AREG_BASE}/areg/resources/areg.init" CONFIGURATIONS Release ) +# 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) @@ -116,6 +117,7 @@ install(FILES 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) @@ -148,6 +150,7 @@ else() 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" @@ -173,3 +176,10 @@ install(EXPORT ${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/setup.cmake b/conf/cmake/setup.cmake index 7b59cdc80..ac3698a1b 100644 --- a/conf/cmake/setup.cmake +++ b/conf/cmake/setup.cmake @@ -60,7 +60,9 @@ 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(CMAKE_CXX_STANDARD ${AREG_CXX_STANDARD}) + +# 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) diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in index 27f3ccb72..7a106cc35 100644 --- a/conf/exports/config.cmake.in +++ b/conf/exports/config.cmake.in @@ -36,6 +36,15 @@ option(AREG_LOGS "AREG logging enable flag" @AREG_LOGS@) 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 @@ -45,8 +54,37 @@ option(AREG_BUILD_EXAMPLES "No AREG Examples" OFF) # 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() diff --git a/conf/exports/example/CMakeLists.txt b/conf/exports/example/CMakeLists.txt new file mode 100644 index 000000000..83ad49137 --- /dev/null +++ b/conf/exports/example/CMakeLists.txt @@ -0,0 +1,12 @@ +# CMakeList.txt : CMake project for example, include source and define +# project specific logic here. +# +cmake_minimum_required(VERSION 3.20.0) + +project ("example") + +find_package(areg CONFIG REQUIRED) +# Add source to this project's executable. +add_executable (example example.cpp) +set_property(TARGET example PROPERTY CXX_STANDARD 17) +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..0277541ad --- /dev/null +++ b/conf/exports/example/ReadMe.md @@ -0,0 +1,26 @@ +This `example` is a small project to check the linking with 'areg' library. +It as well outputs the 'AREG_SHARE_INIT' constant, to show the location of 'areg.init' file template. + +**Important:** AREG requires minimum C++17. + +To build and run the project, performa following steps: + +**Step 1: Copy example** +- Make a copy of the 'example' directory to any place and open there terminal. + +**Step 2: Configure the example** +- In the terminal run the command, but replace the `` and specifying the path in your computer: +```bash + cmake -B ./build -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake +``` +If the command above runs without error, you have properly installed the `areg` package. + +**Step 3: Compile the code** +- In the terminal run the command to compile the code: +```bash + cmake --build ./build +``` + +If compiled without error, you have the correct C++ compiler (minimum C++17) and succeeded to link with 'areg' library. + +To see the result, run binary: `./build//example.exe`. Where `` is the value of `CMAKE_BUILD_TYPE` (normally, `Debug` or `Release`). 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; +} From 59fa30e0f0236bcabc71dcd06b0a2af9b26f8bc0 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Tue, 8 Oct 2024 01:21:56 +0200 Subject: [PATCH 21/24] Fixed linux build of the example. --- conf/cmake/clang.cmake | 2 +- conf/cmake/gnu.cmake | 2 +- conf/cmake/msvc.cmake | 4 ++-- conf/exports/config.cmake.in | 14 ++++++++++++++ conf/exports/example/CMakeLists.txt | 3 +-- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/conf/cmake/clang.cmake b/conf/cmake/clang.cmake index 7676ecbc1..85d2f2737 100644 --- a/conf/cmake/clang.cmake +++ b/conf/cmake/clang.cmake @@ -44,7 +44,7 @@ else(AREG_OS STREQUAL "Posix") 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) diff --git a/conf/cmake/gnu.cmake b/conf/cmake/gnu.cmake index 652617606..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) diff --git a/conf/cmake/msvc.cmake b/conf/cmake/msvc.cmake index ea72368c0..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() diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in index 7a106cc35..a6b9465e3 100644 --- a/conf/exports/config.cmake.in +++ b/conf/exports/config.cmake.in @@ -27,6 +27,11 @@ 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. @@ -88,3 +93,12 @@ if (AREG_LOGS) else() add_definitions(-DAREG_LOGS=0) endif() + +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 index 83ad49137..f0242a207 100644 --- a/conf/exports/example/CMakeLists.txt +++ b/conf/exports/example/CMakeLists.txt @@ -3,10 +3,9 @@ # cmake_minimum_required(VERSION 3.20.0) -project ("example") +project ("example" CXX) find_package(areg CONFIG REQUIRED) # Add source to this project's executable. add_executable (example example.cpp) -set_property(TARGET example PROPERTY CXX_STANDARD 17) target_link_libraries(example PRIVATE areg::areg) From 3ad1460d3b2328f4d98e158861b34caa82d0daf2 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Tue, 8 Oct 2024 01:43:12 +0200 Subject: [PATCH 22/24] Minor improvement of vcpkg to make ready to integrate in the vcpkg. --- conf/exports/example/CMakeLists.txt | 4 +-- conf/exports/example/ReadMe.md | 40 ++++++++++++++++++----------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/conf/exports/example/CMakeLists.txt b/conf/exports/example/CMakeLists.txt index f0242a207..fc6ad012d 100644 --- a/conf/exports/example/CMakeLists.txt +++ b/conf/exports/example/CMakeLists.txt @@ -1,6 +1,4 @@ -# CMakeList.txt : CMake project for example, include source and define -# project specific logic here. -# +# CMakeList.txt : include source and link with 'areg::areg' cmake_minimum_required(VERSION 3.20.0) project ("example" CXX) diff --git a/conf/exports/example/ReadMe.md b/conf/exports/example/ReadMe.md index 0277541ad..40827cdd0 100644 --- a/conf/exports/example/ReadMe.md +++ b/conf/exports/example/ReadMe.md @@ -1,26 +1,36 @@ -This `example` is a small project to check the linking with 'areg' library. -It as well outputs the 'AREG_SHARE_INIT' constant, to show the location of 'areg.init' file template. +### 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. -**Important:** AREG requires minimum C++17. +> **Note:** AREG requires a minimum of C++17. -To build and run the project, performa following steps: +--- -**Step 1: Copy example** -- Make a copy of the 'example' directory to any place and open there terminal. +### 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: -**Step 2: Configure the example** -- In the terminal run the command, but replace the `` and specifying the path in your computer: ```bash - cmake -B ./build -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake +cmake -B ./build -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake ``` -If the command above runs without error, you have properly installed the `areg` package. -**Step 3: Compile the code** -- In the terminal run the command to compile the code: +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 +cmake --build ./build ``` -If compiled without error, you have the correct C++ compiler (minimum C++17) and succeeded to link with 'areg' library. +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. -To see the result, run binary: `./build//example.exe`. Where `` is the value of `CMAKE_BUILD_TYPE` (normally, `Debug` or `Release`). +You can now run the `example` binary located in the `./build` directory to see the results. From f8ee9f6c6ff6013b009fbe1e9d4950eff3d64f94 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Tue, 8 Oct 2024 09:52:34 +0200 Subject: [PATCH 23/24] Fixed MSBuild --- areg-sdk.sln | 23 +++++++++++++++++++++++ framework/areg.vcxproj | 3 --- framework/areg.vcxproj.filters | 3 --- framework/areg/resources/resource.hpp | 14 -------------- framework/areglogger.vcxproj | 3 +-- framework/areglogger.vcxproj.filters | 3 --- framework/areglogger/resources/RCa47136 | Bin 2990 -> 0 bytes framework/logobserver.vcxproj | 2 +- 8 files changed, 25 insertions(+), 26 deletions(-) delete mode 100644 framework/areg/resources/resource.hpp delete mode 100644 framework/areglogger/resources/RCa47136 diff --git a/areg-sdk.sln b/areg-sdk.sln index 2d99052c5..7f7aa2c2b 100644 --- a/areg-sdk.sln +++ b/areg-sdk.sln @@ -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/framework/areg.vcxproj b/framework/areg.vcxproj index 688d610bd..76300790c 100644 --- a/framework/areg.vcxproj +++ b/framework/areg.vcxproj @@ -413,9 +413,6 @@ - - - diff --git a/framework/areg.vcxproj.filters b/framework/areg.vcxproj.filters index 880bb4e39..365261dca 100644 --- a/framework/areg.vcxproj.filters +++ b/framework/areg.vcxproj.filters @@ -746,9 +746,6 @@ Header Files - - Header Files - Header Files diff --git a/framework/areg/resources/resource.hpp b/framework/areg/resources/resource.hpp deleted file mode 100644 index 2567466ba..000000000 --- a/framework/areg/resources/resource.hpp +++ /dev/null @@ -1,14 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by areg.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/areglogger.vcxproj b/framework/areglogger.vcxproj index f980095d6..bb5ac65e8 100644 --- a/framework/areglogger.vcxproj +++ b/framework/areglogger.vcxproj @@ -21,7 +21,7 @@ - $(ProjectCommonDefines);_USRDLL;IMP_AREG_DLL;EXP_LOGOBSERVER_DLL;%(PreprocessorDefinitions) + $(ProjectCommonDefines);_USRDLL;IMP_AREG_DLL;EXP_LOGGER_DLL;%(PreprocessorDefinitions) Windows @@ -47,7 +47,6 @@ - diff --git a/framework/areglogger.vcxproj.filters b/framework/areglogger.vcxproj.filters index c04dc9c76..8a7fa2dc3 100644 --- a/framework/areglogger.vcxproj.filters +++ b/framework/areglogger.vcxproj.filters @@ -46,9 +46,6 @@ Resource Files - - Resource Files - Resource Files diff --git a/framework/areglogger/resources/RCa47136 b/framework/areglogger/resources/RCa47136 deleted file mode 100644 index c41e59b6215265ee01eb57d38b7360146f5383ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2990 zcmd6p-ER^>6vfZ8iT}e0FE(lw3iacS(n=aBH3b??NC@GhMJt#tO<(-u{oR?}7TB#6 z^|q=iEE@+}Wb8G}TOFIh9mUT_4nA{M5DP`UXDKLXpP?U}IhA74IW`_t*q% zpdaA3%)gG&Wabsv1!K$?^J?}H*bPrZ|7>X1>|H;jpr?AG;tEGYUNf9dU_NBt-20rs z)9D;6!v6ppM>H=O&NHwWjq8H@2yC5;!_K@-iG876zp||p7+8*m_`Jc^a#cv#m$116 zUuRs65wn}z<+`TNYOABJ4t1wBr)p$EqOHF+RX>&c%0Z5bQByQuBzmc#@?oJKj zUC+5y%baR)WcbqOu|w2f$ip#F*NM~eam4p>#tv=XlUtwPu(R2_QNnY=F@IS!M#ip4 zoy~luO~}LF)yk@BLKWsS;v{OjJ9dADUac!d)QHn_YGTG)qT4o4LB)}FGO8qsGq~K> z-o@Ay1v)*8GaLHeh!tx3NEHSRw$WP`HP&I$ry83KTjv+UJ!sj%#~C%>$Et<>j$g3} z+5+uzZ}_@?ua|f!r8t)FFyk0{Mb^%nPR?QY32%qqOaAvX(VIi(S!z$dhswX-x3b>) z2uoxv+tTsHtPb$o@IA!d9_r0Ky@~s??NP|yvP$;i-eA3FyY-5`@2s8=1x`e(u;p%4 z@MmBTG@KLmzKK()-My_j*=f7YN)=V&s;1{1pA)P?oA@{1Mro>todQ E8}m4DivR!s 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 From 1d5d4dc6a5849cfed1eafc406e649511a7f94517 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Tue, 8 Oct 2024 15:48:50 +0200 Subject: [PATCH 24/24] Fixed windows build --- CMakeLists.txt | 5 - conf/cmake/user.cmake | 92 +++++++++---------- conf/exports/config.cmake.in | 1 + framework/areg/CMakeLists.txt | 8 +- framework/aregextend/CMakeLists.txt | 2 - framework/areglogger/CMakeLists.txt | 3 +- .../client/private/LogObserverApi.cpp | 5 + framework/logger/CMakeLists.txt | 1 - framework/logobserver/CMakeLists.txt | 5 +- framework/mcrouter/CMakeLists.txt | 1 - thirdparty/sqlite3.vcxproj | 4 +- 11 files changed, 59 insertions(+), 68 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 815a2d654..f7161f166 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,11 +69,6 @@ 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) - message(WARNING "AREG: >>> Forcing to set AREG_INSTALL to OFF, \ - because the project is compiled with local SQLite3 sources.\ - Recompile the project and enable using SQLite package by\ - setting 'AREG_USE_PACKAGES=ON' and specifying 'CMAKE_TOOLCHAIN_FILE' variable.\nExample:\n$ \ - cmake -B ./build -DAREG_USE_PACKAGES=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DAREG_INSTALL=ON") endif() # Print the configuration status diff --git a/conf/cmake/user.cmake b/conf/cmake/user.cmake index 661f997ba..28d3e3c97 100644 --- a/conf/cmake/user.cmake +++ b/conf/cmake/user.cmake @@ -4,28 +4,32 @@ # ########################################################################### # --------------------------------------------------------------------------- -# 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_LOGGER_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_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'. -# 12. AREG_SQLITE_PACKAGE -- Flag, indicating whether should use SQLite3 package available in the system or compile the library from sources. -# 13. AREG_GTEST_PACKAGE -- Flag, indicating whether should use GTest package available in the system or should compile the libraries from sources. -# 14. AREG_BUILD_ROOT -- The root directory to build or create generated files. By default is the './product' directory of 'areg-sdk' root. -# 15. AREG_OUTPUT_DIR -- The output directory of build binaries. -# 16. AREG_OUTPUT_BIN -- The output directory of build executables or runtime binaries (shared libraries). -# 17. AREG_OUTPUT_LIB -- The output directory of static libraries. -# 18. AREG_PACKAGES -- The location to install thirdparty packages. -# 19. 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) @@ -39,37 +43,32 @@ # 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' (possible values: any valid path for outputs for product and generated files) -# 15. AREG_OUTPUT_DIR = '/product/build/gnu-gcc/---release-' (possible values: any valid path for build outputs) -# 16. AREG_OUTPUT_BIN = '/product/build/gnu-gcc/---release-/bin' (possible values: any valid path for binary outputs) -# 17. AREG_OUTPUT_LIB = '/product/build/gnu-gcc/---release-/lib' (possible values: any valid path for library outputs) -# 18. AREG_PACKAGES = '${AREG_BUILD_ROOT}/packages' (possible values: any valid path for package location) -# 19. 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) +# 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 @@ -224,6 +223,7 @@ 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() # CPP standard for the projects diff --git a/conf/exports/config.cmake.in b/conf/exports/config.cmake.in index a6b9465e3..7a3fd99a2 100644 --- a/conf/exports/config.cmake.in +++ b/conf/exports/config.cmake.in @@ -94,6 +94,7 @@ 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) diff --git a/framework/areg/CMakeLists.txt b/framework/areg/CMakeLists.txt index b50dfb5d5..5984b99a3 100644 --- a/framework/areg/CMakeLists.txt +++ b/framework/areg/CMakeLists.txt @@ -27,7 +27,7 @@ if(AREG_BINARY MATCHES "shared") endif() # 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}) @@ -41,7 +41,7 @@ else(AREG_BINARY MATCHES "static") endif() # set_property(TARGET areg PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${AREG_OUTPUT_LIB}) -endif() +endif(AREG_BINARY MATCHES "shared") if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32") target_compile_options(areg PRIVATE -fPIC) @@ -51,10 +51,6 @@ 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 ) -# set_target_properties(areg PROPERTIES VERSION ${AREG_PROJECT_VERSION}) - # copying log and router init files to 'bin/config' add_custom_command( TARGET areg POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/config diff --git a/framework/aregextend/CMakeLists.txt b/framework/aregextend/CMakeLists.txt index 243aa35a9..1e7244802 100644 --- a/framework/aregextend/CMakeLists.txt +++ b/framework/aregextend/CMakeLists.txt @@ -13,6 +13,4 @@ endif() # build areg extended static library addStaticLibEx(aregextend ${AREG_PACKAGE_NAME} "${extend_SRC}" "") - -# set_target_properties(aregextend PROPERTIES VERSION ${AREG_PROJECT_VERSION}) target_compile_options(aregextend PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") diff --git a/framework/areglogger/CMakeLists.txt b/framework/areglogger/CMakeLists.txt index b018d3cd7..a28208906 100644 --- a/framework/areglogger/CMakeLists.txt +++ b/framework/areglogger/CMakeLists.txt @@ -35,7 +35,7 @@ if (AREG_LOGGER_LIB MATCHES "shared") target_link_options(areglogger PRIVATE "/DEF:${areglogger_BASE}/resources/logobserver.def") endif() -else(AREG_LOGGER_LIB MATCHES "static") +else() # build log observer API static library addStaticLibEx(areglogger ${AREG_PACKAGE_NAME} "${areglogger_SRC}" "") target_compile_options(areglogger PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") @@ -47,4 +47,3 @@ else(AREG_LOGGER_LIB MATCHES "static") target_compile_definitions(areglogger PRIVATE EXP_LOGGER_LIB) endif(AREG_LOGGER_LIB MATCHES "shared") -# set_target_properties(areglogger PROPERTIES VERSION ${AREG_PROJECT_VERSION}) diff --git a/framework/areglogger/client/private/LogObserverApi.cpp b/framework/areglogger/client/private/LogObserverApi.cpp index 9bbba544a..704813997 100644 --- a/framework/areglogger/client/private/LogObserverApi.cpp +++ b/framework/areglogger/client/private/LogObserverApi.cpp @@ -26,7 +26,12 @@ #ifdef WINDOWS #pragma comment(lib, "areg") #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 diff --git a/framework/logger/CMakeLists.txt b/framework/logger/CMakeLists.txt index f1701947c..95a212e04 100644 --- a/framework/logger/CMakeLists.txt +++ b/framework/logger/CMakeLists.txt @@ -12,7 +12,6 @@ endif() # build logger executable addExecutableEx(logger ${AREG_PACKAGE_NAME} "${logger_SRC}" "") target_compile_options(logger PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") -# set_target_properties(logger PROPERTIES VERSION ${AREG_PROJECT_VERSION}) if("${AREG_DEVELOP_ENV}" STREQUAL "Win32" OR CYGWIN) add_custom_command( TARGET logger POST_BUILD diff --git a/framework/logobserver/CMakeLists.txt b/framework/logobserver/CMakeLists.txt index be6c9770e..93744bdb4 100644 --- a/framework/logobserver/CMakeLists.txt +++ b/framework/logobserver/CMakeLists.txt @@ -14,10 +14,9 @@ endif() if (AREG_LOGGER_LIB MATCHES "shared") addExecutableEx(logobserver ${AREG_PACKAGE_NAME} "${logobserver_SRC}" areglogger) target_compile_definitions(logobserver PRIVATE IMP_LOGGER_DLL) -else (AREG_LOGGER_LIB MATCHES "static") +else () addExecutableEx(logobserver ${AREG_PACKAGE_NAME} "${logobserver_SRC}" areglogger ${AREG_SQLITE_LIB_REF}) target_compile_definitions(logobserver PRIVATE IMP_LOGGER_LIB) -endif() +endif(AREG_LOGGER_LIB MATCHES "shared") -# set_target_properties(logobserver PROPERTIES VERSION ${AREG_PROJECT_VERSION}) target_compile_options(logobserver PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") diff --git a/framework/mcrouter/CMakeLists.txt b/framework/mcrouter/CMakeLists.txt index f19dfe039..3b0003943 100644 --- a/framework/mcrouter/CMakeLists.txt +++ b/framework/mcrouter/CMakeLists.txt @@ -12,7 +12,6 @@ endif() # build mcrouter executable addExecutableEx(mcrouter ${AREG_PACKAGE_NAME} "${mcrouter_SRC}" "") target_compile_options(mcrouter PRIVATE "${AREG_OPT_DISABLE_WARN_TOOLS}") -# set_target_properties(mcrouter PROPERTIES VERSION ${AREG_PROJECT_VERSION}) if("${AREG_DEVELOP_ENV}" STREQUAL "Win32" OR CYGWIN) add_custom_command( TARGET mcrouter POST_BUILD 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