aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt51
1 files changed, 29 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8f15153..5a75db44 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
# CMake build file list for OpenAL
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
PROJECT(OpenAL)
@@ -24,6 +24,7 @@ INCLUDE(CheckCCompilerFlag)
INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckTypeSize)
include(CheckFileOffsetBits)
+include(GNUInstallDirs)
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
@@ -44,8 +45,14 @@ OPTION(ALSOFT_HRTF_DEFS "Install HRTF definition files" ON)
OPTION(ALSOFT_AMBDEC_PRESETS "Install AmbDec preset files" ON)
OPTION(ALSOFT_INSTALL "Install headers and libraries" ON)
+if(DEFINED SHARE_INSTALL_DIR)
+ message(WARNING "SHARE_INSTALL_DIR is deprecated. Use the variables provided by the GNUInstallDirs module instead")
+ set(CMAKE_INSTALL_DATADIR "${SHARE_INSTALL_DIR}")
+endif()
-set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "The share install dir")
+if(DEFINED LIB_SUFFIX)
+ message(WARNING "LIB_SUFFIX is deprecated. Use the variables provided by the GNUInstallDirs module instead")
+endif()
IF(NOT WIN32)
@@ -1204,9 +1211,9 @@ TARGET_LINK_LIBRARIES(${LIBNAME} common ${EXTRA_LIBS})
IF(ALSOFT_INSTALL)
# Add an install target here
INSTALL(TARGETS ${LIBNAME}
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION "lib${LIB_SUFFIX}"
- ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
INSTALL(FILES include/AL/al.h
include/AL/alc.h
@@ -1214,10 +1221,10 @@ IF(ALSOFT_INSTALL)
include/AL/efx.h
include/AL/efx-creative.h
include/AL/efx-presets.h
- DESTINATION include/AL
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/AL
)
INSTALL(FILES "${OpenAL_BINARY_DIR}/openal.pc"
- DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
ENDIF()
@@ -1245,7 +1252,7 @@ endif()
# Install alsoft.conf configuration file
IF(ALSOFT_CONFIG)
INSTALL(FILES alsoftrc.sample
- DESTINATION ${SHARE_INSTALL_DIR}/openal
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/openal
)
MESSAGE(STATUS "Installing sample configuration")
MESSAGE(STATUS "")
@@ -1255,7 +1262,7 @@ ENDIF()
IF(ALSOFT_HRTF_DEFS)
INSTALL(FILES hrtf/default-44100.mhr
hrtf/default-48000.mhr
- DESTINATION ${SHARE_INSTALL_DIR}/openal/hrtf
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/openal/hrtf
)
MESSAGE(STATUS "Installing HRTF definitions")
MESSAGE(STATUS "")
@@ -1269,7 +1276,7 @@ IF(ALSOFT_AMBDEC_PRESETS)
presets/rectangle.ambdec
presets/square.ambdec
presets/presets.txt
- DESTINATION ${SHARE_INSTALL_DIR}/openal/presets
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/openal/presets
)
MESSAGE(STATUS "Installing AmbDec presets")
MESSAGE(STATUS "")
@@ -1294,9 +1301,9 @@ IF(ALSOFT_UTILS)
IF(ALSOFT_INSTALL)
INSTALL(TARGETS openal-info makehrtf bsincgen
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION "lib${LIB_SUFFIX}"
- ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
ENDIF()
@@ -1317,9 +1324,9 @@ IF(ALSOFT_TESTS)
IF(ALSOFT_INSTALL)
INSTALL(TARGETS altonegen
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION "lib${LIB_SUFFIX}"
- ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
ENDIF()
@@ -1372,9 +1379,9 @@ IF(ALSOFT_EXAMPLES)
IF(ALSOFT_INSTALL)
INSTALL(TARGETS alstream alreverb allatency alloopback alhrtf
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION "lib${LIB_SUFFIX}"
- ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
ENDIF()
@@ -1411,9 +1418,9 @@ IF(ALSOFT_EXAMPLES)
IF(ALSOFT_INSTALL)
INSTALL(TARGETS alffplay
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION "lib${LIB_SUFFIX}"
- ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
ENDIF()
MESSAGE(STATUS "Building SDL and FFmpeg example programs")