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