Skip to content

Commit 401a8a5

Browse files
authored
Merge pull request #734 from FtZPetruska/cmake-force-find
CMake: Add option for strict dependency search
2 parents 03bd505 + 3bd8f49 commit 401a8a5

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.github/workflows/continuous_integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ jobs:
158158
cmake -S prboom2
159159
-B build
160160
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
161+
-DSTRICT_FIND=ON
161162
${{ matrix.config.extra_options }}
162163
163164
- name: Build

prboom2/cmake/DsdaDependencies.cmake

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
include_guard()
22

3+
if(STRICT_FIND)
4+
set(dsda_strict_keyword)
5+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.1)
6+
set(CMAKE_FIND_REQUIRED ON)
7+
else()
8+
set(dsda_strict_keyword REQUIRED)
9+
endif()
10+
endif()
11+
312
# TODO: Move away from including this module this way
413
include(PkgConfigHelper)
514

@@ -30,42 +39,42 @@ if(SndFile_VERSION VERSION_GREATER_EQUAL "1.1.0")
3039
endif()
3140

3241
if(WITH_IMAGE)
33-
find_package(SDL2_image)
42+
find_package(SDL2_image ${dsda_strict_keyword})
3443
if(SDL2_image_FOUND)
3544
set(HAVE_LIBSDL2_IMAGE TRUE)
3645
endif()
3746
endif()
3847

3948
if(WITH_MAD)
40-
find_package(mad)
49+
find_package(mad ${dsda_strict_keyword})
4150
if(mad_FOUND)
4251
set(HAVE_LIBMAD TRUE)
4352
endif()
4453
endif()
4554

4655
if(WITH_FLUIDSYNTH)
47-
find_package(FluidSynth)
56+
find_package(FluidSynth ${dsda_strict_keyword})
4857
if(FluidSynth_FOUND)
4958
set(HAVE_LIBFLUIDSYNTH TRUE)
5059
endif()
5160
endif()
5261

5362
if(WITH_XMP)
54-
find_package(libxmp)
63+
find_package(libxmp ${dsda_strict_keyword})
5564
if(libxmp_FOUND)
5665
set(HAVE_LIBXMP TRUE)
5766
endif()
5867
endif()
5968

6069
if(WITH_VORBISFILE)
61-
find_package(Vorbis COMPONENTS File)
70+
find_package(Vorbis COMPONENTS File ${dsda_strict_keyword})
6271
if(Vorbis_File_FOUND)
6372
set(HAVE_LIBVORBISFILE TRUE)
6473
endif()
6574
endif()
6675

6776
if(WITH_PORTMIDI)
68-
find_package(PortMidi)
77+
find_package(PortMidi ${dsda_strict_keyword})
6978
if(PortMidi_FOUND)
7079
set(HAVE_LIBPORTMIDI TRUE)
7180
endif()

prboom2/cmake/DsdaOptions.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ set(DOOMWADDIR "${CMAKE_INSTALL_PREFIX}/${default_wad_dir}" CACHE PATH "Path to
1616
set(DSDA_INSTALL_COPYRIGHT_DIR "${default_copyright_dir}" CACHE STRING "Destination of the copyright file")
1717
set(DSDA_INSTALL_BINDIR "${default_bin_dir}" CACHE STRING "Destination of the dsda-doom binary")
1818

19+
option(STRICT_FIND "Fail configuration if an optional dependency is not found" OFF)
1920
option(SIMPLECHECKS "Enable checks which only impose significant overhead if a posible error is detected" ON)
2021
option(RANGECHECK "Enable internal range checking" OFF)
2122

0 commit comments

Comments
 (0)