Magellan Linux

Annotation of /trunk/musicbrainz/patches/musicbrainz-5.0.1-support-out-of-source-build.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1909 - (hide annotations) (download)
Fri Oct 12 11:36:11 2012 UTC (11 years, 7 months ago) by niro
File size: 5514 byte(s)
-fixed the patch
1 niro 1909 From b74fd9680c20f8cbdbcf6cdff9ee1074c55fe1c1 Mon Sep 17 00:00:00 2001
2     From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= <lalinsky@gmail.com>
3 niro 1908 Date: Thu, 14 Jun 2012 09:58:41 +0200
4     Subject: [PATCH] Support out-of-source build
5    
6     http://tickets.musicbrainz.org/browse/LMB-10
7     https://github.com/metabrainz/libmusicbrainz/issues/1
8 niro 1909 ---
9 niro 1908 examples/CMakeLists.txt | 5 ++++-
10     src/CMakeLists.txt | 9 +++++++--
11     src/make-c-interface.cc | 8 ++++----
12     tests/CMakeLists.txt | 5 ++++-
13     4 files changed, 19 insertions(+), 8 deletions(-)
14    
15     diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
16     index 3e11469..000d4aa 100644
17 niro 1909 --- a/examples/CMakeLists.txt
18     +++ b/examples/CMakeLists.txt
19     @@ -1,4 +1,7 @@
20     -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include)
21     +INCLUDE_DIRECTORIES(
22     + ${CMAKE_CURRENT_SOURCE_DIR}/../include
23     + ${CMAKE_CURRENT_BINARY_DIR}/../include
24     +)
25 niro 1908 LINK_LIBRARIES(musicbrainz5 ${NEON_LIBRARIES})
26    
27     ADD_EXECUTABLE(cdlookup cdlookup.cc)
28     diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
29     index 2ee102f..89ab63c 100644
30 niro 1909 --- a/src/CMakeLists.txt
31     +++ b/src/CMakeLists.txt
32     @@ -1,5 +1,10 @@
33 niro 1908 SET(CMAKE_INCLUDE_CURRENT_DIR ON)
34 niro 1909 -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../include ${NEON_INCLUDE_DIR})
35     +INCLUDE_DIRECTORIES(
36     + ${CMAKE_CURRENT_SOURCE_DIR}/..
37     + ${CMAKE_CURRENT_SOURCE_DIR}/../include
38     + ${CMAKE_CURRENT_BINARY_DIR}/../include
39     + ${NEON_INCLUDE_DIR}
40     +)
41 niro 1908
42     SET(_sources Alias.cc Annotation.cc Artist.cc ArtistCredit.cc Attribute.cc CDStub.cc Collection.cc
43     Disc.cc Entity.cc FreeDBDisc.cc HTTPFetch.cc ISRC.cc Label.cc LabelInfo.cc Lifespan.cc List.cc
44 niro 1909 @@ -13,7 +18,7 @@ ADD_EXECUTABLE(make-c-interface make-c-interface.cc xmlParser.cpp)
45 niro 1908 ADD_CUSTOM_COMMAND(
46     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mb5_c.cc ${CMAKE_CURRENT_BINARY_DIR}/mb5_c.h ${CMAKE_CURRENT_BINARY_DIR}/../include/musicbrainz5/mb5_c.h
47     COMMAND make-c-interface ${CMAKE_CURRENT_SOURCE_DIR} cinterface.xml ${CMAKE_CURRENT_BINARY_DIR} mb5_c.cc mb5_c.h
48 niro 1909 - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/mb5_c.h ${CMAKE_CURRENT_BINARY_DIR}/../include/musicbrainz5
49     + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/mb5_c.h ${CMAKE_CURRENT_BINARY_DIR}/../include/musicbrainz5/mb5_c.h
50 niro 1908 DEPENDS make-c-interface cinterface.xml *.inc
51     )
52    
53     diff --git a/src/make-c-interface.cc b/src/make-c-interface.cc
54     index 652a65b..70dd6d7 100644
55 niro 1909 --- a/src/make-c-interface.cc
56     +++ b/src/make-c-interface.cc
57     @@ -33,7 +33,7 @@
58 niro 1908
59 niro 1909 #include "musicbrainz5/xmlParser.h"
60 niro 1908
61 niro 1909 -void ProcessBoilerplate(const XMLNode& Node, std::ofstream& Source, std::ofstream& Include);
62     +void ProcessBoilerplate(const XMLNode& Node, std::ofstream& Source, std::ofstream& Include, const std::string& Path);
63     void ProcessHeader(const XMLNode& Node, std::ofstream& Source, std::ofstream& Include);
64     void ProcessEntity(const XMLNode& Node, std::ofstream& Source, std::ofstream& Include);
65     void ProcessClass(const XMLNode& Node, std::ofstream& Source, std::ofstream& Include);
66     @@ -80,7 +80,7 @@ int main(int argc, const char *argv[])
67 niro 1908 std::string Name=Node.getName();
68    
69 niro 1909 if ("boilerplate"==Name)
70     - ProcessBoilerplate(Node,Source,Include);
71     + ProcessBoilerplate(Node,Source,Include,argv[1]);
72     else if ("header"==Name)
73 niro 1908 ProcessHeader(Node,Source,Include);
74 niro 1909 else if ("declare"==Name)
75     @@ -156,13 +156,13 @@ void ProcessHeader(const XMLNode& /*Node*/, std::ofstream& Source, std::ofstream
76     Include << os.str() << std::endl;
77 niro 1908 }
78    
79 niro 1909 -void ProcessBoilerplate(const XMLNode& Node, std::ofstream& Source, std::ofstream& Include)
80     +void ProcessBoilerplate(const XMLNode& Node, std::ofstream& Source, std::ofstream& Include, const std::string& Path)
81 niro 1908 {
82     std::ofstream *File=GetFile(Node,Source,Include);
83    
84 niro 1909 if (Node.isAttributeSet("file"))
85 niro 1908 {
86 niro 1909 - std::string FileName=Node.getAttribute("file");
87     + std::string FileName=Path+"/"+Node.getAttribute("file");
88 niro 1908 std::ifstream InFile(FileName.c_str());
89     if (InFile.is_open())
90 niro 1909 *File << InFile.rdbuf() << std::endl;
91 niro 1908 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
92     index 645f8ae..8a0b38b 100644
93 niro 1909 --- a/tests/CMakeLists.txt
94     +++ b/tests/CMakeLists.txt
95     @@ -1,4 +1,7 @@
96     -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include)
97     +INCLUDE_DIRECTORIES(
98     + ${CMAKE_CURRENT_SOURCE_DIR}/../include
99     + ${CMAKE_CURRENT_BINARY_DIR}/../include
100     +)
101 niro 1908 LINK_LIBRARIES(musicbrainz5 ${NEON_LIBRARIES})
102     ADD_EXECUTABLE(mbtest mbtest.cc)
103     ADD_EXECUTABLE(ctest ctest.c)
104 niro 1909 --
105 niro 1908 1.7.10
106    
107     From b5d4f4ea32068e296326438c747faf665c311ddd Mon Sep 17 00:00:00 2001
108 niro 1909 From: Andy Hawkins <andy@gently.org.uk>
109 niro 1908 Date: Thu, 14 Jun 2012 09:12:27 +0000
110     Subject: [PATCH] Fix install when building out of tree
111    
112 niro 1909 ---
113 niro 1908 CMakeLists.txt | 2 +-
114     1 file changed, 1 insertion(+), 1 deletion(-)
115    
116     diff --git a/CMakeLists.txt b/CMakeLists.txt
117     index 16870b4..958461c 100644
118 niro 1909 --- a/CMakeLists.txt
119     +++ b/CMakeLists.txt
120     @@ -32,7 +32,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_CURRENT_SOURCE
121 niro 1908 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
122    
123     FILE(GLOB headers ${CMAKE_CURRENT_SOURCE_DIR}/include/musicbrainz5/*.h)
124 niro 1909 -INSTALL(FILES ${headers} include/musicbrainz5/mb5_c.h DESTINATION ${INCLUDE_INSTALL_DIR}/musicbrainz5)
125     +INSTALL(FILES ${headers} ${CMAKE_CURRENT_BINARY_DIR}/include/musicbrainz5/mb5_c.h DESTINATION ${INCLUDE_INSTALL_DIR}/musicbrainz5)
126 niro 1908 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmusicbrainz5.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
127    
128     ADD_SUBDIRECTORY(src)
129 niro 1909 --
130 niro 1908 1.7.10
131