OrcaSlicer/cmake/modules/Findlibnoise.cmake
Ocraftyone 026499c5b7
Better CMake Defaults (#10294)
* Auto generate CMAKE_PREFIX_PATH/DESTDIR

* Auto set CMAKE_INSTALL_PREFIX

* Always default SLIC3R_STATIC to on

* Only allow one value for CMAKE_OSX_ARCHITECTURES

* Set arch for OpenSSL from CMAKE_OSX_ARCHITECTURES

* Set CMAKE_INSTALL_RPATH from CMAKE_PREFIX_PATH

* Default CMAKE_MACOSX_RPATH and CMAKE_MACOSX_BUNDLE to on

* Auto set BBL_RELEASE_TO_PUBLIC based on build config

* Default to GTK 3

* Fix linux debug build

Update find modules to also look for the debug variant of the libraries

* Set DEP_DEBUG and ORCA_INCLUDE_DEBUG_INFO based on CMAKE_BUILD_TYPE

* Add a fallback value for Windows SDK if the env variables are not set

* Reflect CMake changes in the build scripts

* Add missing line

* Fix auto setting DEP_DEBUG and ORCA_INCLUDE_DEBUG_INFO

* Update dep folder name for linux in GH actions

* Invert dep-folder-name conditions

`''` is considered a falsy value, which was causing the value to always be set to 'OrcaSlicer_dep'

* Properly handle finding the debug version of libnoise

* Convert FindNLopt.cmake to a config mode wrapper

* Use separate build directory for debug builds on Linux

* Move find_package for libnoise

* Cleanup and improve linux build script

- Add dry run
- Add build in RelWithDebInfo
- Add function to print and run commands

* Remove linux destdir deprecation and cleanup

* Fix flatpak build

* Disable fail fast for flatpak builds

* Flatpak improvements

- Build wxWidgets using deps cmake
- Improve handling of space freeing commands while building deps
- Allow cmake to directly download deps
- Set needed flags within cmake instead of the build manifest

* Print clean build commands

* Implement shellcheck recommendations

* Cleanup

* Fix CMakeLists.txt syntax by replacing empty elseif with else statement

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2025-10-25 22:05:09 +08:00

41 lines
No EOL
1.6 KiB
CMake

find_path(LIBNOISE_INCLUDE_DIR libnoise/noise.h)
find_library(LIBNOISE_LIBRARY_RELEASE NAMES libnoise libnoise_static liblibnoise_static)
find_library(LIBNOISE_LIBRARY_DEBUG NAMES libnoised libnoise_staticd liblibnoise_staticd)
set(libnoise_LIB_FOUND FALSE)
if (LIBNOISE_LIBRARY_RELEASE OR LIBNOISE_LIBRARY_DEBUG)
set(libnoise_LIB_FOUND TRUE)
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libnoise DEFAULT_MSG
libnoise_LIB_FOUND
LIBNOISE_INCLUDE_DIR
)
if(libnoise_FOUND)
add_library(noise::noise STATIC IMPORTED)
set_target_properties(noise::noise PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBNOISE_INCLUDE_DIR}"
)
if (NOT libnoise_FIND_QUIETLY)
message(STATUS "Found libnoise include directory: ${LIBNOISE_INCLUDE_DIR}")
if (LIBNOISE_LIBRARY_RELEASE)
message(STATUS "Found libnoise RELEASE library: ${LIBNOISE_LIBRARY_RELEASE}")
endif ()
if (LIBNOISE_LIBRARY_DEBUG)
message(STATUS "Found libnoise DEBUG library: ${LIBNOISE_LIBRARY_DEBUG}")
endif ()
endif ()
if (LIBNOISE_LIBRARY_RELEASE)
set_property(TARGET noise::noise APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(noise::noise PROPERTIES IMPORTED_LOCATION_RELEASE ${LIBNOISE_LIBRARY_RELEASE})
endif ()
if (LIBNOISE_LIBRARY_DEBUG)
set_property(TARGET noise::noise APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(noise::noise PROPERTIES IMPORTED_LOCATION_DEBUG ${LIBNOISE_LIBRARY_DEBUG})
endif ()
endif()