2022-07-28 04:01:58 +02:00
|
|
|
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)
|
2023-07-11 13:42:15 +02:00
|
|
|
set(Protobuf_LIBRARIES protobuf::libprotobuf)
|
2023-05-14 21:52:55 +02:00
|
|
|
endif()
|
|
|
|
|
2023-05-14 20:07:36 +02:00
|
|
|
set(SOURCES tagreaderbase.cpp tagreadermessages.proto)
|
2021-07-02 01:16:14 +02:00
|
|
|
|
2024-07-01 02:06:39 +02:00
|
|
|
if(HAVE_TAGLIB)
|
2022-08-01 09:41:12 +02:00
|
|
|
list(APPEND SOURCES tagreadertaglib.cpp tagreadergme.cpp)
|
2021-07-02 01:16:14 +02:00
|
|
|
endif()
|
|
|
|
|
2024-07-01 02:06:39 +02:00
|
|
|
if(HAVE_TAGPARSER)
|
2021-07-02 01:16:14 +02:00
|
|
|
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}
|
|
|
|
)
|
|
|
|
|
2024-07-01 02:06:39 +02:00
|
|
|
if(HAVE_TAGLIB)
|
2021-07-02 01:16:14 +02:00
|
|
|
link_directories(${TAGLIB_LIBRARY_DIRS})
|
|
|
|
endif()
|
|
|
|
|
2024-07-01 02:06:39 +02:00
|
|
|
if(HAVE_TAGPARSER)
|
2021-07-02 01:16:14 +02:00
|
|
|
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
|
|
|
|
2020-06-26 23:26:04 +02:00
|
|
|
target_include_directories(libstrawberry-tagreader SYSTEM PRIVATE
|
2020-06-17 22:56:20 +02:00
|
|
|
${GLIB_INCLUDE_DIRS}
|
|
|
|
${PROTOBUF_INCLUDE_DIRS}
|
2020-06-26 23:26:04 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
)
|
2021-07-02 01:16:14 +02:00
|
|
|
|
2024-07-01 02:06:39 +02:00
|
|
|
if(HAVE_TAGLIB)
|
2021-07-02 01:16:14 +02:00
|
|
|
target_include_directories(libstrawberry-tagreader SYSTEM PRIVATE ${TAGLIB_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(libstrawberry-tagreader PRIVATE ${TAGLIB_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2024-07-01 02:06:39 +02:00
|
|
|
if(HAVE_TAGPARSER)
|
2021-07-02 01:16:14 +02:00
|
|
|
target_include_directories(libstrawberry-tagreader SYSTEM PRIVATE ${TAGPARSER_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(libstrawberry-tagreader PRIVATE ${TAGPARSER_LIBRARIES})
|
|
|
|
endif()
|
2023-05-14 20:07:36 +02:00
|
|
|
|
|
|
|
protobuf_generate(TARGET libstrawberry-tagreader)
|