CMakeUserFindDirectShow: Difference between revisions
From KitwarePublic
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
# DIRECTSHOW_INCLUDE_DIR - include directory for DirectShow | # DIRECTSHOW_INCLUDE_DIR - include directory for DirectShow | ||
# DIRECTSHOW_LIBRARIES - libraries you need to link to | # DIRECTSHOW_LIBRARIES - libraries you need to link to | ||
SET(DIRECTSHOW_FOUND "NO") | SET(DIRECTSHOW_FOUND "NO") | ||
# DirectShow is only available on Windows platforms | # DirectShow is only available on Windows platforms | ||
IF(WIN32) | IF(WIN32) | ||
Line 18: | Line 18: | ||
DOC "What is the path where the file ddraw.h can be found" | DOC "What is the path where the file ddraw.h can be found" | ||
) | ) | ||
# if DirectX found, then find DirectShow include directory | # if DirectX found, then find DirectShow include directory | ||
IF(DIRECTX_INCLUDE_DIR) | IF(DIRECTX_INCLUDE_DIR) | ||
Line 27: | Line 27: | ||
DOC "What is the path where the file dshow.h can be found" | DOC "What is the path where the file dshow.h can be found" | ||
) | ) | ||
# if DirectShow include dir found, then find DirectShow libraries | # if DirectShow include dir found, then find DirectShow libraries | ||
IF(DIRECTSHOW_INCLUDE_DIR) | IF(DIRECTSHOW_INCLUDE_DIR) | ||
Line 42: | Line 42: | ||
DOC "Where can the DirectShow quartz library be found" | DOC "Where can the DirectShow quartz library be found" | ||
) | ) | ||
# if DirectShow libraries found, then we're ok | # if DirectShow libraries found, then we're ok | ||
IF(DIRECTSHOW_strmiids_LIBRARY) | IF(DIRECTSHOW_strmiids_LIBRARY) | ||
Line 53: | Line 53: | ||
ENDIF(DIRECTX_INCLUDE_DIR) | ENDIF(DIRECTX_INCLUDE_DIR) | ||
ENDIF(WIN32) | ENDIF(WIN32) | ||
#--------------------------------------------------------------------- | #--------------------------------------------------------------------- | ||
IF(DIRECTSHOW_FOUND) | IF(DIRECTSHOW_FOUND) | ||
Line 77: | Line 77: | ||
ENDIF(NOT DIRECTSHOW_FIND_QUIETLY) | ENDIF(NOT DIRECTSHOW_FIND_QUIETLY) | ||
ENDIF(DIRECTSHOW_FOUND) | ENDIF(DIRECTSHOW_FOUND) | ||
----- | ----- | ||
[[CMake_User_Contributed_Macros|Back]] | [[CMake_User_Contributed_Macros|Back]] | ||
{{CMake/Template/Footer}} | {{CMake/Template/Footer}} |
Revision as of 21:08, 12 March 2006
# - Test for DirectShow on Windows. # Once loaded this will define # DIRECTSHOW_FOUND - system has DirectShow # DIRECTSHOW_INCLUDE_DIR - include directory for DirectShow # DIRECTSHOW_LIBRARIES - libraries you need to link to SET(DIRECTSHOW_FOUND "NO") # DirectShow is only available on Windows platforms IF(WIN32) # Find DirectX Include Directory FIND_PATH(DIRECTX_INCLUDE_DIR ddraw.h "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" "C:/Program Files/Microsoft DirectX SDK (February 2006)/Include" "C:/DXSDK/Include" DOC "What is the path where the file ddraw.h can be found" ) # if DirectX found, then find DirectShow include directory IF(DIRECTX_INCLUDE_DIR) FIND_PATH(DIRECTSHOW_INCLUDE_DIR dshow.h "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" "C:/Program Files/Microsoft Platform SDK/Include" "C:/DXSDK/Include" DOC "What is the path where the file dshow.h can be found" ) # if DirectShow include dir found, then find DirectShow libraries IF(DIRECTSHOW_INCLUDE_DIR) FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY strmiids "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" "C:/Program Files/Microsoft Platform SDK/Lib" "C:/DXSDK/Include/Lib" DOC "Where can the DirectShow strmiids library be found" ) FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY quartz "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" "C:/Program Files/Microsoft Platform SDK/Lib" "C:/DXSDK/Include/Lib" DOC "Where can the DirectShow quartz library be found" ) # if DirectShow libraries found, then we're ok IF(DIRECTSHOW_strmiids_LIBRARY) IF(DIRECTSHOW_quartz_LIBRARY) # everything found SET(DIRECTSHOW_FOUND "YES") ENDIF(DIRECTSHOW_quartz_LIBRARY) ENDIF(DIRECTSHOW_strmiids_LIBRARY) ENDIF(DIRECTSHOW_INCLUDE_DIR) ENDIF(DIRECTX_INCLUDE_DIR) ENDIF(WIN32) #--------------------------------------------------------------------- IF(DIRECTSHOW_FOUND) SET(DIRECTSHOW_INCLUDE_DIR ${DIRECTSHOW_INCLUDE_DIR} ${DIRECTX_INCLUDE_DIR} )
SET(DIRECTSHOW_LIBRARIES ${DIRECTSHOW_strmiids_LIBRARY} ${DIRECTSHOW_quartz_LIBRARY} ) ELSE(DIRECTSHOW_FOUND) # make FIND_PACKAGE friendly IF(NOT DIRECTSHOW_FIND_QUIETLY) IF(DIRECTSHOW_FIND_REQUIRED) MESSAGE(FATAL_ERROR "DirectShow required, please specify it's location.") ELSE(DIRECTSHOW_FIND_REQUIRED) MESSAGE(STATUS "DirectShow was not found.") ENDIF(DIRECTSHOW_FIND_REQUIRED) ENDIF(NOT DIRECTSHOW_FIND_QUIETLY) ENDIF(DIRECTSHOW_FOUND)