From 975423c949793dc33bd5c58d651b8fbd861bd893 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 26 Feb 2013 11:58:45 +0800 Subject: [PATCH] cmake lib lib64 problem As discussed here, there's a semi-standardized way to inform cmake that the install target wants its libs in .../lib64 https://code.google.com/p/bullet/issues/detail?id=174 this patch adds the necessary fiddling Signed-off-by: Andy Green --- CMakeLists.txt | 6 +++--- README.build | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71402a22..4e406838 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -679,7 +679,7 @@ if (UNIX) file(WRITE ${PROJECT_BINARY_DIR}/libwebsockets.pc "prefix=/usr/local exec_prefix=\${prefix} -libdir=\${exec_prefix}/lib +libdir=\${exec_prefix}/lib${LIB_SUFFIX} includedir=\${prefix}/include Name: libwebsockets @@ -702,8 +702,8 @@ set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Header files") # Install libs. install(TARGETS websockets websockets_shared - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT libraries) set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries") diff --git a/README.build b/README.build index 64d98cf6..3994c9cc 100644 --- a/README.build +++ b/README.build @@ -283,12 +283,19 @@ Building on Unix: the source directory of libwebsockets containing the CMakeLists.txt project file. All examples in this file assumes you use "..") + NOTE2 A common option you may want to give is to set the install path, same as --prefix= with autotools. It defaults to /usr/local. You can do this by, eg cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr + NOTE3 + On machines that want libraries in lib64, you can also add the + following to the cmake line + + -DLIB_SUFFIX=64 + 4. Finally you can build using the generated Makefile: make