Skip to content

Commit 0701943

Browse files
authored
better handling of cmake prefix path
1 parent b49db60 commit 0701943

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

.github/workflows/openms_ci_matrix_full.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,17 @@ jobs:
131131
# NOTE: x64 is hardcoded. No support for 32bit
132132
arch: x64
133133

134+
- if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'windows')
135+
name: Install Qt (Windows and macOS)
136+
uses: jurplel/install-qt-action@v3
137+
with:
138+
version: '5.15.2' # 5.12.7 is broken https://bugreports.qt.io/browse/QTBUG-81715, > 5.15.2 is not available on official archives (https://github.com/miurahr/aqtinstall/issues/636)
139+
cache: 'false'
140+
aqtversion: '==3.1.*'
141+
archives: 'qtsvg qtimageformats qtbase'
142+
134143
- name: Setup build tools (and system contrib on Linux)
144+
id: tools-prefix
135145
shell: bash
136146
run: |
137147
if [[ "${{ matrix.os }}" == ubuntu-* ]]; then
@@ -142,12 +152,16 @@ jobs:
142152
sudo apt-get install -y libeigen3-dev libboost-random-dev libboost-regex-dev libboost-iostreams-dev \
143153
libboost-date-time-dev libboost-math-dev libxerces-c-dev zlib1g-dev libsvm-dev libbz2-dev coinor-libcoinmp-dev libhdf5-dev
144154
155+
echo "cmake_prefix=" >> $GITHUB_OUTPUT
156+
145157
if [[ "${{ steps.set-vars.outputs.pkg_type }}" != "none" ]]; then
146158
sudo apt-get install -y doxygen ghostscript graphviz
147159
fi
148160
fi
149161
150162
if [[ "${{ matrix.os }}" == windows-* ]]; then
163+
# Qt5_DIR set by Install Qt5 step
164+
echo "cmake_prefix=$Qt5_DIR/lib/cmake;$Qt5_DIR" >> $GITHUB_OUTPUT
151165
choco install ccache ninja cmake
152166
## GH CLI "SHOULD BE" installed. Sometimes I had to manually install nonetheless. Super weird.
153167
# https://github.com/actions/runner-images/blob/main/images/win/scripts/Installers/Install-GitHub-CLI.ps1
@@ -159,21 +173,16 @@ jobs:
159173
fi
160174
161175
if [[ "${{ matrix.os }}" == macos-* ]]; then
176+
# Qt5_DIR set by Install Qt5 step
177+
echo "cmake_prefix=$Qt5_DIR/lib/cmake;$Qt5_DIR" >> $GITHUB_OUTPUT
162178
brew install ccache autoconf automake libtool ninja && brew link --overwrite ccache
163179
164180
if [[ "${{ steps.set-vars.outputs.pkg_type }}" != "none" ]]; then
165181
brew install doxygen ghostscript graphviz
166182
fi
167183
fi
168184
169-
- if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'windows')
170-
name: Install Qt (Windows and macOS)
171-
uses: jurplel/install-qt-action@v3
172-
with:
173-
version: '5.15.2' # 5.12.7 is broken https://bugreports.qt.io/browse/QTBUG-81715, > 5.15.2 is not available on official archives (https://github.com/miurahr/aqtinstall/issues/636)
174-
cache: 'false'
175-
aqtversion: '==3.1.*'
176-
archives: 'qtsvg qtimageformats qtbase'
185+
177186
178187
- if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'windows')
179188
name: Cache contrib (Windows and macOS)
@@ -250,6 +259,8 @@ jobs:
250259
- name: Build
251260
shell: bash
252261
run: |
262+
# do not fail immediately
263+
set +x
253264
mkdir $GITHUB_WORKSPACE/OpenMS/bld/
254265
ctest --output-on-failure -V -S ../OpenMS/OpenMS/tools/ci/cibuild.cmake
255266
retVal=$?
@@ -262,7 +273,7 @@ jobs:
262273
# TODO allow actual choice of compiler instead of using default.
263274
# Problem: not all compilers are always in the PATH.
264275
CMAKE_CXX_COMPILER: ${{ steps.set-vars.outputs.cxx_compiler }}
265-
CMAKE_PREFIX_PATH: "${{ env.Qt5_DIR }}/lib/cmake;${{ env.Qt5_DIR }}"
276+
CMAKE_PREFIX_PATH: ${{ steps.tools-prefix.outputs.cmake_prefix }}
266277
OPENMS_CONTRIB_LIBS: "${{ github.workspace }}/OpenMS/contrib"
267278
CI_PROVIDER: "GitHub-Actions"
268279
CMAKE_GENERATOR: "Ninja"
@@ -307,6 +318,8 @@ jobs:
307318
name: Package
308319
shell: bash
309320
run: |
321+
# do not fail immediately
322+
set +x
310323
${{ steps.set-vars.outputs.xvfb }} ctest --output-on-failure -V -S $GITHUB_WORKSPACE/OpenMS/tools/ci/cipackage.cmake
311324
retVal=$?
312325
if [ $retVal -ne 0 ]; then

cmake/setup_lib_find_paths.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@
4343
# for searching and as first entry in the includes/libraries to avoid
4444
# mismatches with installed system libraries
4545
if(NOT OPENMS_CONTRIB_LIBS)
46-
message(WARNING "Unless you are certain that you have all contributing libraries in system paths, please specify an explicit path to the built contrib libraries via
46+
message("Note: OPENMS_CONTRIB_LIBS not set. Unless you are certain that you have all contributing libraries in system paths, please specify an explicit path to the built contrib libraries via
4747
-DOPENMS_CONTRIB_LIBS")
4848
else()
4949
list(INSERT CMAKE_PREFIX_PATH 0 ${OPENMS_CONTRIB_LIBS})
5050
list(REMOVE_DUPLICATES CMAKE_PREFIX_PATH)
51+
list(REMOVE_ITEM CMAKE_PREFIX_PATH "") # Remove empty entries
5152
endif()
5253

5354
#------------------------------------------------------------------------------

0 commit comments

Comments
 (0)