You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, I'm not using this library at all, I just pulled the FindFlyCapture.cmake module from it for use in my projects, so I'm too lazy to go through cloning this repo just to create a pull request or patch for this. I'm just going to paste the fixed file.
There are a couple of bugs I could find (so far). One is using "$ENV{SYSTEMDRIVE}" instead of "C:" for the drive letter. Another is missing the PATHS directive from the FIND_LIBRARY command (didn't work for me w/o it on CMake 3).
# Get default values for FLYCAPTURE_ROOT and FLYCAPTURE_LAYOUTIF(WIN32)
IF(EXISTS"$ENV{SYSTEMDRIVE}\\Program Files\\Point Grey Research\\FlyCapture2")
SET(FLYCAPTURE_ROOT "$ENV{SYSTEMDRIVE}\\Program Files\\Point Grey Research\\FlyCapture2")
ELSE(EXISTS"$ENV{SYSTEMDRIVE}\\Program Files\\Point Grey Research\\FlyCapture2")
IF(EXISTS"$ENV{SYSTEMDRIVE}\\Program Files (x86)\\Point Grey Research\\FlyCapture2")
# Maybe we're on 64bit but have 32bit SDK installed.SET(FLYCAPTURE_ROOT "$ENV{SYSTEMDRIVE}\\Program Files (x86)\\Point Grey Research\\FlyCapture2")
ELSE(EXISTS"$ENV{SYSTEMDRIVE}\\Program Files (x86)\\Point Grey Research\\FlyCapture2")
# If not, default to "C:\Program Files".SET(FLYCAPTURE_ROOT "$ENV{SYSTEMDRIVE}\\Program Files\\Point Grey Research\\FlyCapture2")
ENDIF(EXISTS"$ENV{SYSTEMDRIVE}\\Program Files (x86)\\Point Grey Research\\FlyCapture2")
ENDIF(EXISTS"$ENV{SYSTEMDRIVE}\\Program Files\\Point Grey Research\\FlyCapture2")
ELSE(WIN32)
# Assume headers and libraries are installed in FHS locationsSET(FLYCAPTURE_ROOT "/usr")
ENDIF(WIN32)
# defaults for FLYCAPTURE_LAYOUTIF(WIN32)
SET(FLYCAPTURE_LAYOUT "flycapture")
ELSE(WIN32)
# Assume headers and libraries are installed in FHS locationsSET(FLYCAPTURE_LAYOUT "FHS")
ENDIF(WIN32)
############################################## Environment variable overridesSET(FLYCAPTURE_TEST_INCLUDE_PATHS "$ENV{FLYCAPTURE_TEST_INCLUDE_PATHS}")
IF(FLYCAPTURE_TEST_INCLUDE_PATHS STREQUAL"")
# not set with env var, use defaultsSET(FLYCAPTURE_TEST_INCLUDE_PATHS ${FLYCAPTURE_ROOT}/include)
ENDIF(FLYCAPTURE_TEST_INCLUDE_PATHS STREQUAL"")
# Prefer building 64 bit binaries on Windows. If you prefer building#32 bit binaries on 64 bit machines, set this to FALSE.SET(PREFER_64_BIT TRUE)
SET(FLYCAPTURE_TEST_LIB_PATHS "$ENV{FLYCAPTURE_TEST_LIB_PATHS}")
IF(FLYCAPTURE_TEST_LIB_PATHS STREQUAL"")
# not set with env var, use defaultsIF(FLYCAPTURE_LAYOUT STREQUAL"flycapture")
IF(PREFER_64_BIT)
IF(EXISTS${FLYCAPTURE_ROOT}/lib64)
SET(FLYCAPTURE_TEST_LIB_PATHS ${FLYCAPTURE_ROOT}/lib64)
MESSAGE("building FlyCapture2 64-bit backend")
ELSE(EXISTS${FLYCAPTURE_ROOT}/lib64)
SET(FLYCAPTURE_TEST_LIB_PATHS ${FLYCAPTURE_ROOT}/lib)
MESSAGE("building FlyCapture2 32-bit backend")
ENDIF(EXISTS${FLYCAPTURE_ROOT}/lib64)
ELSE(PREFER_64_BIT)
IF(EXISTS${FLYCAPTURE_ROOT}/lib)
SET(FLYCAPTURE_TEST_LIB_PATHS ${FLYCAPTURE_ROOT}/lib)
MESSAGE("building FlyCapture2 32-bit backend")
ELSE(EXISTS${FLYCAPTURE_ROOT}/lib)
SET(FLYCAPTURE_TEST_LIB_PATHS ${FLYCAPTURE_ROOT}/lib64)
MESSAGE("building FlyCapture2 64-bit backend")
ENDIF(EXISTS${FLYCAPTURE_ROOT}/lib)
ENDIF(PREFER_64_BIT)
ELSE(FLYCAPTURE_LAYOUT STREQUAL"flycapture")
IF(NOT FLYCAPTURE_LAYOUT STREQUAL"FHS")
MESSAGE(FATAL_ERROR"unknown FLYCAPTURE_LAYOUT "${FLYCAPTURE_LAYOUT})
ENDIF(NOT FLYCAPTURE_LAYOUT STREQUAL"FHS")
SET(FLYCAPTURE_TEST_LIB_PATHS ${FLYCAPTURE_ROOT}/lib)
ENDIF(FLYCAPTURE_LAYOUT STREQUAL"flycapture")
ENDIF(FLYCAPTURE_TEST_LIB_PATHS STREQUAL"")
############################################## No more environment variable settingsIF(NOT"$ENV{FLYCAPTURE_CMAKE_DEBUG}"STREQUAL"")
MESSAGE("FLYCAPTURE_TEST_INCLUDE_PATHS "${FLYCAPTURE_TEST_INCLUDE_PATHS})
MESSAGE("FLYCAPTURE_TEST_LIB_PATHS "${FLYCAPTURE_TEST_LIB_PATHS})
ENDIF(NOT"$ENV{FLYCAPTURE_CMAKE_DEBUG}"STREQUAL"")
FIND_PATH(FLYCAPTURE_INCLUDE_DIR
NAMES FlyCapture2.h
HINTS${FLYCAPTURE_TEST_INCLUDE_PATHS}PATH_SUFFIXES flycapture
)
FIND_LIBRARY(FLYCAPTURE_LIBRARY NAMES FlyCapture2 flycapture FlyCapture2.lib PATHS${FLYCAPTURE_TEST_LIB_PATHS})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLYCAPTURE DEFAULT_MSG
FLYCAPTURE_INCLUDE_DIR
FLYCAPTURE_LIBRARY)
SET(FLYCAPTURE_LIBRARIES ${FLYCAPTURE_LIBRARY})
SET(FLYCAPTURE_INCLUDE_DIRS ${FLYCAPTURE_INCLUDE_DIR})
The text was updated successfully, but these errors were encountered:
Sorry, I'm not using this library at all, I just pulled the FindFlyCapture.cmake module from it for use in my projects, so I'm too lazy to go through cloning this repo just to create a pull request or patch for this. I'm just going to paste the fixed file.
There are a couple of bugs I could find (so far). One is using "$ENV{SYSTEMDRIVE}" instead of "C:" for the drive letter. Another is missing the PATHS directive from the FIND_LIBRARY command (didn't work for me w/o it on CMake 3).
The text was updated successfully, but these errors were encountered: