Skip to content

Fix tests for out-of-source builds using CMake #235

@doganulus

Description

@doganulus

Newer CMake versions allow out-of-source builds using -S and -B options in configuration (CMake 3.13 or newer).

cmake -S ${PROJECT_SOURCE_DIR} -B ${PROJECT_BUILD_DIR}
cmake --build ${PROJECT_BUILD_DIR}
ctest --test-dir ${PROJECT_BUILD_DIR} --output-on-failure
cmake --install ${PROJECT_BUILD_DIR}

Currently, some tests rely on relative paths assuming a build directory ./build such as:

This makes these tests fail when built out-of-source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions