Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 87 lines (73 sloc) 2.564 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(btag)

if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

find_package(Boost 1.49.0 COMPONENTS filesystem locale system REQUIRED)

find_package(PkgConfig)
pkg_check_modules(LIBEDIT REQUIRED libedit)
pkg_check_modules(TAGLIB REQUIRED taglib)

option(CUESHEET_SUPPORT "Support for reading metadata from cue sheets" ON)
if(CUESHEET_SUPPORT)
    pkg_check_modules(LIBCUE REQUIRED libcue)
    find_library(ICONV_LIBRARIES NAMES iconv)
    if(ICONV_LIBRARIES)
        set(EXTRA_LIBRARIES ${EXTRA_LIBRARIES} ${ICONV_LIBRARIES})
    endif(ICONV_LIBRARIES)
endif(CUESHEET_SUPPORT)

set(PROGRAM_NAME ${PROJECT_NAME})

set(BTAG_SOURCES
    src/BasicStringFilter.cpp
    src/ConfirmationHandler.cpp
    src/EnglishTitleLocalizationHandler.cpp
    src/InteractiveTagger.cpp
    src/main.cpp
    src/RenamingFilter.cpp
    src/SimpleCapitalizationFilter.cpp
    src/SpanishTitleLocalizationHandler.cpp
    src/StandardConsole.cpp
    src/TitleCapitalizationFilter.cpp
    src/TitleLocalizationHandler.cpp)

set(BTAG_HEADERS
    ${CMAKE_CURRENT_BINARY_DIR}/src/config.h
    src/BasicStringFilter.h
    src/CapitalizationFilter.h
    src/ConfirmationHandler.h
    src/ConservativeRenamingFilter.h
    src/EnglishTitleLocalizationHandler.h
    src/InteractiveTagger.h
    src/number_cast.h
    src/RenamingFilter.h
    src/SimpleCapitalizationFilter.h
    src/SpanishTitleLocalizationHandler.h
    src/StandardConsole.h
    src/TitleCapitalizationFilter.h
    src/TitleLocalizationHandler.h
    src/UnixRenamingFilter.h
    src/wide_string_cast.h)

if(CUESHEET_SUPPORT)
    set(BTAG_SOURCES ${BTAG_SOURCES} src/CueReader.cpp)
    set(BTAG_HEADERS ${BTAG_HEADERS} src/CueReader.h)
endif(CUESHEET_SUPPORT)

configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in
    ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)

include_directories(
    ${CMAKE_CURRENT_BINARY_DIR}/src
    ${Boost_INCLUDE_DIRS}
    ${LIBCUE_INCLUDE_DIRS}
    ${LIBEDIT_INCLUDE_DIRS}
    ${TAGLIB_INCLUDE_DIRS})

add_executable(btag ${BTAG_SOURCES} ${BTAG_HEADERS})
target_link_libraries(btag
    ${Boost_LIBRARIES}
    ${LIBCUE_LIBRARIES}
    ${LIBEDIT_LIBRARIES}
    ${TAGLIB_LIBRARIES}
    ${EXTRA_LIBRARIES})

install(TARGETS btag DESTINATION bin)

option(ENABLE_TESTS "Make the check target available" OFF)
if(ENABLE_TESTS)
    enable_testing()
    add_subdirectory(tests)
endif(ENABLE_TESTS)
Something went wrong with that request. Please try again.