swipl-devel
swipl-devel copied to clipboard
Duplicate swipl-win target on Windows
When trying to configure cmake on Windows in MSYS, I got this error:
CMake Error at packages/swipl-win/CMakeLists.txt:79 (add_executable):
add_executable cannot create target "swipl-win" because another target with
the same name already exists. The existing target is an executable created
in source directory "swipl-devel/src". See
documentation for policy CMP0002 for more details.
Which is caused by the windows specific swipl-win target, and the Qt based packages/swipl-win targets interfering with each other. https://github.com/SWI-Prolog/swipl-devel/blob/b91bcb590c59e694333c8c4e49a7c0edb5439fda/cmake/WindowsTargets.cmake#L10
https://github.com/SWI-Prolog/packages-swipl-win/blob/6e85a1cd60cecba9980d1b742a24a60f99a3a0aa/CMakeLists.txt#L79
I'm guessing the assumption is that Qt is not installed when using MSYS, but I had it installed, which resulted in duplicate targets. It would probably make sense to just disable package/swipl-win on Windows. Alternatively it could be renamed, or made optional, since the Qt terminal does seem to work fine on Windows too.
Good point. Originally, the idea was for the Qt console to replace the old Win32 swipl-win. The dependency setup and packaging isn't all that simple though while the Qt version uses many times the resources of the native Win32 version 😢 .
For now disabled the Qt console because adding it also requires verifying the packaging and post installation steps. See SWI-Prolog/swipl-devel@094d7623ca07b421ce111ddd1b4b5c26b5c89dd4
Closing as resolved.