From d03ef3c3122cec5d08f47be2edb5352460106ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Mon, 18 Apr 2011 16:50:18 +0200 Subject: [PATCH 1/9] Use the PUBLIC_HEADER property to prepare for building an OS X framework --- CMakeLists.txt | 1 - bindings/c/CMakeLists.txt | 5 +- taglib/CMakeLists.txt | 104 +++++++++++++++++++++--- taglib/ape/CMakeLists.txt | 1 - taglib/asf/CMakeLists.txt | 1 - taglib/flac/CMakeLists.txt | 1 - taglib/mp4/CMakeLists.txt | 1 - taglib/mpc/CMakeLists.txt | 1 - taglib/mpeg/CMakeLists.txt | 4 - taglib/mpeg/id3v1/CMakeLists.txt | 1 - taglib/mpeg/id3v2/CMakeLists.txt | 4 - taglib/mpeg/id3v2/frames/CMakeLists.txt | 13 --- taglib/ogg/CMakeLists.txt | 6 -- taglib/ogg/flac/CMakeLists.txt | 2 - taglib/ogg/speex/CMakeLists.txt | 1 - taglib/ogg/vorbis/CMakeLists.txt | 1 - taglib/riff/CMakeLists.txt | 4 - taglib/riff/aiff/CMakeLists.txt | 1 - taglib/riff/wav/CMakeLists.txt | 1 - taglib/toolkit/CMakeLists.txt | 1 - taglib/toolkit/tfile.cpp | 1 + taglib/trueaudio/CMakeLists.txt | 1 - taglib/wavpack/CMakeLists.txt | 1 - 23 files changed, 96 insertions(+), 61 deletions(-) delete mode 100644 taglib/ape/CMakeLists.txt delete mode 100644 taglib/asf/CMakeLists.txt delete mode 100644 taglib/flac/CMakeLists.txt delete mode 100644 taglib/mp4/CMakeLists.txt delete mode 100644 taglib/mpc/CMakeLists.txt delete mode 100644 taglib/mpeg/CMakeLists.txt delete mode 100644 taglib/mpeg/id3v1/CMakeLists.txt delete mode 100644 taglib/mpeg/id3v2/CMakeLists.txt delete mode 100644 taglib/mpeg/id3v2/frames/CMakeLists.txt delete mode 100644 taglib/ogg/CMakeLists.txt delete mode 100644 taglib/ogg/flac/CMakeLists.txt delete mode 100644 taglib/ogg/speex/CMakeLists.txt delete mode 100644 taglib/ogg/vorbis/CMakeLists.txt delete mode 100644 taglib/riff/CMakeLists.txt delete mode 100644 taglib/riff/aiff/CMakeLists.txt delete mode 100644 taglib/riff/wav/CMakeLists.txt delete mode 100644 taglib/toolkit/CMakeLists.txt delete mode 100644 taglib/trueaudio/CMakeLists.txt delete mode 100644 taglib/wavpack/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 233f05eb..88894c36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,6 @@ if(WITH_MP4) endif() configure_file(taglib/taglib_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib_config.h) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/taglib_config.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) add_subdirectory(taglib) add_subdirectory(bindings) diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index d1f75234..e9c8843f 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -18,6 +18,8 @@ include_directories( configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib_c.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib_c.pc) +set(tag_c_HDRS tag_c.h) + if(ENABLE_STATIC) add_library(tag_c STATIC tag_c.cpp) set_target_properties(tag_c PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC) @@ -26,6 +28,7 @@ else() endif() target_link_libraries(tag_c tag) +set_target_properties(tag_c PROPERTIES PUBLIC_HEADER "${tag_c_HDRS}") # On Solaris we need to explicitly add the C++ standard and runtime # libraries to the libs used by the C bindings, because those C bindings @@ -58,8 +61,8 @@ install(TARGETS tag_c LIBRARY DESTINATION ${LIB_INSTALL_DIR} RUNTIME DESTINATION ${BIN_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}/taglib ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/taglib_c.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) -install(FILES tag_c.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/CMakeLists.txt b/taglib/CMakeLists.txt index 53022c0a..bd8effc3 100644 --- a/taglib/CMakeLists.txt +++ b/taglib/CMakeLists.txt @@ -25,17 +25,95 @@ if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIR}) endif() -add_subdirectory(toolkit) -add_subdirectory(asf) -add_subdirectory(mpeg) -add_subdirectory(ogg) -add_subdirectory(flac) -add_subdirectory(ape) -add_subdirectory(mpc) -add_subdirectory(mp4) -add_subdirectory(wavpack) -add_subdirectory(trueaudio) -add_subdirectory(riff) +set(tag_HDRS + tag.h + fileref.h + audioproperties.h + taglib_export.h + ${CMAKE_BINARY_DIR}/taglib_config.h + toolkit/taglib.h + toolkit/tstring.h + toolkit/tlist.h + toolkit/tlist.tcc + toolkit/tstringlist.h + toolkit/tbytevector.h + toolkit/tbytevectorlist.h + toolkit/tfile.h + toolkit/tmap.h + toolkit/tmap.tcc + mpeg/mpegfile.h + mpeg/mpegproperties.h + mpeg/mpegheader.h + mpeg/xingheader.h + mpeg/id3v1/id3v1tag.h + mpeg/id3v1/id3v1genres.h + mpeg/id3v2/id3v2extendedheader.h + mpeg/id3v2/id3v2frame.h + mpeg/id3v2/id3v2header.h + mpeg/id3v2/id3v2synchdata.h + mpeg/id3v2/id3v2footer.h + mpeg/id3v2/id3v2framefactory.h + mpeg/id3v2/id3v2tag.h + mpeg/id3v2/frames/attachedpictureframe.h + mpeg/id3v2/frames/commentsframe.h + mpeg/id3v2/frames/generalencapsulatedobjectframe.h + mpeg/id3v2/frames/popularimeterframe.h + mpeg/id3v2/frames/privateframe.h + mpeg/id3v2/frames/relativevolumeframe.h + mpeg/id3v2/frames/textidentificationframe.h + mpeg/id3v2/frames/uniquefileidentifierframe.h + mpeg/id3v2/frames/unknownframe.h + mpeg/id3v2/frames/unsynchronizedlyricsframe.h + mpeg/id3v2/frames/urllinkframe.h + ogg/oggfile.h + ogg/oggpage.h + ogg/oggpageheader.h + ogg/xiphcomment.h + ogg/vorbis/vorbisfile.h + ogg/vorbis/vorbisproperties.h + ogg/flac/oggflacfile.h + ogg/speex/speexfile.h + ogg/speex/speexproperties.h + flac/flacfile.h + flac/flacpicture.h + flac/flacproperties.h + flac/flacmetadatablock.h + ape/apefile.h + ape/apeproperties.h + ape/apetag.h + ape/apefooter.h + ape/apeitem.h + mpc/mpcfile.h + mpc/mpcproperties.h + wavpack/wavpackfile.h + wavpack/wavpackproperties.h + trueaudio/trueaudiofile.h + trueaudio/trueaudioproperties.h + riff/rifffile.h + riff/aiff/aifffile.h + riff/aiff/aiffproperties.h + riff/wav/wavfile.h + riff/wav/wavproperties.h +) +if(WITH_ASF) + set(tag_HDRS ${tag_HDRS} + asf/asffile.h + asf/asfproperties.h + asf/asftag.h + asf/asfattribute.h + asf/asfpicture.h + ) +endif() +if(WITH_MP4) + set(tag_HDRS ${tag_HDRS} + mp4/mp4file.h + mp4/mp4atom.h + mp4/mp4tag.h + mp4/mp4item.h + mp4/mp4properties.h + mp4/mp4coverart.h + ) +endif() set(mpeg_SRCS mpeg/mpegfile.cpp @@ -199,13 +277,13 @@ set_target_properties(tag PROPERTIES INSTALL_NAME_DIR ${LIB_INSTALL_DIR} DEFINE_SYMBOL MAKE_TAGLIB_LIB LINK_INTERFACE_LIBRARIES "" + PUBLIC_HEADER "${tag_HDRS}" ) install(TARGETS tag LIBRARY DESTINATION ${LIB_INSTALL_DIR} RUNTIME DESTINATION ${BIN_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}/taglib ) -install(FILES tag.h fileref.h audioproperties.h taglib_export.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) - diff --git a/taglib/ape/CMakeLists.txt b/taglib/ape/CMakeLists.txt deleted file mode 100644 index 1a3c2093..00000000 --- a/taglib/ape/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES apefile.h apeproperties.h apetag.h apefooter.h apeitem.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/asf/CMakeLists.txt b/taglib/asf/CMakeLists.txt deleted file mode 100644 index 2855beca..00000000 --- a/taglib/asf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES asffile.h asfproperties.h asftag.h asfattribute.h asfpicture.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/flac/CMakeLists.txt b/taglib/flac/CMakeLists.txt deleted file mode 100644 index 588208f9..00000000 --- a/taglib/flac/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES flacfile.h flacpicture.h flacproperties.h flacmetadatablock.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib ) diff --git a/taglib/mp4/CMakeLists.txt b/taglib/mp4/CMakeLists.txt deleted file mode 100644 index 993a5c0b..00000000 --- a/taglib/mp4/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES mp4file.h mp4atom.h mp4tag.h mp4item.h mp4properties.h mp4coverart.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/mpc/CMakeLists.txt b/taglib/mpc/CMakeLists.txt deleted file mode 100644 index 238c9cb1..00000000 --- a/taglib/mpc/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES mpcfile.h mpcproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/mpeg/CMakeLists.txt b/taglib/mpeg/CMakeLists.txt deleted file mode 100644 index 9b0e3086..00000000 --- a/taglib/mpeg/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -ADD_SUBDIRECTORY( id3v1 ) -ADD_SUBDIRECTORY( id3v2 ) - -INSTALL(FILES mpegfile.h mpegproperties.h mpegheader.h xingheader.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib ) diff --git a/taglib/mpeg/id3v1/CMakeLists.txt b/taglib/mpeg/id3v1/CMakeLists.txt deleted file mode 100644 index 64b21ec8..00000000 --- a/taglib/mpeg/id3v1/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES id3v1tag.h id3v1genres.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/mpeg/id3v2/CMakeLists.txt b/taglib/mpeg/id3v2/CMakeLists.txt deleted file mode 100644 index f6e1ef13..00000000 --- a/taglib/mpeg/id3v2/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -ADD_SUBDIRECTORY( frames ) - -INSTALL(FILES id3v2extendedheader.h id3v2frame.h id3v2header.h id3v2synchdata.h id3v2footer.h id3v2framefactory.h id3v2tag.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) - diff --git a/taglib/mpeg/id3v2/frames/CMakeLists.txt b/taglib/mpeg/id3v2/frames/CMakeLists.txt deleted file mode 100644 index 6636ddec..00000000 --- a/taglib/mpeg/id3v2/frames/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -INSTALL(FILES - attachedpictureframe.h - commentsframe.h - generalencapsulatedobjectframe.h - popularimeterframe.h - privateframe.h - relativevolumeframe.h - textidentificationframe.h - uniquefileidentifierframe.h - unknownframe.h - unsynchronizedlyricsframe.h - urllinkframe.h - DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/ogg/CMakeLists.txt b/taglib/ogg/CMakeLists.txt deleted file mode 100644 index d506a3cd..00000000 --- a/taglib/ogg/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -ADD_SUBDIRECTORY( vorbis ) -ADD_SUBDIRECTORY( speex ) -ADD_SUBDIRECTORY( flac ) - -INSTALL( FILES oggfile.h oggpage.h oggpageheader.h xiphcomment.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib ) - diff --git a/taglib/ogg/flac/CMakeLists.txt b/taglib/ogg/flac/CMakeLists.txt deleted file mode 100644 index 6e7d9a81..00000000 --- a/taglib/ogg/flac/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -INSTALL( FILES oggflacfile.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) - diff --git a/taglib/ogg/speex/CMakeLists.txt b/taglib/ogg/speex/CMakeLists.txt deleted file mode 100644 index 7f35b71f..00000000 --- a/taglib/ogg/speex/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES speexfile.h speexproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/ogg/vorbis/CMakeLists.txt b/taglib/ogg/vorbis/CMakeLists.txt deleted file mode 100644 index 7033e132..00000000 --- a/taglib/ogg/vorbis/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES vorbisfile.h vorbisproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/riff/CMakeLists.txt b/taglib/riff/CMakeLists.txt deleted file mode 100644 index f691ee41..00000000 --- a/taglib/riff/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -ADD_SUBDIRECTORY( aiff ) -ADD_SUBDIRECTORY( wav ) - -INSTALL( FILES rifffile.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/riff/aiff/CMakeLists.txt b/taglib/riff/aiff/CMakeLists.txt deleted file mode 100644 index 7e8cdd66..00000000 --- a/taglib/riff/aiff/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES aifffile.h aiffproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/riff/wav/CMakeLists.txt b/taglib/riff/wav/CMakeLists.txt deleted file mode 100644 index c011579c..00000000 --- a/taglib/riff/wav/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES wavfile.h wavproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/toolkit/CMakeLists.txt b/taglib/toolkit/CMakeLists.txt deleted file mode 100644 index 2e39d31f..00000000 --- a/taglib/toolkit/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES taglib.h tstring.h tlist.h tlist.tcc tstringlist.h tbytevector.h tbytevectorlist.h tfile.h tmap.h tmap.tcc DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/toolkit/tfile.cpp b/taglib/toolkit/tfile.cpp index 946d7ea2..93879f10 100644 --- a/taglib/toolkit/tfile.cpp +++ b/taglib/toolkit/tfile.cpp @@ -564,3 +564,4 @@ TagLib::uint File::bufferSize() { return FilePrivate::bufferSize; } + diff --git a/taglib/trueaudio/CMakeLists.txt b/taglib/trueaudio/CMakeLists.txt deleted file mode 100644 index 3a1c3e7b..00000000 --- a/taglib/trueaudio/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES trueaudiofile.h trueaudioproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/wavpack/CMakeLists.txt b/taglib/wavpack/CMakeLists.txt deleted file mode 100644 index 8b9de0fd..00000000 --- a/taglib/wavpack/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -INSTALL( FILES wavpackfile.h wavpackproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) From 81734919d261c2f8c64b64ae82f781b58a9b9637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Tue, 19 Apr 2011 12:45:11 +0200 Subject: [PATCH 2/9] Add info about BUILD_EXAMPLES to the INSTALL file --- INSTALL | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/INSTALL b/INSTALL index e833199f..2aba6b43 100644 --- a/INSTALL +++ b/INSTALL @@ -14,6 +14,10 @@ support for MP4 and WMA using the following options: cmake -DWITH_MP4=ON -DWITH_ASF=ON [...] +In order to build the included examples, use the BUILD_EXAMPLES option: + + cmake -DBUILD_EXAMPLES=ON [...] + If you want to run the test suite to make sure TagLib works properly on your system, you need to have cppunit installed. The test suite has a custom target in the build system, so you can run the tests using make: From b2e3a477e998f7fbf3b3e9567340e71ed25add89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Mon, 2 May 2011 22:41:01 +0200 Subject: [PATCH 3/9] Always make a copy of the ID3v1 genre name strings http://thread.gmane.org/gmane.comp.kde.devel.taglib/1876 --- taglib/mpeg/id3v1/id3v1genres.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taglib/mpeg/id3v1/id3v1genres.cpp b/taglib/mpeg/id3v1/id3v1genres.cpp index 7893c72c..eba4c526 100644 --- a/taglib/mpeg/id3v1/id3v1genres.cpp +++ b/taglib/mpeg/id3v1/id3v1genres.cpp @@ -207,7 +207,7 @@ ID3v1::GenreMap ID3v1::genreMap() String ID3v1::genre(int i) { if(i >= 0 && i < genresSize) - return genres[i]; + return genres[i] + String::null; // always make a copy return String::null; } From c33769416511af7b6ce3cc11e607c994767e60bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sun, 8 May 2011 15:46:19 +0200 Subject: [PATCH 4/9] Make it possible to build an OS X framework --- CMakeLists.txt | 5 +++++ bindings/c/CMakeLists.txt | 8 ++++++-- taglib/CMakeLists.txt | 8 ++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88894c36..2a0992ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,11 @@ set(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" CACHE PATH "The subdirectory to set(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE) set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The subdirectory to the header prefix" FORCE) +if(APPLE) + option(BUILD_FRAMEWORK "Build an OS X framework" OFF) + set(FRAMEWORK_INSTALL_DIR "/Library/Frameworks" CACHE STRING "Directory to install frameworks to.") +endif() + if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index e9c8843f..d6f19855 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -21,14 +21,17 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib_c.pc.cmake ${CMAKE_CURRENT_BIN set(tag_c_HDRS tag_c.h) if(ENABLE_STATIC) - add_library(tag_c STATIC tag_c.cpp) + add_library(tag_c STATIC tag_c.cpp ${tag_c_HDRS}) set_target_properties(tag_c PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC) else() - add_library(tag_c SHARED tag_c.cpp) + add_library(tag_c SHARED tag_c.cpp ${tag_c_HDRS}) endif() target_link_libraries(tag_c tag) set_target_properties(tag_c PROPERTIES PUBLIC_HEADER "${tag_c_HDRS}") +if(BUILD_FRAMEWORK) + set_target_properties(tag_c PROPERTIES FRAMEWORK TRUE) +endif() # On Solaris we need to explicitly add the C++ standard and runtime # libraries to the libs used by the C bindings, because those C bindings @@ -58,6 +61,7 @@ set_target_properties(tag_c PROPERTIES INSTALL_NAME_DIR ${LIB_INSTALL_DIR} ) install(TARGETS tag_c + FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR} LIBRARY DESTINATION ${LIB_INSTALL_DIR} RUNTIME DESTINATION ${BIN_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} diff --git a/taglib/CMakeLists.txt b/taglib/CMakeLists.txt index bd8effc3..8e7a3b64 100644 --- a/taglib/CMakeLists.txt +++ b/taglib/CMakeLists.txt @@ -261,10 +261,10 @@ if(WITH_MP4) endif() if(ENABLE_STATIC) - add_library(tag STATIC ${tag_LIB_SRCS}) + add_library(tag STATIC ${tag_LIB_SRCS} ${tag_HDRS}) set_target_properties(tag PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC) else() - add_library(tag SHARED ${tag_LIB_SRCS}) + add_library(tag SHARED ${tag_LIB_SRCS} ${tag_HDRS}) endif() if(ZLIB_FOUND) @@ -279,8 +279,12 @@ set_target_properties(tag PROPERTIES LINK_INTERFACE_LIBRARIES "" PUBLIC_HEADER "${tag_HDRS}" ) +if(BUILD_FRAMEWORK) + set_target_properties(tag PROPERTIES FRAMEWORK TRUE) +endif() install(TARGETS tag + FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR} LIBRARY DESTINATION ${LIB_INSTALL_DIR} RUNTIME DESTINATION ${BIN_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} From b5b8387aee6ae51416d298805db3353c5a1542af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sun, 8 May 2011 15:50:44 +0200 Subject: [PATCH 5/9] Don't install pkg-config files when building a framework --- CMakeLists.txt | 2 +- bindings/c/CMakeLists.txt | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a0992ba..928a3f5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ include(ConfigureChecks.cmake) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib-config ) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/taglib-config DESTINATION ${BIN_INSTALL_DIR}) -if(NOT WIN32) +if(NOT WIN32 AND NOT BUILD_FRAMEWORK) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib.pc ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/taglib.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) endif() diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index d6f19855..63dc84b8 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -16,8 +16,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/trueaudio ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib_c.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib_c.pc) - set(tag_c_HDRS tag_c.h) if(ENABLE_STATIC) @@ -68,5 +66,8 @@ install(TARGETS tag_c PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}/taglib ) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/taglib_c.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) +if(NOT WIN32 AND NOT BUILD_FRAMEWORK) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib_c.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib_c.pc) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/taglib_c.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) +endif() From a38d2b299589c87e866195959e13f289e2fadca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sun, 8 May 2011 15:57:34 +0200 Subject: [PATCH 6/9] Simplify static builds --- CMakeLists.txt | 6 ++++++ bindings/c/CMakeLists.txt | 7 +------ taglib/CMakeLists.txt | 7 +------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 928a3f5e..fb7c2892 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,12 @@ project(taglib) cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) option(ENABLE_STATIC "Make static version of libtag" OFF) +if(ENABLE_STATIC) + add_definitions(-DTAGLIB_STATIC) + set(BUILD_SHARED_LIBS OFF) +else() + set(BUILD_SHARED_LIBS ON) +endif() option(BUILD_TESTS "Build the test suite" OFF) option(BUILD_EXAMPLES "Build the examples" OFF) diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index 63dc84b8..2d9dafc4 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -18,12 +18,7 @@ include_directories( set(tag_c_HDRS tag_c.h) -if(ENABLE_STATIC) - add_library(tag_c STATIC tag_c.cpp ${tag_c_HDRS}) - set_target_properties(tag_c PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC) -else() - add_library(tag_c SHARED tag_c.cpp ${tag_c_HDRS}) -endif() +add_library(tag_c tag_c.cpp ${tag_c_HDRS}) target_link_libraries(tag_c tag) set_target_properties(tag_c PROPERTIES PUBLIC_HEADER "${tag_c_HDRS}") diff --git a/taglib/CMakeLists.txt b/taglib/CMakeLists.txt index 8e7a3b64..d7274a89 100644 --- a/taglib/CMakeLists.txt +++ b/taglib/CMakeLists.txt @@ -260,12 +260,7 @@ if(WITH_MP4) set(tag_LIB_SRCS ${tag_LIB_SRCS} ${mp4_SRCS}) endif() -if(ENABLE_STATIC) - add_library(tag STATIC ${tag_LIB_SRCS} ${tag_HDRS}) - set_target_properties(tag PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC) -else() - add_library(tag SHARED ${tag_LIB_SRCS} ${tag_HDRS}) -endif() +add_library(tag ${tag_LIB_SRCS} ${tag_HDRS}) if(ZLIB_FOUND) target_link_libraries(tag ${ZLIB_LIBRARIES}) From adb0984c87dda936d94a07c32548e2aedf5129a7 Mon Sep 17 00:00:00 2001 From: Wolfgang Plaschg Date: Mon, 9 May 2011 16:23:17 +0200 Subject: [PATCH 7/9] Adding ignore rules for MSVC 2008 build results --- .gitignore | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index 4bc92e65..3fda06b8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,11 @@ CMakeFiles/ *.so *.so.* *.dylib +*.vcproj +*.ncb +*.sln +*.suo +*.user /CMakeCache.txt /Doxyfile /config.h @@ -12,9 +17,23 @@ CMakeFiles/ /taglib_config.h /taglib-config /bindings/c/taglib_c.pc +/bindings/c/Debug +/bindings/c/MinSizeRel +/bindings/c/Release +/bindings/c/tag_c.dir/Debug +/bindings/c/tag_c.dir/MinSizeRel +/bindings/c/tag_c.dir/Release /examples/framelist /examples/strip-id3v1 /examples/tagreader /examples/tagreader_c /examples/tagwriter /doc/html +/taglib/Debug +/taglib/MinSizeRel +/taglib/Release +/taglib/tag.dir/Debug +/taglib/tag.dir/MinSizeRel +/taglib/tag.dir/Release +/ALL_BUILD.dir +/ZERO_CHECK.dir From efeccbf72614efaed1c7282f8c9ee02a0acf871f Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Mon, 9 May 2011 19:06:08 +0200 Subject: [PATCH 8/9] Don't lead the scanned blocks on save --- taglib/flac/flacfile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/taglib/flac/flacfile.cpp b/taglib/flac/flacfile.cpp index f882ae7b..4e3d2b36 100644 --- a/taglib/flac/flacfile.cpp +++ b/taglib/flac/flacfile.cpp @@ -161,10 +161,12 @@ bool FLAC::File::save() MetadataBlock *block = d->blocks[i]; if(block->code() == MetadataBlock::VorbisComment) { // Set the new Vorbis Comment block + delete block; block = new UnknownMetadataBlock(MetadataBlock::VorbisComment, d->xiphCommentData); foundVorbisCommentBlock = true; } if(block->code() == MetadataBlock::Padding) { + delete block; continue; } newBlocks.append(block); @@ -190,7 +192,7 @@ bool FLAC::File::save() // Adjust the padding block(s) long originalLength = d->streamStart - d->flacStart; - int paddingLength = originalLength - data.size() - 4; + int paddingLength = originalLength - data.size() - 4; if (paddingLength < 0) { paddingLength = MinPaddingLength; } From dc062a0844d9d5050724302478f2d1c0cf0c813e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sun, 15 May 2011 00:07:29 +0200 Subject: [PATCH 9/9] Make RefCounter compile on OS X with the 10.4 SDK The 10.4 SDK defines OSAtomic functions as int32_t, while 10.5 and newer SDKs define them as volatile int32_t. This caused a compilation error when compiling against the 10.4 SDK. I'd have prefered a preprocessor-based solution, but I couldn't find any macro that says the SDK version, so I copied this cast solution from Apple's WebKit. I assume then know what they are doing if they have to workaround their own API. :) --- taglib/toolkit/taglib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/taglib/toolkit/taglib.h b/taglib/toolkit/taglib.h index 922640d1..c42f1bde 100644 --- a/taglib/toolkit/taglib.h +++ b/taglib/toolkit/taglib.h @@ -100,8 +100,8 @@ namespace TagLib { RefCounter() : refCount(1) {} #ifdef TAGLIB_ATOMIC_MAC - void ref() { OSAtomicIncrement32Barrier(&refCount); } - bool deref() { return ! OSAtomicDecrement32Barrier(&refCount); } + void ref() { OSAtomicIncrement32Barrier(const_cast(&refCount)); } + bool deref() { return ! OSAtomicDecrement32Barrier(const_cast(&refCount)); } int32_t count() { return refCount; } private: volatile int32_t refCount;