Comment 1 for bug 872386

Revision history for this message
Chris Hillery (ceejatec) wrote : Re: inconsistent build and install directories

This happens because DECLARE_ZORBA_MODULE() uses a glob pattern to find all .cpp files in the module's source directory. When you make a change which adds new .cpp files, as you did here, it's unfortunately necessary to re-run CMake. There's no way CMake can detect this change automatically, so it doesn't build the new files. I tried doing your experiment and was able to reproduce the bug (it actually gave a runtime linking error after updating to r10491, but I'll put that down to an OS difference). Then I tried it again but adding a call to "cmake" after updating to r10491, and the query ran fine.

CMake recommends against using glob patterns for naming source files for exactly this reason, but I couldn't think of any other way to make a general-purpose DECLARE_ZORBA_MODULE() macro. I suppose it could take a list of source files rather than doing a glob pattern... hard to know whether this would be an ease-of-use improvement or not. What I certainly will do, though, is update the documentation to indicate this problem, and to instruct users to re-run CMake after adding any new .cpp files.