Comments (8)
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?
from scapix.
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.
from scapix.
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 SomeClass.cpp
doesn't get generated and thus cannot be found.
from scapix.
Thanks, I found that simply setting cmake_minimum_required(VERSION 3.18)
in my original test leads to error.
Starting from CMake 3.20 the error disappears because of this change in CMake 3.20:
https://cmake.org/cmake/help/latest/prop_sf/GENERATED.html
There is a workaround in Scapix using older CMake: when linking lib from another CMake file, call scapix_fix_sources(lib)
:
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.
from scapix.
Yes, it works, thanks. But in my project I do not always build examples, so the corresponding CMake file gets skipped, scapix_fix_sources()
doesn't get called, and I get the same error with add_library
as described above (in my project Scapix is configured outside of the file where add_library
is, just like in the example project I commited).
Is there a place where I can find any documentation about scapix_fix_sources()
? If I add some new example targets into the same example/CMakeLists.txt
do I call this command after each new target, or do I call it only after the last one in the file? If I add new targets linking lib
in some other file do I call the command again or do I call it after all of the targets that link lib
in the project are added? Can I just put it at the bottom of my top level CMake file and use it even when no other targets apart from the library is present?
from scapix.
Turns out there were multiple issues affecting the situation when add_library
and scapix_bridge_headers
are called from different directories.
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 scapix_fix_sources(lib)
in every CMake file where lib
is used, even if it's used multiple times in the same CMake file (but there is no harm in calling it multiple times). It should work now even if all these CMake files are skipped.
I will release new Scapix version soon.
from scapix.
Fixed in cmodule v1.0.34:
https://github.com/scapix-com/cmodule/releases
from scapix.
Can confirm that I no longer have these configure time errors with v1.0.34, thanks
from scapix.
Related Issues (20)
- Compilation issues with CMake 3.22.3 and Android HOT 2
- JNI FindClass return null on Android main thread HOT 9
- Null pointer dereference (Android + JNI) HOT 5
- Java bridge: generate all classes as public HOT 3
- Cannot use OpenCV with Scapix `1.0.28` or newer when building with `clang 12` or older HOT 3
- Getting `multiple overloads of 'tuple_base' instantiate to the same signature 'void ()'` error HOT 2
- Cannot return `std::vector<bool>` HOT 2
- Is C# supported on Linux and/or macOS? HOT 2
- C# bindings for existing complex libraries HOT 1
- cmodule SHA256 mismatch HOT 1
- Add a license clause to the scapix link headers?
- Recursive initialization in `scapix_JNI_OnLoad` HOT 4
- Enum class is not propagated to the Python bindings. HOT 3
- Incomplete bindings from C API HOT 4
- Enum not available in Java
- Map containing vectors in Java HOT 1
- `scapix::bridge::object`-derived class parameters can be bridged without `std::shared_ptr`
- Null parameter for callback from Java to C++ HOT 3
- Bug? anonymous union error thrown HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scapix.