Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard
@ 2015-05-08 10:42 Romain Naour
  2015-05-08 10:43 ` [Buildroot] [PATCH] package/tinyxml2: fix cmake warning Romain Naour
  2015-05-08 19:53 ` [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard Samuel Martin
  0 siblings, 2 replies; 6+ messages in thread
From: Romain Naour @ 2015-05-08 10:42 UTC (permalink / raw)
  To: buildroot

Backport an upstream patch to fix the static build:
c8ec6fcab4eb501cc5bd328c19dcbd4b30722d52

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
 ...0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch | 65 ++++++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch

diff --git a/package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch b/package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch
new file mode 100644
index 0000000..52288c5
--- /dev/null
+++ b/package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch
@@ -0,0 +1,65 @@
+From 69acf13fa679628259063c4d0cd17e59b8bb0b75 Mon Sep 17 00:00:00 2001
+From: xantares <xantares09@hotmail.com>
+Date: Fri, 14 Nov 2014 19:40:58 +0100
+Subject: [PATCH] Use BUILD_SHARED_LIBS cmake standard.
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ CMakeLists.txt | 27 +++++++++------------------
+ 1 file changed, 9 insertions(+), 18 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 91c61a4..4375bb9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -10,8 +10,8 @@ include(GNUInstallDirs)
+ ################################
+ # set lib version here
+ 
+-set(GENERIC_LIB_VERSION "2.2.0")
+-set(GENERIC_LIB_SOVERSION "2")
++set(GENERIC_LIB_VERSION "2.2.0")
++set(GENERIC_LIB_SOVERSION "2")
+ 
+ 
+ ################################
+@@ -46,12 +46,8 @@ endif(MSVC)
+ 
+ ################################
+ # Add targets
+-set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libraries")
+-if(BUILD_STATIC_LIBS)
+-	add_library(tinyxml2static STATIC tinyxml2.cpp tinyxml2.h)
+-	set_target_properties(tinyxml2static PROPERTIES OUTPUT_NAME tinyxml2)
+-endif(BUILD_STATIC_LIBS)
+-add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)
++option(BUILD_SHARED_LIBS "build shared or static libraries" ON)
++add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)
+ set_target_properties(tinyxml2 PROPERTIES
+         COMPILE_DEFINITIONS "TINYXML2_EXPORT"
+ 	VERSION "${GENERIC_LIB_VERSION}"
+@@ -63,16 +59,11 @@ add_dependencies(test ${TARGET_DATA_COPY})
+ target_link_libraries(test tinyxml2)
+ 
+ 
+-if(BUILD_STATIC_LIBS)
+-	install(TARGETS tinyxml2 tinyxml2static
+-		RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+-		LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+-		ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+-else(BUILD_STATIC_LIBS)
+-	install(TARGETS tinyxml2
+-		RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+-		LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+-endif(BUILD_STATIC_LIBS)
++install(TARGETS tinyxml2
++        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++
+ install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ foreach(p LIB INCLUDE)
+-- 
+1.9.3
+
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/tinyxml2: fix cmake warning
  2015-05-08 10:42 [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard Romain Naour
@ 2015-05-08 10:43 ` Romain Naour
  2015-05-08 19:53 ` [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard Samuel Martin
  1 sibling, 0 replies; 6+ messages in thread
From: Romain Naour @ 2015-05-08 10:43 UTC (permalink / raw)
  To: buildroot

CMake complains about Policy CMP0037 that reserve some
target name such "test".
So remove the warning by renaming test to xmltest.

Backport an upstream patch:
0b2c22bd46be95b08f234b8b4cb262f72ab3f0e8

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
 .../0002-Rename-test-fixed-cmake-warning.patch     | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 package/tinyxml2/0002-Rename-test-fixed-cmake-warning.patch

diff --git a/package/tinyxml2/0002-Rename-test-fixed-cmake-warning.patch b/package/tinyxml2/0002-Rename-test-fixed-cmake-warning.patch
new file mode 100644
index 0000000..409269a
--- /dev/null
+++ b/package/tinyxml2/0002-Rename-test-fixed-cmake-warning.patch
@@ -0,0 +1,38 @@
+From 77631a9cf500a578338a83bc230c419bf2a05b50 Mon Sep 17 00:00:00 2001
+From: xantares <xantares09@hotmail.com>
+Date: Fri, 14 Nov 2014 19:46:18 +0100
+Subject: [PATCH] Rename test, fixed cmake warning.
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ CMakeLists.txt | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4375bb9..4a8f91d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -53,10 +53,10 @@ set_target_properties(tinyxml2 PROPERTIES
+ 	VERSION "${GENERIC_LIB_VERSION}"
+ 	SOVERSION "${GENERIC_LIB_SOVERSION}")
+ 
+-add_executable(test xmltest.cpp)
+-add_dependencies(test tinyxml2)
+-add_dependencies(test ${TARGET_DATA_COPY})
+-target_link_libraries(test tinyxml2)
++add_executable(xmltest xmltest.cpp)
++add_dependencies(xmltest tinyxml2)
++add_dependencies(xmltest ${TARGET_DATA_COPY})
++target_link_libraries(xmltest tinyxml2)
+ 
+ 
+ install(TARGETS tinyxml2
+@@ -76,4 +76,4 @@ endforeach()
+ configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ 
+-#add_test(test ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)
++#add_test(xmltest ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)
+-- 
+1.9.3
+
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard
  2015-05-08 10:42 [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard Romain Naour
  2015-05-08 10:43 ` [Buildroot] [PATCH] package/tinyxml2: fix cmake warning Romain Naour
@ 2015-05-08 19:53 ` Samuel Martin
  2015-05-08 20:21   ` Romain Naour
  1 sibling, 1 reply; 6+ messages in thread
From: Samuel Martin @ 2015-05-08 19:53 UTC (permalink / raw)
  To: buildroot

Hi Romain,

On Fri, May 8, 2015 at 12:42 PM, Romain Naour <romain.naour@openwide.fr> wrote:
> Backport an upstream patch to fix the static build:
> c8ec6fcab4eb501cc5bd328c19dcbd4b30722d52
>
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> ---
>  ...0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch | 65 ++++++++++++++++++++++
>  1 file changed, 65 insertions(+)
>  create mode 100644 package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch
>
> diff --git a/package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch b/package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch
> new file mode 100644
> index 0000000..52288c5
> --- /dev/null
> +++ b/package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch
> @@ -0,0 +1,65 @@
> +From 69acf13fa679628259063c4d0cd17e59b8bb0b75 Mon Sep 17 00:00:00 2001
> +From: xantares <xantares09@hotmail.com>
> +Date: Fri, 14 Nov 2014 19:40:58 +0100
> +Subject: [PATCH] Use BUILD_SHARED_LIBS cmake standard.
> +
> +Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> +---
> + CMakeLists.txt | 27 +++++++++------------------
> + 1 file changed, 9 insertions(+), 18 deletions(-)
> +
> +diff --git a/CMakeLists.txt b/CMakeLists.txt
> +index 91c61a4..4375bb9 100644
> +--- a/CMakeLists.txt
> ++++ b/CMakeLists.txt
> +@@ -10,8 +10,8 @@ include(GNUInstallDirs)
> + ################################
> + # set lib version here
> +
> +-set(GENERIC_LIB_VERSION "2.2.0")
> +-set(GENERIC_LIB_SOVERSION "2")
> ++set(GENERIC_LIB_VERSION "2.2.0")
> ++set(GENERIC_LIB_SOVERSION "2")
What is the change here?

> +
> +
> + ################################
> +@@ -46,12 +46,8 @@ endif(MSVC)
> +
> + ################################
> + # Add targets
> +-set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libraries")
> +-if(BUILD_STATIC_LIBS)
> +-      add_library(tinyxml2static STATIC tinyxml2.cpp tinyxml2.h)
> +-      set_target_properties(tinyxml2static PROPERTIES OUTPUT_NAME tinyxml2)
> +-endif(BUILD_STATIC_LIBS)
> +-add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)
> ++option(BUILD_SHARED_LIBS "build shared or static libraries" ON)
Not needed, this is a global CMake flag.

> ++add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)
> + set_target_properties(tinyxml2 PROPERTIES
> +         COMPILE_DEFINITIONS "TINYXML2_EXPORT"
> +       VERSION "${GENERIC_LIB_VERSION}"
> +@@ -63,16 +59,11 @@ add_dependencies(test ${TARGET_DATA_COPY})
> + target_link_libraries(test tinyxml2)
> +
> +
> +-if(BUILD_STATIC_LIBS)
> +-      install(TARGETS tinyxml2 tinyxml2static
> +-              RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
> +-              LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
> +-              ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
> +-else(BUILD_STATIC_LIBS)
> +-      install(TARGETS tinyxml2
> +-              RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
> +-              LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
> +-endif(BUILD_STATIC_LIBS)
> ++install(TARGETS tinyxml2
> ++        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
> ++        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
> ++        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
> ++
> + install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
> +
> + foreach(p LIB INCLUDE)
> +--
> +1.9.3
> +
> --
> 1.9.3
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

Regards,


-- 
Samuel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard
  2015-05-08 19:53 ` [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard Samuel Martin
@ 2015-05-08 20:21   ` Romain Naour
  2015-05-11  9:30     ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Romain Naour @ 2015-05-08 20:21 UTC (permalink / raw)
  To: buildroot

Hi Samuel,

Le 08/05/2015 21:53, Samuel Martin a ?crit :
> Hi Romain,
> 
> On Fri, May 8, 2015 at 12:42 PM, Romain Naour <romain.naour@openwide.fr> wrote:
>> Backport an upstream patch to fix the static build:
>> c8ec6fcab4eb501cc5bd328c19dcbd4b30722d52
>>
>> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
>> ---
>>  ...0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch | 65 ++++++++++++++++++++++
>>  1 file changed, 65 insertions(+)
>>  create mode 100644 package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch
>>
>> diff --git a/package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch b/package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch
>> new file mode 100644
>> index 0000000..52288c5
>> --- /dev/null
>> +++ b/package/tinyxml2/0001-Use-BUILD_SHARED_LIBS-cmake-standard.patch
>> @@ -0,0 +1,65 @@
>> +From 69acf13fa679628259063c4d0cd17e59b8bb0b75 Mon Sep 17 00:00:00 2001
>> +From: xantares <xantares09@hotmail.com>
>> +Date: Fri, 14 Nov 2014 19:40:58 +0100
>> +Subject: [PATCH] Use BUILD_SHARED_LIBS cmake standard.
>> +
>> +Signed-off-by: Romain Naour <romain.naour@openwide.fr>
>> +---
>> + CMakeLists.txt | 27 +++++++++------------------
>> + 1 file changed, 9 insertions(+), 18 deletions(-)
>> +
>> +diff --git a/CMakeLists.txt b/CMakeLists.txt
>> +index 91c61a4..4375bb9 100644
>> +--- a/CMakeLists.txt
>> ++++ b/CMakeLists.txt
>> +@@ -10,8 +10,8 @@ include(GNUInstallDirs)
>> + ################################
>> + # set lib version here
>> +
>> +-set(GENERIC_LIB_VERSION "2.2.0")
>> +-set(GENERIC_LIB_SOVERSION "2")
>> ++set(GENERIC_LIB_VERSION "2.2.0")
>> ++set(GENERIC_LIB_SOVERSION "2")
> What is the change here?

Some space changes it seems.

> 
>> +
>> +
>> + ################################
>> +@@ -46,12 +46,8 @@ endif(MSVC)
>> +
>> + ################################
>> + # Add targets
>> +-set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libraries")
>> +-if(BUILD_STATIC_LIBS)
>> +-      add_library(tinyxml2static STATIC tinyxml2.cpp tinyxml2.h)
>> +-      set_target_properties(tinyxml2static PROPERTIES OUTPUT_NAME tinyxml2)
>> +-endif(BUILD_STATIC_LIBS)
>> +-add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)
>> ++option(BUILD_SHARED_LIBS "build shared or static libraries" ON)
> Not needed, this is a global CMake flag.

I have just cherry-picked the patch and keep things as is.
I can rework the patch an keep only useful part if you prefer ;-)

Best regards,
Romain

> 
>> ++add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)
>> + set_target_properties(tinyxml2 PROPERTIES
>> +         COMPILE_DEFINITIONS "TINYXML2_EXPORT"
>> +       VERSION "${GENERIC_LIB_VERSION}"
>> +@@ -63,16 +59,11 @@ add_dependencies(test ${TARGET_DATA_COPY})
>> + target_link_libraries(test tinyxml2)
>> +
>> +
>> +-if(BUILD_STATIC_LIBS)
>> +-      install(TARGETS tinyxml2 tinyxml2static
>> +-              RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
>> +-              LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
>> +-              ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
>> +-else(BUILD_STATIC_LIBS)
>> +-      install(TARGETS tinyxml2
>> +-              RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
>> +-              LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
>> +-endif(BUILD_STATIC_LIBS)
>> ++install(TARGETS tinyxml2
>> ++        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
>> ++        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
>> ++        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
>> ++
>> + install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
>> +
>> + foreach(p LIB INCLUDE)
>> +--
>> +1.9.3
>> +
>> --
>> 1.9.3
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
> 
> Regards,
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard
  2015-05-08 20:21   ` Romain Naour
@ 2015-05-11  9:30     ` Thomas Petazzoni
  2015-05-11 20:36       ` Romain Naour
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2015-05-11  9:30 UTC (permalink / raw)
  To: buildroot

Dear Romain Naour,

On Fri, 08 May 2015 22:21:10 +0200, Romain Naour wrote:

> >> + ################################
> >> +@@ -46,12 +46,8 @@ endif(MSVC)
> >> +
> >> + ################################
> >> + # Add targets
> >> +-set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libraries")
> >> +-if(BUILD_STATIC_LIBS)
> >> +-      add_library(tinyxml2static STATIC tinyxml2.cpp tinyxml2.h)
> >> +-      set_target_properties(tinyxml2static PROPERTIES OUTPUT_NAME tinyxml2)
> >> +-endif(BUILD_STATIC_LIBS)
> >> +-add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)
> >> ++option(BUILD_SHARED_LIBS "build shared or static libraries" ON)
> > Not needed, this is a global CMake flag.
> 
> I have just cherry-picked the patch and keep things as is.
> I can rework the patch an keep only useful part if you prefer ;-)

No, if it is an upstream patch, please keep it as unmodified as
possible when backporting it to Buildroot.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard
  2015-05-11  9:30     ` Thomas Petazzoni
@ 2015-05-11 20:36       ` Romain Naour
  0 siblings, 0 replies; 6+ messages in thread
From: Romain Naour @ 2015-05-11 20:36 UTC (permalink / raw)
  To: buildroot

Hi Thomas, Samuel, all

Le 11/05/2015 11:30, Thomas Petazzoni a ?crit :
> Dear Romain Naour,
> 
> On Fri, 08 May 2015 22:21:10 +0200, Romain Naour wrote:
> 
>>>> + ################################
>>>> +@@ -46,12 +46,8 @@ endif(MSVC)
>>>> +
>>>> + ################################
>>>> + # Add targets
>>>> +-set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libraries")
>>>> +-if(BUILD_STATIC_LIBS)
>>>> +-      add_library(tinyxml2static STATIC tinyxml2.cpp tinyxml2.h)
>>>> +-      set_target_properties(tinyxml2static PROPERTIES OUTPUT_NAME tinyxml2)
>>>> +-endif(BUILD_STATIC_LIBS)
>>>> +-add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)
>>>> ++option(BUILD_SHARED_LIBS "build shared or static libraries" ON)
>>> Not needed, this is a global CMake flag.
>>
>> I have just cherry-picked the patch and keep things as is.
>> I can rework the patch an keep only useful part if you prefer ;-)
> 
> No, if it is an upstream patch, please keep it as unmodified as
> possible when backporting it to Buildroot.

Ok, so this series is still valid.
Thanks Samuel for the review :)

Best regards,
Romain

> 
> Thanks,
> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-05-11 20:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-08 10:42 [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard Romain Naour
2015-05-08 10:43 ` [Buildroot] [PATCH] package/tinyxml2: fix cmake warning Romain Naour
2015-05-08 19:53 ` [Buildroot] [PATCH] package/tinyxml2: Use BUILD_SHARED_LIBS cmake standard Samuel Martin
2015-05-08 20:21   ` Romain Naour
2015-05-11  9:30     ` Thomas Petazzoni
2015-05-11 20:36       ` Romain Naour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox