Skip to content

Commit

Permalink
[Installation] On CentOS install to /usr/lib64
Browse files Browse the repository at this point in the history
  • Loading branch information
space88man committed Feb 25, 2021
1 parent 004126b commit 2e64a7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ if(KS_PLAT_LIN)
find_package(Git)
find_program(GZIP_CMD gzip)
find_program(DATE_CMD date)
include(GNUInstallDirs)
endif()

# Fixes build on older gcc, Debian Jessie
Expand Down Expand Up @@ -79,6 +80,9 @@ endif()
if("${CMAKE_OS_NAME}" STREQUAL "Centos")

# Enable component install
# Install shared libraries to /usr/lib64
set(CMAKE_INSTALL_LIBDIR lib64 CACHE PATH "Library installation location" FORCE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(CPACK_RPM_COMPONENT_INSTALL ON)

# Find stuff we need for packaging on Centos
Expand Down Expand Up @@ -306,7 +310,7 @@ include(CPack)
# us to run the apps from the build dir without installing (come install time
# the binary is re-linked with an rpath matching that of the install prefix)
set(SKIP_BUILD_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")

# Use the link path for the rpath
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
Expand Down Expand Up @@ -390,7 +394,7 @@ set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")

if (NOT KS_PLAT_WIN)
# Set install targets
install(TARGETS signalwire_client COMPONENT "runtime" EXPORT SignalWireClientConfig DESTINATION lib)
install(TARGETS signalwire_client COMPONENT "runtime" EXPORT SignalWireClientConfig DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY inc/signalwire-client-c COMPONENT "runtime" DESTINATION include PATTERN internal EXCLUDE)

# Set path for pkg-config based on ARCH and distro type
Expand Down
2 changes: 1 addition & 1 deletion signalwire_client.pc.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prefix=@PC_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/include
definitions=@PC_DEFINITIONS@

Expand Down

0 comments on commit 2e64a7a

Please sign in to comment.