FindOpenViBE.cmake 854 Bytes
Newer Older
Jozef Legeny's avatar
Jozef Legeny committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# ---------------------------------
# Finds OpenViBE
# Adds library to target
# Adds include path
# ---------------------------------
OPTION(DYNAMIC_LINK_OPENVIBE "Dynamically link OpenViBE" ON)

IF(DYNAMIC_LINK_OPENVIBE)
	ADD_DEFINITIONS(-DOV_Shared)
ENDIF(DYNAMIC_LINK_OPENVIBE)

IF(DYNAMIC_LINK_OPENVIBE)
	SET(OPENVIBE_LINKING "")
ELSE(DYNAMIC_LINK_OPENVIBE)
	SET(OPENVIBE_LINKING "-static")
ENDIF(DYNAMIC_LINK_OPENVIBE)

Jozef Legeny's avatar
Jozef Legeny committed
18
set(SRC_DIR ${OV_BASE_DIR}/openvibe)
Jozef Legeny's avatar
Jozef Legeny committed
19

Jussi Lindgren's avatar
Jussi Lindgren committed
20
FIND_PATH(PATH_OPENVIBE include/openvibe/ov_all.h PATHS ${SRC_DIR} NO_DEFAULT_PATH)
Jozef Legeny's avatar
Jozef Legeny committed
21 22
IF(PATH_OPENVIBE)
	MESSAGE(STATUS "  Found OpenViBE...")
Jozef Legeny's avatar
Jozef Legeny committed
23
	INCLUDE_DIRECTORIES(${PATH_OPENVIBE}/include/)
Jozef Legeny's avatar
Jozef Legeny committed
24 25 26 27 28 29 30 31 32

	TARGET_LINK_LIBRARIES(${PROJECT_NAME} openvibe${OPENVIBE_LINKING})
	
	ADD_DEFINITIONS(-DTARGET_HAS_OpenViBE)
ELSE(PATH_OPENVIBE)
	MESSAGE(STATUS "  FAILED to find OpenViBE...")
ENDIF(PATH_OPENVIBE)