From ff94c0635060f17423e7372d6e33ca9e4ce6b883 Mon Sep 17 00:00:00 2001 From: Dany Petit Date: Sat, 29 Aug 2026 22:24:00 +0200 Subject: [PATCH 1/2] fix(cmake): FindLibNoise returns the parent of noise/ as include dir The module searched for 'noise.h' with PATH_SUFFIXES 'include/noise', which resolves to /include/noise. Since the sources include libnoise as , the include dir must be /include. Searching for 'noise/noise.h' with suffix 'include' makes system installs work without a manual -DLibNoise_INCLUDE_DIR override. --- cmake/find-modules/FindLibNoise.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/find-modules/FindLibNoise.cmake b/cmake/find-modules/FindLibNoise.cmake index af4860166a..ba58969e58 100644 --- a/cmake/find-modules/FindLibNoise.cmake +++ b/cmake/find-modules/FindLibNoise.cmake @@ -8,8 +8,10 @@ endif () include(FindPackageHandleStandardArgs) -find_path(LibNoise_INCLUDE_DIR noise.h - PATH_SUFFIXES include include/noise include/libnoise +# Cytopia includes libnoise as , so the include directory must +# be the parent of the noise/ folder (e.g. /include), not the folder itself. +find_path(LibNoise_INCLUDE_DIR noise/noise.h + PATH_SUFFIXES include HINTS ${LIBNOISE_DIR} $ENV{LIBNOISE_DIR} ) find_library(LibNoise_LIBRARY From 49f9fb7c51cc35f73be363b753159ff0df51cd39 Mon Sep 17 00:00:00 2001 From: Dany Petit Date: Sat, 29 Aug 2026 23:00:40 +0200 Subject: [PATCH 2/2] fix(cmake): FindLibNoise supports the Debian/Ubuntu header layout Distro packages install the headers in /include/libnoise/ while the sources include (upstream/Conan layout uses /include/noise/). When only the libnoise/ layout is found, the find module now creates a noise-compat directory in the build tree with a 'noise' symlink pointing at the distro folder. Verified against both layouts: the game and the test suite build with distro packages (Ubuntu libnoise-dev 1.0.0) and with a source install. --- cmake/find-modules/FindLibNoise.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmake/find-modules/FindLibNoise.cmake b/cmake/find-modules/FindLibNoise.cmake index ba58969e58..8369421c3c 100644 --- a/cmake/find-modules/FindLibNoise.cmake +++ b/cmake/find-modules/FindLibNoise.cmake @@ -14,6 +14,24 @@ find_path(LibNoise_INCLUDE_DIR noise/noise.h PATH_SUFFIXES include HINTS ${LIBNOISE_DIR} $ENV{LIBNOISE_DIR} ) + +# Debian/Ubuntu install the headers in /include/libnoise/ instead of +# /include/noise/. Provide a compatibility symlink so that +# keeps working with distro packages. +if (NOT LibNoise_INCLUDE_DIR) + find_path(LibNoise_INCLUDE_DIR libnoise/noise.h + PATH_SUFFIXES include + HINTS ${LIBNOISE_DIR} $ENV{LIBNOISE_DIR} + ) + if (LibNoise_INCLUDE_DIR) + set(_noise_compat_dir "${CMAKE_BINARY_DIR}/noise-compat") + file(MAKE_DIRECTORY "${_noise_compat_dir}") + if (NOT EXISTS "${_noise_compat_dir}/noise") + file(CREATE_LINK "${LibNoise_INCLUDE_DIR}/libnoise" "${_noise_compat_dir}/noise" SYMBOLIC) + endif () + set(LibNoise_INCLUDE_DIR "${_noise_compat_dir}") + endif () +endif () find_library(LibNoise_LIBRARY NAMES noise noiseutils noise-static noiseutils-static PATH_SUFFIXES lib/x64 lib/x86