You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "JosiahWI (via GitHub)" <gi...@apache.org> on 2023/06/10 12:39:38 UTC

[GitHub] [trafficserver] JosiahWI commented on a diff in pull request #9775: cmake: add OPENSSL_ROOT_DIR to rpath to load the correct lib

JosiahWI commented on code in PR #9775:
URL: https://github.com/apache/trafficserver/pull/9775#discussion_r1225337729


##########
CMakeLists.txt:
##########
@@ -166,11 +165,17 @@ include_directories(
         ${CMAKE_BINARY_DIR}/include
         ${PCRE_INCLUDE_DIRS}
 )
+
 if (OPENSSL_FOUND)
     include_directories(${OPENSSL_INCLUDE_DIR})
     link_libraries(${OPENSSL_CRYPTO_LIBRARY})
 endif(OPENSSL_FOUND)
 
+if (OPENSSL_ROOT_DIR)
+    get_filename_component(OPENSSL_LIBRARY_DIR ${OPENSSL_CRYPTO_LIBRARY} DIRECTORY)
+    set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:${OPENSSL_LIBRARY_DIR}")
+endif(OPENSSL_ROOT_DIR)
+

Review Comment:
   ```suggestion
   set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
   ```
   
   https://cmake.org/cmake/help/v3.26/variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH.html
   Would this not work?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org