@@ -13,35 +13,48 @@ if (WIN32)
1313 #option(BUILD_VFAPIFILTER "Build VFAPIFilter plugin" ON)
1414endif ()
1515
16- include (FindDevIL )
17- if (DevIL_FOUND)
16+ # DevIL detection: skip auto detection if paths are pre-supplied via -DIL_LIBRARIES=...
17+ if (IL_LIBRARIES AND IL_INCLUDE_DIR)
18+ message (STATUS "DevIL paths pre-supplied, skipping auto-detection." )
19+ set (DevIL_FOUND TRUE )
1820 set (DEVIL_PLUGIN_STATE ON )
1921else ()
20- MESSAGE ( WARNING "DevIL library not found. ImageSeq plugin will not be built." )
21- set (DEVIL_PLUGIN_STATE OFF )
22- endif ( )
23-
24- find_package ( PkgConfig )
25- if (PkgConfig_FOUND )
26- pkg_check_modules ( SOUNDTOUCH soundtouch )
22+ include ( FindDevIL ) # official CMake module
23+ if (DevIL_FOUND )
24+ set (DEVIL_PLUGIN_STATE ON )
25+ else ()
26+ MESSAGE ( WARNING "DevIL library not found. ImageSeq plugin will not be built." )
27+ set (DEVIL_PLUGIN_STATE OFF )
28+ endif ( )
2729endif ()
2830
29- if (SOUNDTOUCH_FOUND)
31+ # SoundTouch detection: skip auto-detection if paths are pre-supplied via -DSOUNDTOUCH_LINK_LIBRARIES=...
32+ if (SOUNDTOUCH_LINK_LIBRARIES AND SOUNDTOUCH_INCLUDE_DIRS)
33+ message (STATUS "SoundTouch paths pre-supplied, skipping auto-detection." )
3034 set (SOUNDTOUCH_PLUGIN_STATE ON )
3135else ()
32- # check to see if SoundTouch's CMake files were installed and whether the library itself exists
33- MESSAGE (WARNING "SoundTouch not found by pkg-config, falling back to CMake detection" )
34- find_package (SoundTouch )
35- find_library (SOUNDTOUCH SoundTouch PATH ${SoundTouch_LIBRARY_DIRS} )
36- if (SoundTouch_FOUND)
37- # override the SOUNDTOUCH_LINK_LIBRARIES and SOUNDTOUCH_INCLUDE_DIRS variables
38- # that pkg-config would have set, and allow these to be overridden at configure time as well
39- set (SOUNDTOUCH_LINK_LIBRARIES ${SOUNDTOUCH} CACHE PATH "Path to SoundTouch library" )
40- set (SOUNDTOUCH_INCLUDE_DIRS ${CMAKE_PREFIX_PATH} /include/soundtouch CACHE PATH "Path to SoundTouch headers" )
36+ find_package (PkgConfig )
37+ if (PkgConfig_FOUND)
38+ pkg_check_modules (SOUNDTOUCH soundtouch )
39+ endif ()
40+
41+ if (SOUNDTOUCH_FOUND)
4142 set (SOUNDTOUCH_PLUGIN_STATE ON )
4243 else ()
43- MESSAGE (WARNING "SoundTouch library not found. TimeStretch plugin will not be built." )
44- set (SOUNDTOUCH_PLUGIN_STATE OFF )
44+ # check to see if SoundTouch's CMake files were installed and whether the library itself exists
45+ MESSAGE (WARNING "SoundTouch not found by pkg-config, falling back to CMake detection" )
46+ find_package (SoundTouch )
47+ find_library (SOUNDTOUCH SoundTouch PATH ${SoundTouch_LIBRARY_DIRS} )
48+ if (SoundTouch_FOUND)
49+ # override the SOUNDTOUCH_LINK_LIBRARIES and SOUNDTOUCH_INCLUDE_DIRS variables
50+ # that pkg-config would have set, and allow these to be overridden at configure time as well
51+ set (SOUNDTOUCH_LINK_LIBRARIES ${SOUNDTOUCH} CACHE PATH "Path to SoundTouch library" )
52+ set (SOUNDTOUCH_INCLUDE_DIRS ${CMAKE_PREFIX_PATH} /include/soundtouch CACHE PATH "Path to SoundTouch headers" )
53+ set (SOUNDTOUCH_PLUGIN_STATE ON )
54+ else ()
55+ MESSAGE (WARNING "SoundTouch library not found. TimeStretch plugin will not be built." )
56+ set (SOUNDTOUCH_PLUGIN_STATE OFF )
57+ endif ()
4558 endif ()
4659endif ()
4760
0 commit comments