Skip to content

CMake apps build changes on cmake-modern #4943

@alexreinking

Description

@alexreinking

In an effort to isolate the apps from the rest of the build, and to test our eventual distribution packages, the apps' CMakeLists.txt files were made entirely standalone from the rest of the build. They call find_package(Halide) to load Halide and its special build rules for generators. They also define tests to run the apps on input images and ensure that nothing crashes.

The issue is that building the apps therefore becomes part of testing the app from the main build's perspective and @steven-johnson wants a way to validate that everything builds in a single command (ie. cmake --build .). Installing yourself and triggering external builds is not really ergonomic with CMake unless we want to switch to a super-build structure, which would require some filesystem rearrangement I don't think anyone particularly wants.

The compromise I came up with was to add a flag, APPS_INTERNAL, which changes the behavior to adding the apps (and their tests) to the main build and NOT testing them externally. By default, it is off, meaning that apps only rebuild when they are run as tests.

If anyone has a better solution, this issue is the place to discuss it before landing #4644 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues related to building Halide and with CIdiscussionFor talking about potential improvements & changes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions