2011-01-08 16:34:25 +01:00
|
|
|
#FindIrrlicht.cmake
|
|
|
|
|
|
|
|
set(IRRLICHT_SOURCE_DIR "" CACHE PATH "Path to irrlicht source directory (optional)")
|
|
|
|
|
|
|
|
if( UNIX )
|
|
|
|
# Unix
|
|
|
|
else( UNIX )
|
|
|
|
# Windows
|
|
|
|
endif( UNIX )
|
|
|
|
|
|
|
|
# Find include directory
|
2011-01-08 02:10:20 +01:00
|
|
|
|
2011-02-01 09:45:55 +01:00
|
|
|
if(NOT IRRLICHT_SOURCE_DIR STREQUAL "")
|
|
|
|
set(IRRLICHT_SOURCE_DIR_INCLUDE
|
|
|
|
"${IRRLICHT_SOURCE_DIR}/include"
|
|
|
|
)
|
|
|
|
set(IRRLICHT_SOURCE_DIR_LIBS
|
|
|
|
"${IRRLICHT_SOURCE_DIR}/lib/Win32-visualstudio"
|
|
|
|
"${IRRLICHT_SOURCE_DIR}/lib/Win32-gcc"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2011-01-08 02:10:20 +01:00
|
|
|
FIND_PATH(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
|
2011-01-08 16:34:25 +01:00
|
|
|
PATHS
|
2011-02-15 19:53:29 +01:00
|
|
|
${IRRLICHT_SOURCE_DIR_INCLUDE}
|
2011-01-08 16:34:25 +01:00
|
|
|
/usr/local/include/irrlicht
|
|
|
|
/usr/include/irrlicht
|
2011-01-08 02:10:20 +01:00
|
|
|
)
|
|
|
|
|
2011-01-08 16:34:25 +01:00
|
|
|
# Find library directory
|
2011-01-08 02:10:20 +01:00
|
|
|
|
|
|
|
FIND_LIBRARY(IRRLICHT_LIBRARY NAMES libIrrlicht.a Irrlicht
|
2011-01-08 16:34:25 +01:00
|
|
|
PATHS
|
2011-02-15 19:53:29 +01:00
|
|
|
${IRRLICHT_SOURCE_DIR_LIBS}
|
2011-01-08 16:34:25 +01:00
|
|
|
/usr/local/lib
|
|
|
|
/usr/lib
|
2011-01-08 02:10:20 +01:00
|
|
|
)
|
|
|
|
|
2011-01-08 16:34:25 +01:00
|
|
|
MESSAGE(STATUS "IRRLICHT_INCLUDE_DIR = ${IRRLICHT_INCLUDE_DIR}")
|
2011-01-08 02:10:20 +01:00
|
|
|
MESSAGE(STATUS "IRRLICHT_LIBRARY = ${IRRLICHT_LIBRARY}")
|
|
|
|
|
2011-01-08 16:34:25 +01:00
|
|
|
# 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)"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
FIND_FILE(IRRLICHT_DLL NAMES Irrlicht.dll
|
|
|
|
PATHS
|
|
|
|
"${IRRLICHT_SOURCE_DIR}/bin/Win32-gcc"
|
|
|
|
DOC "Path of the Irrlicht dll (for installation)"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
MESSAGE(STATUS "IRRLICHT_DLL = ${IRRLICHT_DLL}")
|
|
|
|
endif(WIN32)
|
|
|
|
|
2011-01-08 02:10:20 +01:00
|
|
|
# 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)
|
|
|
|
|
2011-01-08 16:34:25 +01:00
|
|
|
MARK_AS_ADVANCED(IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR IRRLICHT_DLL)
|
2011-01-08 02:10:20 +01:00
|
|
|
|