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

Separate library, runtime, and archive destinations in cmake install target #574

Open
tkelman opened this issue Aug 20, 2016 · 4 comments
Open
Labels
component-platform Portability layer and build scripts enhancement

Comments

@tkelman
Copy link

tkelman commented Aug 20, 2016

For example from libssh2's src/CMakeLists.txt, which is pretty typical:

install(TARGETS libssh2
  EXPORT Libssh2Config
  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

This may need to include(GNUInstallDirs) to work with non-make generators. Right now with just the single mbedtls-specific LIB_INSTALL_DIR variable, both static libraries and shared libraries (and import libraries on Windows) are getting installed to the same location which is not the expected behavior on Windows. Typically Windows builds should put dll's in /bin (RUNTIME DESTINATION), static and import libraries in /lib. See https://cmake.org/cmake/help/v3.6/command/install.html#installing-targets.

I'll submit a patch if this sounds acceptable.

tkelman referenced this issue in JuliaLang/julia Aug 20, 2016
since we don't need it

Go back to just copying the mbedtls dll even in cygwin-cross,
otherwise it puts .dll.a files that we don't need alongside the dlls
(should probably fix this upstream)
@ciarmcom
Copy link

ARM Internal Ref: IOTSSL-995

@tkelman
Copy link
Author

tkelman commented Dec 28, 2016

Any comments on this?

@tkelman
Copy link
Author

tkelman commented Apr 28, 2017

Bump. I'll gladly write a patch to fix this if I get any indication that someone would review it.

@yselkowitz
Copy link

--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -152,7 +152,9 @@ if(USE_SHARED_MBEDTLS_LIBRARY)
     target_link_libraries(mbedtls ${libs} mbedx509)

     install(TARGETS mbedtls mbedx509 mbedcrypto
-            DESTINATION ${LIB_INSTALL_DIR}
+            LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+            ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+            RUNTIME DESTINATION bin
             PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
 endif(USE_SHARED_MBEDTLS_LIBRARY)

@RonEld RonEld added the component-platform Portability layer and build scripts label Feb 17, 2019
iameli pushed a commit to livepeer/mbedtls that referenced this issue Dec 5, 2023
Update README.md to include NSS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-platform Portability layer and build scripts enhancement
Projects
None yet
Development

No branches or pull requests

6 participants