Failed to install with conan
mcauto opened this issue · 4 comments
could you help me?
I get an error below.
CMake Error at source_subfolder/CMakeLists.txt:74 (install):
install TARGETS given no ARCHIVE DESTINATION for static library target
"maxminddb"
https://github.com/maxmind/libmaxminddb/blob/main/CMakeLists.txt#L74
cmake, conanfile.py
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
PROJECT ( reference )
FIND_PACKAGE ( PythonInterp )
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/master/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
ENDIF ()
INCLUDE ( ${CMAKE_BINARY_DIR}/conan.cmake )
conan_cmake_run ( CONANFILE conanfile.py BUILD missing BUILD_TYPE Release VERBOSE)
conan_basic_setup ( TARGETS NO_OUTPUT_DIRS )
INCLUDE_DIRECTORIES ( ${CONAN_INCLUDE_DIRS} )
ENABLE_TESTING()
# conanfile.py
from conans import ConanFile
class MylibConan(ConanFile):
setting = "os", "compiler", "build_type", "arch"
requires = (("zlib/1.2.11"),\
("openssl/1.1.1k"),\
("gtest/1.8.1"),\
("benchmark/1.5.3"),\
("libcurl/7.77.0"),\
("libmaxminddb/1.6.0"),
("hiredis/0.14.1"))
generators = "cmake"
option = {"libcurl:fPIC" : True,\
"libcurl:with_openssl": True,\
"libmaxminddb:shared": False }
def imports(self):
self.copy("license*", dst="licenses", folder=True, ignore_case=True)
Originally posted by @mcauto in #263 (comment)
@mcauto, I am not familiar with Conan. For anything specific to Conan, it might make sense to seek help from their support channels.
Are you able to build the package using in the cmake instructions in the README.md file?
@mcauto I can't tell if your CmakeFiles.txt
or conanfile.py
is correct. For my own projects, I specify the requirements via conanfile.txt
and that works. I just tried following the official Getting Started documentation and it works as well.
I do not deny there could be something wrong with the Conan recipe but you will likely have to figure it out with someone from the Conan community. There is a #conan
channel in the cpplang Slack if you need some real-time mean to talk about the issue.
Thanks, @fcelda! I am going to go ahead and close this. If it turns out there is a change to our cmake
configuration that can improve our support for Conan or a particular platform, I am happy to reopen, but right now there is not enough information for this to be actionable on our side.