Open SamuelMarks opened 3 years ago
Related: running with conan install --build='libui' ..
worked, but I'm not sure what find_package
is meant to look like…
Folded it all into one CMakeLists.txt
, and then ran cmake -DCMAKE_BUILD_TYPE=Debug
referring to it:
cmake_minimum_required(VERSION 3.0)
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0054 NEW)
project(pp VERSION 0.0.0 LANGUAGES C)
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/v0.16.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
EXPECTED_HASH SHA256=396e16d0f5eabdc6a14afddbcfff62a54a7ee75c6da23f32f7a31bc85db23484
TLS_VERIFY ON)
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_configure(REQUIRES libui/0.4.1@bincrafters/stable
GENERATORS cmake_find_package)
conan_cmake_autodetect(settings)
conan_add_remote(NAME bincrafters
INDEX 1
URL https://api.bintray.com/conan/bincrafters/public-conan
VERIFY_SSL True)
conan_cmake_install(PATH_OR_REFERENCE .
BUILD missing
REMOTE bincrafters
SETTINGS ${settings})
file(DOWNLOAD "https://raw.githubusercontent.com/andlabs/libui/d788d86/examples/drawtext/main.c"
"${CMAKE_BINARY_DIR}/src/main.c"
EXPECTED_HASH SHA256=cdc67294145e638d6b6444068829ded491c7481660e5d344bd6353be78d697cb
TLS_VERIFY ON)
set(src "${CMAKE_BINARY_DIR}/src/main.c")
file(READ ${src} main_source)
string(REPLACE "#include \"../../ui.h\"" "#include <ui.h>" main_source ${main_source})
file(WRITE ${src} ${main_source})
find_package(ui CONFIG REQUIRED)
add_executable(${PROJECT_NAME} ${src})
target_link_libraries(${PROJECT_NAME} PRIVATE ui)
CMake Error at CMakeLists.txt:38 (find_package):
Could not find a package configuration file provided by "ui" with any of
the following names:
uiConfig.cmake
ui-config.cmake
Add the installation prefix of "ui" to CMAKE_PREFIX_PATH or set "ui_DIR" to
a directory containing one of the above files. If "ui" provides a separate
development package or SDK, be sure it has been installed.
you need to use the cmake_find_package_multi instead of cmake_find_package when invoking conan_cmake_configure
For more information read https://docs.conan.io/en/latest/reference/generators/cmake_find_package.html and https://docs.conan.io/en/latest/reference/generators/cmake_find_package_multi.html#generated-files
Package and Environment Details (include every applicable attribute)
Conan profile (output of
conan profile show default
orconan profile show <profile>
if custom profile is in use)Steps to reproduce (Include if Applicable)
conanfile.txt
Logs (Include/Attach if Applicable)
I mean is this related to the bintray being turned off? - Or am I misusing it?