Page 1 of 1

OIS as dependency for Ogre

Posted: Wed Feb 07, 2018 1:03 pm
by Mido
Hi
I am using Ubuntu 16.04 STL and installed OIS as a dependency for Ogre.OIS installed and the lib generated in the path:/usr/local/lib
Also, I installed ogre without any problems. my main problem is when trying to build my application gives me the following errors :

Failed to find OIS on your system.
Graphical Client is not built as some dependencies are not met.

Here is a part of CMakeList file:
##############
# OGRE 1.9.x #
##############

# If no custom path is specified for Ogre, see if system environment variables point to it.
if(NOT OGRE_HOME)
set(OGRE_HOME $ENV{OGRE_HOME} CACHE PATH "Base directory to look for Ogre.")
string(REGEX REPLACE "\\\\" "/" OGRE_HOME "${OGRE_HOME}")
endif(NOT OGRE_HOME)

if(WIN32)
set(CMAKE_MODULE_PATH ${OGRE_HOME}/CMake ${CMAKE_MODULE_PATH})
else(WIN32)
set(CMAKE_MODULE_PATH ${OGRE_HOME}/lib/OGRE/cmake /usr/local/lib/OGRE/cmake ${CMAKE_MODULE_PATH})
endif(WIN32)

find_package(OGRE QUIET)
if(OGRE_FOUND)
if(NOT "${OGRE_VERSION_NAME}" STREQUAL "Ghadamon")
message(WARNING "You compile against Ogre version ${OGRE_VERSION_NAME} although only Ghadamon (Ogre 1.9) is tested. Problems might arise...")
endif()

if(NOT ${OGRE_Terrain_FOUND})
message("Failed to find the terrain component in your Ogre distribution.")
set(CLIENT_DEPENDENCIES_NOT_MET TRUE)
endif()

find_package(OIS QUIET)
if(NOT OIS_FOUND)
message("Failed to find OIS on your system.")
set(CLIENT_DEPENDENCIES_NOT_MET TRUE)
endif(NOT OIS_FOUND)
else(OGRE_FOUND)
message("Failed to find Ogre3D on your system.")
set(CLIENT_DEPENDENCIES_NOT_MET TRUE)
endif(OGRE_FOUND)


################
# Client build #
################

# Check for dependencies and define target if all libraries are available.
if(CLIENT_DEPENDENCIES_NOT_MET)
message("Graphical Client is not build as some dependencies are not met.")
else(CLIENT_DEPENDENCIES_NOT_MET)
#################################################################################

Re: OIS as dependency for Ogre

Posted: Thu Feb 08, 2018 11:18 am
by tod
You must have OIS_DIR pointing to the folder where the cmake file is.

Re: OIS as dependency for Ogre

Posted: Thu Feb 08, 2018 1:16 pm
by Mido
tod wrote: Thu Feb 08, 2018 11:18 am You must have OIS_DIR pointing to the folder where the cmake file is.
OIS_DIR or OIS_HOME??
the file is in /usr/local/lib

Also, Where I have to add this variable? in .bashrc file from the home directory or in another location?