diff --git a/.devcontainer b/.devcontainer new file mode 160000 index 000000000..2351b765b --- /dev/null +++ b/.devcontainer @@ -0,0 +1 @@ +Subproject commit 2351b765b99b17ec660561898dc919c6e26ace53 diff --git a/.github/workflows/xpbuild.yml b/.github/workflows/xpbuild.yml new file mode 100644 index 000000000..169ff5269 --- /dev/null +++ b/.github/workflows/xpbuild.yml @@ -0,0 +1,30 @@ +name: Build +on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] + workflow_dispatch: +jobs: + linux: + uses: externpro/externpro/.github/workflows/build-linux.yml@25.06 + with: + cmake-workflow-preset: Linux + runon: ubuntu-latest + secrets: inherit + linux-arm64: + uses: externpro/externpro/.github/workflows/build-linux.yml@25.06 + with: + cmake-workflow-preset: Linux + runon: ubuntu-24.04-arm + secrets: inherit + macos: + uses: externpro/externpro/.github/workflows/build-macos.yml@25.06 + with: + cmake-workflow-preset: Darwin + secrets: inherit + windows: + uses: externpro/externpro/.github/workflows/build-windows.yml@25.06 + with: + cmake-workflow-preset: Windows + secrets: inherit diff --git a/.github/workflows/xprelease.yml b/.github/workflows/xprelease.yml new file mode 100644 index 000000000..146191466 --- /dev/null +++ b/.github/workflows/xprelease.yml @@ -0,0 +1,20 @@ +name: Release +on: + workflow_dispatch: + inputs: + workflow_run_url: + description: 'URL of the workflow run containing artifacts to upload (e.g., https://github.com/owner/repo/actions/runs/123456789)' + required: true + type: string +jobs: + # Upload build artifacts as release assets + release-from-build: + uses: externpro/externpro/.github/workflows/release-from-build.yml@25.06 + with: + workflow_run_url: ${{ github.event.inputs.workflow_run_url }} + artifact_pattern: "*.tar.xz" + permissions: + contents: write + id-token: write + attestations: write + secrets: inherit diff --git a/.gitignore b/.gitignore index 5d4af4dac..127566bf1 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ Makefile.in activemq-cpp/aclocal.m4 activemq-cpp/config.h.in configure - - - - +# externpro +.env +_bld*/ +docker-compose.override.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..18932abfb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".devcontainer"] + path = .devcontainer + url = https://github.com/externpro/externpro diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..c85093a09 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.31) +set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake) +project(activemq-cpp) +include(GNUInstallDirs) +include(xpflags) +add_subdirectory(activemq-cpp) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 000000000..f82cfdd2c --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,8 @@ +{ + "version": 8, + "include": [ + ".devcontainer/cmake/presets/xpLinuxNinja.json", + ".devcontainer/cmake/presets/xpDarwinNinja.json", + ".devcontainer/cmake/presets/xpWindowsVs2022.json" + ] +} diff --git a/CMakePresetsBase.json b/CMakePresetsBase.json new file mode 100644 index 000000000..4489d79c3 --- /dev/null +++ b/CMakePresetsBase.json @@ -0,0 +1,19 @@ +{ + "version": 8, + "configurePresets": [ + { + "name": "config-base", + "hidden": true, + "binaryDir": "${sourceDir}/_bld-${presetName}", + "cacheVariables": { + "XP_NAMESPACE": "xpro" + } + } + ], + "buildPresets": [ + { + "name": "build-base", + "hidden": true + } + ] +} diff --git a/activemq-cpp/CMakeLists.txt b/activemq-cpp/CMakeLists.txt index 599dbfc6f..4022d4b72 100644 --- a/activemq-cpp/CMakeLists.txt +++ b/activemq-cpp/CMakeLists.txt @@ -1,13 +1,5 @@ -cmake_minimum_required(VERSION 3.31) -project(activemq-cpp) -include(GNUInstallDirs) -include(xpflags) -if(COMMAND xpFindPkg) - xpFindPkg(PKGS apr openssl) -else() - find_package(APR REQUIRED) - find_package(OpenSSL) -endif() +find_package(apr REQUIRED) +find_package(openssl REQUIRED) if(UNIX) include(configure.cmake) endif() @@ -16,5 +8,15 @@ check_cxx_compiler_flag("-Wno-deprecated-declarations" has_noDeprecatedDeclarati if(has_noDeprecatedDeclarations) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") endif() +set(lib activemqcpp) +set(targetsFile ${lib}-targets) +if(DEFINED XP_NAMESPACE) + set(nameSpace NAMESPACE ${XP_NAMESPACE}::) + string(PREPEND lib "${XP_NAMESPACE}::") +endif() +if(NOT DEFINED XP_INSTALL_CMAKEDIR) + set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake) +endif() +xpPackageDevel(TARGETS_FILE ${targetsFile} DEPS apr openssl LIBRARIES ${lib}) add_subdirectory(src/main) add_subdirectory(src/examples) diff --git a/activemq-cpp/configure.cmake b/activemq-cpp/configure.cmake index 8657ec123..7929dc2e1 100644 --- a/activemq-cpp/configure.cmake +++ b/activemq-cpp/configure.cmake @@ -390,9 +390,9 @@ if(NOT ANSI_CONST) endif() set_define(const) ######################################## -configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake.in .) -configure_file(${CMAKE_BINARY_DIR}/config.h.cmake.in ${CMAKE_BINARY_DIR}/config.h) -include_directories(${CMAKE_BINARY_DIR}) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in .) +configure_file(${CMAKE_CURRENT_BINARY_DIR}/config.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_definitions(-DHAVE_CONFIG_H) ################################################################################ set(CMAKE_REQUIRED_LIBRARIES) diff --git a/activemq-cpp/src/main/CMakeLists.txt b/activemq-cpp/src/main/CMakeLists.txt index df7f80532..510e92f1d 100644 --- a/activemq-cpp/src/main/CMakeLists.txt +++ b/activemq-cpp/src/main/CMakeLists.txt @@ -1,8 +1,5 @@ set(lib_name activemqcpp) ####################################### -# library sources -######################## -# activemq/cmsutil set(activemq_cmsutil_srcs activemq/cmsutil/CachedConsumer.cpp activemq/cmsutil/CachedConsumer.h @@ -34,7 +31,6 @@ set(activemq_cmsutil_srcs source_group(activemq\\cmsutil FILES ${activemq_cmsutil_srcs}) list(APPEND ${lib_name}_libsrcs ${activemq_cmsutil_srcs}) ########## -# activemq/commands set(activemq_commands_srcs activemq/commands/ActiveMQBlobMessage.cpp activemq/commands/ActiveMQBlobMessage.h @@ -169,7 +165,6 @@ set(activemq_commands_srcs source_group(activemq\\commands FILES ${activemq_commands_srcs}) list(APPEND ${lib_name}_libsrcs ${activemq_commands_srcs}) ########## -# activemq/core set(activemq_core_srcs activemq/core/ActiveMQAckHandler.cpp activemq/core/ActiveMQAckHandler.h @@ -252,7 +247,6 @@ set(activemq_core_policies_srcs source_group(activemq\\core\\policies FILES ${activemq_core_policies_srcs}) list(APPEND ${lib_name}_libsrcs ${activemq_core_policies_srcs}) ########## -# activemq/exceptions set(activemq_exceptions_srcs activemq/exceptions/ActiveMQException.cpp activemq/exceptions/ActiveMQException.h @@ -265,7 +259,6 @@ set(activemq_exceptions_srcs source_group(activemq\\exceptions FILES ${activemq_exceptions_srcs}) list(APPEND ${lib_name}_libsrcs ${activemq_exceptions_srcs}) ########## -# activemq/io set(activemq_io_srcs activemq/io/LoggingInputStream.cpp activemq/io/LoggingInputStream.h @@ -275,7 +268,6 @@ set(activemq_io_srcs source_group(activemq\\io FILES ${activemq_io_srcs}) list(APPEND ${lib_name}_libsrcs ${activemq_io_srcs}) ########## -# activemq/library set(activemq_library_srcs activemq/library/ActiveMQCPP.cpp activemq/library/ActiveMQCPP.h @@ -283,7 +275,6 @@ set(activemq_library_srcs source_group(activemq\\library FILES ${activemq_library_srcs}) list(APPEND ${lib_name}_libsrcs ${activemq_library_srcs}) ########## -# activemq/state set(activemq_state_srcs activemq/state/CommandVisitorAdapter.cpp activemq/state/CommandVisitorAdapter.h @@ -307,7 +298,6 @@ set(activemq_state_srcs source_group(activemq\\state FILES ${activemq_state_srcs}) list(APPEND ${lib_name}_libsrcs ${activemq_state_srcs}) ########## -# activemq/threads set(activemq_threads_srcs activemq/threads/CompositeTask.cpp activemq/threads/CompositeTask.h @@ -327,7 +317,6 @@ set(activemq_threads_srcs source_group(activemq\\threads FILES ${activemq_threads_srcs}) list(APPEND ${lib_name}_libsrcs ${activemq_threads_srcs}) ########## -# activemq/transport set(activemq_transport_srcs activemq/transport/AbstractTransportFactory.cpp activemq/transport/AbstractTransportFactory.h @@ -423,7 +412,6 @@ set(activemq_transport_tcp_srcs source_group(activemq\\transport\\tcp FILES ${activemq_transport_tcp_srcs}) list(APPEND ${lib_name}_libsrcs ${activemq_transport_tcp_srcs}) ########## -# activemq/util set(activemq_util_srcs activemq/util/ActiveMQMessageTransformation.cpp activemq/util/ActiveMQMessageTransformation.h @@ -470,7 +458,6 @@ set(activemq_util_srcs source_group(activemq\\util FILES ${activemq_util_srcs}) list(APPEND ${lib_name}_libsrcs ${activemq_util_srcs}) ########## -# activemq/wireformat set(activemq_wireformat_srcs activemq/wireformat/MarshalAware.cpp activemq/wireformat/MarshalAware.h @@ -778,7 +765,6 @@ set(cms_srcs source_group(cms FILES ${cms_srcs}) list(APPEND ${lib_name}_libsrcs ${cms_srcs}) ########## -# decaf/internal set(decaf_internal_srcs decaf/internal/AprPool.cpp decaf/internal/AprPool.h @@ -1050,7 +1036,6 @@ set(decaf_internal_util_zip_srcs source_group(decaf\\internal\\util\\zip FILES ${decaf_internal_util_zip_srcs}) list(APPEND ${lib_name}_libsrcs ${decaf_internal_util_zip_srcs}) ########## -# decaf/io set(decaf_io_srcs decaf/io/BlockingByteArrayInputStream.cpp decaf/io/BlockingByteArrayInputStream.h @@ -1108,7 +1093,6 @@ set(decaf_io_srcs source_group(decaf\\io FILES ${decaf_io_srcs}) list(APPEND ${lib_name}_libsrcs ${decaf_io_srcs}) ########## -# decaf/lang set(decaf_lang_srcs decaf/lang/AbstractStringBuilder.cpp decaf/lang/AbstractStringBuilder.h @@ -1214,7 +1198,6 @@ set(decaf_lang_exceptions_srcs source_group(decaf\\lang\\exceptions FILES ${decaf_lang_exceptions_srcs}) list(APPEND ${lib_name}_libsrcs ${decaf_lang_exceptions_srcs}) ########## -# decaf/net set(decaf_net_srcs decaf/net/BindException.cpp decaf/net/BindException.h @@ -1313,7 +1296,6 @@ set(decaf_net_ssl_srcs source_group(decaf\\net\\ssl FILES ${decaf_net_ssl_srcs}) list(APPEND ${lib_name}_libsrcs ${decaf_net_ssl_srcs}) ########## -# decaf/nio set(decaf_nio_srcs decaf/nio/Buffer.cpp decaf/nio/Buffer.h @@ -1343,7 +1325,6 @@ set(decaf_nio_srcs source_group(decaf\\nio FILES ${decaf_nio_srcs}) list(APPEND ${lib_name}_libsrcs ${decaf_nio_srcs}) ########## -# decaf/security set(decaf_security_srcs decaf/security/DigestException.cpp decaf/security/DigestException.h @@ -1415,7 +1396,6 @@ set(decaf_security_cert_srcs source_group(decaf\\security\\cert FILES ${decaf_security_cert_srcs}) list(APPEND ${lib_name}_libsrcs ${decaf_security_cert_srcs}) ########## -# decaf/util set(decaf_util_srcs decaf/util/AbstractCollection.cpp decaf/util/AbstractCollection.h @@ -1680,7 +1660,6 @@ set(decaf_util_zip_srcs source_group(decaf\\util\\zip FILES ${decaf_util_zip_srcs}) list(APPEND ${lib_name}_libsrcs ${decaf_util_zip_srcs}) ####################################### -# library add_library(${lib_name} STATIC ${${lib_name}_libsrcs}) target_link_libraries(${lib_name} PUBLIC ${APR_LIBRARIES} ${OPENSSL_LIBRARIES}) target_include_directories(${lib_name} PUBLIC $ @@ -1695,16 +1674,9 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${lib_name} FILES_MATCHING PATTERN "*.h" ) -set(targetsFile ${lib_name}-targets) install(TARGETS ${lib_name} EXPORT ${targetsFile} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -if(DEFINED XP_NAMESPACE) - set(nameSpace NAMESPACE ${XP_NAMESPACE}::) -endif() -if(NOT DEFINED XP_INSTALL_CMAKEDIR) - set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake) -endif() install(EXPORT ${targetsFile} DESTINATION ${XP_INSTALL_CMAKEDIR} ${nameSpace}) diff --git a/docker-compose.sh b/docker-compose.sh new file mode 120000 index 000000000..85f182f0b --- /dev/null +++ b/docker-compose.sh @@ -0,0 +1 @@ +.devcontainer/compose.pro.sh \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 120000 index 000000000..46c1f8918 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1 @@ +.devcontainer/compose.bld.yml \ No newline at end of file