2011-01-08 16:34:25 +01:00
|
|
|
|
2015-02-28 00:05:29 +01:00
|
|
|
mark_as_advanced(IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR IRRLICHT_DLL)
|
2011-01-08 16:34:25 +01:00
|
|
|
set(IRRLICHT_SOURCE_DIR "" CACHE PATH "Path to irrlicht source directory (optional)")
|
|
|
|
|
2015-02-28 00:05:29 +01:00
|
|
|
|
2011-01-08 16:34:25 +01:00
|
|
|
# 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"
|
|
|
|
)
|
2011-02-16 08:43:04 +01:00
|
|
|
|
|
|
|
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")
|
2011-05-17 19:11:12 +02:00
|
|
|
set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a libIrrlicht.dll.a)
|
2011-02-16 08:43:04 +01:00
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(IRRLICHT_SOURCE_DIR_LIBS "${IRRLICHT_SOURCE_DIR}/lib/Linux")
|
|
|
|
set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a)
|
|
|
|
endif()
|
|
|
|
|
2015-02-28 00:05:29 +01:00
|
|
|
find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
|
2011-02-16 08:43:04 +01:00
|
|
|
PATHS
|
|
|
|
${IRRLICHT_SOURCE_DIR_INCLUDE}
|
|
|
|
NO_DEFAULT_PATH
|
2011-02-01 09:45:55 +01:00
|
|
|
)
|
|
|
|
|
2015-02-28 00:05:29 +01:00
|
|
|
find_library(IRRLICHT_LIBRARY NAMES ${IRRLICHT_LIBRARY_NAMES}
|
2011-02-16 08:43:04 +01:00
|
|
|
PATHS
|
|
|
|
${IRRLICHT_SOURCE_DIR_LIBS}
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
else()
|
2015-02-28 00:05:29 +01:00
|
|
|
find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
|
2011-02-16 08:43:04 +01:00
|
|
|
PATHS
|
|
|
|
/usr/local/include/irrlicht
|
|
|
|
/usr/include/irrlicht
|
|
|
|
)
|
2011-01-08 02:10:20 +01:00
|
|
|
|
2015-02-28 00:05:29 +01:00
|
|
|
find_library(IRRLICHT_LIBRARY NAMES libIrrlicht.so libIrrlicht.a Irrlicht
|
2011-02-16 08:43:04 +01:00
|
|
|
PATHS
|
|
|
|
/usr/local/lib
|
|
|
|
/usr/lib
|
|
|
|
)
|
|
|
|
endif()
|
2011-01-08 02:10:20 +01:00
|
|
|
|
|
|
|
|
2015-02-28 00:05:29 +01:00
|
|
|
# On Windows, find the DLL for installation
|
2011-01-08 16:34:25 +01:00
|
|
|
if(WIN32)
|
|
|
|
if(MSVC)
|
2015-02-28 00:05:29 +01:00
|
|
|
set(IRRLICHT_COMPILER "VisualStudio")
|
2011-01-08 16:34:25 +01:00
|
|
|
else()
|
2015-02-28 00:05:29 +01:00
|
|
|
set(IRRLICHT_COMPILER "gcc")
|
2011-01-08 16:34:25 +01:00
|
|
|
endif()
|
2015-02-28 00:05:29 +01:00
|
|
|
find_file(IRRLICHT_DLL NAMES Irrlicht.dll
|
|
|
|
PATHS
|
|
|
|
"${IRRLICHT_SOURCE_DIR}/bin/Win32-${IRRLICHT_COMPILER}"
|
|
|
|
DOC "Path of the Irrlicht dll (for installation)"
|
|
|
|
)
|
2011-01-08 16:34:25 +01:00
|
|
|
endif(WIN32)
|
|
|
|
|
2015-02-28 00:05:29 +01:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Irrlicht DEFAULT_MSG IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR)
|
2011-01-08 02:10:20 +01:00
|
|
|
|