include_directories(${DEPS_INCLUDE_DIRS}
                    ${Boost_INCLUDE_DIR}
                    ${CMAKE_SOURCE_DIR}/src)

add_definitions(-DG_LOG_DOMAIN="${PROJECT_NAME}")

set(mediascanner_HEADERS
    commitpolicy.h
    dbusservice.h
    dbustypes.h
    declarations.h
    dbusutils.h
    filesystemscanner.h
    filesystemwalker.h
    filter.h
    locale.h
    mediaindex.h
    mediaroot.h
    mediautils.h
    property.h
    propertyschema.h
    settings.h
    refreshpolicy.h
    writablemediaindex.h
)

set(mediascanner_SOURCES
    commitpolicy.cpp
    dbusservice.cpp
    dbustypes.cpp
    dbusutils.cpp
    filesystemscanner.cpp
    filesystemwalker.cpp
    filter.cpp
    glibutils.cpp
    glibutils.h
    locale.cpp
    logging.cpp
    logging.h
    mediaartcache.cpp
    mediaartdownloader.cpp
    mediaindex.cpp
    mediaroot.cpp
    mediautils.cpp
    metadataresolver.h
    metadataresolver.cpp
    property.cpp
    propertyprivate.h
    propertyschema.cpp
    refreshpolicy.cpp
    settings.cpp
    taskfacades.cpp
    taskfacades.h
    taskmanager.cpp
    taskmanager.h
    utilities.h
    utilities.cpp
    writablemediaindex.cpp
)

add_library(mediascanner SHARED ${mediascanner_SOURCES})
target_link_libraries(mediascanner ${DEPS_LDFLAGS} ${Boost_LIBRARIES})

set_target_properties(mediascanner PROPERTIES
                      OUTPUT_NAME mediascanner-${MEDIASCANNER_API_VERSION}
                      SOVERSION "${MEDIASCANNER_ABI}"
                      VERSION "${MEDIASCANNER_VERSION}")

install(TARGETS mediascanner
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

install(FILES ${mediascanner_HEADERS}
 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mediascanner-${MEDIASCANNER_API_VERSION}/mediascanner
)
