- os: Mac
- ide: CLion
- library: uwebsockets
I'm trying to connect the library to my project, I use Conan, the package is downloaded, but the magic ends there, it gives errors in the python file, but I have no idea what to do with it, the python has been updated to version 3.10.8
conanfile.py
from conans import ConanFile, CMake
class HelloConan(ConanFile):
name = "lib_example"
version = "1.0"
settings = "os", "compiler", "arch"
generators = "cmake", "cmake_find_package"
requires = [("uwebsockets/20.14.0")]
CMakeLists.txt
cmake_minimum_required(VERSION 3.23)
project(lib_example)
set(CMAKE_CXX_STANDARD 14)
add_executable(lib_example main.cpp)
find_package(uwebsockets REQUIRED)
if(uwebsockets FOUND)
target_include_directories(${PROJECT_NAME} PRIVATE ${uwebsockets_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} PRIVATE ${uwebsockets_LIBRARIES})
endif()
terminal
❯ conan install ..
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=12.0
os=Macos
os_build=Macos
[options]
[build_requires]
[env]
ERROR: Error loading conanfile at '/Users/lewz/Desktop/projects/coding/lib_example/conanfile.py': Unable to load conanfile in /Users/lewz/Desktop/projects/coding/lib_example/conanfile.py
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/imp.py", line 172, in load_source
module = _load(spec)
^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 721, in _load
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 936, in exec_module
File "<frozen importlib._bootstrap_external>", line 1074, in get_code
File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/lewz/Desktop/projects/coding/lib_example/conanfile.py", line 9
requires = [("uwebsockets/20.14.0")]
IndentationError: unexpected indent
~/Desktop/projects/coding/lib_example/cmake-build-debug master*
I don't know what to do next