diff options
-rw-r--r-- | cmake/FindFgLib5.cmake | 47 | ||||
-rw-r--r-- | cmake/SisoLibDir.cmake | 25 | ||||
-rw-r--r-- | plugins/pco/CMakeLists.txt | 12 |
3 files changed, 44 insertions, 40 deletions
diff --git a/cmake/FindFgLib5.cmake b/cmake/FindFgLib5.cmake index 3f6a0c1..79964b7 100644 --- a/cmake/FindFgLib5.cmake +++ b/cmake/FindFgLib5.cmake @@ -1,22 +1,17 @@ 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 +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" - "/opt/siso/include" ) INCLUDE(SisoLibDir) SISO_LIB_DIR("${SISODIR5}/lib" LIB_DIRS COMPILER_LIB_DIR) -FIND_LIBRARY(FGLIB5_LIBRARY NAMES fglib5 +FIND_LIBRARY(FgLib5_LIBRARY NAMES fglib5 PATHS "$ENV{FGLIB5}/lib" "$ENV{FGLIB5}" @@ -24,22 +19,28 @@ FIND_LIBRARY(FGLIB5_LIBRARY NAMES fglib5 ${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" - "/opt/siso/lib" ) -IF(FGLIB5_INCLUDE_DIR AND FGLIB5_LIBRARY) - SET(FGLIB5_FOUND TRUE) -ENDIF(FGLIB5_INCLUDE_DIR AND FGLIB5_LIBRARY) +IF (FgLib5_INCLUDE_DIR AND EXISTS "${FgLib5_INCLUDE_DIR}/fgrab_define.h") + FILE(STRINGS "${FgLib5_INCLUDE_DIR}/fgrab_define.h" FGLIB_H_VERSION REGEX "^#define[ \\t]*FGLIB_VERSION_STRING[ \\t]*\"[^\"]*\"") + IF (FGLIB_H_VERSION) + STRING(REGEX REPLACE "^#define FGLIB_VERSION_STRING[ \\t]*\"([^\"]*)\".*" "\\1" FgLib5_VERSION_STRING "${FGLIB_H_VERSION}") + ENDIF (FGLIB_H_VERSION) +ENDIF (FgLib5_INCLUDE_DIR AND EXISTS "${FgLib5_INCLUDE_DIR}/fgrab_define.h") + +INCLUDE(FindPackageHandleStandardArgs) +IF (CMAKE_VERSION VERSION_LESS 2.8.4) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(FgLib5 DEFAULT_MSG FGLIB5_LIBRARY FGLIB5_INCLUDE_DIR) +ELSE (CMAKE_VERSION VERSION_LESS 2.8.4) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(FgLib5 + REQUIRED_VARS FgLib5_LIBRARY FgLib5_INCLUDE_DIR + VERSION_VAR FgLib5_VERSION_STRING) +ENDIF (CMAKE_VERSION VERSION_LESS 2.8.4) + +SET(FgLib5_LIBRARIES ${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) +# backward compatibility +SET(FGLIB5_LIBRARY ${FgLib5_LIBRARY}) +SET(FGLIB5_LIBRARIES ${FgLib5_LIBRARIES}) +SET(FGLIB5_INCLUDE_DIR ${FgLib5_INCLUDE_DIR}) +SET(FGLIB5_FOUND ${FgLib5_FOUND}) diff --git a/cmake/SisoLibDir.cmake b/cmake/SisoLibDir.cmake index 371735e..594b2f9 100644 --- a/cmake/SisoLibDir.cmake +++ b/cmake/SisoLibDir.cmake @@ -46,7 +46,14 @@ MACRO (SISO_LIB_DIR BASE_DIR LIB_DIRS) ELSEIF (CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008 Win64") SET(TMP_MSVC 9) SET(TMP_MSVC_64 1) - ELSEIF (CMAKE_GENERATOR STREQUAL "NMake Makefiles" OR CMAKE_GENERATOR STREQUAL "MinGW Makefiles") + ELSEIF (CMAKE_GENERATOR STREQUAL "Visual Studio 10") + SET(TMP_MSVC 10) + SET(TMP_MSVC_64 0) + ELSEIF (CMAKE_GENERATOR STREQUAL "Visual Studio 10 Win64") + SET(TMP_MSVC 10) + SET(TMP_MSVC_64 1) + ELSEIF (CMAKE_GENERATOR STREQUAL "NMake Makefiles" OR CMAKE_GENERATOR STREQUAL "MinGW Makefiles" + OR CMAKE_GENERATOR STREQUAL "NMake Makefiles JOM") SET(TMP_MSVC_64 ${CMAKE_CL_64}) IF (MSVC_VERSION EQUAL 1400) SET(TMP_MSVC 8) @@ -59,18 +66,14 @@ MACRO (SISO_LIB_DIR BASE_DIR LIB_DIRS) ELSE (MSVC_VERSION EQUAL 1400) SET(TMP_MSVC 6) ENDIF (MSVC_VERSION EQUAL 1400) + ELSE (CMAKE_GENERATOR STREQUAL "Visual Studio 6") + MESSAGE(FATAL_ERROR "Compiler not detected in SisoLibDir.cmake") ENDIF (CMAKE_GENERATOR STREQUAL "Visual Studio 6") SET(TMP_DIRS "") - IF (TMP_MSVC GREATER 9) - LIST(APPEND TMP_DIRS "visualc2010") - ENDIF (TMP_MSVC GREATER 9) - IF (TMP_MSVC GREATER 8) - LIST(APPEND TMP_DIRS "visualc2008") - ENDIF (TMP_MSVC GREATER 8) IF (TMP_MSVC GREATER 7) - LIST(APPEND TMP_DIRS "visualc2005") + LIST(APPEND TMP_DIRS "visualc") ENDIF (TMP_MSVC GREATER 7) IF (TMP_MSVC GREATER 5 AND NOT TMP_MSVC_64) LIST(APPEND TMP_DIRS "visualc") @@ -79,7 +82,7 @@ MACRO (SISO_LIB_DIR BASE_DIR LIB_DIRS) IF (${ARGC} EQUAL 3) LIST(GET TMP_DIRS 0 TMPSTR) IF (TMP_MSVC_64) - SET(TMPSTR "${TMPSTR}_amd64") + SET(TMPSTR "${TMPSTR}") ENDIF (TMP_MSVC_64) set(${ARGV2} ${TMPSTR}) ENDIF (${ARGC} EQUAL 3) @@ -87,7 +90,7 @@ MACRO (SISO_LIB_DIR BASE_DIR LIB_DIRS) IF (NOT BASE_DIR STREQUAL "" AND NOT BASE_DIR STREQUAL "/lib") FOREACH (TMP_ITEM ${TMP_DIRS}) IF (TMP_MSVC_64) - LIST(APPEND ${LIB_DIRS} "${BASE_DIR}/${TMP_ITEM}_amd64") + LIST(APPEND ${LIB_DIRS} "${BASE_DIR}/${TMP_ITEM}") ELSE (TMP_MSVC_64) LIST(APPEND ${LIB_DIRS} "${BASE_DIR}/${TMP_ITEM}") ENDIF (TMP_MSVC_64) @@ -99,7 +102,7 @@ MACRO (SISO_LIB_DIR BASE_DIR LIB_DIRS) LIST(APPEND ${LIB_DIRS} ${BASE_DIR}) ENDIF (NOT BASE_DIR STREQUAL "" AND NOT BASE_DIR STREQUAL "/lib") IF (${ARGC} EQUAL 3) - set(${ARGV2} "") + set(${ARGV2} "interface") ENDIF (${ARGC} EQUAL 3) ENDIF (WIN32) IF (${LIB_DIRS}) diff --git a/plugins/pco/CMakeLists.txt b/plugins/pco/CMakeLists.txt index 1ab4c50..04c2e16 100644 --- a/plugins/pco/CMakeLists.txt +++ b/plugins/pco/CMakeLists.txt @@ -3,9 +3,9 @@ project(ucapco C) find_package(PCO) find_package(FgLib5) -find_package(ClSerMe4) +find_package(ClSerSis) -if (PCO_FOUND AND CLSERME4_FOUND AND FGLIB5_FOUND) +if (PCO_FOUND) set(UCA_CAMERA_NAME "pco") set(PLUGIN_VERSION "1.2.0") set(PLUGIN_REVISION "1") @@ -16,8 +16,8 @@ if (PCO_FOUND AND CLSERME4_FOUND AND FGLIB5_FOUND) ${CMAKE_CURRENT_BINARY_DIR}/../../package-plugin-${UCA_CAMERA_NAME}.sh) include_directories(${PCO_INCLUDE_DIRS} - ${CLSERME4_INCLUDE_DIR} - ${FGLIB5_INCLUDE_DIR} + ${clsersis_INCLUDE_DIR} + ${FgLib5_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${UCA_CONFIGDIR}) @@ -33,8 +33,8 @@ if (PCO_FOUND AND CLSERME4_FOUND AND FGLIB5_FOUND) target_link_libraries(ucapco ${UCA_DEPS} ${PCO_LIBRARIES} - ${CLSERME4_LIBRARY} - ${FGLIB5_LIBRARY}) + ${clsersis_LIBRARY} + ${FgLib5_LIBRARY}) install(TARGETS ucapco LIBRARY DESTINATION ${UCA_PLUGINDIR} |