-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cmake/install refactor #5121
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/install refactor #5121
Conversation
Replaces the hard-coded library paths by a method based on CMake's GetPrerequisites module which recursively finds a binary file's linked libraries. Advantage: Potentially works on any system without adaption as long as CMake supports it, so it could be used to create portable Linux packages as well. Disadvantage: "Potentially".
Also enables deploying dependencies for RemoteZynAddSubFX.
* Add missing entries into the Windows exclude list * Respect the case insensitivity of Windows * Fix incorrect `lib` prefix for plugins on Windows
For some reason `MESSAGE(STATUS)` doesn't work on install time.
Fixes MSVC build error
c2f2c9e to
6e1d2ff
Compare
6e1d2ff to
d937775
Compare
|
I don't get it; for some strange reason cmake tries to write each maybe we Ok, according to sakra/cotire#120 it probably has something to do with those generator expressions. We could try to install the artifact into a temporary directory or just install the artifact and remove other installations. |
cmake/install/CMakeLists.txt
Outdated
| if(IS_DIRECTORY ${lib_dir}/bin) | ||
| list(APPEND LIB_DIRS ${lib_dir}/bin) | ||
| endif() | ||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This trick(adding ../bin and ./bin) should be moved to cmake/install/InstallTargetDependencies.cmake, after line 32. It was here to support non-standard locations, ex. libwinpthread-1.dll in Travis-CI builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to solve that with the SUFFIXES argument. However, I don't know why it doesn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried adding ../bin to the SUFFIXES argument?
… cmake/install-refactor
Apply suffixes to implicit link directories and add ../bin
| if(VAR_GENERATOR_EXPRESSION AND ${CMAKE_VERSION} VERSION_LESS "3.14.0") | ||
| include(CreateTempFilePath) | ||
| CreateTempFilePath(OUTPUT_VAR file_path) | ||
| file(GENERATE OUTPUT "${file_path}" CONTENT "${VAR_CONTENT}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The counter logic doesn't work because the CMake script is evaluated only once. For the MSVC generator, file(GENERATE) itself is executed once, but the content is evaluated multiple times at the generation time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVM, I misunderstood the purpose of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I still wonder: Can we create files with unique names(more readable if possible) without a counter?
| cmake_parse_arguments(VAR "${options}" "${oneValueArgs}" | ||
| "${multiValueArgs}" ${ARGN} ) | ||
|
|
||
| # install(CODE) does not support generator expression in ver<3.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a side note, CMP0087 should be set to use generator expressions in CMake >= 3.14.
|
Regarding the MSVC failure: I debugged the generation logic and got values from different configurations. LMMS binary: Other plugins: I think we can generate with |
| file(GENERATE OUTPUT "${file_path}" CONTENT "${VAR_CONTENT}") | ||
| install(CODE "file(READ ${file_path} \"${VAR_NAME}\")") | ||
| else() | ||
| cmake_policy(SET CMP<0087> NEW) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cmake_policy(SET CMP<0087> NEW) | |
| cmake_policy(SET CMP0087 NEW) |
Also, why did you use spaces instead of tabs in some new files?
|
Due to the GitHub outage, this PR is moved to #5142. |
No description provided.