Commit f6d58380 authored by Jussi Lindgren's avatar Jussi Lindgren

build:

 * OpenViBE will now compile without VRPN. If VRPN is not present, the depending modules will be skipped.
 * Split FindThirdPartyVRPN to two parts, one that looks for the component, and another that adds the libraries/includes etc.


git-svn-id: svn://scm.gforge.inria.fr/svn/openvibe@3558 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f
parent 04b00955
# ---------------------------------
# Finds VRPN
# Adds library to target
# Adds VRPN library to the target project
# Adds include path
# Requires FindThirdPartyVRPN_Check.cmake to have been run successfully before
# ---------------------------------
FIND_PATH(PATH_VRPN include/vrpn_BaseClass.h PATHS ${OV_WIN32_DEP_DIR}/vrpn $ENV{VRPN_ROOT} NO_DEFAULT_PATH)
FIND_PATH(PATH_VRPN include/vrpn_BaseClass.h PATHS ${OV_WIN32_DEP_DIR}/vrpn $ENV{VRPN_ROOT})
IF(PATH_VRPN)
MESSAGE(STATUS " Found VRPN...")
INCLUDE_DIRECTORIES(${PATH_VRPN}/include)
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}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${LIB_VRPN})
ELSE(LIB_VRPN)
MESSAGE(STATUS " [FAILED] lib vrpn")
RETURN()
ENDIF(LIB_VRPN)
ENDIF(WIN32)
......@@ -25,9 +23,9 @@ IF(PATH_VRPN)
FIND_LIBRARY(LIB_VRPNSERVER vrpnserver PATHS ${PATH_VRPN}/lib)
IF(LIB_VRPNSERVER)
MESSAGE(STATUS " [ OK ] lib ${LIB_VRPNSERVER}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${LIB_VRPNSERVER})
ELSE(LIB_VRPNSERVER)
MESSAGE(STATUS " [FAILED] lib vrpnserver")
RETURN()
ENDIF(LIB_VRPNSERVER)
ENDIF(UNIX)
......@@ -35,12 +33,23 @@ IF(PATH_VRPN)
FIND_LIBRARY(LIB_QUAT quat PATHS ${PATH_VRPN}/lib)
IF(LIB_QUAT)
MESSAGE(STATUS " [ OK ] lib ${LIB_QUAT}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${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}-dynamic ${LIB_VRPN})
ENDIF(WIN32)
IF(UNIX)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${LIB_VRPNSERVER})
ENDIF(UNIX)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${LIB_QUAT})
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyVRPN)
ELSE(PATH_VRPN)
MESSAGE(STATUS " FAILED to find VRPN")
MESSAGE(AUTHOR_WARNING "Should not run FindThirdPartyVRPN without FindThirdPartyVRPN_Check passing successfully first")
ENDIF(PATH_VRPN)
# ---------------------------------
# Finds VRPN
# Sets PATH_VRPN if found
# ---------------------------------
FIND_PATH(PATH_VRPN include/vrpn_BaseClass.h PATHS ${OV_WIN32_DEP_DIR}/vrpn $ENV{VRPN_ROOT} NO_DEFAULT_PATH)
FIND_PATH(PATH_VRPN include/vrpn_BaseClass.h PATHS ${OV_WIN32_DEP_DIR}/vrpn $ENV{VRPN_ROOT})
IF(PATH_VRPN)
MESSAGE(STATUS " Found VRPN...")
ELSE(PATH_VRPN)
MESSAGE(STATUS " FAILED to find VRPN")
ENDIF(PATH_VRPN)
......@@ -5,6 +5,12 @@ SET(PROJECT_VERSION_MINOR x)
SET(PROJECT_VERSION_PATCH x)
SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
INCLUDE("FindThirdPartyVRPN_Check")
IF(NOT PATH_VRPN)
MESSAGE(STATUS " --> Not building ${PROJECT_NAME}")
RETURN()
ENDIF(NOT PATH_VRPN)
# The following is required because one of our dependencies hard-links against specific boost libs on Win, so we need to tell the linker the path to them.
# Due to CMake, this needs to be done _before_ creating the target.
INCLUDE("OvAddBoostLinkDir")
......
......@@ -5,6 +5,12 @@ SET(PROJECT_VERSION_MINOR x)
SET(PROJECT_VERSION_PATCH x)
SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
INCLUDE("FindThirdPartyVRPN_Check")
IF(NOT PATH_VRPN)
MESSAGE(STATUS " --> Not building ${PROJECT_NAME}")
RETURN()
ENDIF(NOT PATH_VRPN)
# The following is required because one of our dependencies hard-links against specific boost libs on Win, so we need to tell the linker the path to them.
# Due to CMake, this needs to be done _before_ creating the target.
INCLUDE("OvAddBoostLinkDir")
......
......@@ -5,6 +5,12 @@ SET(PROJECT_VERSION_MINOR x)
SET(PROJECT_VERSION_PATCH x)
SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
INCLUDE("FindThirdPartyVRPN_Check")
IF(NOT PATH_VRPN)
MESSAGE(STATUS " --> Not building ${PROJECT_NAME}")
RETURN()
ENDIF(NOT PATH_VRPN)
FILE(GLOB_RECURSE source_files src/*.cpp src/*.h src/*.inl)
ADD_EXECUTABLE(${PROJECT_NAME}-dynamic ${source_files})
......
......@@ -5,6 +5,12 @@ SET(PROJECT_VERSION_MINOR x)
SET(PROJECT_VERSION_PATCH x)
SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
INCLUDE("FindThirdPartyVRPN_Check")
IF(NOT PATH_VRPN)
MESSAGE(STATUS " --> Not building ${PROJECT_NAME}")
RETURN()
ENDIF(NOT PATH_VRPN)
FILE(GLOB_RECURSE source_files src/*.cpp src/*.h src/*.inl)
ADD_LIBRARY(${PROJECT_NAME}-dynamic SHARED ${source_files})
SET_TARGET_PROPERTIES(${PROJECT_NAME}-dynamic PROPERTIES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment