summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-10-14 22:13:56 +0000
committersamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-10-14 22:13:56 +0000
commit8e8977b9ec07a832dfedf5c1bea74032f3b514eb (patch)
treeeac344541161e643b85c32e4505e43e32428756d
parent82af9dc79b2467d3f9a45ab1caed65045122ccb5 (diff)
downloadother-8e8977b9.tar.gz
other-8e8977b9.zip
[kde-common/cmake] added "tde_setup_paths" macro, a convenient way to setup install paths, inspired by classic configure tool
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kde-common@1186009 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--cmake/modules/TDESetupPaths.cmake143
1 files changed, 143 insertions, 0 deletions
diff --git a/cmake/modules/TDESetupPaths.cmake b/cmake/modules/TDESetupPaths.cmake
new file mode 100644
index 0000000..3b122ad
--- /dev/null
+++ b/cmake/modules/TDESetupPaths.cmake
@@ -0,0 +1,143 @@
+#################################################
+#
+# (C) 2010 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+macro( tde_setup_paths )
+
+ # --prefix
+ # install architecture-independent files in PREFIX
+ if( NOT PREFIX )
+ set( PREFIX "${CMAKE_INSTALL_PREFIX}" )
+ else( NOT PREFIX )
+ # PREFIX have precedence over CMAKE_INSTALL_PREFIX
+ set( CMAKE_INSTALL_PREFIX "${PREFIX}" )
+ endif( NOT PREFIX )
+
+ # --exec-prefix
+ # install architecture-dependent files in EPREFIX
+ if( NOT EPREFIX )
+ set( EPREFIX "${PREFIX}" )
+ endif( NOT EPREFIX )
+
+ # --bindir
+ # user executables
+ if( NOT BINDIR )
+ set( BINDIR "${EPREFIX}/bin" )
+ endif( NOT BINDIR )
+
+ # --sbindir
+ # system admin executables
+ if( NOT SBINDIR )
+ set( SBINDIR "${EPREFIX}/sbin" )
+ endif( NOT SBINDIR )
+
+ # --libexecdir
+ # program executables
+ if( NOT LIBEXECDIR )
+ set( LIBEXECDIR "${EPREFIX}/libexec" )
+ endif( NOT LIBEXECDIR )
+
+ # --sysconfdir
+ # read-only single-machine data
+ if( NOT SYSCONFDIR )
+ set( SYSCONFDIR "${PREFIX}/etc" )
+ endif( NOT SYSCONFDIR )
+
+ # --sharedstatedir
+ # modifiable architecture-independent data
+ if( NOT SHAREDSTATEDIR )
+ set( SHAREDSTATEDIR "${PREFIX}/com" )
+ endif( NOT SHAREDSTATEDIR )
+
+ # --localstatedir
+ # modifiable single-machine data
+ if( NOT LOCALSTATEDIR )
+ set( LOCALSTATEDIR "${PREFIX}/var" )
+ endif( NOT LOCALSTATEDIR )
+
+ # --libdir
+ # object code libraries
+ if( NOT LIBDIR )
+ set( LIBDIR "${EPREFIX}/lib" )
+ endif( NOT LIBDIR )
+
+ # --includedir
+ # C header files
+ if( NOT INCLUDEDIR )
+ set( INCLUDEDIR "${PREFIX}/include" )
+ endif( NOT INCLUDEDIR )
+
+ # --oldincludedir
+ # C header files for non-gcc
+ if( NOT OLDINCLUDEDIR )
+ set( OLDINCLUDEDIR "/usr/include" )
+ endif( NOT OLDINCLUDEDIR )
+
+ # --datarootdir
+ # read-only arch.-independent data root
+ if( NOT DATAROOTDIR )
+ set( DATAROOTDIR "${PREFIX}/share" )
+ endif( NOT DATAROOTDIR )
+
+ # --datadir
+ # read-only architecture-independent data
+ if( NOT DATADIR )
+ set( DATADIR "${DATAROOTDIR}" )
+ endif( NOT DATADIR )
+
+ # --infodir
+ # info documentation
+ if( NOT INFODIR )
+ set( INFODIR "${DATAROOTDIR}/info" )
+ endif( NOT INFODIR )
+
+ # --localedir
+ # locale-dependent data
+ if( NOT LOCALEDIR )
+ set( LOCALEDIR "${DATAROOTDIR}/locale" )
+ endif( NOT LOCALEDIR )
+
+ # --mandir
+ # man documentation
+ if( NOT MANDIR )
+ set( MANDIR "${DATAROOTDIR}/man" )
+ endif( NOT MANDIR )
+
+ # --docdir
+ # documentation root
+ if( NOT DOCDIR )
+ set( DOCDIR "${DATAROOTDIR}/doc/${PACKAGE}" )
+ endif( NOT DOCDIR )
+
+ # --htmldir
+ # html documentation
+ if( NOT HTMLDIR )
+ set( HTMLDIR "${DOCDIR}" )
+ endif( NOT HTMLDIR )
+
+ # --dvidir
+ # dvi documentation
+ if( NOT DVIDIR )
+ set( DVIDIR "${DOCDIR}" )
+ endif( NOT DVIDIR )
+
+ # --pdfdir
+ # pdf documentation
+ if( NOT PDFDIR )
+ set( PDFDIR "${DOCDIR}" )
+ endif( NOT PDFDIR )
+
+ # --psdir
+ # ps documentation
+ if( NOT PSDIR )
+ set( PSDIR "${DOCDIR}" )
+ endif( NOT PSDIR )
+
+endmacro( tde_setup_paths )