CMake build system fix for ticket #90: install dirs configurable

This commit is contained in:
Pedro Lopez-Cabanillas 2010-10-16 17:27:47 +00:00
parent e6eeb05b28
commit 67047a0327
7 changed files with 94 additions and 10 deletions

View file

@ -93,6 +93,9 @@ set ( LIB_SUFFIX ${_init_lib_suffix} CACHE STRING
"library directory name suffix (32/64/nothing)" )
mark_as_advanced ( LIB_SUFFIX )
# Default install directory names
include ( DefaultDirs )
# Basic C library checks
include ( CheckSTDC )
include ( CheckIncludeFile )
@ -197,7 +200,8 @@ unset ( DARWIN CACHE )
unset ( MACOSX_FRAMEWORK CACHE )
if ( ${CMAKE_SYSTEM} MATCHES "Darwin" )
set ( DARWIN 1 )
set ( CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} )
set ( CMAKE_INSTALL_NAME_DIR
${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}${LIB_SUFFIX} )
if ( enable-coreaudio )
check_include_file ( CoreAudio/AudioHardware.h COREAUDIO_FOUND )
if ( COREAUDIO_FOUND )
@ -407,7 +411,7 @@ if ( UNIX )
configure_file ( fluidsynth.pc.in
${CMAKE_BINARY_DIR}/fluidsynth.pc IMMEDIATE @ONLY )
install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc
DESTINATION lib${LIB_SUFFIX}/pkgconfig )
DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX}/pkgconfig )
# uninstall custom target
configure_file ( "${CMAKE_SOURCE_DIR}/cmake_admin/cmake_uninstall.cmake.in"

View file

@ -0,0 +1,78 @@
# Several directory names used by FluidSynth to install files
# the variable names are similar to the KDE4 build system
# BUNDLE_INSTALL_DIR - Mac only: the directory for application bundles
set (BUNDLE_INSTALL_DIR "/Applications" CACHE STRING
"The install dir for application bundles")
mark_as_advanced (BUNDLE_INSTALL_DIR)
# FRAMEWORK_INSTALL_DIR - Mac only: the directory for framework bundles
set (FRAMEWORK_INSTALL_DIR "/Library/Frameworks" CACHE STRING
"The install dir for framework bundles")
mark_as_advanced (FRAMEWORK_INSTALL_DIR)
# BIN_INSTALL_DIR - the directory where executables will be installed
set (BIN_INSTALL_DIR "bin" CACHE STRING "The install dir for executables")
mark_as_advanced (BIN_INSTALL_DIR)
# SBIN_INSTALL_DIR - the directory where system executables will be installed
set (SBIN_INSTALL_DIR "sbin" CACHE STRING
"The install dir for system executables")
mark_as_advanced (SBIN_INSTALL_DIR)
# LIB_INSTALL_DIR - the directory where libraries will be installed
set (LIB_INSTALL_DIR "lib" CACHE STRING "The install dir for libraries")
mark_as_advanced (LIB_INSTALL_DIR)
# INCLUDE_INSTALL_DIR - the install dir for header files
set (INCLUDE_INSTALL_DIR "include" CACHE STRING "The install dir for headers")
mark_as_advanced (INCLUDE_INSTALL_DIR)
# DATA_INSTALL_DIR - the base install directory for data files
set (DATA_INSTALL_DIR "share" CACHE STRING
"The base install dir for data files")
mark_as_advanced (DATA_INSTALL_DIR)
# DOC_INSTALL_DIR - the install dir for documentation
set (DOC_INSTALL_DIR "share/doc" CACHE STRING
"The install dir for documentation")
mark_as_advanced (DOC_INSTALL_DIR)
# INFO_INSTALL_DIR - the info install dir
set (INFO_INSTALL_DIR "share/info" CACHE STRING "The info install dir")
mark_as_advanced (INFO_INSTALL_DIR)
# MAN_INSTALL_DIR - the man pages install dir
set (MAN_INSTALL_DIR "share/man/man1" CACHE STRING "The man pages install dir")
mark_as_advanced (MAN_INSTALL_DIR)
# SYSCONF_INSTALL_DIR - the config file install dir
set (SYSCONF_INSTALL_DIR "/etc" CACHE PATH
"The sysconfig install dir")
mark_as_advanced (SYSCONF_INSTALL_DIR)
# XDG_APPS_INSTALL_DIR - the XDG apps dir, where .desktop files are installed
set (XDG_APPS_INSTALL_DIR "share/applications" CACHE STRING "The XDG apps dir")
mark_as_advanced (XDG_APPS_INSTALL_DIR)
# XDG_MIME_INSTALL_DIR - the XDG mimetypes install dir
set (XDG_MIME_INSTALL_DIR "share/mime/packages" CACHE STRING
"The install dir for the xdg mimetypes")
mark_as_advanced (XDG_MIME_INSTALL_DIR)
# DBUS_INTERFACES_INSTALL_DIR - the directory where dbus interfaces are
# installed
set (DBUS_INTERFACES_INSTALL_DIR "share/dbus-1/interfaces" CACHE STRING
"The dbus interfaces install dir")
mark_as_advanced (DBUS_INTERFACES_INSTALL_DIR)
# DBUS_SERVICES_INSTALL_DIR - the directory where dbus services are installed
set (DBUS_SERVICES_INSTALL_DIR "share/dbus-1/services" CACHE STRING
"The dbus services install dir")
mark_as_advanced (DBUS_SERVICES_INSTALL_DIR)
# DBUS_SYSTEM_SERVICES_INSTALL_DIR - the directory where dbus system services
# are installed
set (DBUS_SYSTEM_SERVICES_INSTALL_DIR "share/dbus-1/system-services"
CACHE STRING "The dbus system services install dir")
mark_as_advanced (DBUS_SYSTEM_SERVICES_INSTALL_DIR)

View file

@ -5,6 +5,7 @@ EXTRA_DIST = CheckDIRSymbolExists.cmake \
CheckSTDC.cmake \
cmake_uninstall.cmake.in \
CreateLibtoolFile.cmake \
DefaultDirs.cmake \
FindMidiShare.cmake \
FindOSS.cmake \
FindPthreads.cmake \

View file

@ -31,5 +31,5 @@ endif ( DOXYGEN_FOUND )
if ( UNIX )
install ( FILES fluidsynth.1
DESTINATION share/man/man1 )
DESTINATION ${MAN_INSTALL_DIR} )
endif ( UNIX )

View file

@ -22,5 +22,5 @@
add_subdirectory ( fluidsynth )
IF (NOT MACOSX_FRAMEWORK )
install ( FILES fluidsynth.h DESTINATION include )
install ( FILES fluidsynth.h DESTINATION ${INCLUDE_INSTALL_DIR} )
ENDIF (NOT MACOSX_FRAMEWORK )

View file

@ -46,6 +46,6 @@ if ( NOT MACOSX_FRAMEWORK )
${include_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/version.h
DESTINATION
include/fluidsynth
${INCLUDE_INSTALL_DIR}/fluidsynth
)
endif ( NOT MACOSX_FRAMEWORK )

View file

@ -252,7 +252,7 @@ if ( MACOSX_FRAMEWORK )
FRAMEWORK TRUE
PUBLIC_HEADER "${public_main_HEADER}"
FRAMEWORK_VERSION "${LT_VERSION_CURRENT}"
INSTALL_NAME_DIR "/Library/Frameworks"
INSTALL_NAME_DIR ${FRAMEWORK_INSTALL_DIR}
VERSION ${LT_VERSION_INFO}
SOVERSION ${LT_VERSION_CURRENT}
)
@ -309,8 +309,9 @@ target_link_libraries ( fluidsynth
)
install ( TARGETS fluidsynth libfluidsynth
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
FRAMEWORK DESTINATION /Library/Frameworks
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX}
FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR}
BUNDLE DESTINATION ${BUNDLE_INSTALL_DIR}
)