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

CMake: Fix DLL install directory in mingw #505

Merged
merged 1 commit into from
Sep 25, 2023
Merged

CMake: Fix DLL install directory in mingw #505

merged 1 commit into from
Sep 25, 2023

Conversation

Biswa96
Copy link
Contributor

@Biswa96 Biswa96 commented Sep 22, 2023

This installs DLL in 'bin' directory instead of 'lib' by default.
In mingw environment, all DLLs and EXEs are installed in 'bin'
and static & import libraries are installed in 'lib' directory.
This does not affect other environment because the 'RUNTIME'
and 'LIBRARY' targets are automatically set by cmake. See
https://cmake.org/cmake/help/latest/command/install.html

Fixes #502

@Biswa96
Copy link
Contributor Author

Biswa96 commented Sep 22, 2023

This also fixes the generated cmake file as following.

--- a/lib/cmake/CLBlast/CLBlastConfig-release.cmake
+++ b/lib/cmake/CLBlast/CLBlastConfig-release.cmake
@@ -10,11 +10,11 @@
 set_target_properties(clblast PROPERTIES
   IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/libclblast.dll.a"
   IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "/ucrt64/lib/libOpenCL.dll.a"
-  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libclblast.dll"
+  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/libclblast.dll"
   )
 
 list(APPEND _cmake_import_check_targets clblast )
-list(APPEND _cmake_import_check_files_for_clblast "${_IMPORT_PREFIX}/lib/libclblast.dll.a" "${_IMPORT_PREFIX}/lib/libclblast.dll" )
+list(APPEND _cmake_import_check_files_for_clblast "${_IMPORT_PREFIX}/lib/libclblast.dll.a" "${_IMPORT_PREFIX}/bin/libclblast.dll" )
 
 # Commands beyond this point should not need to know the version.
 set(CMAKE_IMPORT_FILE_VERSION)

@bandoti
Copy link

bandoti commented Sep 22, 2023

Nice! Thank you.

Copy link
Owner

@CNugteren CNugteren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for fixing this issue!

One minor comment, if you would be so kind to add a note about this fix between line 2 and 3 of the CHANGELOG (https://github.com/CNugteren/CLBlast/blob/master/CHANGELOG#L2C1-L2C69).

Thanks

This installs DLL in 'bin' directory instead of 'lib' by default.
In mingw environment, all DLLs and EXEs are installed in 'bin'
and static & import libraries are installed in 'lib' directory.
This does not affect other environment because the 'RUNTIME'
and 'LIBRARY' targets are automatically set by cmake. See
https://cmake.org/cmake/help/latest/command/install.html

Signed-off-by: Biswapriyo Nath <[email protected]>
@Biswa96
Copy link
Contributor Author

Biswa96 commented Sep 22, 2023

Done.

@CNugteren CNugteren enabled auto-merge (squash) September 25, 2023 08:35
@CNugteren CNugteren merged commit 60e7574 into CNugteren:master Sep 25, 2023
4 checks passed
@Biswa96 Biswa96 deleted the cmake-mingw-install branch September 25, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMake find package paths broken in MSYS2
3 participants