[openrtm-commit:01113] r83 - branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/BaseClasses
openrtm @ openrtm.org
openrtm @ openrtm.org
2013年 7月 16日 (火) 09:29:41 JST
Author: kawauchi
Date: 2013-07-16 09:29:41 +0900 (Tue, 16 Jul 2013)
New Revision: 83
Modified:
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/BaseClasses/FindDirectShow.cmake
Log:
Modified DirectShow search method. refs #2704
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/BaseClasses/FindDirectShow.cmake
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/BaseClasses/FindDirectShow.cmake 2013-07-01 07:54:14 UTC (rev 82)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/BaseClasses/FindDirectShow.cmake 2013-07-16 00:29:41 UTC (rev 83)
@@ -1,65 +1,62 @@
# Find DirectShow on Windows.
#
# Once loaded this will define
-# DIRECTSHOW_FOUND - system has DirectShow
-# WINDOWSSDK_INCLUDE_DIR - include directory for Windows SDK
-# WINDOWSSDK_LIBRARY_DIRS - library directries for Windows SDK
-# DIRECTSHOW_BASECLASS_DIR - directory for DirectShow baseclasses
-# WINDOWSSDK_STRMIIDS_LIB - strmiids.lib you need to link to
+# DIRECTSHOW_FOUND - system has DirectShow
+# WINDOWSSDK_INCLUDE_DIR - include directory for Windows SDK
+# WINDOWSSDK_LIBRARY_DIRS - library directries for Windows SDK
+# DIRECTSHOW_BASECLASS_DIR - directory for DirectShow baseclasses
+# WINDOWSSDK_STRMIIDS_LIB - strmiids.lib you need to link to
-set(DIRECTSHOW_FOUND "NO")
-
if(MSVC)
- get_filename_component(WINDOWSSDK_ROOT
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]"
- ABSOLUTE CACHE
- )
-# message("WINDOWSSDK_ROOT : ${WINDOWSSDK_ROOT}")
+ foreach(winsdkver v7.1 v7.0A)
+ get_filename_component(sdkdir
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\${winsdkver};InstallationFolder]"
+ ABSOLUTE)
+ if(EXISTS "${sdkdir}")
+ list(APPEND win_sdk_dir "${sdkdir}")
+ endif()
+ endforeach()
- find_path(WINDOWSSDK_INCLUDE_DIR
- NAMES DShow.h
- PATHS
- "${WINDOWSSDK_ROOT}/Include"
- NO_DEFAULT_PATH
- )
-# message("${WINDOWSSDK_INCLUDE_DIR}")
+ foreach(sdkdir ${win_sdk_dir})
+ if(EXISTS "${sdkdir}/Samples/Multimedia/DirectShow/BaseClasses/streams.h"
+ AND EXISTS "${sdkdir}/Include/DShow.h")
+ list(APPEND WINDOWSSDK_ROOT "${sdkdir}")
+ list(APPEND WINDOWSSDK_INCLUDE_DIR "${sdkdir}/Include")
+ endif()
+ endforeach()
+ message(STATUS "WindowsSDK Include : ${WINDOWSSDK_INCLUDE_DIR}")
+
set(WINDOWSSDK_LIBRARY_DIRS "${WINDOWSSDK_ROOT}/Lib")
- message(STATUS "DirectShow Library: ${WINDOWSSDK_LIBRARY_DIRS}")
- find_path(DIRECTSHOW_BASECLASS_DIR
- NAMES streams.h
- PATHS
- "${WINDOWSSDK_ROOT}"
- PATH_SUFFIXES
- "Samples/multimedia/directshow/baseclasses"
- NO_DEFAULT_PATH
- )
-# message(STATUS "${DIRECTSHOW_BASECLASS_DIR}")
+ set(DIRECTSHOW_BASECLASS_DIR "${WINDOWSSDK_ROOT}/Samples/multimedia/directshow/baseclasses")
+ message(STATUS "DirectShow baseclasses : ${DIRECTSHOW_BASECLASS_DIR}")
# if DirectShow include dir found, then find DirectShow libraries
if(WINDOWSSDK_INCLUDE_DIR)
if(CMAKE_CL_64)
find_library(WINDOWSSDK_STRMIIDS_LIB
- NAMES strmiids
- PATHS
- "${WINDOWSSDK_ROOT}/Lib/x64"
+ NAMES strmiids
+ PATHS
+ "${WINDOWSSDK_ROOT}/Lib/x64"
NO_DEFAULT_PATH
- )
+ )
else(CMAKE_CL_64)
find_library(WINDOWSSDK_STRMIIDS_LIB
- NAMES strmiids
- PATHS
- "${WINDOWSSDK_ROOT}/Lib"
- "${WINDOWSSDK_ROOT}/Lib/x86"
+ NAMES strmiids
+ PATHS
+ "${WINDOWSSDK_ROOT}/Lib"
+ "${WINDOWSSDK_ROOT}/Lib/x86"
NO_DEFAULT_PATH
- )
+ )
endif(CMAKE_CL_64)
endif(WINDOWSSDK_INCLUDE_DIR)
- if(DIRECTSHOW_BASECLASS_DIR)
- set(DIRECTSHOW_FOUND "YES")
- endif(DIRECTSHOW_BASECLASS_DIR)
+ if(DIRECTSHOW_BASECLASS_DIR)
+ set(DIRECTSHOW_FOUND TRUE)
+ else(DIRECTSHOW_BASECLASS_DIR)
+ message(STATUS "Warning: cannot find DirectShow baseclasses")
+ endif(DIRECTSHOW_BASECLASS_DIR)
endif(MSVC)
\ No newline at end of file
More information about the openrtm-commit
mailing list