Commit 3fef4c7a authored by Jussi Lindgren's avatar Jussi Lindgren

Build: Made Ogre 3D optional

Ogre dep can now be skipped with OV_DISABLE_OGRE flag in main CMakeLists.txt.
Added tests to 3D boxes to return an initialization error if 3D is not available.
parent 4b0d5e95
......@@ -27,13 +27,13 @@ ELSEIF(UNIX)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
IF(COMPILER_SUPPORTS_CXX11)
# TODO after release 0.19 next line will be uncommnent
# TODO maybe in future the next line will be uncommented
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSEIF(COMPILER_SUPPORTS_CXX0X)
# TODO after release 0.19 next line will be uncommnent
# TODO maybe in future the next line will be uncommented
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
ELSE(COMPILER_SUPPORTS_CXX0X)
MESSAGE(WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. For the release 0.19 and after, the compiler will need to support C++11.")
MESSAGE(WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. In the future this may be required.")
ENDIF(COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
......@@ -56,15 +56,23 @@ MESSAGE(STATUS " CMAKE_CXX_FLAGS = '${CMAKE_CXX_FLAGS}'")
MESSAGE(STATUS " CMAKE_CXX_FLAGS_RELEASE = '${CMAKE_CXX_FLAGS_RELEASE}'")
MESSAGE(STATUS " CMAKE_CXX_FLAGS_DEBUG = '${CMAKE_CXX_FLAGS_DEBUG}'")
# if no specific branch has been given for an openvibe component, default is to compile its trunk folder
## SET(OV_TRUNK "trunc")
# if want to compile tests, use the following.
SET(OV_COMPILE_TESTS "true")
# if you don't want an Ogre dependency, use the following. All 3D visualizations and 3D apps will be unavailable. The result will also compile faster.
# SET(OV_DISABLE_OGRE "true")
# By setting SKIP[_FOLDER]* you can skip a subtree (example: SKIP_A_B_C skips folder a/b/c and all its subfolders if any)
# Skip building documentation
SET(SKIP_DOCUMENTATION "1")
# Python plugin sometimes causes problems; use the following to disable it
#SET(SKIP_CONTRIB_PLUGINS_PROCESSING_PYTHON "1")
# Skipping demos can speed up compilation a lot, if you don't need them
#SET(SKIP_APPLICATIONS_DEMOS "1")
IF(UNIX)
# On Linux, the presence of matlab plugin .so can cause crashes in Simple DSP box as the two may use different versions of boost which are
# then wrongly exposed to the other party due to the dlopen() flag RTLD_GLOBAL. Unfortunately this flag is needed or the python plugin
......
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCCommandShipControl.h"
#include "ovassvepCShooterApplication.h"
......@@ -25,3 +28,5 @@ void CCommandShipControl::execute(int iButton, int iState)
break;
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCCommandTargetControl.h"
#include "ovassvepCShooterApplication.h"
......@@ -39,3 +42,5 @@ void CCommandTargetControl::execute(int iButton, int iState)
dynamic_cast<CShooterApplication*>(m_poApplication)->addTarget(iButton);
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCShooterApplication.h"
#include "../ovassvepCCommandStartStop.h"
......@@ -98,3 +101,5 @@ void CShooterApplication::startExperiment()
m_poInstructionsReady->setVisible( false );
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCShooterTarget.h"
using namespace OpenViBESSVEP;
......@@ -51,3 +54,5 @@ bool CShooterTarget::collidesWith(std::pair<Ogre::Real, Ogre::Real> pPoint)
return l_rDistance <= SSVEP_SHOOTER_TARGET_SIZE;
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCStarShip.h"
#include "../ovassvepCApplication.h"
......@@ -178,3 +181,5 @@ std::pair<Ogre::Real, Ogre::Real> CStarShip::getShotCoordinates()
{
return std::make_pair( -Ogre::Math::Sin(m_rCurrentAngle) * m_rShotDistance, Ogre::Math::Cos(m_rCurrentAngle) * m_rShotDistance);
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCCommandReceiveTarget.h"
#include "ovassvepCTrainerApplication.h"
......@@ -12,3 +15,5 @@ void CCommandReceiveTarget::execute(int iButton, int iState)
{
dynamic_cast<CTrainerApplication*>(m_poApplication)->setTarget(iButton);
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCTrainerApplication.h"
#include "../ovassvepCCommandStartStop.h"
......@@ -128,3 +131,5 @@ void CTrainerApplication::stopFlickering()
this->setTarget( -1 );
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCTrainerFlickeringObject.h"
#include "ovassvepCTrainerApplication.h"
......@@ -107,3 +110,4 @@ void CTrainerFlickeringObject::setTarget( bool bIsTarget )
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCApplication.h"
#include <cmath>
......@@ -301,3 +304,5 @@ void CApplication::stopExperiment()
this->exit();
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCBasicPainter.h"
#include "ovassvepCApplication.h"
......@@ -166,4 +169,4 @@ void CBasicPainter::paintText(
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCCommandStartStop.h"
#include "ovassvepCApplication.h"
#include "ovassvepCVRPNServer.h"
......@@ -47,3 +50,5 @@ void CCommandStartStop::receiveKeyReleasedEvent( const OIS::KeyCode oKey )
m_poVRPNServer->changeButtonState("SSVEP_VRPN_StartStop", 0, 0);
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCCommandStimulatorControl.h"
#include "ovassvepCApplication.h"
......@@ -38,3 +41,5 @@ void CCommandStimulatorControl::execute(int iButton, int iState)
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCSSVEPFlickeringObject.h"
#include <iostream>
......@@ -39,3 +42,5 @@ void CSSVEPFlickeringObject::processFrame()
m_ui32CurrentFrame = 0;
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCVRPNServer.h"
#include "ovassvepCApplication.h"
......@@ -57,3 +60,6 @@ int CVRPNServer::getButtonState(std::string sName, int iIndex)
{
return m_oButtonCache[sName][iIndex];
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepICommandOIS.h"
#include "ovassvepCApplication.h"
......@@ -89,3 +92,5 @@ bool ICommandOIS::keyReleased( const OIS::KeyEvent &oEvent )
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepICommandVRPNButton.h"
#include "ovassvepCApplication.h"
......@@ -43,3 +46,5 @@ void ICommandVRPNButton::processFrame()
{
m_poVRPNButton->mainloop();
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvep_defines.h"
#include <openvibe/ov_all.h>
#include <toolkit/ovtk_all.h>
......@@ -114,3 +117,16 @@ int main(int argc, char** argv)
#else
#include <stdio.h>
int main(int argc, char** argv)
{
printf("SSVEP demo has not been compiled as it depends on Ogre (missing/disabled)\n");
return -1;
}
#endif
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCGenericStimulatorApplication.h"
#include "../log/ovkCLogListenerFileBuffered.h"
......@@ -139,3 +142,5 @@ void CGenericStimulatorApplication::stopFlickering()
this->setTarget( -1 );
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCGenericStimulatorFlickeringObject.h"
#include "ovassvepCGenericStimulatorApplication.h"
......@@ -140,3 +143,5 @@ void CGenericStimulatorFlickeringObject::setTarget( bool bIsTarget )
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
/*
* @author Ogre
* @note This code likely originates from the Ogre project
......@@ -1443,3 +1445,5 @@ void DotSceneLoader::processUserDataReference(rapidxml::xml_node<>* XMLNode, Ogr
Ogre::String str = XMLNode->first_attribute("id")->value();
pEntity->setUserAny(Ogre::Any(str));
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCAdvancedControl.h"
#include "ovassvepCImpactApplication.h"
......@@ -96,3 +99,4 @@ void CAdvancedControl::commandeerShip(CAdvancedControl::ShipCommand sCommand)
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCCommandFeedbackHandler.h"
#include "ovassvepCImpactApplication.h"
......@@ -14,3 +17,5 @@ void CCommandFeedbackHandler::execute(int iChannelCount, double* pChannel)
l_poImpactApplication->calculateFeedback(iChannelCount, pChannel);
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCCommandImpactCustomTargetControl.h"
#include "ovassvepCImpactApplication.h"
......@@ -55,3 +58,5 @@ void CCommandImpactCustomTargetControl::execute(int iButton, int iState)
l_poImpactApplication->addTarget(3);
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCCommandImpactShipControl.h"
#include "ovassvepCImpactApplication.h"
......@@ -25,3 +28,5 @@ void CCommandImpactShipControl::execute(int iButton, int iState)
break;
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCCommandImpactShipControlOIS.h"
#include "ovassvepCImpactApplication.h"
......@@ -74,3 +77,5 @@ void CCommandImpactShipControlOIS::receiveKeyReleasedEvent( const OIS::KeyCode o
{
m_vKeyPressed[OIS::KC_RIGHT] = false;
}}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCCommandImpactTargetControl.h"
#include "ovassvepCImpactApplication.h"
......@@ -37,3 +40,5 @@ void CCommandImpactTargetControl::execute(int iButton, int iState)
m_poApplication->getLogManager() << LogLevel_Info << "Adding target, position : " << iButton << "\n";
dynamic_cast<CImpactApplication*>(m_poApplication)->addTarget(iButton);
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCImpactApplication.h"
#include "openvibe/ov_all.h"
......@@ -628,3 +631,5 @@ void CImpactApplication::debugAction4()
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCImpactEnemyShip.h"
#include "ovassvepCImpactApplication.h"
......@@ -293,3 +296,5 @@ void CImpactEnemyShip::processHit(Ogre::Vector2 oPoint)
m_vExplosions.push_back(l_poExplosion);
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCImpactShip.h"
#include "ovassvepCImpactEnemyShip.h"
......@@ -461,3 +464,5 @@ bool CImpactShip::evaluateHit(CImpactEnemyShip* poEnemy)
return false;
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovkCLogListenerFileBuffered.h"
#include <cstdio>
......@@ -197,3 +200,5 @@ void CLogListenerFileBuffered::log(const ELogLevel eLogLevel)
void CLogListenerFileBuffered::log(const ELogColor eLogColor)
{
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCApplication.h"
#include <cmath>
#include <algorithm>
......@@ -377,3 +380,5 @@ void CApplication::stopExperiment()
this->exit();
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCBasicPainter.h"
#include "ovassvepCApplication.h"
......@@ -265,3 +268,5 @@ void CBasicPainter::paintText(
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCCommandCamera.h"
#include "ovassvepCApplication.h"
#include "ovassvepCVRPNServer.h"
......@@ -169,3 +172,5 @@ void CCommandCamera::receiveMouseEvent(const OIS::MouseEvent &arg)
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCCommandReceiveTarget.h"
#include "ovassvepCApplication.h"
......@@ -12,3 +15,5 @@ void CCommandReceiveTarget::execute(int iButton, int iState)
{
dynamic_cast<CApplication*>(m_poApplication)->setTarget(iButton);
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCCommandStartStop.h"
#include "ovassvepCApplication.h"
#include "ovassvepCVRPNServer.h"
......@@ -52,3 +55,5 @@ void CCommandStartStop::receiveKeyReleasedEvent( const OIS::KeyCode oKey )
m_poVRPNServer->changeButtonState("SSVEP_VRPN_StartStop", 0, 0);
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCCommandStimulatorControl.h"
#include "ovassvepCApplication.h"
......@@ -38,3 +41,5 @@ void CCommandStimulatorControl::execute(int iButton, int iState)
}
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCSSVEPFlickeringObject.h"
#include <iostream>
#include <cmath>
......@@ -50,3 +53,5 @@ void CSSVEPFlickeringObject::processFrame()
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepCVRPNServer.h"
#include "ovassvepCApplication.h"
......@@ -57,3 +60,5 @@ int CVRPNServer::getButtonState(std::string sName, int iIndex)
{
return m_oButtonCache[sName][iIndex];
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepICommandOIS.h"
#include "ovassvepCApplication.h"
......@@ -115,3 +118,5 @@ bool ICommandOIS::mouseMoved( const OIS::MouseEvent &oEvent )
return true;
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepICommandVRPNAnalog.h"
#include "ovassvepCApplication.h"
......@@ -43,3 +46,5 @@ void ICommandVRPNAnalog::processFrame()
{
m_poVRPNAnalog->mainloop();
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvepICommandVRPNButton.h"
#include "ovassvepCApplication.h"
......@@ -43,3 +46,5 @@ void ICommandVRPNButton::processFrame()
{
m_poVRPNButton->mainloop();
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3DTerrain)
#include "ovassvep_defines.h"
#include <openvibe/ov_all.h>
#include <toolkit/ovtk_all.h>
......@@ -147,3 +150,13 @@ int main(int argc, char** argv)
#else
#include <stdio.h>
int main(int argc, char** argv)
{
printf("SSVEP Mind Shooter has not been compiled as it depends on Ogre (missing/disabled)\n");
return -1;
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovavrdCHandballBCI.h"
#include <iostream>
......@@ -712,3 +715,5 @@ void CHandballBCI::initSceneCrossArrowAndFeedback()
l_poFeedbackNode->setVisible(false);
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovavrdCTieFighterBCI.h"
#include <openvibe/ov_directories.h>
......@@ -651,3 +654,5 @@ void CTieFighterBCI::processStageFreetime(double timeSinceLastProcess)
Vector3 l_v3MiniTie3Position = m_poSceneManager->getSceneNode("Mini3Node")->getPosition();
m_poSceneManager->getSceneNode("Mini3Node")->setPosition(l_v3MiniTie3Position.x, m_vfSmallObjectHeight[2], l_v3MiniTie3Position.z);
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovavrdCOgreVRApplication.h"
#include <system/Time.h>
......@@ -404,3 +407,5 @@ void COgreVRApplication::windowResized(RenderWindow* rw)
{
CEGUI::System::getSingleton().notifyDisplaySizeChanged(CEGUI::Size((float)rw->getWidth(), (float)rw->getHeight()));
}
#endif
\ No newline at end of file
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovavrdCOgreVRApplication.h"
#include "HandballBCI/ovavrdCHandballBCI.h"
......@@ -79,3 +83,14 @@ int main(int argc, char **argv)
return 0;
}
#else
#include <stdio.h>
int main(int argc, char** argv)
{
printf("VR demo has not been compiled as it depends on Ogre (missing/disabled)\n");
return -1;
}
#endif
\ No newline at end of file
......@@ -11,6 +11,11 @@
# Sets CEGUI_CFLAGS_OTHERS
# ---------------------------------
IF(OV_DISABLE_OGRE)
MESSAGE(STATUS " SKIPPED Ogre3D/OIS (CEGUI), disabled, no 3D ...")
RETURN()
ENDIF(OV_DISABLE_OGRE)
IF(WIN32)
FIND_PATH(PATH_CEGUI cegui/include/CEGUI.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/cegui)
IF(PATH_CEGUI)
......
......@@ -56,7 +56,7 @@ ENDIF(WIN32)
IF(WIN32)
FIND_PATH(PATH_INPOUT32 include/inpout32.h ${OV_CUSTOM_DEPENDENCIES_PATH}/inpout32/)
IF(PATH_INPOUT32)
MESSAGE(STATUS " Found inpout32 in ${PATH_INPOUT32}")
MESSAGE(STATUS " Found inpout32 in ${PATH_INPOUT32}")
INCLUDE_DIRECTORIES(${PATH_INPOUT32}/include)
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyInpout)
ELSE(PATH_INPOUT32)
......
......@@ -14,6 +14,11 @@
# Adds include path
# ---------------------------------
IF(OV_DISABLE_OGRE)
MESSAGE(STATUS " SKIPPED Ogre3D/OIS, disabled, no 3D ...")
RETURN()