strawberry-audio-player-win.../ext/libstrawberry-tagreader/CMakeLists.txt

70 lines
1.9 KiB
CMake
Raw Permalink Normal View History

cmake_minimum_required(VERSION 3.7)
2019-09-15 20:27:32 +02:00
2023-05-14 21:52:55 +02:00
# Workaround a bug in protobuf-generate.cmake (https://github.com/protocolbuffers/protobuf/issues/12450)
if(NOT protobuf_PROTOC_EXE)
set(protobuf_PROTOC_EXE "protobuf::protoc")
endif()
if(NOT Protobuf_LIBRARIES)
set(Protobuf_LIBRARIES protobuf::libprotobuf)
2023-05-14 21:52:55 +02:00
endif()
set(SOURCES tagreaderbase.cpp tagreadermessages.proto)
if(USE_TAGLIB AND TAGLIB_FOUND)
list(APPEND SOURCES tagreadertaglib.cpp tagreadergme.cpp)
endif()
if(USE_TAGPARSER AND TAGPARSER_FOUND)
list(APPEND SOURCES tagreadertagparser.cpp)
endif()
2018-02-27 18:06:05 +01:00
2020-06-17 22:56:20 +02:00
link_directories(
${GLIB_LIBRARY_DIRS}
${PROTOBUF_LIBRARY_DIRS}
)
if(USE_TAGLIB AND TAGLIB_FOUND)
link_directories(${TAGLIB_LIBRARY_DIRS})
endif()
if(USE_TAGPARSER AND TAGPARSER_FOUND)
link_directories(${TAGPARSER_LIBRARY_DIRS})
endif()
2020-04-23 20:59:09 +02:00
add_library(libstrawberry-tagreader STATIC ${PROTO_SOURCES} ${SOURCES})
2020-06-17 22:56:20 +02:00
target_include_directories(libstrawberry-tagreader SYSTEM PRIVATE
2020-06-17 22:56:20 +02:00
${GLIB_INCLUDE_DIRS}
${PROTOBUF_INCLUDE_DIRS}
)
target_include_directories(libstrawberry-tagreader PRIVATE
2020-06-17 22:56:20 +02:00
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/ext/libstrawberry-common
${CMAKE_SOURCE_DIR}/src
${CMAKE_BINARY_DIR}/src
)
target_link_libraries(libstrawberry-tagreader PRIVATE
${GLIB_LIBRARIES}
2023-03-08 18:56:15 +01:00
${Protobuf_LIBRARIES}
2023-09-16 14:06:09 +02:00
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Gui
2020-06-17 22:56:20 +02:00
libstrawberry-common
)
if(USE_TAGLIB AND TAGLIB_FOUND)
target_include_directories(libstrawberry-tagreader SYSTEM PRIVATE ${TAGLIB_INCLUDE_DIRS})
target_link_libraries(libstrawberry-tagreader PRIVATE ${TAGLIB_LIBRARIES})
endif()
if(USE_TAGPARSER AND TAGPARSER_FOUND)
target_include_directories(libstrawberry-tagreader SYSTEM PRIVATE ${TAGPARSER_INCLUDE_DIRS})
target_link_libraries(libstrawberry-tagreader PRIVATE ${TAGPARSER_LIBRARIES})
endif()
protobuf_generate(TARGET libstrawberry-tagreader)