Skip to content

Integrations

Egor Pugin edited this page May 13, 2019 · 4 revisions

It is possible to use SW as package manager for your favourite build system.

Here you can find list of completed integrations with examples.

CMake

Full example

Steps:

  1. Download SW, unpack and add to PATH.
  2. Run sw setup to perform initial integration into system.
  3. Add necessary parts to your CMakeLists.txt (see below).

First, make sure CMake is able to found SW package: find_package(SW REQUIRED)

Then add necessary dependencies (packages) with sw_add_package(). You can omit version. In this case the latest will be used.

Next step is to execute SW to prepare imported targets script with sw_execute().

find_package(SW REQUIRED)
sw_add_package(
    org.sw.demo.sqlite3
    org.sw.demo.glennrp.png
)
sw_execute()

Last thing is to add dependency to your package:

add_executable(mytarget ${MY_SOURCES})
target_link_libraries(mytarget 
    org.sw.demo.glennrp.png
)

Configure SW deps

Use set(SW_BUILD_SHARED_LIBS 1) to build shared libs instead of static (default).

Waf

Full example

  1. Copy-paste these lines to your file https://github.com/SoftwareNetwork/sw/blob/master/test/integrations/wscript#L4-L25
  2. Replace these lines with your dependencies https://github.com/SoftwareNetwork/sw/blob/master/test/integrations/wscript#L9-L10
  3. Use deps like on those lines https://github.com/SoftwareNetwork/sw/blob/master/test/integrations/wscript#L35-L36

To build things call

waf sw_configure sw_build configure build

sw_configure setups SW for waf.

sw_build builds necessary deps.

You can’t perform that action at this time.