Skip to content

Commit f774047

Browse files
authored
Merge pull request #1 from externpro/xpro
externpro devel package
2 parents cd48e60 + 235e3fd commit f774047

10 files changed

Lines changed: 103 additions & 6 deletions

File tree

.devcontainer

Submodule .devcontainer added at f1dc36f

.github/workflows/xpbuild.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build
2+
on:
3+
push:
4+
branches: [ "dev" ]
5+
pull_request:
6+
branches: [ "dev" ]
7+
workflow_dispatch:
8+
jobs:
9+
linux:
10+
uses: externpro/externpro/.github/workflows/build-linux.yml@25.06
11+
with:
12+
cmake-workflow-preset: LinuxRelease
13+
runon: ubuntu-latest
14+
secrets: inherit
15+
linux-arm64:
16+
uses: externpro/externpro/.github/workflows/build-linux.yml@25.06
17+
with:
18+
cmake-workflow-preset: LinuxRelease
19+
runon: ubuntu-24.04-arm
20+
secrets: inherit
21+
macos:
22+
uses: externpro/externpro/.github/workflows/build-macos.yml@25.06
23+
with:
24+
cmake-workflow-preset: DarwinRelease
25+
secrets: inherit
26+
windows:
27+
uses: externpro/externpro/.github/workflows/build-windows.yml@25.06
28+
with:
29+
cmake-workflow-preset: WindowsRelease
30+
secrets: inherit

.github/workflows/xprelease.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
workflow_run_url:
6+
description: 'URL of the workflow run containing artifacts to upload (e.g., https://github.com/owner/repo/actions/runs/123456789)'
7+
required: true
8+
type: string
9+
jobs:
10+
# Upload build artifacts as release assets
11+
release-from-build:
12+
uses: externpro/externpro/.github/workflows/release-from-build.yml@25.06
13+
with:
14+
workflow_run_url: ${{ github.event.inputs.workflow_run_url }}
15+
artifact_pattern: "*.tar.xz"
16+
permissions:
17+
contents: write
18+
id-token: write
19+
attestations: write
20+
secrets: inherit

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33

44
# Build directory
55
*build/
6+
7+
# externpro
8+
.env
9+
_bld*/
10+
docker-compose.override.yml

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule ".devcontainer"]
2+
path = .devcontainer
3+
url = https://github.com/externpro/externpro

CMakeLists.txt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
cmake_minimum_required(VERSION 3.0.0...3.31)
22

3+
set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake)
34
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
45

56
include (DetectCPPZMQVersion)
@@ -16,8 +17,10 @@ if (NOT TARGET ${nSpace}libzmq AND NOT TARGET ${nSpace}libzmq-static)
1617
if(COMMAND xpFindPkg)
1718
xpFindPkg(PKGS libzmq)
1819
set(ZeroMQ_FOUND TRUE)
20+
set(installTargets cppzmq-static)
1921
else()
2022
find_package(ZeroMQ QUIET)
23+
set(installTargets cppzmq cppzmq-static)
2124
endif()
2225

2326
# libzmq autotools install: fallback to pkg-config
@@ -68,24 +71,27 @@ target_link_libraries(cppzmq-static INTERFACE ${nSpace}libzmq-static)
6871
include(GNUInstallDirs)
6972
include(CMakePackageConfigHelpers)
7073

71-
install(TARGETS cppzmq cppzmq-static
74+
if(NOT DEFINED XP_INSTALL_CMAKEDIR)
75+
set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake)
76+
endif()
77+
set(targetsFile ${PROJECT_NAME}Targets)
78+
xpPackageDevel(TARGETS_FILE ${targetsFile} LIBRARIES ${nSpace}cppzmq-static)
79+
80+
install(TARGETS ${installTargets}
7281
EXPORT ${PROJECT_NAME}-targets)
7382

7483
install(FILES ${CPPZMQ_HEADERS}
7584
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
7685

7786
# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share".
78-
if(NOT DEFINED XP_INSTALL_CMAKEDIR)
79-
set(XP_INSTALL_CMAKEDIR share/cmake/${PROJECT_NAME})
80-
endif()
8187
set(CPPZMQ_CMAKECONFIG_INSTALL_DIR "${XP_INSTALL_CMAKEDIR}" CACHE STRING "install path for cppzmqConfig.cmake")
8288

8389
configure_file(libzmq-pkg-config/FindZeroMQ.cmake
8490
libzmq-pkg-config/FindZeroMQ.cmake
8591
COPYONLY)
8692

8793
export(EXPORT ${PROJECT_NAME}-targets
88-
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
94+
FILE "${CMAKE_CURRENT_BINARY_DIR}/${targetsFile}.cmake")
8995
configure_package_config_file(${PROJECT_NAME}Config.cmake.in
9096
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
9197
INSTALL_DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR})
@@ -102,13 +108,15 @@ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Conf
102108
set(CMAKE_SIZEOF_VOID_P ${CPPZMQ_SIZEOF_VOID_P})
103109

104110
install(EXPORT ${PROJECT_NAME}-targets
105-
FILE ${PROJECT_NAME}Targets.cmake ${nameSpace}
111+
FILE ${targetsFile}.cmake ${nameSpace}
106112
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR})
113+
if(NOT DEFINED XP_NAMESPACE)
107114
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
108115
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
109116
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR})
110117
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libzmq-pkg-config/FindZeroMQ.cmake
111118
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR}/libzmq-pkg-config)
119+
endif()
112120

113121
option(CPPZMQ_BUILD_TESTS "Whether or not to build the tests" ON)
114122

CMakePresets.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"version": 8,
3+
"include": [
4+
".devcontainer/cmake/presets/xpLinuxNinja.json",
5+
".devcontainer/cmake/presets/xpDarwinNinja.json",
6+
".devcontainer/cmake/presets/xpWindowsVs2022.json"
7+
]
8+
}

CMakePresetsBase.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": 8,
3+
"configurePresets": [
4+
{
5+
"name": "config-base",
6+
"hidden": true,
7+
"binaryDir": "${sourceDir}/_bld-${presetName}",
8+
"cacheVariables": {
9+
"CPPZMQ_BUILD_TESTS": "OFF",
10+
"XP_NAMESPACE": "xpro"
11+
}
12+
}
13+
],
14+
"buildPresets": [
15+
{
16+
"name": "build-base",
17+
"hidden": true
18+
}
19+
]
20+
}

docker-compose.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.devcontainer/compose.pro.sh

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.devcontainer/compose.bld.yml

0 commit comments

Comments
 (0)