• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1add_library(FLAC++
2    metadata.cpp
3    stream_decoder.cpp
4    stream_encoder.cpp)
5set_property(TARGET FLAC++ PROPERTY PROJECT_LABEL "libFLAC++")
6target_compile_definitions(FLAC++
7    PRIVATE $<$<BOOL:${BUILD_SHARED_LIBS}>:FLACPP_API_EXPORTS>
8    PUBLIC $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:FLAC__NO_DLL>)
9if(NOT WIN32)
10    target_compile_definitions(FLAC++ PRIVATE $<$<BOOL:${BUILD_SHARED_LIBS}>:FLAC__USE_VISIBILITY_ATTR>)
11endif()
12target_include_directories(FLAC++ INTERFACE
13    "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
14    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
15target_link_libraries(FLAC++ PUBLIC FLAC)
16if(BUILD_SHARED_LIBS)
17    set_target_properties(FLAC++ PROPERTIES
18        VERSION 10.0.0
19        SOVERSION 10)
20    if(NOT WIN32)
21        set_target_properties(FLAC++ PROPERTIES CXX_VISIBILITY_PRESET hidden)
22    endif()
23endif()
24
25add_library(FLAC::FLAC++ ALIAS FLAC++)
26
27install(TARGETS FLAC++ EXPORT targets
28    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
29    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
30    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/")
31
32if(INSTALL_PKGCONFIG_MODULES)
33    set(prefix "${CMAKE_INSTALL_PREFIX}")
34    set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
35    set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
36    set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
37    configure_file(flac++.pc.in flac++.pc @ONLY)
38    install(FILES "${CMAKE_CURRENT_BINARY_DIR}/flac++.pc"
39        DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
40endif()
41