Skip to content

Commit

Permalink
respect libsuffix in pkgconfig (capstone-engine#1393)
Browse files Browse the repository at this point in the history
* respect libsuffix in pkgconfig

discovered in https://bugs.gentoo.org/677946

* Update CMakeLists.txt

* Update CMakeLists.txt

* Update CMakeLists.txt
  • Loading branch information
blshkv authored and aquynh committed Feb 20, 2019
1 parent 0b37390 commit 211a2eb
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -594,16 +594,7 @@ source_group("Include\\EVM" FILES ${HEADERS_EVM})
source_group("Include\\MOS65XX" FILES ${HEADERS_MOS65XX})

### test library 64bit routine:
get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)

if (NOT APPLE AND "${LIB64}" STREQUAL "TRUE")
set(LIBSUFFIX 64)
else()
set(LIBSUFFIX "")
endif()

set(INSTALL_LIB_DIR lib${LIBSUFFIX} CACHE PATH "Installation directory for libraries")
mark_as_advanced(INSTALL_LIB_DIR)
include("GNUInstallDirs")

## installation
install(FILES ${HEADERS_COMMON} DESTINATION include/capstone)
Expand All @@ -612,15 +603,15 @@ configure_file(capstone.pc.in ${CMAKE_BINARY_DIR}/capstone.pc @ONLY)
if (CAPSTONE_BUILD_STATIC)
install(TARGETS capstone-static
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif ()

if (CAPSTONE_BUILD_SHARED)
install(TARGETS capstone-shared
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif ()

if (CAPSTONE_BUILD_SHARED AND CAPSTONE_BUILD_CSTOOL)
Expand All @@ -629,5 +620,5 @@ add_executable(cstool ${CSTOOL_SRC})
target_link_libraries(cstool ${default-target})

install(TARGETS cstool DESTINATION bin)
install(FILES ${CMAKE_BINARY_DIR}/capstone.pc DESTINATION lib/pkgconfig)
install(FILES ${CMAKE_BINARY_DIR}/capstone.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif ()

0 comments on commit 211a2eb

Please sign in to comment.