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

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

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


##########
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:
   Yes, that works and simplifies things.  I tested it and works well:
   
   ```
   08:43:26 zeus:(cmake_boringssl_rpath)~/dev/apache/trafficserver$ objdump -x /opt/ats/bin/traffic_server
   ...
     RUNPATH              /opt/ats/lib:/opt/boringssl/lib64
   ```



-- 
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