Open CapSel opened 5 months ago
I've experienced this problem here https://github.com/drogonframework/drogon/issues/1916
It seems that 3 cmake files are not properly exported/available to include when I use drogon as a conan dependency. Together with cmake files there should be 2 executable files (with_ctl) reachable from DragonUtilities.cmake.
[settings] arch=armv8 build_type=Release compiler=apple-clang compiler.cppstd=gnu17 compiler.libcxx=libc++ compiler.version=15 os=Macos
I use it with this command: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -G Ninja
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -G Ninja
CMake Error at CMakeLists.txt:63 (drogon_create_views): Unknown CMake command "drogon_create_views".
not only this version
Description
I've experienced this problem here https://github.com/drogonframework/drogon/issues/1916
It seems that 3 cmake files are not properly exported/available to include when I use drogon as a conan dependency. Together with cmake files there should be 2 executable files (with_ctl) reachable from DragonUtilities.cmake.
Package and Environment Details
Conan profile
[settings] arch=armv8 build_type=Release compiler=apple-clang compiler.cppstd=gnu17 compiler.libcxx=libc++ compiler.version=15 os=Macos
Steps to reproduce
This is my cmake file
``` cmake_minimum_required(VERSION 3.5) project(capsaicin CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake") message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan") file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake" "${CMAKE_BINARY_DIR}/conan.cmake" TLS_VERIFY ON) endif() include(${CMAKE_BINARY_DIR}/conan.cmake) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) conan_cmake_configure(REQUIRES drogon/1.9.4 yaml-cpp/0.8.0 GENERATORS CMakeDeps CMakeToolchain OPTIONS boost/*:without_python=True drogon/*:with_ctl=True drogon/*:with_postgres=True drogon/*:with_redis=True drogon/*:with_yaml_cpp=True ) conan_cmake_autodetect(settings) conan_cmake_install(PATH_OR_REFERENCE . BUILD missing REMOTE conancenter SETTINGS ${settings} ) include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake) include(CheckIncludeFileCXX) set(MAIN_SRC_LIST main.cpp ) add_executable(${PROJECT_NAME} ${MAIN_SRC_LIST}) find_package(Drogon CONFIG REQUIRED) find_package(yaml-cpp REQUIRED) target_link_libraries(${PROJECT_NAME} PRIVATE Drogon::Drogon Threads::Threads yaml-cpp::yaml-cpp ) aux_source_directory(controllers CTL_SRC) aux_source_directory(filters FILTER_SRC) aux_source_directory(plugins PLUGIN_SRC) aux_source_directory(models MODEL_SRC) drogon_create_views(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/views ${CMAKE_CURRENT_BINARY_DIR} TRUE) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/models) target_sources(${PROJECT_NAME} PRIVATE ${SRC_DIR} ${CTL_SRC} ${FILTER_SRC} ${PLUGIN_SRC} ${MODEL_SRC}) install(TARGETS ${PROJECT_NAME} DESTINATION bin) ```I use it with this command:
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -G Ninja
Logs