diff options
author | Laurent Montel <montel@kde.org> | 2007-06-11 15:40:55 +0000 |
---|---|---|
committer | Laurent Montel <montel@kde.org> | 2007-06-11 15:40:55 +0000 |
commit | 46aa763e481365e55fe052b1028bf2f6d6e76918 (patch) | |
tree | db574d332ee7d8718a2b451140620b049a92e950 | |
parent | 02c7e311e874cc9e863da474e6fb7ee4a6cedcb1 (diff) | |
download | extra-cmake-modules-46aa763e481365e55fe052b1028bf2f6d6e76918.tar.gz extra-cmake-modules-46aa763e481365e55fe052b1028bf2f6d6e76918.tar.bz2 |
Move to kdelibs (needs by kipi-plugins and kdegraphics)
svn path=/trunk/KDE/kdelibs/; revision=674018
-rw-r--r-- | modules/FindGphoto2.cmake | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/modules/FindGphoto2.cmake b/modules/FindGphoto2.cmake new file mode 100644 index 00000000..5a0ce432 --- /dev/null +++ b/modules/FindGphoto2.cmake @@ -0,0 +1,50 @@ +# 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, 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 PATHS + /usr/bin + /usr/local/bin + ) + + FIND_PROGRAM(GHOTO2PORTCONFIG_EXECUTABLE NAMES gphoto2-port-config PATHS + /usr/bin + /usr/local/bin + ) + 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_INCLUDE_DIR) + EXEC_PROGRAM(${GHOTO2CONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPHOTO2_INCLUDE_DIR) + + set(GPHOTO2_LIBRARIES ${GPHOTO2PORT_LIBRARY} ${GPHOTO2_LIBRARY}) + 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) + |