Integration

The recommended way is to setup one CMake project file for cross-platform C++ code (built for different platforms as either static or dynamic library) and a set of separate application projects for different platforms, some using Cmake and some created manually in corresponding IDEs.

In CMakeLists.txt for your lib target, call scapix_bridge_headers(). This will invoke Scapix code generator during build if any of your C++ bridge class definitions change. Place the call after any calls to target_include_directories() and target_link_libraries() for the target.

Example:

include(${SCAPIX_ROOT}/project/cmake/modules/scapix.cmake)

scapix_bridge_headers(
    chatlib
    "com.scapix.chat"
    "${PROJECT_ROOT}/source/chat/contact.h"
    "${PROJECT_ROOT}/source/chat/session.h"
    "${PROJECT_ROOT}/source/chat/model.h"
)

scapix_bridge_headers() parameters:

  • target - your lib target with cross-platform C++ code
  • domain - reverse domain for your application (example: com.companyname.appname)
  • bridge_headers - individually listed pathnames of header files containing your C++ bridge classes (classes derived from scapix::bridge::object)

For Python bridge, the order of headers passed to scapix_bridge_headers() matters: headers with base classes should come before headers with derived classes.