Commit 24005e2f authored by Jussi Lindgren's avatar Jussi Lindgren

core/cmake-modules:

 + Added various Find* scripts used by plugins/ compilation.
 + Added the launcher base scripts.


git-svn-id: svn://scm.gforge.inria.fr/svn/openvibe@3628 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f
parent fec7969c
# ---------------------------------
# Finds module Automaton
# Adds library to target
# Adds include path
# ---------------------------------
OPTION(DYNAMIC_LINK_OPENVIBE_MODULE_AUTOMATON "Dynamically link OpenViBE module Automaton" ON)
IF(DYNAMIC_LINK_OPENVIBE_MODULE_AUTOMATON)
SET(OPENVIBE_MODULE_AUTOMATON_LINKING "")
ELSE(DYNAMIC_LINK_OPENVIBE_MODULE_AUTOMATON)
SET(OPENVIBE_MODULE_AUTOMATON_LINKING "-static")
ENDIF(DYNAMIC_LINK_OPENVIBE_MODULE_AUTOMATON)
set(SRC_DIR ${OV_BASE_DIR}/modules/automaton/)
FIND_PATH(PATH_OPENVIBE_MODULES_AUTOMATON include/defines.h PATHS ${SRC_DIR})
IF(PATH_OPENVIBE_MODULES_AUTOMATON)
MESSAGE(STATUS " Found OpenViBE module Automaton...")
INCLUDE_DIRECTORIES(${PATH_OPENVIBE_MODULES_AUTOMATON}/../)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} openvibe-module-automaton${OPENVIBE_MODULE_AUTOMATON_LINKING})
ADD_DEFINITIONS(-DTARGET_HAS_Automaton)
ELSE(PATH_OPENVIBE_MODULES_AUTOMATON)
MESSAGE(STATUS " FAILED to find OpenViBE module Automaton...")
ENDIF(PATH_OPENVIBE_MODULES_AUTOMATON)
# ---------------------------------
# Finds module EBML
# Adds library to target
# Adds include path
# ---------------------------------
OPTION(DYNAMIC_LINK_OPENVIBE_MODULE_EBML "Dynamically link OpenViBE module EBML" ON)
IF(DYNAMIC_LINK_OPENVIBE_MODULE_EBML)
SET(OPENVIBE_MODULE_EBML_LINKING "")
ELSE(DYNAMIC_LINK_OPENVIBE_MODULE_EBML)
SET(OPENVIBE_MODULE_EBML_LINKING "-static")
ENDIF(DYNAMIC_LINK_OPENVIBE_MODULE_EBML)
set(SRC_DIR ${OV_BASE_DIR}/modules/ebml/)
FIND_PATH(PATH_OPENVIBE_MODULES_EBML include/defines.h PATHS ${SRC_DIR})
IF(PATH_OPENVIBE_MODULES_EBML)
MESSAGE(STATUS " Found OpenViBE module EBML...")
INCLUDE_DIRECTORIES(${PATH_OPENVIBE_MODULES_EBML}/../)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} openvibe-module-ebml${OPENVIBE_MODULE_EBML_LINKING})
ADD_DEFINITIONS(-DTARGET_HAS_EBML)
ELSE(PATH_OPENVIBE_MODULES_EBML)
MESSAGE(STATUS " FAILED to find OpenViBE module EBML...")
ENDIF(PATH_OPENVIBE_MODULES_EBML)
# ---------------------------------
# Finds module Socket
# Adds library to target
# Adds include path
# ---------------------------------
OPTION(DYNAMIC_LINK_OPENVIBE_MODULE_SOCKET "Dynamically link OpenViBE module Socket" ON)
IF(DYNAMIC_LINK_OPENVIBE_MODULE_SOCKET)
SET(OPENVIBE_MODULE_SOCKET_LINKING "")
ELSE(DYNAMIC_LINK_OPENVIBE_MODULE_SOCKET)
SET(OPENVIBE_MODULE_SOCKET_LINKING "-static")
ENDIF(DYNAMIC_LINK_OPENVIBE_MODULE_SOCKET)
set(SRC_DIR ${OV_BASE_DIR}/modules/socket/)
FIND_PATH(PATH_OPENVIBE_MODULES_SOCKET include/defines.h PATHS ${SRC_DIR})
IF(PATH_OPENVIBE_MODULES_SOCKET)
MESSAGE(STATUS " Found OpenViBE module Socket...")
INCLUDE_DIRECTORIES(${PATH_OPENVIBE_MODULES_SOCKET}/../)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} openvibe-module-socket${OPENVIBE_MODULE_SOCKET_LINKING})
ADD_DEFINITIONS(-DTARGET_HAS_Socket)
ELSE(PATH_OPENVIBE_MODULES_SOCKET)
MESSAGE(STATUS " FAILED to find OpenViBE module Socket...")
ENDIF(PATH_OPENVIBE_MODULES_SOCKET)
# ---------------------------------
# Finds openvibe-toolkit
# Adds library to target
# Adds include path
# ---------------------------------
OPTION(DYNAMIC_LINK_OPENVIBE_TOOLKIT "Dynamically link openvibe-toolkit" ON)
IF(DYNAMIC_LINK_OPENVIBE_TOOLKIT)
SET(OPENVIBE_TOOLKIT_LINKING "")
ELSE(DYNAMIC_LINK_OPENVIBE_TOOLKIT)
SET(OPENVIBE_TOOLKIT_LINKING "-static")
ENDIF(DYNAMIC_LINK_OPENVIBE_TOOLKIT)
set(SRC_DIR ${OV_BASE_DIR}/toolkit/)
FIND_PATH(PATH_OPENVIBE_TOOLKIT include/ovtk_all.h PATHS ${SRC_DIR})
IF(PATH_OPENVIBE_TOOLKIT)
MESSAGE(STATUS " Found openvibe-toolkit...")
INCLUDE_DIRECTORIES(${PATH_OPENVIBE_TOOLKIT}/../)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} openvibe-toolkit${OPENVIBE_TOOLKIT_LINKING})
ADD_DEFINITIONS(-DTARGET_HAS_OpenViBEToolkit)
ELSE(PATH_OPENVIBE_TOOLKIT)
MESSAGE(STATUS " FAILED to find openvibe-toolkit...")
ENDIF(PATH_OPENVIBE_TOOLKIT)
# ---------------------------------
# Finds BLiFF
# Adds library to target
# Adds include path
# ---------------------------------
IF(UNIX)
FIND_PATH(PATH_BLiFF include/Trial.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH})
IF(PATH_BLiFF)
MESSAGE(STATUS " Found BLiFF++...")
INCLUDE_DIRECTORIES(${PATH_BLiFF}/include)
INCLUDE_DIRECTORIES(${OV_CUSTOM_DEPENDENCIES_PATH}/include/itpp) # for itpp, BLiFF++ does not include files correctly
INCLUDE_DIRECTORIES(${OV_CUSTOM_DEPENDENCIES_PATH}/include/itpp/base) # for itpp, BLiFF++ does not include files correctly
INCLUDE_DIRECTORIES(${OV_CUSTOM_DEPENDENCIES_PATH}/include/itpp/base/algebra) # for itpp, BLiFF++ does not include files correctly
INCLUDE_DIRECTORIES(${OV_CUSTOM_DEPENDENCIES_PATH}/include/itpp/comm) # for itpp, BLiFF++ does not include files correctly
INCLUDE_DIRECTORIES(${OV_CUSTOM_DEPENDENCIES_PATH}/include/itpp/fixedpoint) # for itpp, BLiFF++ does not include files correctly
INCLUDE_DIRECTORIES(${OV_CUSTOM_DEPENDENCIES_PATH}/include/itpp/protocol) # for itpp, BLiFF++ does not include files correctly
INCLUDE_DIRECTORIES(${OV_CUSTOM_DEPENDENCIES_PATH}/include/itpp/srccode) # for itpp, BLiFF++ does not include files correctly
FIND_LIBRARY(LIB_BLiFF bliff PATHS ${PATH_BLiFF}/lib )
IF(LIB_BLiFF)
MESSAGE(STATUS " [ OK ] lib ${LIB_BLiFF}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_BLiFF} )
ELSE(LIB_BLiFF)
MESSAGE(STATUS " [FAILED] lib bliff")
ENDIF(LIB_BLiFF)
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyBLiFF)
ADD_DEFINITIONS(-Wno-deprecated)
ELSE(PATH_BLiFF)
MESSAGE(STATUS " FAILED to find BLiFF++")
ENDIF(PATH_BLiFF)
ENDIF(UNIX)
# ---------------------------------
# Finds third party boost
# Adds library to target
# Adds include path
# ---------------------------------
IF(UNIX)
FIND_LIBRARY(LIB_Boost_Regex NAMES "boost_regex-mt" PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/lib NO_DEFAULT_PATH)
FIND_LIBRARY(LIB_Boost_Regex NAMES "boost_regex-mt" PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/lib)
IF(LIB_Boost_Regex)
MESSAGE(STATUS " [ OK ] lib ${LIB_Boost_Regex}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_Boost_Regex} )
ELSE(LIB_Boost_Regex)
MESSAGE(STATUS " [FAILED] lib boost_regex-mt")
ENDIF(LIB_Boost_Regex)
ENDIF(UNIX)
IF(WIN32)
OV_LINK_BOOST_LIB("regex" ${OV_WIN32_BOOST_VERSION})
ENDIF(WIN32)
# ---------------------------------
# Finds Eigen headers
#
# Adds include path
# ---------------------------------
IF(WIN32)
FIND_PATH(PATH_EIGEN Eigen/Eigen PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/eigen)
IF(PATH_EIGEN)
SET(EIGEN_FOUND TRUE)
SET(EIGEN_INCLUDE_DIRS ${PATH_EIGEN})
SET(EIGEN_CFLAGS "")
#SET(EIGEN_LIBRARIES_RELEASE EIGEN)
#SET(EIGEN_LIBRARIES_DEBUG EIGENd)
#SET(EIGEN_LIBRARY_DIRS ${PATH_EIGEN}/lib )
ENDIF(PATH_EIGEN)
ENDIF(WIN32)
IF(UNIX)
INCLUDE("FindThirdPartyPkgConfig")
pkg_check_modules(EIGEN eigen3)
ENDIF(UNIX)
IF(EIGEN_FOUND)
MESSAGE(STATUS " Found eigen3...")
INCLUDE_DIRECTORIES(${EIGEN_INCLUDE_DIRS})
ADD_DEFINITIONS(${EIGEN_CFLAGS})
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyEIGEN)
ELSE(EIGEN_FOUND)
MESSAGE(STATUS " FAILED to find eigen3...")
ENDIF(EIGEN_FOUND)
# ---------------------------------
# Finds ITPP toolkit
#
# Sets ITPP_FOUND
# Sets ITPP_LIBRARIES
# Sets ITPP_LIBRARY_DIRS
# Sets ITPP_LDFLAGS
# Sets ITPP_LDFLAGS_OTHERS
# Sets ITPP_INCLUDE_DIRS
# Sets ITPP_CFLAGS
# Sets ITPP_CFLAGS_OTHERS
#
# Adds library to target
# Adds include path
# ---------------------------------
IF(WIN32)
FIND_PATH(PATH_ITPP include/itpp/itbase.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/itpp)
IF(PATH_ITPP)
SET(ITPP_FOUND TRUE)
SET(ITPP_INCLUDE_DIRS ${PATH_ITPP}/include)
SET(ITPP_LIBRARIES libblas.a libfftw3-3 liblapack.a libgcc.a libg2c.a)
SET(ITPP_LIBRARIES_RELEASE itpp)
SET(ITPP_LIBRARIES_DEBUG itppd)
SET(ITPP_LIBRARY_DIRS ${PATH_ITPP}/lib )
ENDIF(PATH_ITPP)
ENDIF(WIN32)
IF(UNIX)
INCLUDE("FindThirdPartyPkgConfig")
pkg_check_modules(ITPP itpp)
ENDIF(UNIX)
IF(ITPP_FOUND)
MESSAGE(STATUS " Found it++...")
INCLUDE_DIRECTORIES(${ITPP_INCLUDE_DIRS})
ADD_DEFINITIONS(${ITPP_CFLAGS})
ADD_DEFINITIONS(${ITPP_CFLAGS_OTHERS})
# LINK_DIRECTORIES(${ITPP_LIBRARY_DIRS})
FOREACH(ITPP_LIB ${ITPP_LIBRARIES})
SET(ITPP_LIB1 "ITPP_LIB1-NOTFOUND")
FIND_LIBRARY(ITPP_LIB1 NAMES ${ITPP_LIB} PATHS ${ITPP_LIBRARY_DIRS} ${ITPP_LIBDIR} NO_DEFAULT_PATH)
IF(ITPP_LIB1)
MESSAGE(STATUS " [ OK ] Third party lib ${ITPP_LIB1}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${ITPP_LIB1})
ELSE(ITPP_LIB1)
MESSAGE(STATUS " [FAILED] Third party lib ${ITPP_LIB1}")
ENDIF(ITPP_LIB1)
ENDFOREACH(ITPP_LIB)
FOREACH(ITPP_LIB ${ITPP_LIBRARIES_RELEASE})
SET(ITPP_LIB1 "ITPP_LIB1-NOTFOUND")
FIND_LIBRARY(ITPP_LIB1 NAMES ${ITPP_LIB} PATHS ${ITPP_LIBRARY_DIRS} ${ITPP_LIBDIR} NO_DEFAULT_PATH)
IF(ITPP_LIB1)
MESSAGE(STATUS " [ OK ] Third party lib ${ITPP_LIB1}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} optimized ${ITPP_LIB1})
ELSE(ITPP_LIB1)
MESSAGE(STATUS " [FAILED] Third party lib ${ITPP_LIB1}")
ENDIF(ITPP_LIB1)
ENDFOREACH(ITPP_LIB)
FOREACH(ITPP_LIB ${ITPP_LIBRARIES_DEBUG})
SET(ITPP_LIB1 "ITPP_LIB1-NOTFOUND")
FIND_LIBRARY(ITPP_LIB1 NAMES ${ITPP_LIB} PATHS ${ITPP_LIBRARY_DIRS} ${ITPP_LIBDIR} NO_DEFAULT_PATH)
IF(ITPP_LIB1)
MESSAGE(STATUS " [ OK ] Third party lib ${ITPP_LIB1}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} debug ${ITPP_LIB1})
ELSE(ITPP_LIB1)
MESSAGE(STATUS " [FAILED] Third party lib ${ITPP_LIB1}")
ENDIF(ITPP_LIB1)
ENDFOREACH(ITPP_LIB)
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyITPP)
ELSE(ITPP_FOUND)
MESSAGE(STATUS " FAILED to find it++...")
ENDIF(ITPP_FOUND)
# ---------------------------------
# Finds LUA
# Adds library to target
# Adds include path
# ---------------------------------
IF(WIN32)
FIND_PATH(PATH_LUA lua.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/lua/include NO_DEFAULT_PATH)
ELSEIF(UNIX)
FIND_PACKAGE(Lua51 REQUIRED)
SET(PATH_LUA ${LUA_INCLUDE_DIR})
MESSAGE(STATUS "${PATH_LUA}")
ENDIF(WIN32)
IF(PATH_LUA)
MESSAGE(STATUS " Found Lua...")
INCLUDE_DIRECTORIES(${PATH_LUA})
SET(name_liblua lua)
IF(WIN32)
SET(name_liblua lua51)
ENDIF(WIN32)
IF(WIN32)
FIND_LIBRARY(LIB_LUA ${name_liblua} PATHS ${PATH_LUA}/../lib NO_DEFAULT_PATH)
FIND_LIBRARY(LIB_LUA ${name_liblua} PATHS ${PATH_LUA}/../lib)
ELSE(UNIX)
SET(LIB_LUA ${LUA_LIBRARIES})
ENDIF(WIN32)
IF(LIB_LUA)
MESSAGE(STATUS " [ OK ] lib ${LIB_LUA}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_LUA})
ELSE(LIB_LUA)
MESSAGE(STATUS " [FAILED] lib ${name_liblua}")
ENDIF(LIB_LUA)
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyLua)
ELSE(PATH_LUA)
MESSAGE(STATUS " FAILED to find Lua")
ENDIF(PATH_LUA)
# ---------------------------------
# Finds Matlab toolkit
# ---------------------------------
SET(Matlab_EXECUTABLE "Matlab_EXECUTABLE-NOTFOUND")
IF (WIN32)
FIND_PROGRAM(Matlab_EXECUTABLE MATLAB)
ENDIF(WIN32)
IF (UNIX)
FIND_PROGRAM(Matlab_EXECUTABLE matlab)
ENDIF(UNIX)
IF(UNIX OR WIN32)
IF(UNIX AND NOT Matlab_EXECUTABLE)
# Alternative way to try to find matlab
FILE(GLOB_RECURSE Executable_Candidates "/usr/local/matlab*/matlab")
IF(Executable_Candidates)
LIST(GET Executable_Candidates 1 Matlab_EXECUTABLE)
ENDIF(Executable_Candidates)
ENDIF(UNIX AND NOT Matlab_EXECUTABLE)
IF(Matlab_EXECUTABLE)
GET_FILENAME_COMPONENT(Matlab_ROOT ${Matlab_EXECUTABLE} PATH)
SET(Matlab_ROOT ${Matlab_ROOT}/..)
FIND_PATH(Matlab_INCLUDE "mex.h" PATHS ${Matlab_ROOT}/extern/include ${Matlab_ROOT}/extern/include/extern)
IF(Matlab_INCLUDE)
IF(UNIX)
SET(Matlab_LIBRARIES mex mx eng)
IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
SET(Matlab_LIB_DIRECTORIES ${Matlab_ROOT}/bin/glnx86)
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
SET(Matlab_LIB_DIRECTORIES ${Matlab_ROOT}/bin/glnxa64)
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)
ENDIF(UNIX)
IF(WIN32)
SET(Matlab_LIBRARIES libmex libmx libeng) #mclmcrrt
SET(Matlab_LIB_DIRECTORIES ${Matlab_ROOT}/extern/lib/win32/microsoft)
# for delayed importation on windows
TARGET_LINK_LIBRARIES(${PROJECT_NAME} Delayimp )
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/DELAYLOAD:libeng.dll /DELAYLOAD:libmx.dll")
# /DELAYLOAD:libmex.dll /DELAYLOAD:mclmcrrt.dll --> useless, no import
ENDIF(WIN32)
SET(Matlab_FOUND TRUE)
ELSE(Matlab_INCLUDE)
ENDIF(Matlab_INCLUDE)
ENDIF(Matlab_EXECUTABLE)
ENDIF(UNIX OR WIN32)
IF(Matlab_FOUND)
MESSAGE(STATUS " Found Matlab [${Matlab_EXECUTABLE}]")
SET(Matlab_LIB_FOUND TRUE)
INCLUDE_DIRECTORIES(${Matlab_INCLUDE})
FOREACH(Matlab_LIB ${Matlab_LIBRARIES})
SET(Matlab_LIB1 "Matlab_LIB1-NOTFOUND")
FIND_LIBRARY(Matlab_LIB1 NAMES ${Matlab_LIB} PATHS ${Matlab_LIB_DIRECTORIES} NO_DEFAULT_PATH)
FIND_LIBRARY(Matlab_LIB1 NAMES ${Matlab_LIB})
IF(Matlab_LIB1)
MESSAGE(STATUS " [ OK ] Third party lib ${Matlab_LIB1}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${Matlab_LIB1})
ELSE(Matlab_LIB1)
MESSAGE(STATUS " [FAILED] Third party lib ${Matlab_LIB}")
SET(Matlab_LIB_FOUND FALSE)
ENDIF(Matlab_LIB1)
ENDFOREACH(Matlab_LIB)
IF(Matlab_LIB_FOUND)
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyMatlab)
ELSE(Matlab_LIB_FOUND)
MESSAGE(STATUS " FAILED to find Matlab Libs, the plugins won't be built. Please ensure you have a valid MATLAB installation (32 bits only).")
ENDIF(Matlab_LIB_FOUND)
ELSE(Matlab_FOUND)
MESSAGE(STATUS " FAILED to find Matlab...")
ENDIF(Matlab_FOUND)
\ No newline at end of file
# ---------------------------------
# Finds OpenAL, ALUT, OGGVORBIS
# Adds library to target
# Adds include path
# ---------------------------------
IF(WIN32)
FIND_PATH(PATH_OPENAL include/al.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/openal ${OV_CUSTOM_DEPENDENCIES_PATH} NO_DEFAULT_PATH)
FIND_PATH(PATH_ALUT include/AL/alut.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/freealut ${OV_CUSTOM_DEPENDENCIES_PATH})
FIND_PATH(PATH_OGG include/ogg/ogg.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/libogg ${OV_CUSTOM_DEPENDENCIES_PATH})
FIND_PATH(PATH_VORBIS include/vorbis/vorbisfile.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/libvorbis ${OV_CUSTOM_DEPENDENCIES_PATH})
SET(BUILDTYPE_PATH_DEBUG "debug")
SET(BUILDTYPE_PATH_RELEASE "release")
IF(PATH_OPENAL)
MESSAGE(STATUS " Found OpenAL...")
FIND_LIBRARY(LIB_OPENAL OpenAL32 PATHS ${PATH_OPENAL}/libs/Win32 NO_DEFAULT_PATH)
IF(LIB_OPENAL)
MESSAGE(STATUS " [ OK ] lib ${LIB_OPENAL}")
ELSE(LIB_OPENAL)
MESSAGE(STATUS " [FAILED] lib OpenAL32")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(LIB_OPENAL)
ELSE(PATH_OPENAL)
MESSAGE(STATUS " FAILED to find OpenAL")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(PATH_OPENAL)
IF(PATH_ALUT)
FIND_LIBRARY(LIB_ALUT alut PATHS ${PATH_ALUT}/lib NO_DEFAULT_PATH)
IF(LIB_ALUT)
MESSAGE(STATUS " [ OK ] lib ${LIB_ALUT}")
ELSE(LIB_ALUT)
MESSAGE(STATUS " [FAILED] lib alut")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(LIB_ALUT)
ELSE(PATH_ALUT)
MESSAGE(STATUS " -- FAILED to find ALUT")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(PATH_ALUT)
IF(PATH_OGG)
FIND_LIBRARY(LIB_OGG_RELEASE libogg PATHS ${PATH_OGG}/win32/lib/${BUILDTYPE_PATH_RELEASE} NO_DEFAULT_PATH)
IF(LIB_OGG_RELEASE)
MESSAGE(STATUS " [ OK ] lib ${LIB_OGG_RELEASE} (release)")
ELSE(LIB_OGG_RELEASE)
MESSAGE(STATUS " [FAILED] lib ogg (release)")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(LIB_OGG_RELEASE)
FIND_LIBRARY(LIB_OGG_DEBUG libogg PATHS ${PATH_OGG}/win32/lib/${BUILDTYPE_PATH_DEBUG} NO_DEFAULT_PATH)
IF(LIB_OGG_DEBUG)
MESSAGE(STATUS " [ OK ] lib ${LIB_OGG_DEBUG} (debug)")
ELSE(LIB_OGG_DEBUG)
MESSAGE(STATUS " [FAILED] lib ogg (debug)")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(LIB_OGG_DEBUG)
ELSE(PATH_OGG)
MESSAGE(STATUS " -- FAILED to find OGG")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(PATH_OGG)
IF(PATH_VORBIS)
FIND_LIBRARY(LIB_VORBIS_RELEASE libvorbis PATHS ${PATH_VORBIS}/win32/lib/${BUILDTYPE_PATH_RELEASE} NO_DEFAULT_PATH)
IF(LIB_VORBIS_RELEASE)
MESSAGE(STATUS " [ OK ] lib ${LIB_VORBIS_RELEASE} (release)")
ELSE(LIB_VORBIS_RELEASE)
MESSAGE(STATUS " [FAILED] lib vorbis (release)")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(LIB_VORBIS_RELEASE)
FIND_LIBRARY(LIB_VORBIS_DEBUG libvorbis PATHS ${PATH_VORBIS}/win32/lib/${BUILDTYPE_PATH_DEBUG} NO_DEFAULT_PATH)
IF(LIB_VORBIS_DEBUG)
MESSAGE(STATUS " [ OK ] lib ${LIB_VORBIS_DEBUG} (debug)")
ELSE(LIB_VORBIS_DEBUG)
MESSAGE(STATUS " [FAILED] lib vorbis (debug)")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(LIB_VORBIS_DEBUG)
FIND_LIBRARY(LIB_VORBISFILE_RELEASE libvorbisfile PATHS ${PATH_VORBIS}/win32/lib/${BUILDTYPE_PATH_RELEASE} NO_DEFAULT_PATH)
IF(LIB_VORBISFILE_RELEASE)
MESSAGE(STATUS " [ OK ] lib ${LIB_VORBISFILE_RELEASE} (release)")
ELSE(LIB_VORBISFILE_RELEASE)
MESSAGE(STATUS " [FAILED] lib vorbisfile (release)")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(LIB_VORBISFILE_RELEASE)
FIND_LIBRARY(LIB_VORBISFILE_DEBUG libvorbisfile PATHS ${PATH_VORBIS}/win32/lib/${BUILDTYPE_PATH_DEBUG} NO_DEFAULT_PATH)
IF(LIB_VORBISFILE_DEBUG)
MESSAGE(STATUS " [ OK ] lib ${LIB_VORBISFILE_DEBUG} (debug)")
ELSE(LIB_VORBISFILE_DEBUG)
MESSAGE(STATUS " [FAILED] lib vorbisfile (debug)")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(LIB_VORBISFILE_DEBUG)
ELSE(PATH_VORBIS)
MESSAGE(STATUS " -- FAILED to find VORBIS")
SET(OPENAL_MISSED_SOMETHING YES)
ENDIF(PATH_VORBIS)
IF(OPENAL_MISSED_SOMETHING)
MESSAGE(STATUS " FAILED to find everything required by OpenAL")
ELSE(OPENAL_MISSED_SOMETHING)
MESSAGE(STATUS " Found OpenAL and all its library dependencies...")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_OPENAL})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_ALUT})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} optimized ${LIB_OGG_RELEASE})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} optimized ${LIB_VORBIS_RELEASE})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} optimized ${LIB_VORBISFILE_RELEASE})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} debug ${LIB_OGG_DEBUG})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} debug ${LIB_VORBIS_DEBUG})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} debug ${LIB_VORBISFILE_DEBUG})
INCLUDE_DIRECTORIES(${PATH_OPENAL}/include ${PATH_ALUT}/include ${PATH_OGG}/include ${PATH_VORBIS}/include)
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyOpenAL)
ENDIF(OPENAL_MISSED_SOMETHING)
ENDIF(WIN32)
IF(UNIX)
INCLUDE("FindThirdPartyPkgConfig")
pkg_check_modules(ALUT freealut)
IF(ALUT_FOUND)
MESSAGE(STATUS " Found ALUT...")
INCLUDE_DIRECTORIES(${ALUT_INCLUDE_DIRS})
ADD_DEFINITIONS(${ALUT_CFLAGS})
ADD_DEFINITIONS(${ALUT_CFLAGS_OTHERS})
# LINK_DIRECTORIES(${ALUT_LIBRARY_DIRS})
FOREACH(ALUT_LIB ${ALUT_LIBRARIES})
SET(ALUT_LIB1 "ALUT_LIB1-NOTFOUND")
FIND_LIBRARY(ALUT_LIB1 NAMES ${ALUT_LIB} PATHS ${ALUT_LIBRARY_DIRS} ${ALUT_LIBDIR} NO_DEFAULT_PATH)
FIND_LIBRARY(ALUT_LIB1 NAMES ${ALUT_LIB})
IF(ALUT_LIB1)
MESSAGE(STATUS " [ OK ] Third party lib ${ALUT_LIB1}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${ALUT_LIB1})
ELSE(ALUT_LIB1)
MESSAGE(STATUS " [FAILED] Third party lib ${ALUT_LIB}")
ENDIF(ALUT_LIB1)
ENDFOREACH(ALUT_LIB)
ELSE(ALUT_FOUND)
MESSAGE(STATUS " FAILED to find ALUT...")
ENDIF(ALUT_FOUND)
pkg_check_modules(VORBIS vorbisfile)
IF(VORBIS_FOUND)
MESSAGE(STATUS " Found VORBIS...")
INCLUDE_DIRECTORIES(${VORBIS_INCLUDE_DIRS})
ADD_DEFINITIONS(${VORBIS_CFLAGS})
ADD_DEFINITIONS(${VORBIS_CFLAGS_OTHERS})
# LINK_DIRECTORIES(${VORBIS_LIBRARY_DIRS})
FOREACH(VORBIS_LIB ${VORBIS_LIBRARIES})
SET(VORBIS_LIB1 "VORBIS_LIB1-NOTFOUND")
FIND_LIBRARY(VORBIS_LIB1 NAMES ${VORBIS_LIB} PATHS ${VORBIS_LIBRARY_DIRS} ${VORBIS_LIBDIR} NO_DEFAULT_PATH)
FIND_LIBRARY(VORBIS_LIB1 NAMES ${VORBIS_LIB})
IF(VORBIS_LIB1)
MESSAGE(STATUS " [ OK ] Third party lib ${VORBIS_LIB1}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${VORBIS_LIB1})
ELSE(VORBIS_LIB1)
MESSAGE(STATUS " [FAILED] Third party lib ${VORBIS_LIB}")
ENDIF(VORBIS_LIB1)
ENDFOREACH(VORBIS_LIB)
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyOpenAL)
ELSE(VORBIS_FOUND)
MESSAGE(STATUS " FAILED to find VORBIS...")
ENDIF(VORBIS_FOUND)
ENDIF(UNIX)
# ---------------------------------
# Finds Python
# Adds library to target
# Adds include path
# ---------------------------------
IF(WIN32)
FIND_PATH(PATH_PYTHON include/Python.h PATHS "c:/python27" ${OV_CUSTOM_DEPENDENCIES_PATH} [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath])
IF(PATH_PYTHON)
MESSAGE(STATUS " Found Python...")
INCLUDE_DIRECTORIES(${PATH_PYTHON}/include)
FILE(GLOB_RECURSE lib_files ${PATH_PYTHON}/libs/*.lib)
FOREACH(PYTHON_LIB ${lib_files})
MESSAGE(STATUS " [ OK ] Third party lib ${PYTHON_LIB}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} debug ${PYTHON_LIB})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} optimized ${PYTHON_LIB})
ENDFOREACH(PYTHON_LIB)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} Delayimp )
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/DELAYLOAD:python27.dll")
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyPython)
ELSE(PATH_PYTHON)
MESSAGE(STATUS " FAILED to find Python")
ENDIF(PATH_PYTHON)
ENDIF(WIN32)
IF(UNIX)
# Prefert Python 2.7 supported by OV python-plugin
SET(Python_ADDITIONAL_VERSIONS 2.7)
INCLUDE("FindPythonLibs")
IF(PYTHONLIBS_FOUND)
MESSAGE(STATUS " Found Python...")
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PYTHON_LIBRARIES})
# FOREACH(PYTHON_LIB ${PYTHON_LIBRARIES})
# SET(PYTHON_LIB1 "PYTHON_LIB1-NOTFOUND")
# FIND_LIBRARY(PYTHON_LIB1 NAMES ${PYTHON_LIB} PATHS NO_DEFAULT_PATH)
# FIND_LIBRARY(PYTHON_LIB1 NAMES ${PYTHON_LIB} PATHS "/")
# IF(PYTHON_LIB1)
# MESSAGE(STATUS " [ OK ] Third party lib ${PYTHON_LIB1}")
# TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PYTHON_LIB1})
# ELSE(PYTHON_LIB1)
# MESSAGE(STATUS " [FAILED] Third party lib ${PYTHON_LIB}")
# ENDIF(PYTHON_LIB1)
# ENDFOREACH(PYTHON_LIB)
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyPython)
ELSE(PYTHONLIBS_FOUND)
MESSAGE(STATUS " FAILED to find Python")
ENDIF(PYTHONLIBS_FOUND)
ENDIF(UNIX)
# ---------------------------------
# Adds VRPN library to the target project
# Adds include path
# Requires FindThirdPartyVRPN_Check.cmake to have been run successfully before
# ---------------------------------
IF(PATH_VRPN)
# Find all library paths
IF(WIN32)
FIND_LIBRARY(LIB_VRPN vrpn PATHS ${PATH_VRPN}/lib NO_DEFAULT_PATH)
FIND_LIBRARY(LIB_VRPN vrpn PATHS ${PATH_VRPN}/lib)
IF(LIB_VRPN)
MESSAGE(STATUS " [ OK ] lib ${LIB_VRPN}")
ELSE(LIB_VRPN)
MESSAGE(STATUS " [FAILED] lib vrpn")
RETURN()
ENDIF(LIB_VRPN)
ENDIF(WIN32)
IF(UNIX)
FIND_LIBRARY(LIB_VRPNSERVER vrpnserver PATHS ${PATH_VRPN}/lib NO_DEFAULT_PATH)
FIND_LIBRARY(LIB_VRPNSERVER vrpnserver PATHS ${PATH_VRPN}/lib)
IF(LIB_VRPNSERVER)
MESSAGE(STATUS " [ OK ] lib ${LIB_VRPNSERVER}")
ELSE(LIB_VRPNSERVER)
MESSAGE(STATUS " [FAILED] lib vrpnserver")
RETURN()
ENDIF(LIB_VRPNSERVER)
ENDIF(UNIX)
FIND_LIBRARY(LIB_QUAT quat PATHS ${PATH_VRPN}/lib NO_DEFAULT_PATH)
FIND_LIBRARY(LIB_QUAT quat PATHS ${PATH_VRPN}/lib)
IF(LIB_QUAT)
MESSAGE(STATUS " [ OK ] lib ${LIB_QUAT}")
ELSE(LIB_QUAT)
MESSAGE(STATUS " [FAILED] lib quat")
RETURN()
ENDIF(LIB_QUAT)
# If we reach here, everything has been found, add
INCLUDE_DIRECTORIES(${PATH_VRPN}/include)
IF(WIN32)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_VRPN})
ENDIF(WIN32)
IF(UNIX)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_VRPNSERVER})
ENDIF(UNIX)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_QUAT})
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyVRPN)
ELSE(PATH_VRPN)
MESSAGE(AUTHOR_WARNING "Should not run FindThirdPartyVRPN without FindThirdPartyVRPN_Check passing successfully first")
ENDIF(PATH_VRPN)
# ---------------------------------
# Finds VRPN
# Sets PATH_VRPN if found
# ---------------------------------
# The first ${..}/vrpn path is for Windows, the second ${..}/ for Linux
FIND_PATH(PATH_VRPN include/vrpn_BaseClass.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/vrpn ${OV_CUSTOM_DEPENDENCIES_PATH} NO_DEFAULT_PATH)
FIND_PATH(PATH_VRPN include/vrpn_BaseClass.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/vrpn ${OV_CUSTOM_DEPENDENCIES_PATH})
IF(PATH_VRPN)
MESSAGE(STATUS " Found VRPN...")
ELSE(PATH_VRPN)
MESSAGE(STATUS " FAILED to find VRPN")
ENDIF(PATH_VRPN)
#!/bin/bash
#
# This script is meant to be launched from inside an OpenViBE application (such as a scenario in Designer)
#
CALLCMD=$1
shift
ov_run_bg=0
if [ "$1" == "--run-bg" ]; then
ov_run_bg=1
shift
fi