-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird source files in multilevel CMake build #38
Comments
Thank you for reporting this. Is your project available on github? If not, can you please post skeleton CMake files, so I can setup the test project? |
I tried to recreate your setup, here: https://github.com/scapix-com/bug_multilevel However, I do not get the error, everything works fine. I gave you write access to this repository, can you please add necessary modifications to get the error? Thanks. |
I managed to recreate the error and commited it to the repository. It represents the current state of my project: if I use CMake 3.18 then the errors described above appear, if I use CMake 3.20 or higher then the configuration completes without errors, but build fails because the bridge file for |
Thanks, I found that simply setting Starting from CMake 3.20 the error disappears because of this change in CMake 3.20: There is a workaround in Scapix using older CMake: when linking lib from another CMake file, call add_executable(example example.cpp)
target_link_libraries(example lib)
scapix_fix_sources(lib) Please tell me if this workaround is good enough for your use case. |
Yes, it works, thanks. But in my project I do not always build examples, so the corresponding CMake file gets skipped, Is there a place where I can find any documentation about |
Handle dependencies when add_library() and scapix_bridge_headers() are in different directories. #38
Turns out there were multiple issues affecting the situation when I submitted a fix, and now it should work correctly with CMake 3.18 or later (there is still an issue with CMake older then 3.18). All you need in your case is a single call to I will release new Scapix version soon. |
Fixed in cmodule v1.0.34: |
Can confirm that I no longer have these configure time errors with v1.0.34, thanks |
I have a CMake project with layout like this:
The top-level CMake file includes other files via
add_subdirectory
: firstly the main target is created insrc
subfolder viaadd_library
, then Scapix and other libraries are configured, thenexamples
subfolder is added the same way, containing some executable targets created viaadd_executable
(the library is linked to them). The project builds and works fine without Scapix.The problem is that when I add Scapix to the project with
and run CMake with
-DSCAPIX_BRIDGE=java
I get the following errors at configure time:I do not specify the missing files by myself, it seems like Scapix adds them to the targets somehow.
I can get rid of the first one if I place the content of the CMake file that loads Scapix into the CMake file that creates the library target (
src/CMakeLists.txt
), but then the second one remains, and I can get rid of the second one if I place it into the CMake file that creates the example target (examples/CMakeLists.txt
), but then the first one remains.Is it possible to fix these errors without throwing all CMake code into a single CMake file?
The text was updated successfully, but these errors were encountered: