conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
943 stars 1.71k forks source link

[package] oatpp/1.1.0~1.3.0: INVALID Package ID with `shared=True` option. #10965

Open hwhsu1231 opened 2 years ago

hwhsu1231 commented 2 years ago

Package and Environment Details (include every applicable attribute)

Conan profile (output of conan profile show default)

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
build_type=Release
[options]
[conf]
[build_requires]
[env]

Root-level CMakeLists.txt

I use CMake-Conan to install package. Here is my root-level CMakeLists.txt file:

Click to CMakeLists.txt ```cmake cmake_minimum_required(VERSION 3.15) get_filename_component(folder_name "${CMAKE_CURRENT_SOURCE_DIR}" NAME) project(${folder_name} LANGUAGES C CXX) message("========== ${folder_name} ==========") get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG) if(is_multi_config) # Multi-Config Generator set(output_dir "${CMAKE_BINARY_DIR}/$") else(is_multi_config) # Single-Config Generator set(output_dir "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}") endif(is_multi_config) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${output_dir}/bin") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${output_dir}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${output_dir}/lib") if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) add_compile_options("/source-charset:utf-8") elseif(CMAKE_CXX_COMPILER_DIR MATCHES GNU) add_compile_options("-finput-charset=utf-8") endif() 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/develop/conan.cmake" "${CMAKE_BINARY_DIR}/conan.cmake" TLS_VERIFY ON) endif() include("${CMAKE_BINARY_DIR}/conan.cmake") set(conan_config_generators "CMakeDeps") set(conan_config_requires "oatpp/1.3.0") set(conan_config_options "oatpp:shared=True") if(is_multi_config) # Multi-Config Generator foreach(type Debug;Release) conan_cmake_configure( GENERATORS ${conan_config_generators} REQUIRES ${conan_config_requires} OPTIONS ${conan_config_options} IMPORTS "bin, *.dll -> ../${type}/bin") conan_cmake_autodetect(settings BUILD_TYPE ${type}) conan_cmake_install( PATH_OR_REFERENCE "." INSTALL_FOLDER "./conan" BUILD missing REMOTE conancenter SETTINGS ${settings}) endforeach() else(is_multi_config) # Single-Config Generator set(type ${CMAKE_BUILD_TYPE}) conan_cmake_configure( GENERATORS ${conan_config_generators} REQUIRES ${conan_config_requires} OPTIONS ${conan_config_options} IMPORTS "bin, *.dll -> ../${type}/bin") conan_cmake_autodetect(settings) conan_cmake_install( PATH_OR_REFERENCE "." INSTALL_FOLDER "./conan" BUILD missing REMOTE conancenter SETTINGS ${settings}) endif(is_multi_config) list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/conan") list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}/conan") find_package(oatpp CONFIG REQUIRED) ```

Steps to reproduce

  1. Use VSCode to open a empty folder.
  2. Download CMake-Tools plugin from Extension.
  3. Create an empty CMakeLists.txt file, and then paste the above example on it.
  4. Press Ctrl+Shift+P, and then type CMake: Configure.

Logs

Click to expand log ``` [cmake] ========== TEST-CMakeDeps-oatpp ========== [cmake] -- Conan: Detected VS runtime: MDd [cmake] -- Conan: checking conan executable [cmake] -- Conan: Found program C:/Program Files/Conan/conan/conan.exe [cmake] -- Conan: Version found Conan version 1.48.1 [cmake] -- Conan executing: C:/Program Files/Conan/conan/conan.exe install . --remote conancenter --install-folder ./conan --build missing --settings arch=x86_64 --settings build_type=Debug --settings compiler=Visual Studio --settings compiler.version=16 --settings compiler.runtime=MDd [cmake] Configuration: [cmake] [settings] [cmake] arch=x86_64 [cmake] arch_build=x86_64 [cmake] build_type=Debug [cmake] compiler=Visual Studio [cmake] compiler.runtime=MDd [cmake] compiler.version=16 [cmake] os=Windows [cmake] os_build=Windows [cmake] [options] [cmake] [build_requires] [cmake] [env] [cmake] [cmake] conanfile.txt: Installing package [cmake] Requirements [cmake] oatpp/1.3.0 from 'conancenter' - Cache [cmake] Packages [cmake] oatpp/1.3.0:INVALID - Invalid [cmake] [cmake] Installing (downloading, building) binaries... [cmake] ERROR: There are invalid packages (packages that cannot exist for this configuration): [cmake] oatpp/1.3.0: Invalid ID: oatpp can not be built as shared library on Windows [cmake] CMake Error at build/win32-MSVC-x64-Debug/conan.cmake:651 (message): [cmake] Conan install failed='6' [cmake] Call Stack (most recent call first): [cmake] CMakeLists.txt:63 (conan_cmake_install) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! ```
SpaceIm commented 2 years ago

It's not a recipe issue.