Skip to content

Commit db4d811

Browse files
committed
add submodule check for XMP-Toolkit-SDK at configure time
Fresh clones without --recurse-submodules would fail with cryptic source-file-not-found errors. Add an explicit check for the SDK's presence in both CMake and Meson, with a clear error message telling the user to run git submodule update --init --recursive.
1 parent 005d8e8 commit db4d811

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

xmpsdk/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/XMP-Toolkit-SDK/public/include/XMP_Const.h")
2+
message(FATAL_ERROR
3+
"XMP-Toolkit-SDK submodule not found. Please run:\n"
4+
" git submodule update --init --recursive")
5+
endif()
6+
17
add_library(
28
exiv2-xmp OBJECT
39
XMP-Toolkit-SDK/public/include/XMP_Const.h

xmpsdk/meson.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ endif
66

77
sdk = 'XMP-Toolkit-SDK'
88

9+
fs = import('fs')
10+
if not fs.is_file(sdk / 'public' / 'include' / 'XMP_Const.h')
11+
error('XMP-Toolkit-SDK submodule not found. Please run:\n' +
12+
' git submodule update --init --recursive')
13+
endif
14+
915
# The SDK includes expat as "third-party/expat/lib/expat.h".
1016
# A wrapper header at xmpsdk/third-party/expat/lib/expat.h redirects
1117
# this to the system expat via #include_next.

0 commit comments

Comments
 (0)