Skip to content

Add insulation of packaging definitions to library examples #8

Open
@daixtrose

Description

@daixtrose

See https://alexreinking.com/blog/building-a-dual-shared-and-static-library-with-cmake.html

Finally, we'll add some packaging logic, but include it by default only if we're the top-level project. That insulates FetchContent users from our install rules if they don't want them, but keeps them available in case they do:

string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" is_top_level)
option(SomeLib_INCLUDE_PACKAGING "Include packaging rules for SomeLib" "${is_top_level}")
if (SomeLib_INCLUDE_PACKAGING)
    add_subdirectory(packaging)
endif ()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions