diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ffa2f2b..a7f6d9d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -24,101 +24,195 @@ jobs: matrix: config: # Create matrix with combinations # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and logs - - { name: linux-gnu-shared-ext-log, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: ON} + - { name: linux-gnu-g++-shared, + os: ubuntu-latest, + lib: shared, + family: gnu, + cxx: g++, + comp: ON, + before: ON + } + # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and no logs - - { name: linux-gnu-shared-ext-nolog, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: OFF} + - { name: linux-gnu-g++-static, + os: ubuntu-latest, + lib: static, + family: gnu, + cxx: g++, + comp: OFF, + before: OFF + } + # compile AREG engine as a static library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and logs - - { name: linux-gnu-static-ext-log, os: ubuntu-latest, lib: static, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: ON} + - { name: linux-gnu-gcc-shared, + os: ubuntu-latest, + lib: shared, + family: gnu, + cxx: gcc, + comp: OFF, + before: ON + } + # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, disable AREG extensions and logs - - { name: linux-gnu-shared-noext-log, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: OFF, logs: ON} - # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, disable AREG extensions and no logs - - { name: linux-gnu-shared-noext-nolog, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: OFF, logs: OFF} + - { name: linux-gnu-gcc-static, + os: ubuntu-latest, + lib: shared, + family: gnu, + cxx: gcc, + comp: ON, + before: OFF + } + + # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and logs + - { name: linux-llvm-clang++-shared, + os: ubuntu-latest, + lib: shared, + family: llvm, + cxx: clang++, + comp: ON, + before: ON + } + + # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and no logs + - { name: linux-llvm-clang++-static, + os: ubuntu-latest, + lib: static, + family: llvm, + cxx: clang++, + comp: OFF, + before: OFF + } + # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and logs - - { name: linux-clang-shared-ext-log, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: ON} + - { name: linux-llvm-clang-shared, + os: ubuntu-latest, + lib: shared, + family: llvm, + cxx: clang, + comp: OFF, + before: ON + } + # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and no logs - - { name: linux-clang-shared-ext-nolog, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: OFF} - # compile AREG engine as a static library with clang on Ubuntu Linux, enable AREG extensions and logs - - { name: linux-clang-static-ext-log, os: ubuntu-latest, lib: static, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: ON} - # compile AREG engine as a shared library with clang on Ubuntu Linux, disable AREG extensions and logs - - { name: linux-clang-shared-noext-log, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: OFF, logs: ON} - # compile AREG engine as a shared library with clang on Ubuntu Linux, disable AREG extensions and no logs - - { name: linux-clang-shared-noext-nolog,os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: OFF, logs: OFF} + - { name: linux-llvm-clang-static, + os: ubuntu-latest, + lib: static, + family: llvm, + cxx: clang, + comp: ON, + before: OFF + } + + # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs + - { name: win-cygwin-g++-shared, + os: windows-latest, + lib: shared, + family: cygwin, + cxx: g++, + comp: ON, + before: ON + } + + # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs + - { name: win-cygwin-g++-static, + os: windows-latest, + lib: static, + family: cygwin, + cxx: g++, + comp: OFF, + before: OFF + } + + # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs + - { name: win-cygwin-gcc-shared, + os: windows-latest, + lib: shared, + family: cygwin, + cxx: gcc, + comp: OFF, + before: ON + } + # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs - - { name: win-cygwin-shared-ext-log, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: ON} - # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and no logs - - { name: win-cygwin-shared-ext-nolog, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: OFF} - # compile AREG engine as a static with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs - - { name: win-cygwin-static-ext-log, os: windows-latest, lib: static, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: ON} - # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, disable AREG extensions and logs - - { name: win-cygwin-shared-noext-log, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: OFF, logs: ON} - # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, disable AREG extensions and no logs - - { name: win-cygwin-shared-noext-nolog,os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: OFF, logs: OFF} + - { name: win-cygwin-gcc-static, + os: windows-latest, + lib: static, + family: cygwin, + cxx: gcc, + comp: ON, + before: OFF + } + # compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and logs - - { name: win-msvc-shared-ext-log, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: ON, logs: ON} - # compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and no logs - - { name: win-msvc-shared-ext-nolog, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: ON, logs: OFF} - # compile AREG engine as a static with MSVC on Windows, enable AREG extensions and logs - - { name: win-msvc-static-ext-log, os: windows-latest, lib: static, family: msvc, cxx: cl, cc: cl, extend: ON, logs: ON} + - { name: win-msvc-cl-shared, + os: windows-latest, + lib: shared, + family: msvc, + cxx: cl, + comp: ON, + before: ON + } + # compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and logs - - { name: win-msvc-shared-noext-log, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: OFF, logs: ON} - # compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and no logs - - { name: win-msvc-shared-noext-nolog, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: OFF, logs: OFF} + - { name: win-msvc-cl-static, + os: windows-latest, + lib: static, + family: msvc, + cxx: cl, + comp: OFF, + before: OFF + } steps: - - name: Checkout AREG engine (AREG SDK) source codes and dependencies - uses: actions/checkout@v3 + - name: Checkout AREG SDK Demo project sources and dependencies + uses: actions/checkout@v4 with: submodules: recursive + - name: Setup Java JDK to run code generator + uses: actions/setup-java@v4.4.0 + with: + java-version: 17 + java-package: jre + distribution: temurin + - name: Update compilers on Linux if: matrix.config.os == 'ubuntu-latest' # Update compilers, set C/C++ compilers - run: | - sudo apt-get update - export CC=/usr/bin/${{matrix.config.cc}} CXX=/usr/bin/${{matrix.config.cxx}} + run: sudo apt-get update - - name: Fetch cygwin installer on Windows + - name: Set Windows PATH environment variable for cygwin if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' - shell: powershell - run: Invoke-WebRequest https://cygwin.com/setup-x86_64.exe -OutFile C:\setup.exe + run: echo "PATH=C:\cygwin;C:\cygwin\bin;C:\cygwin\lib;%SYSTEMROOT%\system32;%PATH%" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Install cygwin on Windows if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' - shell: cmd - run: | - c:\setup.exe -qgnO -s http://mirrors.kernel.org/sourceware/cygwin/ -l C:\cygwin-packages\ -P ^ - cmake,^ - dos2unix,^ - extra-cmake-modules,^ - flexdll,^ - gcc-g++,^ - make,^ - ncurses,^ - libncurses-devel - - - name: set Windows PATH environment variable - if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' - run: echo "PATH=C:\cygwin64;C:\cygwin64\bin;C:\cygwin64\lib;%SYSTEMROOT%\system32;%PATH%" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - name: Configure CMake with enabled extended feature and selected compiler family - if: matrix.config.extend == 'ON' + uses: cygwin/cygwin-install-action@v4 + with: + packages: cmake, dos2unix, flexdll, gcc-g++, git, ncurses, libncurses-devel, make + + - name: Set cmake cache destination for Linux + if: matrix.config.os == 'ubuntu-latest' + run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> "$GITHUB_ENV" + + - name: Set cmake cache destination for Windows + if: matrix.config.os == 'windows-latest' + run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> $env:GITHUB_ENV + + - name: Configure CMake and pass compiler option + if: matrix.config.comp == 'ON' working-directory: ${{github.workspace}} run: | - cmake -B ./build -DAREG_COMPILER_FAMILY=${{matrix.config.family}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DAREG_EXTENDED:BOOL=${{matrix.config.extend}} -DAREG_LOGS:BOOL=${{matrix.config.logs}} + cmake -B ${{env.CACHE_DEST}} -DAREG_COMPILER=${{matrix.config.cxx}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DINTEGRATE_AREG_BEFORE_PROJECT:BOOL=${{matrix.config.before}} - - name: Configure CMake for disabled extended feature and selected compiler - if: matrix.config.extend == 'OFF' + - name: Configure CMake and pass compiler family option + if: matrix.config.comp == 'OFF' working-directory: ${{github.workspace}} run: | - cmake -B ./build -DAREG_COMPILER=${{matrix.config.cc}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DAREG_EXTENDED:BOOL=${{matrix.config.extend}} -DAREG_LOGS:BOOL=${{matrix.config.logs}} + cmake -B ${{env.CACHE_DEST}} -DAREG_COMPILER_FAMILY=${{matrix.config.family}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DINTEGRATE_AREG_BEFORE_PROJECT:BOOL=${{matrix.config.before}} - name: Build with CMake working-directory: ${{github.workspace}} # Build your program with the given configuration - run: cmake --build ./build -j10 - - - name: Run Unit Tests - working-directory: ${{github.workspace}} - run: ctest --test-dir ./build --output-on-failure --output-junit test_results.xml - + run: cmake --build ${{env.CACHE_DEST}} -j 20 diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index c9592db..9eef942 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -50,20 +50,27 @@ jobs: - {name: MSBuild-x64-noext-nolog, platform: x64, extend: 0, logs: 0} steps: - - name: Checkout AREG engine (AREG SDK) source codes and submodules - uses: actions/checkout@v3 - with: - submodules: recursive + - name: Checkout AREG SDK Demo project sources and dependencies + uses: actions/checkout@v4 + with: + submodules: recursive - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 + - name: Setup Java JDK to run code generator + uses: actions/setup-java@v4.4.0 + with: + java-version: 17 + java-package: jre + distribution: temurin - - name: Restore NuGet packages - working-directory: ${{env.GITHUB_WORKSPACE}} - run: nuget restore ${{env.SOLUTION_FILE_PATH}} + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v2 - - name: Build areg-sdk solution. - working-directory: ${{env.GITHUB_WORKSPACE}} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - run: msbuild /m /property:Configuration=${{env.BUILD_CONFIGURATION}} /property:Platform=${{matrix.config.platform}} /property:AregExtended=${{matrix.config.extend}} /property:AregLogs=${{matrix.config.logs}} ${{env.SOLUTION_FILE_PATH}} + - name: Restore NuGet packages + working-directory: ${{env.GITHUB_WORKSPACE}} + run: nuget restore ${{env.SOLUTION_FILE_PATH}} + + - name: Build areg-sdk solution. + working-directory: ${{env.GITHUB_WORKSPACE}} + # Add additional options to the MSBuild command line here (like platform or verbosity level). + # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference + run: msbuild /m /property:Configuration=${{env.BUILD_CONFIGURATION}} /property:Platform=${{matrix.config.platform}} /property:AregExtended=${{matrix.config.extend}} /property:AregLogs=${{matrix.config.logs}} ${{env.SOLUTION_FILE_PATH}} diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cca1d7..45c55db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,110 +1,126 @@ # ################################################################## -# This file can be used as an example to integrate areg-sdk into -# the existing project. Use your paths of your project structure +# Example CMake script to integrate AREG SDK into an existing project. # +# This script demonstrates how to integrate AREG SDK as a package or +# fetch its sources from https://github.com/aregtech/areg-sdk.git. +# +# Integration can occur before or after the `project()` declaration: +# - Set `INTEGRATE_AREG_BEFORE_PROJECT` to TRUE (or ON) to integrate +# AREG SDK before calling `project()`, enabling immediate use of +# AREG SDK configurations. +# - Set `INTEGRATE_AREG_BEFORE_PROJECT` to FALSE (or OFF) to manually +# set project options before integrating AREG SDK. # ################################################################## cmake_minimum_required(VERSION 3.20.0) -set(AREG_SDK_DEMO_ROOT "${CMAKE_SOURCE_DIR}") -set(AREG_DEMO_SOURCES "${AREG_SDK_DEMO_ROOT}/demo") - -set(PROJECT_NAME "areg-sdk-demo") -set(PROJECT_VERSION "1.0.0") -project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX) - -find_package(areg CONFIG) - -if (NOT areg_FOUND) - - # ################################################################## - # Prepare AREG SDK configuration before fetching from GitHub - # ################################################################## - - # Specify where should AREG SDK output built binary directory - set(AREG_BUILD_ROOT "${AREG_SDK_DEMO_ROOT}/product") - - # Specify where should fetch the thirdparty source codes, including AREG SDK sources - set(AREG_PACKAGES "${AREG_BUILD_ROOT}/packages") - - # Specify AREG Framework library type - set(AREG_BINARY "shared") - - # Disable building AREG SDK Examples - option(AREG_BUILD_EXAMPLES "Disable building areg-sdk examples" OFF) - - # Disable building AreG SDK unit tests. - option(AREG_BUILD_TESTS "Disable building areg-sdk unit tests" OFF) - - include(FetchContent) - set(FETCHCONTENT_BASE_DIR "${AREG_PACKAGES}") - message(STATUS "Demo: >>> Fetching areg-sdk from https://github.com/aregtech/areg-sdk.git repo to ${FETCHCONTENT_BASE_DIR} directory") - FetchContent_Declare(areg-sdk - GIT_REPOSITORY https://github.com/aregtech/areg-sdk.git - GIT_TAG "master") - - FetchContent_MakeAvailable(areg-sdk) - - set(AREG_SDK_ROOT "${areg-sdk_SOURCE_DIR}") - set(AREG_CMAKE_CONFIG_DIR "${AREG_SDK_ROOT}/conf/cmake") - -else(NOT areg_FOUND) - - message(STATUS "Demo: >>> Found areg package in \'${areg_DIR}\',\ - configuration file \'${areg_CONFIG}\',\ - library \'${areg_LIBRARY}\',\ - package root is \'${areg_ROOT}\'.") - message(STATUS "Demo: >>> The SDK root \'${AREG_SDK_ROOT}\',\ - configuration files are \'${AREG_CMAKE_CONFIG_DIR}\' directory,\ - tools are in \'${AREG_SDK_TOOLS}\' directory.") - -endif(NOT areg_FOUND) +# Macro to load and configure the AREG SDK package or source repository +macro(macro_load_areg_sdk) + find_package(areg CONFIG) + + if (NOT areg_FOUND) + # ################################################################## + # AREG SDK not found as a package, fetching from GitHub. + # ################################################################## + + # Specify the root directory for AREG SDK build outputs. + set(AREG_BUILD_ROOT "${AREG_SDK_DEMO_ROOT}/product") + + # Specify where to fetch third-party sources (including AREG SDK). + set(AREG_PACKAGES "${AREG_BUILD_ROOT}/packages") + + # Disable building AREG SDK examples and unit tests for this demo. + option(AREG_BUILD_EXAMPLES "Disable areg-sdk examples for Demo" OFF) + option(AREG_BUILD_TESTS "Disable areg-sdk unit tests for Demo" OFF) + + include(FetchContent) + set(FETCHCONTENT_BASE_DIR "${AREG_PACKAGES}") + message(STATUS "Demo: >>> Fetching AREG SDK from GitHub to ${FETCHCONTENT_BASE_DIR}") + + FetchContent_Declare( + areg-sdk + GIT_REPOSITORY https://github.com/aregtech/areg-sdk.git + GIT_TAG "master" + ) + message(STATUS "Demo: >>> AREG SDK sources are fetched, setting up areg-sdk ...") + FetchContent_MakeAvailable(areg-sdk) + + # Set the root directory of the fetched AREG SDK + set(AREG_SDK_ROOT "${areg-sdk_SOURCE_DIR}") + set(AREG_CMAKE_CONFIG_DIR "${AREG_SDK_ROOT}/conf/cmake") + message(STATUS "Demo: >>> AREG_SDK_ROOT set to '${AREG_SDK_ROOT}', configuring AREG SDK...") + + else() + # AREG SDK package found + message(STATUS "Demo: >>> Found AREG package at '${areg_DIR}',") + message(STATUS " >>> Library: '${areg_LIBRARY}', Config: '${areg_CONFIG}', Package Root: '${areg_ROOT}'") + message(STATUS " >>> SDK Root: '${AREG_SDK_ROOT}', CMake Config: '${AREG_CMAKE_CONFIG_DIR}', Tools: '${AREG_SDK_TOOLS}'") + endif() +endmacro(macro_load_areg_sdk) + +# Set the root of the demo project and its sources +set(AREG_SDK_DEMO_ROOT "${CMAKE_SOURCE_DIR}") +set(AREG_DEMO_SOURCES "${AREG_SDK_DEMO_ROOT}/demo") + +# Control whether to integrate AREG SDK before or after the project declaration +if (NOT DEFINED INTEGRATE_AREG_BEFORE_PROJECT) + set(INTEGRATE_AREG_BEFORE_PROJECT TRUE) # Default is TRUE (integrate before `project()`) +endif() + +# Integration logic based on INTEGRATE_AREG_BEFORE_PROJECT flag +if (INTEGRATE_AREG_BEFORE_PROJECT) + # Integrate AREG SDK before calling project() + macro_load_areg_sdk() + + # Define the project after integrating AREG SDK + set(PROJECT_NAME "areg-sdk-demo") + set(PROJECT_VERSION "2.0.0") + project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX) +else() + # Integrate AREG SDK after calling project() + + # Reset compiler settings to avoid potential warnings + set(AREG_COMPILER "") + set(AREG_COMPILER_FAMILY "") + + # Declare the project + set(PROJECT_NAME "areg-sdk-demo") + set(PROJECT_VERSION "1.0.0") + project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX) + + # Now integrate AREG SDK after project is defined + macro_load_areg_sdk() +endif() # ################################################################## -# We are ready to develop AREG SDK base applications. -# We can as well use AREG SDK settings to create new projects -# In order to compile projects based on AREG SDK settings, -# we should perform these 5 steps, where steps 1-4 are preparations: -# 1. Set 'AREG_SDK_ROOT' variable --> see above. It is either '${areg-sdk_SOURCE_DIR}' or '${areg-sdk_DIR}' -# 2. Include '${AREG_SDK_ROOT}conf/cmake/setup.cmake' -# 3. Include '${AREG_SDK_ROOT}conf/cmake/common.cmake' -# 4. Set '${AREG_BASE}' path in the includes -# 5. Include your projects to compile project +# Steps to prepare AREG SDK base applications: +# +# 1. Set the 'AREG_SDK_ROOT' variable (this is either '${areg-sdk_SOURCE_DIR}' +# when fetched, or '${areg-sdk_DIR}' when using the package). +# 2. Include '${AREG_SDK_ROOT}/conf/cmake/setup.cmake'. +# 3. Include '${AREG_SDK_ROOT}/conf/cmake/common.cmake'. +# 4. Set the '${AREG_FRAMEWORK}' path in the includes. +# 5. Include and build your projects (e.g., Demo). # ################################################################## -# Step 1: Set 'AREG_SDK_ROOT' variable --> see above. `AREG_SDK_ROOT` is either '${areg-sdk_SOURCE_DIR}' or '${areg-sdk_DIR}' +# Step 1: AREG_SDK_ROOT is already set in macro_load_areg_sdk() -# Step 2: include '${AREG_SDK_ROOT}/conf/cmake/setup.cmake' +# Step 2: Include setup.cmake from AREG SDK include(${AREG_CMAKE_CONFIG_DIR}/setup.cmake) -# Step 3: include '${AREG_SDK_ROOT}/conf/cmake/common.cmake' +# Step 3: Include common.cmake from AREG SDK include(${AREG_CMAKE_CONFIG_DIR}/common.cmake) -# Step 4: Set '${AREG_BASE}' path in the includes -include_directories(${AREG_BASE}) +# Step 4: Set the framework include directory +include_directories(${AREG_FRAMEWORK}) -# Step 5: Include your projects -# Start building Demo applications +# Step 5: Include the demo project and start building include("${AREG_DEMO_SOURCES}/CMakeLists.txt") -message(STATUS ">>> Demo: After AREG_SDK_ROOT = ${AREG_SDK_ROOT}, AREG_BASE = ${AREG_BASE}") - # Print the configuration status -message(STATUS "=======================================================================================") -message(STATUS "------------------> AREG SDK Demo project CMake Status Report Begin <------------------") -message(STATUS "=======================================================================================") -message(STATUS "Demo: >>> CMAKE_SOURCE_DIR = \'${CMAKE_SOURCE_DIR}\', build type \'${CMAKE_BUILD_TYPE}\'") -message(STATUS "Demo: >>> Build ...........: \'${CMAKE_SYSTEM_NAME}\' system, \'${AREG_BITNESS}\'-bit platform, \'${AREG_PROCESSOR}\' CPU") -message(STATUS "Demo: >>> Compiler ........: \'${CMAKE_CXX_COMPILER}\'") -message(STATUS "Demo: >>> Compiler Version : C++ standard \'c++${CMAKE_CXX_STANDARD}\', compiler family \'${AREG_COMPILER_FAMILY}\'") -message(STATUS "Demo: >>> Binary output ...: \'${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\', extension '${CMAKE_EXECUTABLE_SUFFIX}'") -message(STATUS "Demo: >>> Generated files .: \'${AREG_GENERATE_DIR}\' directory") -message(STATUS "Demo: >>> Packages ........: \'${FETCHCONTENT_BASE_DIR}\' directory") -message(STATUS "Demo: >>> Build libraries .: areg is \'${AREG_BINARY}\', aregextend is static, areglogger is \'${AREG_LOGGER_LIB}\' library") -message(STATUS "Demo: >>> Java version ....: \'${Java_VERSION_STRING}\' of version \'${Java_JAVA_EXECUTABLE}\'. Minimum should be 17") -message(STATUS "Demo: >>> Use of packages .: SQLite3 package use is \'${AREG_SQLITE_PACKAGE}\', GTest package use is \'${AREG_GTEST_PACKAGE}\' ") -message(STATUS "Demo: >>> Other options ...: Examples = \'${AREG_BUILD_EXAMPLES}\', Unit Tests = \'${AREG_BUILD_TESTS}\', Demo Extended = \'${AREG_EXTENDED}\', Logs = \'${AREG_LOGS}\'") -message(STATUS "Demo: >>> Installation ....: is '${AREG_INSTALL}', location \'${CMAKE_INSTALL_PREFIX}\'") -message(STATUS "=======================================================================================") -message(STATUS "------------------> AREG SDK Demo project CMake Status Report End <-------------------") -message(STATUS "=======================================================================================") +printAregConfigStatus( + areg_FOUND + "Demo" + "------------------> AREG SDK Demo project CMake Status Report Begin <------------------" + "-------------------> AREG SDK Demo project CMake Status Report End <-------------------" +) diff --git a/areg-sdk-demo.sln b/areg-sdk-demo.sln index a0efc56..ead94e7 100644 --- a/areg-sdk-demo.sln +++ b/areg-sdk-demo.sln @@ -12,9 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "areg", "thirdparty\areg-sdk\framework\areg.vcxproj", "{2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5}" - ProjectSection(ProjectDependencies) = postProject - {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} = {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aregextend", "thirdparty\areg-sdk\framework\aregextend.vcxproj", "{FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3}" EndProject @@ -237,12 +234,15 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "areglogger", "thirdparty\areg-sdk\framework\areglogger.vcxproj", "{B29F438E-904C-4929-903C-F4673182A417}" ProjectSection(ProjectDependencies) = postProject {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} = {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} - {6941F2A7-F0C7-4293-8646-AF68A7E35183} = {6941F2A7-F0C7-4293-8646-AF68A7E35183} + {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} = {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} + {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} = {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logger", "thirdparty\areg-sdk\framework\logger.vcxproj", "{0A2D4D13-6AC2-4602-BF8F-DA73133C1974}" ProjectSection(ProjectDependencies) = postProject {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} = {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} + {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} = {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} + {B29F438E-904C-4929-903C-F4673182A417} = {B29F438E-904C-4929-903C-F4673182A417} {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} = {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} EndProjectSection EndProject @@ -250,6 +250,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logobserver", "thirdparty\a ProjectSection(ProjectDependencies) = postProject {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} = {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} = {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} + {B29F438E-904C-4929-903C-F4673182A417} = {B29F438E-904C-4929-903C-F4673182A417} {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} = {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} EndProjectSection EndProject diff --git a/demo/dummy/ReadMe.md b/demo/dummy/ReadMe.md new file mode 100644 index 0000000..c6bfed9 --- /dev/null +++ b/demo/dummy/ReadMe.md @@ -0,0 +1,8 @@ +# dummy Overview + +This project is required only to call the `demo_generate.bat` script located in the `/demo` directory. The script should run as a pre-build action to generate files from `.siml` Service Interface files. The scrip receive 2 parameters: +- The root directory of `` (parameter `$(AregSdkRoot)`), required to access the `codegen.jar`; +- The output directory to write generated files. + +The generated files are included in each `xx_generate` project of Demo. +Right now, there is no automated way to create `*.vcxproj` MSVC project files and update the `*.sln` MSVC solution file. The `xx_generate` projects should be manually created and the generated files should be manually included in the `xx_generate.vcxproj` files. Unlike build with Microsoft Visual Studio and MSBuild, the build with CMake automated this process. diff --git a/demo/dummy/dummy.vcxproj b/demo/dummy/dummy.vcxproj index 93f0096..dba0084 100644 --- a/demo/dummy/dummy.vcxproj +++ b/demo/dummy/dummy.vcxproj @@ -1,10 +1,10 @@  - + - + {98743716-82FC-4B02-96AF-E6F649403A0A} @@ -17,23 +17,26 @@ StaticLibrary - + - $(OutLibDir)\ + $(OutLibDir) + + + + + + IMPORT_SHARED_SYMBOLS;%(PreprocessorDefinitions) - $(SolutionDir)\demo\demo_generate.bat $(AregSdkRoot) $(AregBuildRoot) + $(SolutionDir)demo\demo_generate.bat $(AregSdkRoot) $(AregBuildRoot) Call to generate service interface source files for all example projects. - - - diff --git a/demo/dummy/dummy.vcxproj.filters b/demo/dummy/dummy.vcxproj.filters index 446a812..4912546 100644 --- a/demo/dummy/dummy.vcxproj.filters +++ b/demo/dummy/dummy.vcxproj.filters @@ -19,4 +19,7 @@ Source Files + + + \ No newline at end of file diff --git a/thirdparty/areg-sdk b/thirdparty/areg-sdk index f4971f2..a94fc74 160000 --- a/thirdparty/areg-sdk +++ b/thirdparty/areg-sdk @@ -1 +1 @@ -Subproject commit f4971f2618c543a39c917324bcb0390baba28edf +Subproject commit a94fc7439c9c3ed88dee841d6c0d57864b040c1f