PROJECT(VRPNHD)

FIND_PACKAGE(VRPN)

## VRPN
IF(NOT VRPN_FOUND)
	MESSAGE(STATUS "Could not find VRPN libraries. Disabling the VRPNHD plugin")
	RETURN()
ENDIF()

INCLUDE_DIRECTORIES(${VRPN_INCLUDE_DIR})

SET(DIRECTORY source)
### list all filenames of the directory here ###
SET(SOURCES_LIST
	${DIRECTORY}/VRPNHDPlugin.C
	${DIRECTORY}/VRPNHDDriver.C
)

SET(RCC_SOURCES_LIST
	${DIRECTORY}/logo.qrc
)

SET(DIRECTORY include)
### the list of all files requiring a moc run ###
SET(MOC_SOURCES_LIST
	${DIRECTORY}/VRPNHDPlugin.h
)

QT4_WRAP_CPP(MOC_OUTFILES ${MOC_SOURCES_LIST})
QT4_ADD_RESOURCES(RCC_OUTFILES ${RCC_SOURCES_LIST})
QT4_WRAP_UI(UIC_OUTFILES ${UI_SOURCES_LIST})

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})

ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)

ADD_LIBRARY(pluginVRPNHD SHARED
	${SOURCES_LIST}
	${MOC_OUTFILES}
	${RCC_OUTFILES}
	${UIC_OUTFILES}
)

SET_TARGET_PROPERTIES(pluginVRPNHD PROPERTIES PREFIX "")

INSTALL(TARGETS pluginVRPNHD
	COMPONENT "${COMPONENT_PLUGINS}"
	RUNTIME DESTINATION "${BALL_PLUGIN_INSTALL_DIRECTORY}"
	LIBRARY DESTINATION "${BALL_PLUGIN_INSTALL_DIRECTORY}"
)

TARGET_LINK_LIBRARIES(pluginVRPNHD BALL VIEW ${VRPN_LIBRARY})
