diff options
author | samelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-12-05 21:21:24 +0000 |
---|---|---|
committer | samelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-12-05 21:21:24 +0000 |
commit | 3aaef8e61de684af6ced2951ab2391cd104e0d4c (patch) | |
tree | be81056df0fda1ddddf85959d301a184e8fb3999 /CMakeLists.txt | |
parent | 2e898ecb33af26bd460e9b058fe19d2a680db93d (diff) | |
download | arts-3aaef8e61de684af6ced2951ab2391cd104e0d4c.tar.gz arts-3aaef8e61de684af6ced2951ab2391cd104e0d4c.zip |
[dependencies/arts] improved setup paths
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/arts@1203988 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c026d0c..22ce656 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,21 +37,19 @@ option( WITH_MAD "Enable MAD mp3 decoder support" ON ) ##### paths setup ############################### -if( NOT BIN_INSTALL_DIR ) - set( BIN_INSTALL_DIR bin ) -endif ( NOT BIN_INSTALL_DIR ) +macro( _tde_internal_setup_path _path _default ) + if( DEFINED ${_path} ) + set( ${_path} "${${_path}}" CACHE INTERNAL "" FORCE ) + else( ) + set( ${_path} "${_default}" ) + endif( ) +endmacro( _tde_internal_setup_path ) -if( NOT LIB_INSTALL_DIR ) - set( LIB_INSTALL_DIR lib ) -endif( NOT LIB_INSTALL_DIR ) - -if( NOT INCLUDE_INSTALL_DIR ) - set( INCLUDE_INSTALL_DIR include/${CMAKE_PROJECT_NAME} ) -endif( NOT INCLUDE_INSTALL_DIR ) - -if( NOT PKGCONFIG_INSTALL_DIR ) - set( PKGCONFIG_INSTALL_DIR lib/pkgconfig ) -endif( NOT PKGCONFIG_INSTALL_DIR ) +_tde_internal_setup_path( EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ) +_tde_internal_setup_path( BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" ) +_tde_internal_setup_path( LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" ) +_tde_internal_setup_path( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/${CMAKE_PROJECT_NAME}" ) +_tde_internal_setup_path( PKGCONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig" ) ##### check for include files ################### @@ -192,6 +190,9 @@ configure_file( config.h.cmake config.h @ONLY ) ##### write pkgconfig file ###################### +string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} ) +string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR} ) +string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} ) configure_file( arts.pc.cmake arts.pc @ONLY ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/arts.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} ) |