Skip to content

Instantly share code, notes, and snippets.

@stintel
Created March 15, 2022 12:19
Show Gist options
  • Save stintel/62b7f251450356d44eeb7a2b80e0ae65 to your computer and use it in GitHub Desktop.
Save stintel/62b7f251450356d44eeb7a2b80e0ae65 to your computer and use it in GitHub Desktop.
./dev-lang/ucode/files/ucode-lib64.patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f993019..e4dab38 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,16 @@ IF(NOT LEGACY_SUPPORT)
ADD_DEFINITIONS(-DNO_LEGACY)
ENDIF()
+GET_PROPERTY(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
+
+IF(LIB64)
+ set(LIB_SUFFIX 64)
+ELSE()
+ set(LIB_SUFFIX "")
+ENDIF()
+
+SET(LIB_DIR "lib${LIB_SUFFIX}" CACHE PATH "Library installation directory")
+
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(JSONC json-c json)
IF(JSONC_FOUND)
@@ -152,8 +162,8 @@ IF(UNIT_TESTING)
ENDIF()
INSTALL(TARGETS ucode RUNTIME DESTINATION bin)
-INSTALL(TARGETS libucode LIBRARY DESTINATION lib)
-INSTALL(TARGETS ${LIBRARIES} LIBRARY DESTINATION lib/ucode)
+INSTALL(TARGETS libucode LIBRARY DESTINATION "${LIB_DIR}")
+INSTALL(TARGETS ${LIBRARIES} LIBRARY DESTINATION "lib/ucode")
FILE(GLOB UCODE_HEADERS "include/ucode/*.h")
INSTALL(FILES ${UCODE_HEADERS} DESTINATION include/ucode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment