summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt12
-rw-r--r--libusbmuxd.pc.in4
-rw-r--r--libusbmuxd/CMakeLists.txt4
3 files changed, 12 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4251bde..a5e8f1c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,9 +6,13 @@ SET ( LIBUSBMUXD_SOVERSION "1" )
cmake_minimum_required(VERSION 2.6)
-IF(NOT DEFINED CMAKE_INSTALL_LIBDIR)
- SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
-ENDIF(NOT DEFINED CMAKE_INSTALL_LIBDIR)
+IF(NOT DEFINED LIB_SUFFIX)
+ IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(LIB_SUFFIX "64" CACHE STRING "Define suffix of library directory name (32/64)" )
+ ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ENDIF(NOT DEFINED LIB_SUFFIX)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/Modules/")
@@ -20,7 +24,7 @@ add_subdirectory (udev)
# pkg-config
CONFIGURE_FILE ("${CMAKE_SOURCE_DIR}/libusbmuxd.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc")
# install pkg-config file
-INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/)
+INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig/)
# add uninstall target
CONFIGURE_FILE( "${CMAKE_SOURCE_DIR}/Modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
diff --git a/libusbmuxd.pc.in b/libusbmuxd.pc.in
index f949ba0..25d4e09 100644
--- a/libusbmuxd.pc.in
+++ b/libusbmuxd.pc.in
@@ -1,12 +1,12 @@
prefix=${CMAKE_INSTALL_PREFIX}
exec_prefix=${CMAKE_INSTALL_PREFIX}
-libdir=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
+libdir=${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
includedir=${CMAKE_INSTALL_PREFIX}/include
Name: libusbmuxd
Description: A library to communicate with the usbmux daemon
Version: ${USBMUXD_VERSION}
Requires: libusb-1.0 >= 1.0.3
-Libs: -L${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} -lusbmuxd
+Libs: -L${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} -lusbmuxd
Cflags: -I${CMAKE_INSTALL_PREFIX}/include
diff --git a/libusbmuxd/CMakeLists.txt b/libusbmuxd/CMakeLists.txt
index d57d0a0..fd47afb 100644
--- a/libusbmuxd/CMakeLists.txt
+++ b/libusbmuxd/CMakeLists.txt
@@ -10,7 +10,7 @@ set_target_properties(libusbmuxd PROPERTIES VERSION ${LIBUSBMUXD_VERSION})
set_target_properties(libusbmuxd PROPERTIES SOVERSION ${LIBUSBMUXD_SOVERSION})
install(TARGETS libusbmuxd
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
)
install(FILES usbmuxd.h usbmuxd-proto.h DESTINATION include)