Commit 01668a67 authored by Alexis Girault's avatar Alexis Girault

COMP: Fix FindVRPN when USE_OMNI

FindVRPN: The order in which the libraries were
found was creating an compilation error during
linking on Linux, as well as windows when being
read from an external project.

iMSTKConfig.cmake.in: ${PROJECT_NAME} would not be
set to "iMSTK" from an external project.

External_VRPN: VRPN_BUILD_SERVERS:BOOL was defined
twice in imstk_add_external_project(VRPN)
parent 53c929da
...@@ -37,7 +37,6 @@ imstk_add_external_project( VRPN ...@@ -37,7 +37,6 @@ imstk_add_external_project( VRPN
-DBUILD_TESTING:BOOL=OFF -DBUILD_TESTING:BOOL=OFF
-DVRPN_SUBPROJECT_BUILD:BOOL=ON -DVRPN_SUBPROJECT_BUILD:BOOL=ON
-DVRPN_BUILD_CLIENTS:BOOL=OFF -DVRPN_BUILD_CLIENTS:BOOL=OFF
-DVRPN_BUILD_SERVERS:BOOL=OFF
-DVRPN_BUILD_CLIENT_LIBRARY:BOOL=ON -DVRPN_BUILD_CLIENT_LIBRARY:BOOL=ON
-DVRPN_BUILD_SERVER_LIBRARY:BOOL=ON -DVRPN_BUILD_SERVER_LIBRARY:BOOL=ON
-DVRPN_INSTALL:BOOL=OFF -DVRPN_INSTALL:BOOL=OFF
......
...@@ -49,17 +49,51 @@ if(WIN32) ...@@ -49,17 +49,51 @@ if(WIN32)
list(APPEND VRPN_INCLUDE_DIRS ${LIBFTD2XX_INCLUDE_DIR}) list(APPEND VRPN_INCLUDE_DIRS ${LIBFTD2XX_INCLUDE_DIR})
endif() endif()
#-----------------------------------------------------------------------------
# Phantom Omni support
#-----------------------------------------------------------------------------
if(${iMSTK_USE_OMNI})
find_library(VRPN_PHANTOM_LIBRARY
NAMES
vrpn_phantom
vrpn_phantomd
)
mark_as_advanced(VRPN_PHANTOM_LIBRARY)
list(APPEND VRPN_LIBRARIES ${VRPN_PHANTOM_LIBRARY})
list(APPEND CMAKE_MODULE_PATH ${VRPN_INCLUDE_DIR}/cmake)
find_package(OpenHaptics)
list(APPEND VRPN_LIBRARIES ${OPENHAPTICS_LIBRARIES})
list(APPEND VRPN_INCLUDE_DIRS ${OPENHAPTICS_INCLUDE_DIRS})
list(REMOVE_ITEM CMAKE_MODULE_PATH ${VRPN_INCLUDE_DIR}/cmake)
find_package(OpenGL)
list(APPEND VRPN_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
list(APPEND VRPN_LIBRARIES ${OPENGL_LIBRARY})
endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Find library # Find library
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
find_library(VRPN_LIBRARY find_library(VRPN_LIBRARY
NAMES NAMES
vrpnserver vrpn
vrpnserverd vrpnd
) )
mark_as_advanced(VRPN_LIBRARY) mark_as_advanced(VRPN_LIBRARY)
list(APPEND VRPN_LIBRARIES ${VRPN_LIBRARY}) list(APPEND VRPN_LIBRARIES ${VRPN_LIBRARY})
find_library(VRPNSERVER_LIBRARY
NAMES
vrpnserver
vrpnserverd
)
mark_as_advanced(VRPNSERVER_LIBRARY)
list(APPEND VRPN_LIBRARIES ${VRPNSERVER_LIBRARY})
find_library(QUAT_LIBRARY find_library(QUAT_LIBRARY
NAMES NAMES
quat quat
...@@ -109,26 +143,6 @@ endif() ...@@ -109,26 +143,6 @@ endif()
list(APPEND VRPN_LIBRARIES ${HIDAPI_LIBRARY}) list(APPEND VRPN_LIBRARIES ${HIDAPI_LIBRARY})
mark_as_advanced(HIDAPI_LIBRARY) mark_as_advanced(HIDAPI_LIBRARY)
#-----------------------------------------------------------------------------
# Phantom Omni support
#-----------------------------------------------------------------------------
if(${${PROJECT_NAME}_USE_OMNI})
list(APPEND CMAKE_MODULE_PATH ${VRPN_INCLUDE_DIR}/cmake)
find_package(OpenHaptics)
list(REMOVE_ITEM CMAKE_MODULE_PATH ${VRPN_INCLUDE_DIR}/cmake)
find_library(VRPN_PHANTOM_LIBRARY
NAMES
vrpn_phantom
vrpn_phantomd
)
mark_as_advanced(VRPN_PHANTOM_LIBRARY)
list(APPEND VRPN_LIBRARIES ${VRPN_PHANTOM_LIBRARY} ${OPENHAPTICS_LIBRARIES})
list(APPEND VRPN_INCLUDE_DIRS ${OPENHAPTICS_INCLUDE_DIRS})
endif()
message(STATUS "OPENHAPTICS_LIBRARIES : ${OPENHAPTICS_LIBRARIES}")
message(STATUS "OPENHAPTICS_INCLUDE_DIRS : ${OPENHAPTICS_INCLUDE_DIRS}")
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Find package # Find package
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
......
...@@ -36,7 +36,7 @@ include( ${VTK_USE_FILE} ) ...@@ -36,7 +36,7 @@ include( ${VTK_USE_FILE} )
find_package( VRPN REQUIRED ) find_package( VRPN REQUIRED )
include_directories( ${VRPN_INCLUDE_DIRS} ) include_directories( ${VRPN_INCLUDE_DIRS} )
add_definitions( -DVRPN_USE_LIBNIFALCON ) add_definitions( -DVRPN_USE_LIBNIFALCON )
if(${PROJECT_NAME}_USE_OMNI) if(iMSTK_USE_OMNI)
add_definitions( -DiMSTK_USE_OPENHAPTICS ) add_definitions( -DiMSTK_USE_OPENHAPTICS )
add_definitions( -DVRPN_USE_PHANTOM_SERVER ) add_definitions( -DVRPN_USE_PHANTOM_SERVER )
else() else()
......
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