Fix files from different configurations overwriting on installation #192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I was looking for guidelines on contributions but didn't find any information.
Anyways,
The problem:
Installation files are overwriting each other from different configurations during installation. This will result in only "Debug" files being installed at the end and all "Release", "MinSizeRel" or "RelWithDebInfo" files will be missing. This is because the target file names and their paths are not being discriminated during installation.
This will turn linking into a nightmare because of course we get a lot of "mismatch detected for '_ITERATOR_DEBUG_LEVEL'" kind of errors when trying to build another library that depends on OIDN. This is because CMake will always link to the debug configuration of OIDN.
I'm aware of the CMAKE_BUILD_TYPE option but:
I realized there's a .zip file that is generated at the end of the installation, and even this file suffers from the same problem: It's only debug files.
The solution:
I propose installing these files in separate folders, one for each configuration which is a pretty standard way of doing it. This way the won't collide with each other and one can seamlessly link OIDN to other projects using CMake targets.
Note: There's an additional file (external\mkl-dnn\src\CMakeLists.txt) that I couldn't commit. I think it's because it's from another library but it was as simple as changing one line. However, I can see the "mkl-dnn" folder in "external", but it's empty. Maybe it's being ignored from somewhere? I couldn't find the .ignore file or how you guys are handling this.
If you need additional information or any changes, please let me know!
I'm quite sleepy, so I apologize for any spelling or grammar mistakes I may have made.
Software:
Windows 10
CMake 3.27.9
Visual Studio Community 2017 (15.9.58)
Platform Toolset Visual Studio 2017 (v141)
Windows SDK Version 10.0.22621.0
C++17 Standard