summaryrefslogtreecommitdiffstats
path: root/cmake/FindFgLib5.cmake
blob: cba0002842029916ed91ea60a9d6eba4414e8ac1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FILE(TO_CMAKE_PATH "$ENV{SISODIR5}" SISODIR5)

IF (FGLIB5_INCLUDE_DIR AND FGLIB5_LIBRARY)
	SET(FGLIB5_FIND_QUIETLY TRUE)
ENDIF (FGLIB5_INCLUDE_DIR AND FGLIB5_LIBRARY)

FIND_PATH(FGLIB5_INCLUDE_DIR fgrab_define.h
	PATHS
	"$ENV{FGLIB5}/include"
	"${CMAKE_INSTALL_PREFIX}/include"
	"${SISODIR5}/include"
	"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Silicon Software GmbH\\Runtime5;Info]/include"
)

INCLUDE(SisoLibDir)
SISO_LIB_DIR("${SISODIR5}/lib" LIB_DIRS COMPILER_LIB_DIR)

FIND_LIBRARY(FGLIB5_LIBRARY NAMES fglib5
	PATHS
	"$ENV{FGLIB5}/lib"
	"$ENV{FGLIB5}"
	"${CMAKE_INSTALL_PREFIX}/lib"
	${LIB_DIRS}
	"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Silicon Software GmbH\\Runtime5;Info]/lib/${COMPILER_LIB_DIR}"
	"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Silicon Software GmbH\\Runtime5;Info]/lib"
)

IF(FGLIB5_INCLUDE_DIR AND FGLIB5_LIBRARY)
	SET(FGLIB5_FOUND TRUE)
ENDIF(FGLIB5_INCLUDE_DIR AND FGLIB5_LIBRARY)

IF(FGLIB5_FOUND)
	IF(NOT FGLIB5_FIND_QUIETLY)
		MESSAGE(STATUS "Found Framegrabber library version 5: ${FGLIB5_LIBRARY}")
	ENDIF(NOT FGLIB5_FIND_QUIETLY)
	SET(FGLIB5_LIBRARIES ${FGLIB5_LIBRARY})
ELSE(FGLIB5_FOUND)
	IF(FGLIB5_FIND_REQUIRED)
		IF(NOT FGLIB5_LIBRARY)
			MESSAGE(FATAL_ERROR "Framegrabber library version 5 not found")
		ENDIF(NOT FGLIB5_LIBRARY)
	ENDIF(FGLIB5_FIND_REQUIRED)
ENDIF(FGLIB5_FOUND)