summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <SmSpillaz@gmail.com>2010-05-18 19:30:17 +0800
committerSam Spilsbury <SmSpillaz@gmail.com>2010-05-18 19:30:17 +0800
commit54deec100959dd84fc3ad7df28cfd745883f5644 (patch)
tree42081f56208e19b994cb53351c2b79d19ac1804b
parent9447ee14f0bc64d005c153eb54247fe8a3b1c44a (diff)
downloadzcomp-54deec100959dd84fc3ad7df28cfd745883f5644.tar.gz
zcomp-54deec100959dd84fc3ad7df28cfd745883f5644.tar.bz2
Added DESTDIR support for packaging
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmake/CMakeLists.txt4
-rw-r--r--cmake/CompizCommon.cmake8
-rw-r--r--cmake/CompizGconf.cmake6
-rw-r--r--cmake/CompizPlugin.cmake12
-rw-r--r--cmake/base.cmake4
-rw-r--r--gtk/gnome/CMakeLists.txt4
-rw-r--r--gtk/window-decorator/CMakeLists.txt2
-rw-r--r--images/CMakeLists.txt2
-rw-r--r--include/CMakeLists.txt2
-rw-r--r--include/core/CMakeLists.txt2
-rw-r--r--kde/window-decorator-kde4/CMakeLists.txt2
-rw-r--r--libdecoration/CMakeLists.txt4
-rw-r--r--metadata/CMakeLists.txt2
-rw-r--r--plugins/decor/CMakeLists.txt3
-rw-r--r--po/CMakeLists.txt2
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--xslt/CMakeLists.txt4
18 files changed, 34 insertions, 35 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d444cf5..dee32e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,7 +76,7 @@ compiz_configure_file (
install (
FILES ${CMAKE_BINARY_DIR}/generated/compiz-common.h
- DESTINATION ${includedir}/compiz
+ DESTINATION ${COMPIZ_DESTDIR}${includedir}/compiz
)
compiz_configure_file (
@@ -88,7 +88,7 @@ compiz_configure_file (
install (
FILES ${CMAKE_BINARY_DIR}/compiz.pc
- DESTINATION ${libdir}/pkgconfig
+ DESTINATION ${COMPIZ_DESTDIR}${libdir}/pkgconfig
)
add_subdirectory (cmake)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 74a19b2..be750f3 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -17,5 +17,5 @@ endif ()
install (
FILES ${_files}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/compiz/cmake
-) \ No newline at end of file
+ DESTINATION ${COMPIZ_DESTDIR}${CMAKE_INSTALL_PREFIX}/share/compiz/cmake
+)
diff --git a/cmake/CompizCommon.cmake b/cmake/CompizCommon.cmake
index 1b99640..66cc506 100644
--- a/cmake/CompizCommon.cmake
+++ b/cmake/CompizCommon.cmake
@@ -16,6 +16,8 @@ cmake_policy (SET CMP0011 OLD)
set (CMAKE_SKIP_RPATH FALSE)
option (COMPIZ_BUILD_WITH_RPATH "Leave as ON unless building packages" ON)
+option (COMPIZ_RUN_LDCONFIG "Leave OFF unless you need to run ldconfig after install")
+set (COMPIZ_DESTDIR ${COMPIZ_DESTDIR} CACHE STRING "Leave blank unless building packages")
set (COMPIZ_DATADIR ${CMAKE_INSTALL_PREFIX}/share)
set (COMPIZ_METADATADIR ${CMAKE_INSTALL_PREFIX}/share/compiz)
@@ -46,14 +48,14 @@ function (compiz_ensure_linkage)
find_program (LDCONFIG_EXECUTABLE ldconfig)
mark_as_advanced (FORCE LDCONFIG_EXECUTABLE)
- if (LDCONFIG_EXECUTABLE AND NOT ${CMAKE_BUILD_WITH_RPATH})
+ if (LDCONFIG_EXECUTABLE AND ${COMPIZ_RUN_LDCONFIG})
install (
CODE "message (\"Running \" ${LDCONFIG_EXECUTABLE} \" \" ${CMAKE_INSTALL_PREFIX} \"/lib\")
exec_program (${LDCONFIG_EXECUTABLE} ARGS \"-v\" ${CMAKE_INSTALL_PREFIX}/lib)"
)
- endif (LDCONFIG_EXECUTABLE AND NOT ${CMAKE_BUILD_WITH_RPATH})
+ endif (LDCONFIG_EXECUTABLE AND ${COMPIZ_RUN_LDCONFIG})
endfunction ()
macro (compiz_add_git_dist)
@@ -202,7 +204,7 @@ function (compiz_opt_install_file _src _dst)
install (CODE
"message (\"-- Installing: ${_dst}\")
execute_process (
- COMMAND ${CMAKE_COMMAND} -E copy_if_different \"${_src}\" \"${_dst}\"
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different \"${_src}\" \"${COMPIZ_DESTDIR}${_dst}\"
RESULT_VARIABLE _result
OUTPUT_QUIET ERROR_QUIET
)
diff --git a/cmake/CompizGconf.cmake b/cmake/CompizGconf.cmake
index e116a12..c7c235c 100644
--- a/cmake/CompizGconf.cmake
+++ b/cmake/CompizGconf.cmake
@@ -29,7 +29,7 @@ function (compiz_install_gconf_schema _src _dst)
endif ()
install (
FILES "${_src}"
- DESTINATION "${_dst}"
+ DESTINATION "${COMPIZ_DESTDIR}${_dst}"
)
endfunction ()
@@ -40,9 +40,9 @@ function (compiz_gconf_schema _src _dst _inst)
if (XSLTPROC_EXECUTABLE)
add_custom_command (
- OUTPUT ${_dst}
+ OUTPUT ${COMPIZ_DESTDIR}${_dst}
COMMAND ${XSLTPROC_EXECUTABLE}
- -o ${_dst}
+ -o ${COMPIZ_DESTDIR}${_dst}
${COMPIZ_GCONF_SCHEMAS_XSLT}
${_src}
DEPENDS ${_src}
diff --git a/cmake/CompizPlugin.cmake b/cmake/CompizPlugin.cmake
index 13107ed..8d1e7b6 100644
--- a/cmake/CompizPlugin.cmake
+++ b/cmake/CompizPlugin.cmake
@@ -284,7 +284,7 @@ function (_build_compiz_plugin plugin)
# install xml
install (
FILES ${_translated_xml}
- DESTINATION ${PLUGIN_XMLDIR}
+ DESTINATION ${COMPIZ_DESTDIR}${PLUGIN_XMLDIR}
)
endif (_translated_xml)
@@ -315,11 +315,11 @@ function (_build_compiz_plugin plugin)
install (
FILES ${CMAKE_BINARY_DIR}/generated/compiz-${plugin}.pc
- DESTINATION ${PLUGIN_PKGDIR}
+ DESTINATION ${COMPIZ_DESTDIR}${PLUGIN_PKGDIR}
)
install (
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/${plugin}
- DESTINATION ${PLUGIN_INCDIR}/compiz
+ DESTINATION ${COMPIZ_DESTDIR}${PLUGIN_INCDIR}/compiz
)
endif ()
endif ()
@@ -328,7 +328,7 @@ function (_build_compiz_plugin plugin)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/data)
install (
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data
- DESTINATION ${PLUGIN_DATADIR}
+ DESTINATION ${COMPIZ_DESTDIR}${PLUGIN_DATADIR}
)
endif ()
@@ -336,7 +336,7 @@ function (_build_compiz_plugin plugin)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/images)
install (
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/images
- DESTINATION ${PLUGIN_IMAGEDIR}
+ DESTINATION ${COMPIZ_DESTDIR}${PLUGIN_IMAGEDIR}
)
endif ()
@@ -409,7 +409,7 @@ function (_build_compiz_plugin plugin)
install (
TARGETS ${plugin}
- LIBRARY DESTINATION ${PLUGIN_LIBDIR}
+ LIBRARY DESTINATION ${COMPIZ_DESTDIR}${PLUGIN_LIBDIR}
)
compiz_add_uninstall ()
diff --git a/cmake/base.cmake b/cmake/base.cmake
index 01135f0..fe44c1c 100644
--- a/cmake/base.cmake
+++ b/cmake/base.cmake
@@ -45,7 +45,7 @@ function (_check_compiz_cmake_macro)
endif ()
add_custom_target (
findcompiz_install
- ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/FindCompiz.cmake ${CMAKE_ROOT}/Modules
+ ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/FindCompiz.cmake ${DESTDIR}${CMAKE_ROOT}/Modules
)
endfunction ()
@@ -60,4 +60,4 @@ if (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}")
set (ENV{PKG_CONFIG_PATH}
"${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig:$ENV{PKG_CONFIG_PATH}")
endif ()
-endif () \ No newline at end of file
+endif ()
diff --git a/gtk/gnome/CMakeLists.txt b/gtk/gnome/CMakeLists.txt
index c4b5ab6..93c2044 100644
--- a/gtk/gnome/CMakeLists.txt
+++ b/gtk/gnome/CMakeLists.txt
@@ -22,7 +22,7 @@ if (USE_GNOME)
)
install (
FILES ${desktop_file}
- DESTINATION ${datadir}/applications
+ DESTINATION ${COMPIZ_DESTDIR}${datadir}/applications
)
set (wmproperties_file ${CMAKE_CURRENT_BINARY_DIR}/compiz-wm.desktop)
@@ -79,7 +79,7 @@ if (USE_GNOME)
install (
TARGETS gnome-compiz
- DESTINATION ${windowsettingslibdir}/window-manager-settings
+ DESTINATION ${COMPIZ_DESTDIR}${windowsettingslibdir}/window-manager-settings
)
compiz_opt_install_file (
diff --git a/gtk/window-decorator/CMakeLists.txt b/gtk/window-decorator/CMakeLists.txt
index 7ec4d54..cba5464 100644
--- a/gtk/window-decorator/CMakeLists.txt
+++ b/gtk/window-decorator/CMakeLists.txt
@@ -53,7 +53,7 @@ if (USE_GTK)
install (
TARGETS gtk-window-decorator
- DESTINATION ${exec_prefix}
+ DESTINATION ${COMPIZ_DESTDIR}${exec_prefix}
)
diff --git a/images/CMakeLists.txt b/images/CMakeLists.txt
index e31ed5a..77589a4 100644
--- a/images/CMakeLists.txt
+++ b/images/CMakeLists.txt
@@ -6,5 +6,5 @@ set (_images
install (
FILES ${_images}
- DESTINATION ${compiz_imagedir}
+ DESTINATION ${COMPIZ_DESTDIR}${compiz_imagedir}
)
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 6ff6fd0..31b7b94 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -5,7 +5,7 @@ set (_headers
install (
FILES ${_headers}
- DESTINATION ${includedir}/compiz
+ DESTINATION ${COMPIZ_DESTDIR}${includedir}/compiz
)
add_subdirectory (core)
diff --git a/include/core/CMakeLists.txt b/include/core/CMakeLists.txt
index 75db4f6..eac25a6 100644
--- a/include/core/CMakeLists.txt
+++ b/include/core/CMakeLists.txt
@@ -24,5 +24,5 @@ set (_headers
install (
FILES ${_headers}
- DESTINATION ${includedir}/compiz/core
+ DESTINATION ${COMPIZ_DESTDIR}${includedir}/compiz/core
)
diff --git a/kde/window-decorator-kde4/CMakeLists.txt b/kde/window-decorator-kde4/CMakeLists.txt
index 8f7d989..51e0d50 100644
--- a/kde/window-decorator-kde4/CMakeLists.txt
+++ b/kde/window-decorator-kde4/CMakeLists.txt
@@ -61,7 +61,7 @@ if (USE_KDE4)
install (
TARGETS kde4-window-decorator
- DESTINATION ${exec_prefix}
+ DESTINATION ${COMPIZ_DESTDIR}${exec_prefix}
)
else (KDE4_FOUND)
diff --git a/libdecoration/CMakeLists.txt b/libdecoration/CMakeLists.txt
index 2ee4ffa..144fe37 100644
--- a/libdecoration/CMakeLists.txt
+++ b/libdecoration/CMakeLists.txt
@@ -35,7 +35,7 @@ target_link_libraries (
install (
TARGETS decoration
- DESTINATION ${libdir}
+ DESTINATION ${COMPIZ_DESTDIR}${libdir}
)
set (DECORATION_LIBS "")
@@ -55,5 +55,5 @@ compiz_configure_file (
install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/libdecoration.pc
- DESTINATION ${libdir}/pkgconfig
+ DESTINATION ${COMPIZ_DESTDIR}${libdir}/pkgconfig
)
diff --git a/metadata/CMakeLists.txt b/metadata/CMakeLists.txt
index 25097bd..63a250d 100644
--- a/metadata/CMakeLists.txt
+++ b/metadata/CMakeLists.txt
@@ -37,7 +37,7 @@ compiz_translate_xml (
install (
FILES ${CMAKE_BINARY_DIR}/generated/core.xml
- DESTINATION ${compiz_metadatadir}
+ DESTINATION ${COMPIZ_DESTDIR}${compiz_metadatadir}
)
add_custom_target (core-xml-file ALL
diff --git a/plugins/decor/CMakeLists.txt b/plugins/decor/CMakeLists.txt
index 4d14c8d..b912b74 100644
--- a/plugins/decor/CMakeLists.txt
+++ b/plugins/decor/CMakeLists.txt
@@ -3,12 +3,9 @@ find_package (Compiz REQUIRED)
include (CompizPlugin)
include (CompizCommon)
-message ("build rpath is " ${COMPIZ_BUILD_WITH_RPATH})
-
compiz_plugin(decor PLUGINDEPS composite opengl LIBRARIES decoration)
if (COMPIZ_BUILD_WITH_RPATH)
- message ("set rpath")
set_target_properties (
decor PROPERTIES
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index fb88a3a..940ed77 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -45,7 +45,7 @@ foreach(catalog ${compiz_catalogs})
install (
FILES ${po_BINARY_DIR}/${catalog}/lc_messages/compiz.mo
- DESTINATION ${datadir}/compiz/locale/${catalog}/lc_messages
+ DESTINATION ${COMPIZ_DESTDIR}${datadir}/compiz/locale/${catalog}/lc_messages
)
set (compiz_catalog_targets ${compiz_catalog_targets} ${po_BINARY_DIR}/${catalog}/lc_messages/compiz.mo)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5c0290e..8d923c3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -57,5 +57,5 @@ target_link_libraries (
install (
TARGETS compiz
- DESTINATION ${exec_prefix}
+ DESTINATION ${COMPIZ_DESTDIR}${exec_prefix}
)
diff --git a/xslt/CMakeLists.txt b/xslt/CMakeLists.txt
index df6c31a..594e6cb 100644
--- a/xslt/CMakeLists.txt
+++ b/xslt/CMakeLists.txt
@@ -9,5 +9,5 @@ endif ()
install (
FILES ${_files}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/compiz/xslt
-) \ No newline at end of file
+ DESTINATION ${COMPIZ_DESTDIR}${CMAKE_INSTALL_PREFIX}/share/compiz/xslt
+)