Skip to content

Disabling BUILD_TESTING causes project to fail to install #70

@wusatosi

Description

@wusatosi

I was trying to update the README regarding the BUILD_TESTING option, and I don't think its working.

For example, if I try to install the header with Build testing on (default), the following code work as desired:

cmake -B build -S . -DCMAKE_CXX_STANDARD=20 -DBUILD_TESTING=ON
cmake --build build --config Release --verbose
cmake --install build --config Release --prefix /tmp/beman.exemplar
ls -l /tmp/beman.exemplar

Outputs:

-- Installing: /tmp/beman.exemplar/lib/libbeman.exemplar.a
-- Up-to-date: /tmp/beman.exemplar/include/beman/exemplar/identity.hpp
total 8
drwxr-xrw-+ 3 vscode vscode 4096 Nov 10 02:42 include
drwxr-xrw-+ 2 vscode vscode 4096 Nov 10 02:50 lib

However, if I disable Build testing:

cmake -B build -S . -DCMAKE_CXX_STANDARD=20 -DBUILD_TESTING=OFF
cmake --build build --config Release --verbose
cmake --install build --config Release --prefix /tmp/beman.exemplar

CMake fails with:

CMake Error at build/src/beman/exemplar/cmake_install.cmake:46 (file):
  file INSTALL given no DESTINATION
Call Stack (most recent call first):
  build/cmake_install.cmake:47 (include)

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