]> granicus.if.org Git - taglib/commitdiff
Add support for a global, installable config header
authorLukáš Lalinský <lalinsky@gmail.com>
Fri, 4 Sep 2009 09:29:59 +0000 (09:29 +0000)
committerLukáš Lalinský <lalinsky@gmail.com>
Fri, 4 Sep 2009 09:29:59 +0000 (09:29 +0000)
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1019671 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

18 files changed:
CMakeLists.txt
bindings/c/tag_c.cpp
configure.in.in
taglib/Makefile.am
taglib/asf/asfattribute.cpp
taglib/asf/asffile.cpp
taglib/asf/asfproperties.cpp
taglib/asf/asftag.cpp
taglib/fileref.cpp
taglib/mp4/mp4atom.cpp
taglib/mp4/mp4file.cpp
taglib/mp4/mp4item.cpp
taglib/mp4/mp4properties.cpp
taglib/mp4/mp4tag.cpp
taglib/taglib_config.h.cmake [new file with mode: 0644]
taglib/taglib_config.h.in [new file with mode: 0644]
taglib/taglib_export.h
tests/test_fileref.cpp

index b3e617dbef6b49c442746b9067f3757ff94dd27c..ec77cb5df170d446226f8190ebd3f4db26a64627 100644 (file)
@@ -53,6 +53,15 @@ endif(NOT WIN32)
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 configure_file(config-taglib.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
 
+if(WITH_ASF)
+    set(TAGLIB_WITH_ASF TRUE)
+endif(WITH_ASF)
+if(WITH_MP4)
+    set(TAGLIB_WITH_MP4 TRUE)
+endif(WITH_MP4)
+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(tests)
index 42f503ec1ea2cb792478b01e0cd25531a5f9ed84..238af0785578c63afcebefa5da74ca7988ab6f0b 100644 (file)
@@ -86,11 +86,11 @@ TagLib_File *taglib_file_new_type(const char *filename, TagLib_File_Type type)
     return reinterpret_cast<TagLib_File *>(new Ogg::Speex::File(filename));
   case TagLib_File_TrueAudio:
     return reinterpret_cast<TagLib_File *>(new TrueAudio::File(filename));
-#ifdef WITH_MP4
+#ifdef TAGLIB_WITH_MP4
   case TagLib_File_MP4:
     return reinterpret_cast<TagLib_File *>(new MP4::File(filename));
 #endif
-#ifdef WITH_ASF
+#ifdef TAGLIB_WITH_ASF
   case TagLib_File_ASF:
     return reinterpret_cast<TagLib_File *>(new ASF::File(filename));
 #endif
index 3cbbae96d66dad21cb67de8f4fd527c2fbc25a0d..ee9a2166fb53ff6cc2e08b0267098eefa7910526 100644 (file)
@@ -56,6 +56,7 @@ KDE_CONF_FILES
 dnl without this order in this file, automake will be confused!
 dnl
 AM_CONFIG_HEADER(config.h)
+AM_CONFIG_HEADER(taglib/taglib_config.h)
 
 dnl checks for programs.
 dnl first check for c/c++ compilers
@@ -129,15 +130,15 @@ AC_DEFUN([AC_NO_CPPUNIT],
 AC_ARG_ENABLE([mp4],
     [AS_HELP_STRING([--enable-mp4], [add MP4 support])],
     [
-        AC_DEFINE([WITH_MP4], [1],
-                  [With MP4 support])
+        AC_DEFINE([WITH_MP4], [1], [With MP4 support]),
+        AC_DEFINE([TAGLIB_WITH_MP4], [1], [With MP4 support])
     ])
 
 AC_ARG_ENABLE([asf],
     [AS_HELP_STRING([--enable-asf], [add ASF support])],
     [
-        AC_DEFINE([WITH_ASF], [1],
-                  [With ASF support])
+        AC_DEFINE([WITH_ASF], [1], [With ASF support]),
+        AC_DEFINE([TAGLIB_WITH_ASF], [1], [With ASF support])
     ])
 
 AC_LANG_SAVE
index c78a78ea414ef92e51ad5bd96b5c72641f57c97a..c11f0d9beb752c0ebe9fbf86ad85aca7e6118f6d 100644 (file)
@@ -24,7 +24,7 @@ INCLUDES = \
 lib_LTLIBRARIES = libtag.la
 
 libtag_la_SOURCES = tag.cpp tagunion.cpp fileref.cpp audioproperties.cpp
-taglib_include_HEADERS = tag.h fileref.h audioproperties.h taglib_export.h
+taglib_include_HEADERS = tag.h fileref.h audioproperties.h taglib_export.h taglib_config.h
 taglib_includedir = $(includedir)/taglib
 
 # Here are a set of rules to help you update your library version information:
index a4a4c178c146a4c17af75839bb6867dcc61c4c04..f9bae6583cde65a15ff724e9fa9e6856094286bb 100644 (file)
@@ -27,7 +27,7 @@
 #include <config.h>
 #endif
 
-#ifdef WITH_ASF
+#ifdef TAGLIB_WITH_ASF
 
 #include <taglib.h>
 #include "asfattribute.h"
index e403934b215e870541034f3dabd2ea6f2d3d6b7f..da50056d8d8c2c6b502088affc0dca8a1d27e1aa 100644 (file)
@@ -27,7 +27,7 @@
 #include <config.h>
 #endif
 
-#ifdef WITH_ASF
+#ifdef TAGLIB_WITH_ASF
 
 #include <tdebug.h>
 #include <tbytevectorlist.h>
index 68e2d4ca4805a1c12b44701ce6bb92124ed62c81..f7b7be48da0b014413e688214924f679df201d4e 100644 (file)
@@ -27,7 +27,7 @@
 #include <config.h>
 #endif
 
-#ifdef WITH_ASF
+#ifdef TAGLIB_WITH_ASF
 
 #include <tdebug.h>
 #include <tstring.h>
index 6bea247f2d710f7d3e81675b2e714d940050c05c..6ec64aa03f8cb3fd3b9966c45891cf9fc8e47061 100644 (file)
@@ -27,7 +27,7 @@
 #include <config.h>
 #endif
 
-#ifdef WITH_ASF
+#ifdef TAGLIB_WITH_ASF
 
 #include "asftag.h"
 
index 31fcddab212a75f348cd5cd434d82dd00114caf8..8e4272dd685ee3137439112226c83a818857557d 100644 (file)
@@ -129,14 +129,14 @@ StringList FileRef::defaultFileExtensions()
   l.append("wv");
   l.append("spx");
   l.append("tta");
-#ifdef WITH_MP4
+#ifdef TAGLIB_WITH_MP4
   l.append("m4a");
   l.append("m4b");
   l.append("m4p");
   l.append("3g2");
   l.append("mp4");
 #endif
-#ifdef WITH_ASF
+#ifdef TAGLIB_WITH_ASF
   l.append("wma");
   l.append("asf");
 #endif
@@ -221,11 +221,11 @@ File *FileRef::create(FileName fileName, bool readAudioProperties,
       return new Ogg::Speex::File(fileName, readAudioProperties, audioPropertiesStyle);
     if(ext == "TTA")
       return new TrueAudio::File(fileName, readAudioProperties, audioPropertiesStyle);
-#ifdef WITH_MP4
+#ifdef TAGLIB_WITH_MP4
     if(ext == "M4A" || ext == "M4B" || ext == "M4P" || ext == "MP4" || ext == "3G2")
       return new MP4::File(fileName, readAudioProperties, audioPropertiesStyle);
 #endif
-#ifdef WITH_ASF
+#ifdef TAGLIB_WITH_ASF
     if(ext == "WMA" || ext == "ASF")
       return new ASF::File(fileName, readAudioProperties, audioPropertiesStyle);
 #endif
index ba07409a39593f20e264bd1a3a91a46c4b36c14f..7ef163170430480c35f7d7074feb516baa889d8c 100644 (file)
@@ -27,7 +27,7 @@
 #include <config.h>
 #endif
 
-#ifdef WITH_MP4
+#ifdef TAGLIB_WITH_MP4
 
 #include <tdebug.h>
 #include <tstring.h>
index 3165256c4a58a19365a08f7f8d576ea97854eacc..bbf58b05bde6164a66dcc9864c83f623fd37142c 100644 (file)
@@ -27,7 +27,7 @@
 #include <config.h>
 #endif
 
-#ifdef WITH_MP4
+#ifdef TAGLIB_WITH_MP4
 
 #include <tdebug.h>
 #include <tstring.h>
index 2b5613ad61c9e9c251d6488dfcc040943cb0aed8..f0cb9ebf0f9a4f836c01d2e822d13844b04e06b4 100644 (file)
@@ -27,7 +27,7 @@
 #include <config.h>
 #endif
 
-#ifdef WITH_MP4
+#ifdef TAGLIB_WITH_MP4
 
 #include <taglib.h>
 #include <tdebug.h>
index c973d3a2f480a8c761c25fc4253fdf3a9391c1f6..2ae762bb90be9fe86603e68555be6c96b31fa3e3 100644 (file)
@@ -27,7 +27,7 @@
 #include <config.h>
 #endif
 
-#ifdef WITH_MP4
+#ifdef TAGLIB_WITH_MP4
 
 #include <tdebug.h>
 #include <tstring.h>
index e73952d78c9121345bddb3134c5c67fc81e31b8f..77f1a317b633eb8e200460743f966f8fea79c97f 100644 (file)
@@ -27,7 +27,7 @@
 #include <config.h>
 #endif
 
-#ifdef WITH_MP4
+#ifdef TAGLIB_WITH_MP4
 
 #include <tdebug.h>
 #include <tstring.h>
diff --git a/taglib/taglib_config.h.cmake b/taglib/taglib_config.h.cmake
new file mode 100644 (file)
index 0000000..aa9df25
--- /dev/null
@@ -0,0 +1,4 @@
+/* taglib_config.h. Generated by cmake from taglib_config.h.cmake */
+
+#cmakedefine   TAGLIB_WITH_ASF 1
+#cmakedefine   TAGLIB_WITH_MP4 1
diff --git a/taglib/taglib_config.h.in b/taglib/taglib_config.h.in
new file mode 100644 (file)
index 0000000..7be1170
--- /dev/null
@@ -0,0 +1,5 @@
+/* With ASF support */
+#undef TAGLIB_WITH_ASF
+
+/* With MP4 support */
+#undef TAGLIB_WITH_MP4
index d14d69f0f17fcb63fda4d2ad89052c96828cf521..02a2f2171af50174cada67220de385cc0a9d327e 100644 (file)
@@ -36,4 +36,6 @@
 #define TAGLIB_EXPORT
 #endif
 
+#include "taglib_config.h"
+
 #endif
index 880c300a02207b042e49dd23de5b7ca4da825c6f..6617ccd13e4583d123478661b6c756bdbca3ab28 100644 (file)
@@ -14,7 +14,7 @@ using namespace TagLib;
 class TestFileRef : public CppUnit::TestFixture
 {
   CPPUNIT_TEST_SUITE(TestFileRef);
-#ifdef WITH_ASF
+#ifdef TAGLIB_WITH_ASF
   CPPUNIT_TEST(testASF);
 #endif
   CPPUNIT_TEST(testMusepack);
@@ -22,7 +22,7 @@ class TestFileRef : public CppUnit::TestFixture
   CPPUNIT_TEST(testSpeex);
   CPPUNIT_TEST(testFLAC);
   CPPUNIT_TEST(testMP3);
-#ifdef WITH_MP4
+#ifdef TAGLIB_WITH_MP4
   CPPUNIT_TEST(testMP4_1);
   CPPUNIT_TEST(testMP4_2);
   CPPUNIT_TEST(testMP4_3);
@@ -82,7 +82,7 @@ public:
     fileRefSave("click", ".mpc");
   }
 
-#ifdef WITH_ASF
+#ifdef TAGLIB_WITH_ASF
   void testASF()
   {
     fileRefSave("silence-1", ".wma");
@@ -114,7 +114,7 @@ public:
     fileRefSave("empty", ".tta");
   }
 
-#ifdef WITH_MP4
+#ifdef TAGLIB_WITH_MP4
   void testMP4_1()
   {
     fileRefSave("has-tags", ".m4a");