You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configuring fmi-library currently prints a few CMake warnings. One of these warnings is
CMake Warning (dev) at Config.cmake/fmixml.cmake:185 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "/home/mahge/fmi-library/build_cmake/CMakeCache.txt"
of target "expatex" does not exist.
The external project is setup at build time. This seems to be no problem for some generators like GNU Makefiles. However, for some strict build systems like "Ninja" the will trigger an error at the start of build because the dependency does not exist yet.. This means any project that adds fmi-library as a sub-project can not use these generators.
As far as I can see, expat can be added as a sub-directory instead of an external project. It has support for CMake configuration. If there is no other reason to keep it configuring/building as an external project, it should be switched.
I will create a pull request with the respective changes.
Edit
Up on further investigation, the cause for the Ninja build failure is not that specific warning. The exact error message is
ninja: error: 'ExpatEx/libexpat.a', needed by '3rdParty/FMIL/fmilib_dummy.c', missing and no known rule to make it
As far as I can see fmilib_dummy.c depends on expat.
I am not very familiar with the inter-workings of ExternalProject but I guess the issue lies somewhere here in the interaction of imported targets, imported llibrary locations, and explicit add_dependency() calls.
There is also quite a heave usage of CMAKE_BINARY_DIRECTORY in this part of the code, which is fine when fmi-libray is a standalone project. However, if it is a subproject it might be writing and reading things from places that were not intentional. Not to mention it pollutes the parent projects space.
The linked PR should still remove the issue, even though I am not sure yet what is causing it here.
The text was updated successfully, but these errors were encountered:
Configuring fmi-library currently prints a few CMake warnings. One of these warnings is
Due to this line
fmi-library/Config.cmake/fmixml.cmake
Line 185 in 0edf0b0
The external project is setup at build time. This seems to be no problem for some generators like GNU Makefiles. However, for some strict build systems like "Ninja" the will trigger an error at the start of build because the dependency does not exist yet.. This means any project that adds fmi-library as a sub-project can not use these generators.
As far as I can see, expat can be added as a sub-directory instead of an external project. It has support for CMake configuration. If there is no other reason to keep it configuring/building as an external project, it should be switched.
I will create a pull request with the respective changes.
Edit
Up on further investigation, the cause for the Ninja build failure is not that specific warning. The exact error message is
ninja: error: 'ExpatEx/libexpat.a', needed by '3rdParty/FMIL/fmilib_dummy.c', missing and no known rule to make it
As far as I can see fmilib_dummy.c depends on expat.
fmi-library/Config.cmake/mergestaticlibs.cmake
Lines 124 to 127 in 0edf0b0
and merge_static_libs is invoked with
${libs}
as${FMILIB_SUBLIBS}
and that list containsexpat
. Plusexpat
depends explicitly on expatexfmi-library/Config.cmake/fmixml.cmake
Lines 191 to 196 in 0edf0b0
I am not very familiar with the inter-workings of ExternalProject but I guess the issue lies somewhere here in the interaction of imported targets, imported llibrary locations, and explicit add_dependency() calls.
There is also quite a heave usage of CMAKE_BINARY_DIRECTORY in this part of the code, which is fine when fmi-libray is a standalone project. However, if it is a subproject it might be writing and reading things from places that were not intentional. Not to mention it pollutes the parent projects space.
The linked PR should still remove the issue, even though I am not sure yet what is causing it here.
The text was updated successfully, but these errors were encountered: