diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/FindGMP.cmake | 2 | ||||
-rw-r--r-- | cmake/Modules/FindGettextLib.cmake | 9 | ||||
-rw-r--r-- | cmake/Modules/FindIrrlicht.cmake | 51 | ||||
-rw-r--r-- | cmake/Modules/FindJson.cmake | 23 |
4 files changed, 18 insertions, 67 deletions
diff --git a/cmake/Modules/FindGMP.cmake b/cmake/Modules/FindGMP.cmake index 7b45f16c7..190b7c548 100644 --- a/cmake/Modules/FindGMP.cmake +++ b/cmake/Modules/FindGMP.cmake @@ -12,8 +12,6 @@ if(ENABLE_SYSTEM_GMP) else() message (STATUS "Detecting GMP from system failed.") endif() -else() - message (STATUS "Detecting GMP from system disabled! (ENABLE_SYSTEM_GMP=0)") endif() if(NOT USE_SYSTEM_GMP) diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index 529452a4a..b7681827c 100644 --- a/cmake/Modules/FindGettextLib.cmake +++ b/cmake/Modules/FindGettextLib.cmake @@ -42,15 +42,6 @@ if(WIN32) NAMES ${GETTEXT_LIB_NAMES} PATHS "${CUSTOM_GETTEXT_PATH}/lib" DOC "GetText library") - find_file(GETTEXT_DLL - NAMES libintl.dll intl.dll libintl3.dll intl3.dll - PATHS "${CUSTOM_GETTEXT_PATH}/bin" "${CUSTOM_GETTEXT_PATH}/lib" - DOC "gettext *intl*.dll") - find_file(GETTEXT_ICONV_DLL - NAMES libiconv2.dll - PATHS "${CUSTOM_GETTEXT_PATH}/bin" "${CUSTOM_GETTEXT_PATH}/lib" - DOC "gettext *iconv*.lib") - set(GETTEXT_REQUIRED_VARS ${GETTEXT_REQUIRED_VARS} GETTEXT_DLL GETTEXT_ICONV_DLL) endif(WIN32) diff --git a/cmake/Modules/FindIrrlicht.cmake b/cmake/Modules/FindIrrlicht.cmake index 6f361e829..8296de685 100644 --- a/cmake/Modules/FindIrrlicht.cmake +++ b/cmake/Modules/FindIrrlicht.cmake @@ -1,44 +1,11 @@ mark_as_advanced(IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR IRRLICHT_DLL) -set(IRRLICHT_SOURCE_DIR "" CACHE PATH "Path to irrlicht source directory (optional)") +# Find include directory and libraries -# Find include directory - -if(NOT IRRLICHT_SOURCE_DIR STREQUAL "") - set(IRRLICHT_SOURCE_DIR_INCLUDE - "${IRRLICHT_SOURCE_DIR}/include" - ) - - set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a Irrlicht Irrlicht.lib) - - if(WIN32) - if(MSVC) - set(IRRLICHT_SOURCE_DIR_LIBS "${IRRLICHT_SOURCE_DIR}/lib/Win32-visualstudio") - set(IRRLICHT_LIBRARY_NAMES Irrlicht.lib) - else() - set(IRRLICHT_SOURCE_DIR_LIBS "${IRRLICHT_SOURCE_DIR}/lib/Win32-gcc") - set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a libIrrlicht.dll.a) - endif() - else() - set(IRRLICHT_SOURCE_DIR_LIBS "${IRRLICHT_SOURCE_DIR}/lib/Linux") - set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a) - endif() - - find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h - PATHS - ${IRRLICHT_SOURCE_DIR_INCLUDE} - NO_DEFAULT_PATH - ) - - find_library(IRRLICHT_LIBRARY NAMES ${IRRLICHT_LIBRARY_NAMES} - PATHS - ${IRRLICHT_SOURCE_DIR_LIBS} - NO_DEFAULT_PATH - ) - -else() +if(TRUE) find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h + DOC "Path to the directory with Irrlicht includes" PATHS /usr/local/include/irrlicht /usr/include/irrlicht @@ -46,7 +13,8 @@ else() PATH_SUFFIXES "include/irrlicht" ) - find_library(IRRLICHT_LIBRARY NAMES libIrrlicht.so libIrrlicht.a Irrlicht + find_library(IRRLICHT_LIBRARY NAMES libIrrlicht Irrlicht + DOC "Path to the Irrlicht library file" PATHS /usr/local/lib /usr/lib @@ -54,19 +22,14 @@ else() ) endif() +# Users will likely need to edit these +mark_as_advanced(CLEAR IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR) # On Windows, find the DLL for installation if(WIN32) # If VCPKG_APPLOCAL_DEPS is ON, dll's are automatically handled by VCPKG if(NOT VCPKG_APPLOCAL_DEPS) - if(MSVC) - set(IRRLICHT_COMPILER "VisualStudio") - else() - set(IRRLICHT_COMPILER "gcc") - endif() find_file(IRRLICHT_DLL NAMES Irrlicht.dll - PATHS - "${IRRLICHT_SOURCE_DIR}/bin/Win32-${IRRLICHT_COMPILER}" DOC "Path of the Irrlicht dll (for installation)" ) endif() diff --git a/cmake/Modules/FindJson.cmake b/cmake/Modules/FindJson.cmake index a5e9098f8..cce2d387f 100644 --- a/cmake/Modules/FindJson.cmake +++ b/cmake/Modules/FindJson.cmake @@ -1,26 +1,25 @@ -# Look for JSONCPP if asked to. -# We use a bundled version by default because some distros ship versions of -# JSONCPP that cause segfaults and other memory errors when we link with them. -# See https://github.com/minetest/minetest/issues/1793 +# Look for JsonCpp, with fallback to bundeled version mark_as_advanced(JSON_LIBRARY JSON_INCLUDE_DIR) -option(ENABLE_SYSTEM_JSONCPP "Enable using a system-wide JSONCPP. May cause segfaults and other memory errors!" FALSE) +option(ENABLE_SYSTEM_JSONCPP "Enable using a system-wide JsonCpp" TRUE) +set(USE_SYSTEM_JSONCPP FALSE) if(ENABLE_SYSTEM_JSONCPP) find_library(JSON_LIBRARY NAMES jsoncpp) find_path(JSON_INCLUDE_DIR json/allocator.h PATH_SUFFIXES jsoncpp) - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Json DEFAULT_MSG JSON_LIBRARY JSON_INCLUDE_DIR) - - if(JSON_FOUND) - message(STATUS "Using system JSONCPP library.") + if(JSON_LIBRARY AND JSON_INCLUDE_DIR) + message(STATUS "Using JsonCpp provided by system.") + set(USE_SYSTEM_JSONCPP TRUE) endif() endif() -if(NOT JSON_FOUND) - message(STATUS "Using bundled JSONCPP library.") +if(NOT USE_SYSTEM_JSONCPP) + message(STATUS "Using bundled JsonCpp library.") set(JSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jsoncpp) set(JSON_LIBRARY jsoncpp) add_subdirectory(lib/jsoncpp) endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Json DEFAULT_MSG JSON_LIBRARY JSON_INCLUDE_DIR) |