[cmake-developers] [PATCH] QtDialog: Allow to set CMAKE_SHARE_DIR

2015-12-20 Thread Niels Ole Salscheider
This is needed for multiarch layouts where the prefix is /usr/${host} but
where arch-independet files are installed to /usr/share.
---
 Source/CMakeInstallDestinations.cmake | 3 +++
 Source/QtDialog/CMakeLists.txt| 6 +++---
 bootstrap | 7 +++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Source/CMakeInstallDestinations.cmake 
b/Source/CMakeInstallDestinations.cmake
index 99c86ca..b0cbc85 100644
--- a/Source/CMakeInstallDestinations.cmake
+++ b/Source/CMakeInstallDestinations.cmake
@@ -13,6 +13,8 @@ else()
   set(CMAKE_MAN_DIR_DEFAULT "man") # OTHER
 endif()
 
+set(CMAKE_SHARE_DIR_DEFAULT "share")
+
 set(CMAKE_DATA_DIR_DESC "data")
 set(CMAKE_DOC_DIR_DESC "docs")
 set(CMAKE_MAN_DIR_DESC "man pages")
@@ -21,6 +23,7 @@ foreach(v
 CMAKE_DATA_DIR
 CMAKE_DOC_DIR
 CMAKE_MAN_DIR
+CMAKE_SHARE_DIR
 )
   # Populate the cache with empty values so we know when the user sets them.
   set(${v} "" CACHE STRING "")
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 9161ad3..9137695 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -193,7 +193,7 @@ if(UNIX AND NOT APPLE)
   foreach (size IN ITEMS 32 128)
 install(
   FILES   "${CMAKE_CURRENT_SOURCE_DIR}/CMakeSetup${size}.png"
-  DESTINATION "share/icons/hicolor/${size}x${size}/apps"
+  DESTINATION "${CMAKE_SHARE_DIR}/icons/hicolor/${size}x${size}/apps"
   ${COMPONENT}
   RENAME  "CMakeSetup.png")
   endforeach ()
@@ -201,10 +201,10 @@ if(UNIX AND NOT APPLE)
   # install a desktop file so CMake appears in the application start menu
   # with an icon
   install(FILES CMake.desktop
-DESTINATION share/applications
+DESTINATION "${CMAKE_SHARE_DIR}/applications"
 ${COMPONENT})
   install(FILES cmakecache.xml
-DESTINATION share/mime/packages
+DESTINATION "${CMAKE_SHARE_DIR}/mime/packages"
 ${COMPONENT})
 endif()
 
diff --git a/bootstrap b/bootstrap
index b2421a1..27f1efd 100755
--- a/bootstrap
+++ b/bootstrap
@@ -63,9 +63,11 @@ cmake_copyright="`grep '^Copyright .* Kitware' 
"${cmake_source_dir}/Copyright.tx
 cmake_data_dir_keyword="OTHER"
 cmake_doc_dir_keyword="OTHER"
 cmake_man_dir_keyword="OTHER"
+cmake_share_dir_keyword="OTHER"
 cmake_data_dir=""
 cmake_doc_dir=""
 cmake_man_dir=""
+cmake_share_dir=""
 cmake_init_file=""
 cmake_bootstrap_system_libs=""
 cmake_bootstrap_qt_gui=""
@@ -214,6 +216,7 @@ fi
 cmake_data_dir_default="`cmake_install_dest_default DATA 
${cmake_data_dir_keyword}`"
 cmake_doc_dir_default="`cmake_install_dest_default DOC 
${cmake_doc_dir_keyword}`"
 cmake_man_dir_default="`cmake_install_dest_default MAN 
${cmake_man_dir_keyword}`"
+cmake_share_dir_default="`cmake_install_dest_default SHARE 
${cmake_share_dir_keyword}`"
 
 CMAKE_KNOWN_C_COMPILERS="cc gcc xlc icc tcc"
 CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ c++ icc como "
@@ -428,6 +431,8 @@ Directory and file names:
   ['"${cmake_doc_dir_default}"']
   --mandir=DIRinstall man pages files in PREFIX/DIR/manN
   ['"${cmake_man_dir_default}"']
+  --sharedir=DIR  install architecture-independent files in PREFIX/DIR
+  ['"${cmake_share_dir_default}"']
 '
   exit 10
 }
@@ -616,6 +621,7 @@ while test $# != 0; do
   --datadir=*) cmake_data_dir=`cmake_arg "$1"` ;;
   --docdir=*) cmake_doc_dir=`cmake_arg "$1"` ;;
   --mandir=*) cmake_man_dir=`cmake_arg "$1"` ;;
+  --sharedir=*) cmake_share_dir=`cmake_arg "$1"` ;;
   --init=*) cmake_init_file=`cmake_arg "$1"` ;;
   --system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} 
-DCMAKE_USE_SYSTEM_LIBRARIES=1" ;;
   --no-system-libs) 
cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} 
-DCMAKE_USE_SYSTEM_LIBRARIES=0" ;;
@@ -1368,6 +1374,7 @@ set (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE 
PATH "Install path pre
 set (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for 
documentation (relative to prefix)." FORCE)
 set (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man 
pages (relative to prefix)." FORCE)
 set (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for 
data (relative to prefix)." FORCE)
+set (CMAKE_SHARE_DIR "'"${cmake_share_dir}"'" CACHE PATH "Install location for 
architecture-independent files (relative to prefix)." FORCE)
 ' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
 
 # Add configuration settings given as command-line options.
-- 
2.6.4

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html


Re: [cmake-developers] Restriction on target types for GraphViz dependency graph generation

2015-12-20 Thread Daniel Pfeifer
On Wed, Dec 16, 2015 at 5:20 AM, Andrey Mishchenko  wrote:
> Hi,
>
> I noticed that the automatic dependency graph generation in CMake targeting
> GraphViz only considers targets of certain types. In particular, it only
> adds nodes for executables and shared, static, and module libraries.
>
> Is this deliberate?

There are open issues about that:

https://cmake.org/Bug/view.php?id=13809
https://cmake.org/Bug/view.php?id=15636
https://cmake.org/Bug/view.php?id=15638

> If I submit a patch extending this functionality to (optionally, via
> configuration variables) work with more target types, would it be received
> well?

Absolutely. Thanks for working on this!

-- Daniel
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers