Hopefully fixed the problem of IRRLICHT_SOURCE_DIR being not considered when a local...
authorPerttu Ahola <celeron55@gmail.com>
Tue, 1 Feb 2011 08:45:55 +0000 (10:45 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 1 Feb 2011 08:45:55 +0000 (10:45 +0200)
cmake/Modules/FindIrrlicht.cmake

index 246e72cfb1c90e63d25ac0b550749361f9c71b7d..01e7088c9fb0f7ed3bc524050fbab9251b3c0a97 100644 (file)
@@ -10,22 +10,30 @@ endif( UNIX )
 
 # Find include directory
 
+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()
+
 FIND_PATH(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
        PATHS
+       "${IRRLICHT_SOURCE_DIR_INCLUDE}"
        /usr/local/include/irrlicht
        /usr/include/irrlicht
-       "${IRRLICHT_SOURCE_DIR}/include"
 )
 
 # Find library directory
 
 FIND_LIBRARY(IRRLICHT_LIBRARY NAMES libIrrlicht.a Irrlicht
        PATHS
+       "${IRRLICHT_SOURCE_DIR_LIBS}"
        /usr/local/lib
        /usr/lib
-       #${IRRLICHT_PLATFORM_DIR}
-       "${IRRLICHT_SOURCE_DIR}/lib/Win32-visualstudio"
-       "${IRRLICHT_SOURCE_DIR}/lib/Win32-gcc"
 )
 
 MESSAGE(STATUS "IRRLICHT_INCLUDE_DIR = ${IRRLICHT_INCLUDE_DIR}")