Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properly set lib dir for 64 bit systems #168

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ endif()
# 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")

# Now detect a bunch of platform stuff
include(CheckFunctionExists)
Expand Down Expand Up @@ -558,19 +557,9 @@ export(TARGETS ks2
if (NOT KS_PLAT_WIN)

# Set install targets
install(TARGETS ks2 COMPONENT "runtime" EXPORT LibKS2Config DESTINATION lib)
install(TARGETS ks2 COMPONENT "runtime" EXPORT LibKS2Config DESTINATION ${LIB_INSTALL_DIR})
install(DIRECTORY src/include/libks COMPONENT "runtime" DESTINATION include/libks2 PATTERN src/include/libks/internal EXCLUDE)

# Set path for pkg-config based on ARCH and distro type
if("${CMAKE_OS_NAME}" STREQUAL "Centos") # pkg-config --variable pc_path pkg-config
if(${CPACK_SYSTEM_NAME} MATCHES "x86_64")
install(FILES ${PROJECT_BINARY_DIR}/libks2.pc COMPONENT "runtime" DESTINATION lib64/pkgconfig)
else()
install(FILES ${PROJECT_BINARY_DIR}/libks2.pc COMPONENT "runtime" DESTINATION lib/pkgconfig)
endif()
else()
install(FILES ${PROJECT_BINARY_DIR}/libks2.pc COMPONENT "runtime" DESTINATION lib/pkgconfig)
endif()
install(FILES ${PROJECT_BINARY_DIR}/libks2.pc COMPONENT "runtime" DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)

install(FILES cmake/ksutil.cmake COMPONENT "runtime" DESTINATION include/libks2/libks/cmake)
install(FILES cmake/FindPCRE.cmake COMPONENT "runtime" DESTINATION include/libks2/libks/cmake)
Expand Down Expand Up @@ -599,6 +588,7 @@ if (NOT KS_PLAT_WIN)
# Name: @PACKAGE_NAME@
# Version: @PACKAGE_VERSION@
set(PC_PREFIX ${CMAKE_INSTALL_PREFIX})
set(PC_LIB_DIR ${LIB_INSTALL_DIR})
set(PACKAGE_VERSION ${PROJECT_VERSION})
get_property(PC_DEFINITIONS TARGET ks2 PROPERTY INTERFACE_COMPILE_DEFINITIONS)
configure_file("${CMAKE_CURRENT_LIST_DIR}/libks.pc.in" "${PROJECT_BINARY_DIR}/libks2.pc" @ONLY)
Expand Down
2 changes: 1 addition & 1 deletion libks.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=@PC_LIB_DIR@
includedir=${prefix}/include/libks2
definitions=@PC_DEFINITIONS@

Expand Down