Skip to content

Commit 3e5dc1d

Browse files
committed
Streamline libopenshot-audio discovery
1 parent d04a71e commit 3e5dc1d

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

cmake/Modules/FindOpenShotAudio.cmake

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,12 @@
77

88
message("$ENV{LIBOPENSHOT_AUDIO_DIR}")
99

10-
# Find the base directory of juce includes
11-
find_path(LIBOPENSHOT_AUDIO_BASE_DIR JuceHeader.h
10+
# Find the libopenshot-audio header files
11+
find_path(LIBOPENSHOT_AUDIO_INCLUDE_DIR JuceHeader.h
1212
PATHS $ENV{LIBOPENSHOT_AUDIO_DIR}/include/libopenshot-audio/
1313
/usr/include/libopenshot-audio/
1414
/usr/local/include/libopenshot-audio/ )
1515

16-
# Get a list of all header file paths
17-
FILE(GLOB_RECURSE JUCE_HEADER_FILES
18-
${LIBOPENSHOT_AUDIO_BASE_DIR}/*.h
19-
)
20-
21-
# Loop through each header file
22-
FOREACH(HEADER_PATH ${JUCE_HEADER_FILES})
23-
# Get the directory of each header file
24-
get_filename_component(HEADER_DIRECTORY ${HEADER_PATH}
25-
PATH
26-
)
27-
28-
# Append each directory into the HEADER_DIRECTORIES list
29-
LIST(APPEND HEADER_DIRECTORIES ${HEADER_DIRECTORY})
30-
ENDFOREACH(HEADER_PATH)
31-
32-
# Remove duplicates from the header directories list
33-
LIST(REMOVE_DUPLICATES HEADER_DIRECTORIES)
34-
3516
# Find the libopenshot-audio.so (check env var first)
3617
find_library(LIBOPENSHOT_AUDIO_LIBRARY
3718
NAMES libopenshot-audio openshot-audio
@@ -48,9 +29,7 @@ find_library(LIBOPENSHOT_AUDIO_LIBRARY
4829
set(LIBOPENSHOT_AUDIO_LIBRARIES ${LIBOPENSHOT_AUDIO_LIBRARY})
4930
set(LIBOPENSHOT_AUDIO_LIBRARY ${LIBOPENSHOT_AUDIO_LIBRARIES})
5031

51-
# Seems to work fine with just the base dir (rather than all the actual include folders)
52-
set(LIBOPENSHOT_AUDIO_INCLUDE_DIR ${LIBOPENSHOT_AUDIO_BASE_DIR} )
53-
set(LIBOPENSHOT_AUDIO_INCLUDE_DIRS ${LIBOPENSHOT_AUDIO_BASE_DIR} )
32+
set(LIBOPENSHOT_AUDIO_INCLUDE_DIRS ${LIBOPENSHOT_AUDIO_INCLUDE_DIR} )
5433

5534
include(FindPackageHandleStandardArgs)
5635
# handle the QUIETLY and REQUIRED arguments and set LIBOPENSHOT_AUDIO_FOUND to TRUE

0 commit comments

Comments
 (0)