aboutsummaryrefslogtreecommitdiff
path: root/src/mineral.cpp
Commit message (Expand)AuthorAge
* All textures are are now searched first from the directory specified by the t...Perttu Ahola2011-05-21
* fully working i guessPerttu Ahola2011-02-11
* work-in-progress texture atlas optimizationPerttu Ahola2011-02-10
* server builds now!Perttu Ahola2011-01-28
* server might build nowPerttu Ahola2011-01-28
* Now texture handling is fast. Also now players are saved on disk.Perttu Ahola2011-01-28
' href='#n57'>57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

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 "")
	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()
	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
		PATHS
		/usr/local/lib
		/usr/lib
	)
endif()


# On Windows, find the DLL for installation
if(WIN32)
	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(WIN32)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Irrlicht DEFAULT_MSG IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR)