Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 833 Bytes

dependencies.rst

File metadata and controls

26 lines (16 loc) · 833 Bytes

Dependencies

Externals

CMake offers many way to add dependencies to your project. PyCmake use Externals object to manage this:

depends = Externals()

Currently, PyCMake supports add_subdirectory for other directory with CMakeLists projects. And you can link_directories to link binaries already built:

depends.add_subdirectory('zlib', '${PROJECT_DIR}/external/zlib/', '${PROJECT_DIR}/build/zlib')
depends.add_link_directories(('${PROJECT_DIR}/external/g3log')

You can link your project with your dependencies. Simply tell which target you want to link with them. If the target exists in your project, PyCmake will link them:

depends.target_link_libraries('mylib', 'zlib', 'g3log')
project.add_dependencies(depends)