annotate cmake/FindSndFile.cmake @ 517:6e8f6640e05b

misc: use extern C manually
author David Demelier <markand@malikania.fr>
date Sat, 04 Mar 2023 14:23:59 +0100
parents 67c1c46af2c8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
379
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 # FindSndFile
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 # -----------
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 #
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 # Find SndFile library, this modules defines:
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 #
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # SndFile_INCLUDE_DIRS, where to find sndfile.h
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # SndFile_LIBRARIES, where to find library
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 # SndFile_FOUND, if it is found
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 #
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # The following imported targets will be available:
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 #
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # SndFile::SndFile, if found.
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 #
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
14
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 find_path(SndFile_INCLUDE_DIR NAMES sndfile.h)
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 find_library(SndFile_LIBRARY NAMES libsndfile sndfile)
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
17
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
18 include(FindPackageHandleStandardArgs)
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
19
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 find_package_handle_standard_args(
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 SndFile
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 FOUND_VAR SndFile_FOUND
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 REQUIRED_VARS SndFile_LIBRARY SndFile_INCLUDE_DIR
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 )
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
25
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 if (SndFile_FOUND)
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 set(SndFile_LIBRARIES ${SndFile_LIBRARY})
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 set(SndFile_INCLUDE_DIRS ${SndFile_INCLUDE_DIR})
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
29
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 if (NOT TARGET SndFile::SndFile)
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 add_library(SndFile::SndFile UNKNOWN IMPORTED)
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 set_target_properties(
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 SndFile::SndFile
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 PROPERTIES
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 IMPORTED_LOCATION "${SndFile_LIBRARY}"
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 INTERFACE_INCLUDE_DIRECTORIES "${SndFile_INCLUDE_DIRS}"
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
38 )
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 endif ()
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 endif ()
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
41
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 mark_as_advanced(SndFile_INCLUDE_DIR SndFile_LIBRARY)