pistacheio / pistache

A high-performance REST toolkit written in C++
https://pistacheio.github.io/pistache/
Apache License 2.0
3.12k stars 690 forks source link

build(cmake): add install error message #1073

Closed Tachi107 closed 2 years ago

Tachi107 commented 2 years ago

When running the install target, users will now get the following error:

$ cmake --install build
-- Install configuration: "Release"
CMake Error at build/cmake_install.cmake:46 (message):
  Please use Meson to install Pistache.

  See the README for details:
  https://github.com/pistacheio/pistache#building-from-source

Fixes #1072

(CI skipped as CMake isn't tested)

dennisjenkins75 commented 2 years ago

cool. ty.

Tachi107 commented 2 years ago

Thank you for suggesting the enhancement in the first place! I hope we'll get fewer reports like #1068, #919, and #908

patrick-kings commented 1 year ago

Is there a way to disable "Please use Meson to install Pistache" error since my setup works with the previous commit and FetchContent in cmake.

FetchContent_Declare(pistache
    GIT_REPOSITORY https://github.com/pistacheio/pistache.git
    GIT_TAG 469bad6edf32d76bab3565d5d1f09b86807ff08c
    GIT_PROGRESS TRUE
    DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)

FetchContent_MakeAvailable(pistache)

target_link_libraries(${PROJECT_NAME} PRIVATE pistache)
Tachi107 commented 1 year ago

Weird, why is the install target invoked? Does removing the error message make things work?

eli-schwartz commented 1 year ago

add_subdirectory still invokes installation, and that's what FetchContent_MakeAvailable essentially is.

You could guard this error message by checking if it is the main project, I guess. :)