summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey C. Ollie <jeff@ocjtech.us>2008-09-12 11:00:39 -0500
committerJeffrey C. Ollie <jeff@ocjtech.us>2008-09-12 11:00:39 -0500
commit61bc227dd4dc3a58a5b0ce3b3c8b0fc0a7bd8801 (patch)
treea2bc60f65e0c0a7766a10be6b6ba4e7928be88f2
parentf36ec3d6f7dce974ccb2e8ecc10eb0d8bb334ec3 (diff)
downloadlibresample-61bc227dd4dc3a58a5b0ce3b3c8b0fc0a7bd8801.tar.gz
libresample-61bc227dd4dc3a58a5b0ce3b3c8b0fc0a7bd8801.tar.xz
libresample-61bc227dd4dc3a58a5b0ce3b3c8b0fc0a7bd8801.zip
Check for 32 or 64 bit platform
Check the size of a "void *" to see if we are on a 32 or 64 bit platform and adjust the installation directory of the libraries accordingly.
-rw-r--r--CMakeLists.txt15
1 files changed, 13 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ecbfdd..27fb949 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,17 @@ cmake_minimum_required(VERSION 2.6)
project(libresample)
include(CheckIncludeFiles)
+include(CheckTypeSize)
+
+check_type_size("void *" POINTER_SIZE)
+
+if(${POINTER_SIZE} EQUAL 8)
+ set(LIBDIR lib64)
+elseif(${POINTER_SIZE} EQUAL 4)
+ set(LIBDIR lib)
+else(${POINTER_SIZE} EQUAL 8)
+ message(FATAL_ERROR "pointer size is not 4 bytes or 8 bytes")
+endif(${POINTER_SIZE} EQUAL 8)
check_include_files(inttypes.h HAVE_INTTYPES_H)
@@ -10,5 +21,5 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/configtemplate.h ${CMAKE_CURRENT_
add_library(resample SHARED src/filterkit.c src/resample.c src/resamplesubs.c)
set_target_properties(resample PROPERTIES VERSION 1.0 SOVERSION 1)
-install(TARGETS resample LIBRARY DESTINATION ${LIB_INSTALL_DIR})
-install(FILES include/libresample.h DESTINATION ${INCLUDE_INSTALL_DIR})
+install(TARGETS resample LIBRARY DESTINATION ${LIBDIR})
+install(FILES include/libresample.h DESTINATION include)