Skip to content

Commit

Permalink
DirectShowSource: Sensible defaults for CMake baseclasses lib, remove…
Browse files Browse the repository at this point in the history
…d dx include path
  • Loading branch information
ignus2 committed Oct 30, 2016
1 parent b54a6be commit dbcfae2
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions plugins/DirectShowSource/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ CMAKE_MINIMUM_REQUIRED( VERSION 2.8.11 )
set(PluginName "DirectShowSource")
set(ProjectName "Plugin${PluginName}")

# Sensible defaults that should just work if WINSDK is installed and baseclasses built
set(DEFAULT_BASECLASSES_PATH "C:/Program Files/Microsoft SDKs/Windows/v7.1/Samples/multimedia/directshow/baseclasses")
if(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32-bit
set(DEFAULT_BASECLASSES_LIB "${DEFAULT_BASECLASSES_PATH}/Release/strmbase.lib")
else() # 64-bit
set(DEFAULT_BASECLASSES_LIB "${DEFAULT_BASECLASSES_PATH}/x64/Release/strmbase.lib")
endif()

# We need these variables set by the user to compile successfully
set(DSHOWSRC_BASECLASSES_PATH "C:/Program Files/Microsoft SDKs/Windows/v7.1/Samples/multimedia/directshow/baseclasses" CACHE STRING "Folder path to the DirectShow example baseclasses.")
set(DSHOWSRC_BASECLASSES_LIB CACHE FILEPATH "File path to the DirectShow example baseclasses precompiled static library ('strmbase.lib').")
set(DSHOWSRC_DX_INCLUDE_PATH "C:/Program Files/Microsoft DirectX SDK (August 2009)/Include" CACHE STRING "Include folder path to the DirectX headers.")
set(DSHOWSRC_BASECLASSES_PATH "${DEFAULT_BASECLASSES_PATH}" CACHE STRING "Folder path to the DirectShow example baseclasses.")
set(DSHOWSRC_BASECLASSES_LIB "${DEFAULT_BASECLASSES_LIB}" CACHE FILEPATH "File path to the DirectShow example baseclasses precompiled static library ('strmbase.lib').")

# Create library
project(${ProjectName})
Expand All @@ -23,7 +30,7 @@ set_target_properties(${ProjectName} PROPERTIES "OUTPUT_NAME" ${PluginName})
target_link_libraries(${ProjectName} "Winmm.lib" "Quartz.lib" "Ole32.lib" "User32.lib" "Oleaut32.lib" "Advapi32.lib" ${DSHOWSRC_BASECLASSES_LIB})

# Include directories
target_include_directories(${ProjectName} PRIVATE ${AvsCore_SOURCE_DIR} ${DSHOWSRC_BASECLASSES_PATH} ${DSHOWSRC_DX_INCLUDE_PATH})
target_include_directories(${ProjectName} PRIVATE ${AvsCore_SOURCE_DIR} ${DSHOWSRC_BASECLASSES_PATH})

if (MSVC_IDE)
# Copy output to a common folder for easy deployment
Expand All @@ -32,4 +39,4 @@ if (MSVC_IDE)
POST_BUILD
COMMAND xcopy /Y \"$(TargetPath)\" \"${CMAKE_BINARY_DIR}/Output/plugins\"
)
endif()
endif()

0 comments on commit dbcfae2

Please sign in to comment.