Closed merwaaan closed 2 years ago
I wonder if we can keep the generator expression and simply use string(generate ...)
from CMake instead, to just have it evaluate the generator expression directly into a string and then vomit it out into the export...
I'm on Windows and it builds for me, but then I'm far from a CMake enjoyer.
Applied as 55f8b9b8b3e4ef665bec4477cb5021e6922960ec with minor editorial, cheers.
Hi,
CMake causes issues on Windows because the generated export inherits a string from the build script that contains generator expressions that are successfully evaluated at generation time, but they cannot be evaluated at import time (due to the missing target).
The generated code in
infowareConfig.cmake
looks like this, with the escaped expression from the generation script:This commit replaces the generator expression with a plain condition based on BUILD_SHARED_LIBS, which already controls the behavior of
add_library
used earlier.This changes the content of the import script with:
(when building a shared library, otherwise INFOWARE_DLL is not defined).
This fixes the import on Windows.