diff options
author | ShadowNinja <shadowninja@minetest.net> | 2015-02-27 18:05:29 -0500 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2015-03-27 15:00:48 -0400 |
commit | 93fcab952b28f4db39d9326b83f14cbd86c0cf17 (patch) | |
tree | 4a2f0fcf7341c596f50ec24ff0a5a81d43d17ccd /cmake/Modules/FindIrrlicht.cmake | |
parent | 284fefb0c32e8222fadd78eeec6e7e718fe25668 (diff) | |
download | minetest-93fcab952b28f4db39d9326b83f14cbd86c0cf17.tar.gz minetest-93fcab952b28f4db39d9326b83f14cbd86c0cf17.tar.bz2 minetest-93fcab952b28f4db39d9326b83f14cbd86c0cf17.zip |
Clean up and tweak build system
* Combine client and server man pages.
* Update unit test options and available databases in man page.
* Add `--worldname` to man page.
* Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`.
* Disable server build by default on all operating systems.
* Make `ENABLE_FREETYPE` not fail if FreeType isn't found.
* Enable LevelDB, Redis, and FreeType detection by default.
* Remove the `VERSION_PATCH_ORIG` hack.
* Add option to search for and use system JSONCPP.
* Remove broken LuaJIT version detection.
* Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`.
* Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`.
* Clean up style of CMake files.
Diffstat (limited to 'cmake/Modules/FindIrrlicht.cmake')
-rw-r--r-- | cmake/Modules/FindIrrlicht.cmake | 49 |
1 files changed, 16 insertions, 33 deletions
diff --git a/cmake/Modules/FindIrrlicht.cmake b/cmake/Modules/FindIrrlicht.cmake index a84765d4e..8dda15722 100644 --- a/cmake/Modules/FindIrrlicht.cmake +++ b/cmake/Modules/FindIrrlicht.cmake @@ -1,7 +1,8 @@ -#FindIrrlicht.cmake +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 if(NOT IRRLICHT_SOURCE_DIR STREQUAL "") @@ -24,65 +25,47 @@ if(NOT IRRLICHT_SOURCE_DIR STREQUAL "") set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a) endif() - FIND_PATH(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h + find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h PATHS ${IRRLICHT_SOURCE_DIR_INCLUDE} NO_DEFAULT_PATH ) - FIND_LIBRARY(IRRLICHT_LIBRARY NAMES ${IRRLICHT_LIBRARY_NAMES} + find_library(IRRLICHT_LIBRARY NAMES ${IRRLICHT_LIBRARY_NAMES} PATHS ${IRRLICHT_SOURCE_DIR_LIBS} NO_DEFAULT_PATH ) else() - - FIND_PATH(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h + find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h PATHS /usr/local/include/irrlicht /usr/include/irrlicht ) - FIND_LIBRARY(IRRLICHT_LIBRARY NAMES libIrrlicht.so libIrrlicht.a Irrlicht + find_library(IRRLICHT_LIBRARY NAMES libIrrlicht.so libIrrlicht.a Irrlicht PATHS /usr/local/lib /usr/lib ) endif() -MESSAGE(STATUS "IRRLICHT_SOURCE_DIR = ${IRRLICHT_SOURCE_DIR}") -MESSAGE(STATUS "IRRLICHT_INCLUDE_DIR = ${IRRLICHT_INCLUDE_DIR}") -MESSAGE(STATUS "IRRLICHT_LIBRARY = ${IRRLICHT_LIBRARY}") -# On windows, find the dll for installation +# On Windows, find the DLL for installation if(WIN32) if(MSVC) - FIND_FILE(IRRLICHT_DLL NAMES Irrlicht.dll - PATHS - "${IRRLICHT_SOURCE_DIR}/bin/Win32-VisualStudio" - DOC "Path of the Irrlicht dll (for installation)" - ) + set(IRRLICHT_COMPILER "VisualStudio") else() - FIND_FILE(IRRLICHT_DLL NAMES Irrlicht.dll - PATHS - "${IRRLICHT_SOURCE_DIR}/bin/Win32-gcc" - DOC "Path of the Irrlicht dll (for installation)" - ) + set(IRRLICHT_COMPILER "gcc") endif() - MESSAGE(STATUS "IRRLICHT_DLL = ${IRRLICHT_DLL}") + find_file(IRRLICHT_DLL NAMES Irrlicht.dll + PATHS + "${IRRLICHT_SOURCE_DIR}/bin/Win32-${IRRLICHT_COMPILER}" + DOC "Path of the Irrlicht dll (for installation)" + ) endif(WIN32) -# handle the QUIETLY and REQUIRED arguments and set IRRLICHT_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Irrlicht DEFAULT_MSG IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR) - -IF(IRRLICHT_FOUND) - SET(IRRLICHT_LIBRARIES ${IRRLICHT_LIBRARY}) -ELSE(IRRLICHT_FOUND) - SET(IRRLICHT_LIBRARIES) -ENDIF(IRRLICHT_FOUND) - -MARK_AS_ADVANCED(IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR IRRLICHT_DLL) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Irrlicht DEFAULT_MSG IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR) |