From 6aa41d8180207dc1ce058710dec4693ac50e8ea0 Mon Sep 17 00:00:00 2001 From: Graham Perks Date: Mon, 25 Jul 2011 17:56:42 -0500 Subject: [PATCH 1/7] Updated OS X build instructions --- INSTALL | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 8391c0b3..9d1ed410 100644 --- a/INSTALL +++ b/INSTALL @@ -30,7 +30,16 @@ an Universal Binary framework with Mac OS X 10.4 as the deployment target: -DCMAKE_CXX_COMPILER=/usr/bin/c++-4.0 \ -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk/ \ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 \ - -DCMAKE_OSX_ARCHITECTURES="ppc;i368;x86_64" + -DCMAKE_OSX_ARCHITECTURES="ppc;i386;x86_64" + +For a 10.6 Snow Leopard take, use: + cmake -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_FRAMEWORK=ON \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 \ + -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" + +After 'make', taglib.framework will be found in taglib/tag.framework. Add this to +your project in XCode, then #include , similarly for other headers. Unit Tests ---------- From 1a53bfd71af254ade524aea81f48e688018ad58c Mon Sep 17 00:00:00 2001 From: Graham Perks Date: Tue, 26 Jul 2011 11:12:27 -0500 Subject: [PATCH 2/7] Example cmake for OS X to build a static library --- INSTALL | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/INSTALL b/INSTALL index 9d1ed410..6870e58f 100644 --- a/INSTALL +++ b/INSTALL @@ -32,14 +32,16 @@ an Universal Binary framework with Mac OS X 10.4 as the deployment target: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 \ -DCMAKE_OSX_ARCHITECTURES="ppc;i386;x86_64" -For a 10.6 Snow Leopard take, use: +For a 10.6 Snow Leopard static library with ASF and MP4 support, use: cmake -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_FRAMEWORK=ON \ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 \ - -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" + -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \ + -DENABLE_STATIC=ON \ + -DWITH_ASF=ON \ + -DWITH_MP4=ON -After 'make', taglib.framework will be found in taglib/tag.framework. Add this to -your project in XCode, then #include , similarly for other headers. +After 'make', libtag.a will be found in the taglib folder. Add this to +your project in XCode, add taglib to your Xcode's User Header Search Paths. Unit Tests ---------- From 0341079b92c4578dded99b29490b08e4c822d644 Mon Sep 17 00:00:00 2001 From: Graham Perks Date: Tue, 26 Jul 2011 21:35:44 -0500 Subject: [PATCH 3/7] Misc typo corrections --- taglib/asf/asfpicture.cpp | 4 ++-- taglib/asf/asfpicture.h | 4 ++-- taglib/toolkit/taglib.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/taglib/asf/asfpicture.cpp b/taglib/asf/asfpicture.cpp index 50a42ab3..c36ffa3a 100644 --- a/taglib/asf/asfpicture.cpp +++ b/taglib/asf/asfpicture.cpp @@ -35,7 +35,7 @@ using namespace TagLib; -class ASF::Picture::PicturePriavte : public RefCounter +class ASF::Picture::PicturePrivate : public RefCounter { public: bool valid; @@ -51,7 +51,7 @@ public: ASF::Picture::Picture() { - d = new PicturePriavte(); + d = new PicturePrivate(); d->valid = true; } diff --git a/taglib/asf/asfpicture.h b/taglib/asf/asfpicture.h index 5c1bfbfd..aa0a060c 100644 --- a/taglib/asf/asfpicture.h +++ b/taglib/asf/asfpicture.h @@ -208,8 +208,8 @@ namespace TagLib friend class Attribute; #endif private: - struct PicturePriavte; - PicturePriavte *d; + class PicturePrivate; + PicturePrivate *d; }; } } diff --git a/taglib/toolkit/taglib.h b/taglib/toolkit/taglib.h index eebafbc5..dda9c83c 100644 --- a/taglib/toolkit/taglib.h +++ b/taglib/toolkit/taglib.h @@ -65,7 +65,7 @@ /*! * This namespace contains everything in TagLib. For projects working with - * TagLib extensively it may be conveniten to add a + * TagLib extensively it may be convenient to add a * \code * using namespace TagLib; * \endcode From 8b647e5fa71bbad8d244dbe1fac61e58ebedc93c Mon Sep 17 00:00:00 2001 From: Graham Perks Date: Tue, 26 Jul 2011 21:43:11 -0500 Subject: [PATCH 4/7] Fix for VS2010 which had been throwing out "cannot access protected member declared in class 'TagLib::Mod::Properties'" errors. --- taglib/it/itproperties.h | 3 +++ taglib/mod/modproperties.h | 2 ++ taglib/s3m/s3mproperties.h | 2 ++ taglib/xm/xmproperties.h | 2 ++ 4 files changed, 9 insertions(+) diff --git a/taglib/it/itproperties.h b/taglib/it/itproperties.h index 79ebc383..b63b0c85 100644 --- a/taglib/it/itproperties.h +++ b/taglib/it/itproperties.h @@ -72,7 +72,10 @@ namespace TagLib { uchar panningSeparation() const; uchar pitchWheelDepth() const; +#if !defined(_MSC_VER) protected: +#endif + void setChannels(int channels); void setLengthInPatterns(ushort lengthInPatterns); diff --git a/taglib/mod/modproperties.h b/taglib/mod/modproperties.h index 8bf3ac5e..bdf1b752 100644 --- a/taglib/mod/modproperties.h +++ b/taglib/mod/modproperties.h @@ -41,7 +41,9 @@ namespace TagLib { uint instrumentCount() const; uchar lengthInPatterns() const; +#if !defined(_MSC_VER) protected: +#endif void setChannels(int channels); void setInstrumentCount(uint sampleCount); diff --git a/taglib/s3m/s3mproperties.h b/taglib/s3m/s3mproperties.h index 4be14508..820623ab 100644 --- a/taglib/s3m/s3mproperties.h +++ b/taglib/s3m/s3mproperties.h @@ -61,7 +61,9 @@ namespace TagLib { uchar tempo() const; uchar bpmSpeed() const; +#if !defined(_MSC_VER) protected: +#endif void setChannels(int channels); void setLengthInPatterns (ushort lengthInPatterns); diff --git a/taglib/xm/xmproperties.h b/taglib/xm/xmproperties.h index 97f93111..7ba193a2 100644 --- a/taglib/xm/xmproperties.h +++ b/taglib/xm/xmproperties.h @@ -54,7 +54,9 @@ namespace TagLib { ushort tempo() const; ushort bpmSpeed() const; +#if !defined(_MSC_VER) protected: +#endif void setChannels(int channels); void setLengthInPatterns(ushort lengthInPatterns); From 5f84bbf61a2aee64f4c96bf666f1957d91b3ed09 Mon Sep 17 00:00:00 2001 From: Graham Perks Date: Wed, 27 Jul 2011 10:54:33 -0500 Subject: [PATCH 5/7] Correction to OS X build; include basic Windows build instructions --- INSTALL | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/INSTALL b/INSTALL index 6870e58f..835c1fa9 100644 --- a/INSTALL +++ b/INSTALL @@ -32,16 +32,23 @@ an Universal Binary framework with Mac OS X 10.4 as the deployment target: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 \ -DCMAKE_OSX_ARCHITECTURES="ppc;i386;x86_64" -For a 10.6 Snow Leopard static library with ASF and MP4 support, use: +For a 10.6 Snow Leopard static library, use: cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 \ -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \ -DENABLE_STATIC=ON \ - -DWITH_ASF=ON \ - -DWITH_MP4=ON + -DCMAKE_INSTALL_PREFIX="" -After 'make', libtag.a will be found in the taglib folder. Add this to -your project in XCode, add taglib to your Xcode's User Header Search Paths. +After 'make', and 'make install', add libtag.a to your XCode project, and add +the include folder to the project's User Header Search Paths. + +For Windows with Visual Studio 2010, cd to the taglib folder then: + md build + cd build + cmake -DENABLE_STATIC=ON -G "Visual Studio 10" .. + +That will create a Visual Studio solution file that you can open and build +as normal. Unit Tests ---------- From 10ea76ff11f7b2bd8904fd1fc84b95cd90942313 Mon Sep 17 00:00:00 2001 From: Graham Perks Date: Wed, 27 Jul 2011 14:25:26 -0500 Subject: [PATCH 6/7] Add build option for Visual Studio to link with the static runtime (/MT vs /MD), pass -DENABLE_STATIC_RUNTIME=ON to cmake --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 611e9ec1..df14631e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ if(ENABLE_STATIC) else() set(BUILD_SHARED_LIBS ON) endif() +OPTION(ENABLE_STATIC_RUNTIME "Visual Studio, link with runtime statically" OFF) option(BUILD_TESTS "Build the test suite" OFF) option(BUILD_EXAMPLES "Build the examples" OFF) @@ -34,6 +35,11 @@ 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") endif() +if (MSVC AND ENABLE_STATIC_RUNTIME) + foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endforeach(flag_var) +endif(ENABLE_STATIC_RUNTIME) set(TAGLIB_LIB_MAJOR_VERSION "1") set(TAGLIB_LIB_MINOR_VERSION "7") From 19484c059dc4ccbd99c16e740e1d9c0db6e65b1c Mon Sep 17 00:00:00 2001 From: Graham Perks Date: Wed, 27 Jul 2011 14:35:24 -0500 Subject: [PATCH 7/7] Document ENABLE_STATIC_RUNTIME --- INSTALL | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/INSTALL b/INSTALL index 835c1fa9..89a555ab 100644 --- a/INSTALL +++ b/INSTALL @@ -45,10 +45,12 @@ the include folder to the project's User Header Search Paths. For Windows with Visual Studio 2010, cd to the taglib folder then: md build cd build - cmake -DENABLE_STATIC=ON -G "Visual Studio 10" .. + cmake -DENABLE_STATIC=ON -DENABLE_STATIC_RUNTIME=ON -G "Visual Studio 10" .. -That will create a Visual Studio solution file that you can open and build -as normal. +Including ENABLE_STATIC_RUNTIME=ON indicates you want taglib built using the +static runtime library, rather than the DLL form of the runtime. +cmake will create a Visual Studio solution, taglib.sln that you can open and +build as normal. Unit Tests ----------