include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/toolkit
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ape
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v1
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2/frames
  ${CMAKE_CURRENT_SOURCE_DIR}/../bindings/c/
)

if(NOT BUILD_SHARED_LIBS)
  add_definitions(-DTAGLIB_STATIC)
endif()

########### next target ###############

add_executable(tagreader tagreader.cpp)
target_link_libraries(tagreader tag)

########### next target ###############

add_executable(tagreader_c tagreader_c.c)
target_link_libraries(tagreader_c tag_c)

########### next target ###############

add_executable(tagwriter tagwriter.cpp)
target_link_libraries(tagwriter tag)

########### next target ###############

add_executable(framelist framelist.cpp)
target_link_libraries(framelist tag)

########### next target ###############

add_executable(strip-id3v1 strip-id3v1.cpp)
target_link_libraries(strip-id3v1 tag)


include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/toolkit
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ape
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v1
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2
  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2/frames
  ${CMAKE_CURRENT_SOURCE_DIR}/../bindings/c/
)

if(NOT BUILD_SHARED_LIBS)
  add_definitions(-DTAGLIB_STATIC)
endif()

########### next target ###############

add_executable(tagreader tagreader.cpp)
target_link_libraries(tagreader tag)

########### next target ###############

add_executable(tagreader_c tagreader_c.c)
target_link_libraries(tagreader_c tag_c)

########### next target ###############

add_executable(tagwriter tagwriter.cpp)
target_link_libraries(tagwriter tag)

########### next target ###############

add_executable(framelist framelist.cpp)
target_link_libraries(framelist tag)

########### next target ###############

add_executable(strip-id3v1 strip-id3v1.cpp)
target_link_libraries(strip-id3v1 tag)

install(TARGETS tagreader tagreader_c tagwriter framelist strip-id3v1
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

Install examples after we selected to build them
Install examples after we selected to build them

Signed-off-by: Andreas Sturmlechner <4ab28f2b959a234fa5e75929a1ee4d4ebc8839ca@gentoo.org>
