diff options
| author | Allen Winter <allen.winter@kdab.com> | 2011-06-30 17:36:45 -0400 |
|---|---|---|
| committer | Allen Winter <allen.winter@kdab.com> | 2011-06-30 17:36:45 -0400 |
| commit | d2b2c90a06bf1f4a21df196430d1f95856900410 (patch) | |
| tree | aba9d2a48d7b2ac1e960e1b68218394524c7e6a8 /attic/modules/FindGphoto2.cmake | |
| parent | e15ffacc69242c89107afbfda6f8ece9f2b56633 (diff) | |
| download | extra-cmake-modules-d2b2c90a06bf1f4a21df196430d1f95856900410.tar.gz extra-cmake-modules-d2b2c90a06bf1f4a21df196430d1f95856900410.tar.bz2 | |
Move the modules, modules-test and systeminfo subdirs into 'attic'
Diffstat (limited to 'attic/modules/FindGphoto2.cmake')
| -rw-r--r-- | attic/modules/FindGphoto2.cmake | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/attic/modules/FindGphoto2.cmake b/attic/modules/FindGphoto2.cmake new file mode 100644 index 00000000..b1bd6270 --- /dev/null +++ b/attic/modules/FindGphoto2.cmake @@ -0,0 +1,60 @@ +# cmake macro to test if we use gphoto2 +# GPHOTO2_FOUND - system has the GPHOTO2 library +# GPHOTO2_INCLUDE_DIR - the GPHOTO2 include directory +# GPHOTO2_LIBRARIES - The libraries needed to use GPHOTO2 + +# Copyright (c) 2006, 2007 Laurent Montel, <montel@kde.org> +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +option(KDE4_GPHOTO2 "do not build kamera (gphoto2 required)" ON) +if (KDE4_GPHOTO2 ) + IF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIR) + # in cache already + SET(GPHOTO2_FOUND TRUE) + ELSE (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIR) + + FIND_PROGRAM(GHOTO2CONFIG_EXECUTABLE NAMES gphoto2-config + ) + + FIND_PROGRAM(GHOTO2PORTCONFIG_EXECUTABLE NAMES gphoto2-port-config + ) + set(GPHOTO2_LIBRARIES) + set(GPHOTO2_INCLUDE_DIRS) + # if gphoto2-port-config and gphoto2-config have been found + IF (GHOTO2PORTCONFIG_EXECUTABLE AND GHOTO2CONFIG_EXECUTABLE) + EXEC_PROGRAM(${GHOTO2PORTCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPHOTO2PORT_LIBRARY) + EXEC_PROGRAM(${GHOTO2CONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPHOTO2_LIBRARY) + + EXEC_PROGRAM(${GHOTO2PORTCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _GPHOTO2PORT_RESULT_INCLUDE_DIR) + EXEC_PROGRAM(${GHOTO2CONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _GPHOTO2_RESULT_INCLUDE_DIR) + + set(GPHOTO2_LIBRARIES ${GPHOTO2PORT_LIBRARY} ${GPHOTO2_LIBRARY}) + # the cflags for poppler-qt4 can contain more than one include path + separate_arguments(_GPHOTO2_RESULT_INCLUDE_DIR) + foreach(_includedir ${_GPHOTO2_RESULT_INCLUDE_DIR}) + string(REGEX REPLACE "-I(.+)" "\\1" _includedir "${_includedir}") + set(GPHOTO2_INCLUDE_DIR ${GPHOTO2_INCLUDE_DIR} ${_includedir}) + endforeach(_includedir) + separate_arguments(_GPHOTO2PORT_RESULT_INCLUDE_DIR) + foreach(_includedir ${_GPHOTO2PORT_RESULT_INCLUDE_DIR}) + string(REGEX REPLACE "-I(.+)" "\\1" _includedir "${_includedir}") + set(GPHOTO2PORT_INCLUDE_DIR ${GPHOTO2PORT_INCLUDE_DIR} ${_includedir}) + endforeach(_includedir) + + + + set(GPHOTO2_INCLUDE_DIRS ${GPHOTO2PORT_INCLUDE_DIR} ${GPHOTO2_INCLUDE_DIR} ) + endif(GHOTO2PORTCONFIG_EXECUTABLE AND GHOTO2CONFIG_EXECUTABLE) + + IF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIRS) + SET(GPHOTO2_FOUND TRUE) + message(STATUS "Found gphoto2: ${GPHOTO2_LIBRARIES}") + ENDIF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIRS) + ENDIF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIR) + MARK_AS_ADVANCED(GPHOTO2_LIBRARIES GPHOTO2_INCLUDE_DIRS) + +endif(KDE4_GPHOTO2) + |
