Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

378 integrate areg in vcpkg #390

Merged
merged 24 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -35,17 +35,22 @@ include(${AREG_CMAKE_CONFIG_DIR}/common.cmake)
# this ensures that the commands to create directories are called first.
add_custom_target(areg-dummy ALL COMMAND ${CMAKE_COMMAND} VERBATIM)
add_custom_command( TARGET areg-dummy PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${AREG_OUTPUT_DIR}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${AREG_OUTPUT_BIN}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${AREG_OUTPUT_LIB}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}"
VERBATIM)

include_directories(${AREG_BASE})
include_directories(${AREG_THIRDPARTY})

# build AREG Framework thirdparty software
include(${AREG_THIRDPARTY}/CMakeLists.txt)
if (NOT AREG_SQLITE_FOUND)
add_dependencies(aregsqlite3 areg-dummy)
endif()

# build AREG Framework software
include(${AREG_BASE}/CMakeLists.txt)
add_dependencies(areg areg-dummy)

# build optional AREG project examples, if required
if(AREG_BUILD_EXAMPLES)
Expand All @@ -55,24 +60,32 @@ endif()
# build optional AREG Framework unit tests, if required
if(AREG_BUILD_TESTS)
include(${AREG_TESTS}/CMakeLists.txt)
if (NOT AREG_GTEST_FOUND)
add_dependencies(areg-unit-tests areg-dummy)
endif()
endif()

include(${AREG_CMAKE_CONFIG_DIR}/install.cmake)
if (AREG_INSTALL AND AREG_SQLITE_FOUND)
include(${AREG_CMAKE_CONFIG_DIR}/install.cmake)
elseif(AREG_INSTALL)
option(AREG_INSTALL "Enable install AREG SDK" OFF)
endif()

# Print the configuration status
message(STATUS "=======================================================================================")
message(STATUS "----------------------> AREG project CMake Status Report Begin <-----------------------")
message(STATUS "=======================================================================================")
message(STATUS "AREG: >>> CMAKE_SOURCE_DIR = \'${CMAKE_SOURCE_DIR}\', build type \'${CMAKE_BUILD_TYPE}\'")
message(STATUS "AREG: >>> Build ...........: \'${CMAKE_SYSTEM_NAME}\' system, \'${AREG_BITNESS}\'-bit platform, \'${AREG_PROCESSOR}\' CPU")
message(STATUS "AREG: >>> Compiler ........: \'${CMAKE_CXX_COMPILER}\', ID \'${AREG_COMPILER_FAMILY}\'")
message(STATUS "AREG: >>> Binary output ...: \'${AREG_OUTPUT_BIN}\', extension '${CMAKE_EXECUTABLE_SUFFIX}'")
message(STATUS "AREG: >>> Compiler ........: \'${CMAKE_CXX_COMPILER}\', ID \'${AREG_COMPILER_FAMILY}\', C++${CMAKE_CXX_STANDARD}")
message(STATUS "AREG: >>> Binary output ...: \'${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\', extension '${CMAKE_EXECUTABLE_SUFFIX}'")
message(STATUS "AREG: >>> Generated files .: \'${AREG_GENERATE_DIR}\' directory")
message(STATUS "AREG: >>> Packages ........: \'${FETCHCONTENT_BASE_DIR}\' directory")
message(STATUS "AREG: >>> Build libraries .: areg is \'${AREG_BINARY}\', aregextend is static, areglogger is \'${AREG_LOGGER_LIB}\' library")
message(STATUS "AREG: >>> Java version ....: \'${Java_VERSION_STRING}\' of version \'${Java_JAVA_EXECUTABLE}\'. Minimum should be 17")
message(STATUS "AREG: >>> Use of packages .: SQLite3 package use is \'${AREG_SQLITE_PACKAGE}\', GTest package use is \'${AREG_GTEST_PACKAGE}\' ")
message(STATUS "AREG: >>> Other options ...: Examples = \'${AREG_BUILD_EXAMPLES}\', Unit Tests = \'${AREG_BUILD_TESTS}\', AREG Extended = \'${AREG_EXTENDED}\', Logs = \'${AREG_LOGS}\'")
message(STATUS "AREG: >>> Installation ....: is '${AREG_INSTALL}', Thirdparty is '${AREG_INSTALL_DEPENDS}', location \'${CMAKE_INSTALL_PREFIX}\'")
message(STATUS "AREG: >>> Installation ....: is '${AREG_INSTALL}', location \'${CMAKE_INSTALL_PREFIX}\'")
message(STATUS "=======================================================================================")
message(STATUS "-----------------------> AREG project CMake Status Report End <------------------------")
message(STATUS "=======================================================================================")
27 changes: 25 additions & 2 deletions areg-sdk.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
12 changes: 7 additions & 5 deletions conf/cmake/clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if (AREG_OS STREQUAL "Windows")
list(APPEND AREG_COMPILER_OPTIONS -Wall -c)
# Linker flags (-l is not necessary)
list(APPEND AREG_LDFLAGS advapi32 psapi shell32 ws2_32)
set(AREG_LDFLAGS_STR "-ladvapi32 -lpsapi -lshell32 -lws2_32")

else(AREG_OS STREQUAL "Posix")

Expand All @@ -38,11 +39,12 @@ else(AREG_OS STREQUAL "Posix")
list(APPEND AREG_COMPILER_OPTIONS -pthread -Wall -c -fmessage-length=0)
# Linker flags (-l is not necessary)
list(APPEND AREG_LDFLAGS stdc++ m pthread rt)
set(AREG_LDFLAGS_STR "-lstdc++ -lm -lpthread -lrt")
set(AREG_COMPILER_VERSION -stdlib=libstdc++)

endif(AREG_OS STREQUAL "Windows")

if(AREG_BITNESS MATCHES "32")
if(${AREG_BITNESS} EQUAL 32)
list(APPEND AREG_COMPILER_OPTIONS -m32)
else()
list(APPEND AREG_COMPILER_OPTIONS -m64)
Expand All @@ -66,21 +68,21 @@ 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
-Wno-cast-calling-convention
-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
Expand All @@ -93,7 +95,7 @@ list(APPEND AREG_OPT_DISABLE_WARN_EXAMPLES
-Wno-unused-local-typedef
-Wno-unused-macros
-Wno-unused-parameter
)
)

# disable warnings for generated codes
list(APPEND AREG_OPT_DISABLE_WARN_CODEGEN
Expand Down
57 changes: 40 additions & 17 deletions conf/cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
# Copyright 2022-2023 Aregtech
# ###########################################################################

set(AREG_PACKAGE_NAME "areg")

if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "")
set(AREG_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
endif()

if ("${AREG_COMPILER_FAMILY}" STREQUAL "")
set(AREG_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
set(AREG_C_COMPILER "${CMAKE_C_COMPILER}")
Expand Down Expand Up @@ -43,16 +49,20 @@ set(AREG_CC_TOOLCHAIN "${CMAKE_CC_COMPILER}")
set(AREG_DEVELOP_ENV)
# The linker flags
set(AREG_LDFLAGS)
# The compiler options
set(AREG_COMPILER_OPTIONS)
set(AREG_LDFLAGS_STR "")
# set areg extended static library dependencies
set(AREG_EXTENDED_LIBS)
set(AREG_EXTENDED_LIBS_STR "")
# The compiler options
set(AREG_COMPILER_OPTIONS)
# set areg compiler version
set(AREG_COMPILER_VERSION)
set(AREG_TARGET_COMPILER_OPTIONS)
# Set the SQLite library reference
set(AREG_SQLITE_LIB_REF sqlite3)
option(AREG_SQLITE_FOUND "SQLite3 package" OFF)
set(AREG_SQLITE_LIB_REF)
set(AREG_SQLITE_LIB sqlite3)
option(AREG_SQLITE_FOUND "SQLite3 package found flag" FALSE)
option(AREG_GTEST_FOUND "GTest package found flag" FALSE)

# Adding common definition
add_definitions(-DUNICODE -D_UNICODE)
Expand Down Expand Up @@ -97,6 +107,7 @@ if (AREG_EXTENDED)
add_definitions(-DAREG_EXTENDED=1)
if (NOT ${AREG_DEVELOP_ENV} MATCHES "Win32")
list(APPEND AREG_EXTENDED_LIBS ncurses)
set(AREG_EXTENDED_LIBS_STR "-lncurses")
endif()
else()
add_definitions(-DAREG_EXTENDED=0)
Expand All @@ -108,21 +119,29 @@ else()
add_definitions(-DAREG_LOGS=0)
endif()

if ( "${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "AREG build type")
endif()

# -------------------------------------------------------
# Setup product paths
# -------------------------------------------------------

# The output directory
if (NOT DEFINED AREG_OUTPUT_DIR OR "${AREG_OUTPUT_DIR}" STREQUAL "")
# Relative path of the output folder for the builds
set(AREG_PRODUCT_PATH "build/${AREG_COMPILER_FAMILY}-${AREG_COMPILER_SHORT}/${AREG_OS}-${AREG_BITNESS}-${AREG_PROCESSOR}-${CMAKE_BUILD_TYPE}-${AREG_BINARY}")
string(TOLOWER "${AREG_PRODUCT_PATH}" AREG_PRODUCT_PATH)
# The absolute path of 'AREG_OUTPUT_DIR' for builds if it is not set.
set(AREG_OUTPUT_DIR "${AREG_BUILD_ROOT}/${AREG_PRODUCT_PATH}")
if (AREG_ENABLE_OUTPUTS)

# The output directory
if (NOT DEFINED AREG_OUTPUT_DIR OR "${AREG_OUTPUT_DIR}" STREQUAL "")
# Relative path of the output folder for the builds
set(_product_path "build/${AREG_COMPILER_FAMILY}-${AREG_COMPILER_SHORT}/${AREG_OS}-${AREG_BITNESS}-${AREG_PROCESSOR}-${CMAKE_BUILD_TYPE}-${AREG_BINARY}")
string(TOLOWER "${_product_path}" _product_path)
# The absolute path of 'AREG_OUTPUT_DIR' for builds if it is not set.
set(AREG_OUTPUT_DIR "${AREG_BUILD_ROOT}/${_product_path}")
unset(_product_path)
endif()

else()

# The output directory
if (NOT DEFINED AREG_OUTPUT_DIR OR "${AREG_OUTPUT_DIR}" STREQUAL "")
set(AREG_OUTPUT_DIR "${AREG_BUILD_ROOT}")
endif()

endif()

# The directory to output static libraries
Expand Down Expand Up @@ -163,7 +182,7 @@ set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${AREG_OUTPUT_DIR}
include_directories(BEFORE "${AREG_BASE}" "${AREG_BUILD_ROOT}" "${AREG_GENERATE_DIR}" "${AREG_THIRDPARTY}")

# Adding library search paths
link_directories(BEFORE "${AREG_OUTPUT_BIN}" "${AREG_OUTPUT_LIB}")
link_directories(BEFORE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")

# Only for Linux
if(UNIX AND NOT CYGWIN)
Expand All @@ -182,7 +201,11 @@ if (NOT ${Java_FOUND})
find_package(Java COMPONENTS Development)
endif()

# Check and setup variables for installation
if (AREG_INSTALL)
set(CMAKE_INSTALL_PREFIX "${AREG_INSTALL_PATH}")
option(INSTALL_GTEST "Disable Googletest installation" OFF)

if (NOT "${AREG_INSTALL_PATH}" STREQUAL "")
set(CMAKE_INSTALL_PREFIX "${AREG_INSTALL_PATH}")
endif()
endif()
Loading
Loading