Re: [waffle] [PATCH 5/8] cmake: reformat/update install targets

2014-05-30 Thread Emil Velikov
On 31/05/14 01:43, Chad Versace wrote:
 On Sat, May 24, 2014 at 11:51:32PM +0100, Emil Velikov wrote:
 Cleanup the formatting and add component for each build target.
 The latter will allow us to use CPack to create a component
 based installer for Windows.
 
 I've never used CPack, so my review here is a little uninformed.
 I have one small request.
 
 
 diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
 index b89fde3..a2d46e6 100644
 --- a/doc/CMakeLists.txt
 +++ b/doc/CMakeLists.txt
 @@ -1,7 +1,14 @@
 -install(FILES ${CMAKE_SOURCE_DIR}/README.txt
 -  ${CMAKE_SOURCE_DIR}/LICENSE.txt
 -DESTINATION ${CMAKE_INSTALL_DOCDIR})
 +install(
 +FILES
 +${CMAKE_SOURCE_DIR}/README.txt
 +${CMAKE_SOURCE_DIR}/LICENSE.txt
 +DESTINATION ${CMAKE_INSTALL_DOCDIR}
 +COMPONENT coredocs
 +)
 
 
 
 diff --git a/man/html.cmake b/man/html.cmake
 index ea55600..efe3887 100644
 --- a/man/html.cmake
 +++ b/man/html.cmake
 @@ -92,5 +92,8 @@ add_custom_target(html
  DEPENDS ${html_outputs}
  )
  
 -install(DIRECTORY ${html_out_dir}
 -DESTINATION ${CMAKE_INSTALL_DOCDIR}/html)
 +install(
 +DIRECTORY ${html_out_dir}
 +DESTINATION ${CMAKE_INSTALL_DOCDIR}/html
 +COMPONENT docs
 +)
 
 
 I find the name 'docs' confusing, relative to 'coredocs',  because
 I usually interpreet 'foo' as a superset of '${qualifier}_foo'. I'd like
 to rename it to 'htmldocs', which is a more accurate name anyway. Will
 that confuse CPack or the Windows installer?
 
AFAIU the names are only symbolic and it should not make any difference.

htmldocs sounds good to me, although I will need to rethink the idea of having
an CPack/installer due to the binary libraries (mingw build). Not sure if I
can make the cmake pick them up.

-Emil
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


[waffle] [PATCH 5/8] cmake: reformat/update install targets

2014-05-24 Thread Emil Velikov
Cleanup the formatting and add component for each build target.
The latter will allow us to use CPack to create a component
based installer for Windows.
Additionally install wflinfo to CMAKE_INSTALL_BINDIR rather
than hardcoding it to 'bin'.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 CMakeLists.txt| 14 ++
 doc/CMakeLists.txt| 19 +--
 examples/CMakeLists.txt   | 12 
 include/CMakeLists.txt| 18 +++---
 man/html.cmake|  7 +--
 man/manpages.cmake| 21 +++--
 src/utils/CMakeLists.txt  |  6 +-
 src/waffle/CMakeLists.txt |  7 +--
 8 files changed, 72 insertions(+), 32 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8d234d..b32b3d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,11 +92,17 @@ endif()
 
 configure_file(waffle.pc.in ${waffle_libname}.pc @ONLY)
 
-install(FILES ${CMAKE_BINARY_DIR}/${waffle_libname}.pc
-DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+install(
+FILES ${CMAKE_BINARY_DIR}/${waffle_libname}.pc
+DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+COMPONENT pkgconfig
+)
 
-install(FILES cmake/Modules/FindWaffle.cmake
-DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules)
+install(
+FILES cmake/Modules/FindWaffle.cmake
+DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules
+COMPONENT cmakefind
+)
 
 # 
--
 
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index b89fde3..a2d46e6 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,7 +1,14 @@
-install(FILES ${CMAKE_SOURCE_DIR}/README.txt
-  ${CMAKE_SOURCE_DIR}/LICENSE.txt
-DESTINATION ${CMAKE_INSTALL_DOCDIR})
+install(
+FILES
+${CMAKE_SOURCE_DIR}/README.txt
+${CMAKE_SOURCE_DIR}/LICENSE.txt
+DESTINATION ${CMAKE_INSTALL_DOCDIR}
+COMPONENT coredocs
+)
 
-install(DIRECTORY ${CMAKE_SOURCE_DIR}/doc/release-notes
-DESTINATION ${CMAKE_INSTALL_DOCDIR}
-FILES_MATCHING PATTERN 
waffle-${waffle_major_version}.${waffle_minor_version}.*.txt)
+install(
+DIRECTORY ${CMAKE_SOURCE_DIR}/doc/release-notes
+DESTINATION ${CMAKE_INSTALL_DOCDIR}
+COMPONENT releasenotes
+FILES_MATCHING PATTERN 
waffle-${waffle_major_version}.${waffle_minor_version}.*.txt
+)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 410bbf8..8392ecb 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,7 +1,11 @@
-install(FILES Makefile.example
-  gl_basic.c
-  simple-x11-egl.c
-DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
+install(
+FILES
+Makefile.example
+gl_basic.c
+simple-x11-egl.c
+DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples
+COMPONENT examples
+)
 
 # 
 # Target: simple-x11-egl (executable)
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 0123c28..e190a76 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -2,10 +2,14 @@ configure_file(waffle/waffle_version.h.in
${CMAKE_CURRENT_SOURCE_DIR}/waffle/waffle_version.h
@ONLY)
 
-install(FILES waffle/waffle.h
-  waffle/waffle_gbm.h
-  waffle/waffle_glx.h
-  waffle/waffle_version.h
-  waffle/waffle_wayland.h
-  waffle/waffle_x11_egl.h
-DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${waffle_libname})
+install(
+FILES
+waffle/waffle.h
+waffle/waffle_gbm.h
+waffle/waffle_glx.h
+waffle/waffle_version.h
+waffle/waffle_wayland.h
+waffle/waffle_x11_egl.h
+DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${waffle_libname}
+COMPONENT headers
+)
diff --git a/man/html.cmake b/man/html.cmake
index ea55600..efe3887 100644
--- a/man/html.cmake
+++ b/man/html.cmake
@@ -92,5 +92,8 @@ add_custom_target(html
 DEPENDS ${html_outputs}
 )
 
-install(DIRECTORY ${html_out_dir}
-DESTINATION ${CMAKE_INSTALL_DOCDIR}/html)
+install(
+DIRECTORY ${html_out_dir}
+DESTINATION ${CMAKE_INSTALL_DOCDIR}/html
+COMPONENT docs
+)
diff --git a/man/manpages.cmake b/man/manpages.cmake
index 1332eb9..b8ededa 100644
--- a/man/manpages.cmake
+++ b/man/manpages.cmake
@@ -92,9 +92,18 @@ add_custom_target(man
 DEPENDS ${man_outputs}
 )
 
-install(DIRECTORY ${man_out_dir}/man1
-DESTINATION ${CMAKE_INSTALL_MANDIR})
-install(DIRECTORY ${man_out_dir}/man3
-DESTINATION ${CMAKE_INSTALL_MANDIR})
-install(DIRECTORY ${man_out_dir}/man7
-DESTINATION ${CMAKE_INSTALL_MANDIR})
+install(
+DIRECTORY ${man_out_dir}/man1
+DESTINATION ${CMAKE_INSTALL_MANDIR}
+COMPONENT manuals
+)
+install(
+DIRECTORY ${man_out_dir}/man3
+DESTINATION ${CMAKE_INSTALL_MANDIR}
+COMPONENT