I'm using llvm in my project and find it with cmake's find_package(LLVM REQUIRED CONFIG).
Configuration fails with message:
[cmake] CMake Error at /Applications/CMake.app/Contents/share/cmake-3.23/Modules/Internal/CheckSourceCompiles.cmake:44 (message):
[cmake] check_source_compiles: C: needs to be enabled before use.
[cmake] Call Stack (most recent call first):
[cmake] /Applications/CMake.app/Contents/share/cmake-3.23/Modules/CheckCSourceCompiles.cmake:76 (cmake_check_source_compiles)
[cmake] /usr/local/lib/cmake/llvm/FindTerminfo.cmake:21 (check_c_source_compiles)
[cmake] /usr/local/lib/cmake/llvm/LLVMConfig.cmake:242 (find_package)
[cmake] tools/driver/CMakeLists.txt:6 (find_package)
[cmake]
[cmake]
[cmake] -- Could NOT find Terminfo (missing: Terminfo_LINKABLE)
[cmake] -- Configuring incomplete, errors occurred!
How to fix it?
It's actually a well-known issue in clang-14 and greater.
Temporary solution is to use C language in your project.
project(test LANGUAGES C CXX) # instead of project(test LANGUAGES CXX)
I am trying to use OpenCV in VS Code.
Here's what I've done:
Installed OpenCV for windows.
Added "C:\opencv\build\x64\vc15\bin","C:\opencv\build\x64\vc15\lib" PATH environment variable.
Here's my CMakeLists.txt file.
cmake_minimum_required(VERSION 3.0.0)
project(opencvtest VERSION 0.1.0)
include(CTest)
enable_testing()
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable(opencvtest main.cpp)
target_link_libraries( opencvtest ${OpenCV_LIBS} )
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
But the file throws the following error:
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\TDM-GCC-64\bin\x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\TDM-GCC-64\bin\x86_64-w64-mingw32-g++.exe -Hc:/Users/Administrator/Desktop/open -Bc:/Users/Administrator/Desktop/open/build -G "MinGW Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- OpenCV ARCH: x64
[cmake] -- OpenCV RUNTIME: mingw
[cmake] -- OpenCV STATIC: OFF
[cmake] CMake Warning at C:/opencv/build/OpenCVConfig.cmake:190 (message):
[cmake] Found OpenCV Windows Pack but it has no binaries compatible with your
[cmake] configuration.
[cmake]
[cmake] You should manually point CMake variable OpenCV_DIR to your build of OpenCV
[cmake] library.
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:7 (find_package)
[cmake]
[cmake]
[cmake] CMake Error at CMakeLists.txt:7 (find_package):
[cmake] Found package configuration file:
[cmake]
[cmake] C:/opencv/build/OpenCVConfig.cmake
[cmake]
[cmake] but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
[cmake] NOT FOUND.
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
I am trying to run a C++ file in VS Code that includes <opencv2/opencv.hpp>.
As the error suggests, CMake found your OpenCV installation, but it is not compatible. What is it not compatible with? Your compiler. The OpenCV installation is built with MSVC 15 (it also includes a 14 build). You have asked CMake to use MinGW as your compiler. Libraries need to have been built with the same (well, with some leeway) compiler for everything to work.
You have two options:
Build OpenCV yourself with MinGW, or try a third-party MinGW binary distribution of OpenCV. Web searches for "opencv mingw" turn up some
possibilities.
Use the MSVC compiler for your project. Microsoft offers some free versions of its tools. Just be sure to install the optional older toolsets so that you have access to the VC 15 tools to match OpenCV.
So My Workspace Screenshot After Trying a while i cant Get Cmake To find the required packages even after i did everything as shown in vcpkg
cmake_minimum_required(VERSION 3.0.0)
project(TEst VERSION 0.1.0)
include(CTest)
enable_testing()
set(CMAKE_TOOLCHAIN_FILE "N:/Vc-PKG/vcpkg/scripts/buildsystems/vcpkg.cmake")
find_package(glfw3 CONFIG REQUIRED)
target_link_libraries(TEst PRIVATE glfw)
add_executable(TEst main.cpp)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
and my Vcpkg install directory is N:\Vc-PKG\vcpkg
i also added these lines in vscode
"C_Cpp.default.includePath": [
"N:/Vc-PKG/vcpkg/installed/x64-windows/include",
"N:/Vc-PKG/vcpkg/installed/x86-windows/include",
],
"c-cpp-flylint.cppcheck.includePaths": [
"N:\\Vc-PKG\\vcpkg\\installed\\x64-windows\\include",
"N:\\Vc-PKG\\vcpkg\\installed\\x86-windows\\include",
],
"cmake.generator": "MinGW Makefiles",
The output i get For the following is
[main] Configuring folder: Junks
[proc] Executing command: N:\MSYS64\mingw64\bin\cmake.EXE --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=N:\MSYS64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=N:\MSYS64\mingw64\bin\x86_64-w64-mingw32-g++.exe "-Hl:/Programming Projects/Vs Code/Junks" "-Bl:/Programming Projects/Vs Code/Junks/build" -G "MinGW Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] CMake Error at CMakeLists.txt:7 (find_package):
[cmake] Could not find a package configuration file provided by "glfw3" with any of
[cmake] the following names:
[cmake]
[cmake] glfw3Config.cmake
[cmake] glfw3-config.cmake
[cmake]
[cmake] Add the installation prefix of "glfw3" to CMAKE_PREFIX_PATH or set
[cmake] "glfw3_DIR" to a directory containing one of the above files. If "glfw3"
[cmake] provides a separate development package or SDK, be sure it has been
[cmake] installed.
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "L:/Programming Projects/Vs Code/Junks/build/CMakeFiles/CMakeOutput.log".
[cmake]
Please any help would be much apricated, sry if i made a mistake this is the 1st time i am posting a question.
You can't set CMAKE_TOOLCHAIN_FILE after the call to project(). That's the command responsible for loading the toolchain file in the first place. Move it before the call to project() or better yet: set it at the command line or in a preset.
Also, unless you're actually using CMake 3.0.0, you shouldn't set it as a minimum. CMake is not forwards compatible, so without actually testing it on the minimum version, you have no way of knowing whether it will work that far back.
I am currently trying to cross compile a program I wrote on macOS to Linux, and I have had to make some changes to the build.ninja file to make that possible (specifically the linker commands/other places where libraries are linked). However, this gets wiped when I reconfigure CMake. Is there a way that I could use CMake to set the values in my Ninja file instead of wherever they are being set from? I am also using vcpkg for this project with GCC 10.2.0 for x86_64 Linux. The ninja files had to be trimmed to fit under the character limit, I can find a different way to put up the complete ones if needed. Here are my current CMakeLists, the first being my top level one and the second being the one that links everything:
Removed to make room for edits, working file can be found in edit 2
# CMakeList.txt : CMake project for ImpromptuServer, include source and define
# project specific logic here.
#
cmake_minimum_required(VERSION 3.8)
add_subdirectory("database")
add_subdirectory("web")
add_subdirectory("api")
add_subdirectory("utils")
# Add source to this project's executable.
file(GLOB_RECURSE web ./web/*.cpp ./web/*.hpp)
file(GLOB_RECURSE database ./database/*.cpp ./datbase/*.hpp)
file(GLOB_RECURSE api ./api/*.cpp ./api/*.hpp)
add_library(libweb ${web})
add_library(libdata ${database})
add_library(libapi ${api})
add_executable(ImpromptuServer "ImpromptuServer.cpp" ${web} ${database} ${api})
set(ALL_LIBS Wt::Wt Wt::Dbo Wt::HTTP Wt::DboSqlite3 cryptopp-static json11 OpenSSL::SSL OpenSSL::Crypto cpr)
# TODO: Add tests and install targets if needed.
target_link_libraries(ImpromptuServer PRIVATE ${ALL_LIBS})
target_link_libraries(libweb PRIVATE Wt::Wt Wt::Dbo Wt::HTTP Wt::DboSqlite3)
target_link_libraries(libdata PRIVATE Wt::Wt Wt::Dbo Wt::HTTP Wt::DboSqlite3)
target_link_libraries(libapi PRIVATE ${ALL_LIBS})
I know GLOB_RECURSE is not best practice, but I don't want to change it unless it will fix my problem. Here is my original build.ninja file:
REMOVED due to irrelevancy to question.
Here is the one that I modified to get working:
REMOVED due to irrelevancy to question.
However, even when I compile successfully with the modified ninja file, I get this output message and the code fails to run on a Linux machine:
/Volumes/CaseSensitive/cross/lib/gcc/x86_64-linux/10.2.0/../../../../x86_64-linux/bin/ld: warning: cannot find entry symbol arch_paths_first; defaulting to 0000000000414000
The code runs fine when compiling for macOS and using the original build.ninja file.
Edit 1
After a lot of work, I have gotten CMake to use the toolchain file, but I still have a lingering problem where CMake can't find Threads::Threads. Here is my current CMakeLists.txt:
Working file can be found in edit 2
Here is the output message that I get:
[main] Configuring folder: ImpromptuServer
[cmake] -- Found OpenSSL: /usr/lib/libcrypto.dylib
[cmake] -- Found ZLIB: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libz.tbd (found version "1.2.11")
[cmake] -- Found CURL: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libcurl.tbd (found version "7.64.1")
[cmake] -- Configuring done
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:331 (_add_executable):
[cmake] Target "ImpromptuServer" links to target "Threads::Threads" but the target
[cmake] was not found. Perhaps a find_package() call is missing for an IMPORTED
[cmake] target, or an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:20 (add_executable)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:331 (_add_executable):
[cmake] Target "ImpromptuServer" links to target "Threads::Threads" but the target
[cmake] was not found. Perhaps a find_package() call is missing for an IMPORTED
[cmake] target, or an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:20 (add_executable)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:331 (_add_executable):
[cmake] Target "ImpromptuServer" links to target "Threads::Threads" but the target
[cmake] was not found. Perhaps a find_package() call is missing for an IMPORTED
[cmake] target, or an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:20 (add_executable)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:331 (_add_executable):
[cmake] Target "ImpromptuServer" links to target "Threads::Threads" but the target
[cmake] was not found. Perhaps a find_package() call is missing for an IMPORTED
[cmake] target, or an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:20 (add_executable)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libapi" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:18 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libapi" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:18 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libapi" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:18 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libapi" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:18 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libdata" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:17 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libdata" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:17 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libdata" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:17 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libdata" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:17 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libweb" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:16 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libweb" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:16 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libweb" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:16 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libweb" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:16 (add_library)
[cmake]
[cmake]
[cmake] -- Generating done
[cmake] CMake Generate step failed. Build files cannot be regenerated correctly.
[main] Configuring folder: ImpromptuServer
[proc] Executing command: /usr/local/bin/cmake --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE=/Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake -DCMAKE_CROSSCOMPILING=True -Wno-dev -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/Volumes/CaseSensitive/cross/bin/x86_64-linux-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/Volumes/CaseSensitive/cross/bin/x86_64-linux-g++ -H/Users/jackhogan/Desktop/Code/C++/ImpromptuServer -B/Users/jackhogan/Desktop/Code/C++/ImpromptuServer/build -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] INFO Using Linux protocols
[cmake] -- Configuring done
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:331 (_add_executable):
[cmake] Target "ImpromptuServer" links to target "Threads::Threads" but the target
[cmake] was not found. Perhaps a find_package() call is missing for an IMPORTED
[cmake] target, or an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:20 (add_executable)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:331 (_add_executable):
[cmake] Target "ImpromptuServer" links to target "Threads::Threads" but the target
[cmake] was not found. Perhaps a find_package() call is missing for an IMPORTED
[cmake] target, or an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:20 (add_executable)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:331 (_add_executable):
[cmake] Target "ImpromptuServer" links to target "Threads::Threads" but the target
[cmake] was not found. Perhaps a find_package() call is missing for an IMPORTED
[cmake] target, or an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:20 (add_executable)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:331 (_add_executable):
[cmake] Target "ImpromptuServer" links to target "Threads::Threads" but the target
[cmake] was not found. Perhaps a find_package() call is missing for an IMPORTED
[cmake] target, or an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:20 (add_executable)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libapi" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:18 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libapi" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:18 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libapi" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:18 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libapi" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:18 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libdata" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:17 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libdata" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:17 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libdata" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:17 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libdata" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:17 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libweb" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:16 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libweb" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:16 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libweb" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:16 (add_library)
[cmake]
[cmake]
[cmake] CMake Error at /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake:360 (_add_library):
[cmake] Target "libweb" links to target "Threads::Threads" but the target was not
[cmake] found. Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake] an ALIAS target is missing?
[cmake] Call Stack (most recent call first):
[cmake] ImpromptuServer/CMakeLists.txt:16 (add_library)
[cmake]
[cmake]
[cmake] -- Generating done
[cmake] CMake Generate step failed. Build files cannot be regenerated correctly.
Edit 2
Everything now configures correctly with this CMake file:
# CMakeList.txt : Top-level CMake project file, do global configuration
# and include sub-projects here.
#
cmake_minimum_required(VERSION 3.8)
project (ImpromptuServer C CXX)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
#set(CMAKE_TOOLCHAIN_FILE /Users/jackhogan/Desktop/Code/Utilities/vcpkg/scripts/buildsystems/vcpkg.cmake)
set(LIB_DIR /Users/jackhogan/Desktop/Code/Utilities/vcpkg/installed/x64-osx/debug/lib)
add_compile_options(-std=c++17)
find_package(threads REQUIRED)
else()
message(INFO " Using Linux protocols")
if(NOT ${CMAKE_TOOLCHAIN_FILE} STREQUAL /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake)
message(FATAL_ERROR " Incorrect toolchain file")
endif()
add_compile_options(-std=gnu++17)
#set(CMAKE_TOOLCHAIN_FILE /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake)
set(CMAKE_CROSSCOMPILING true)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(LIB_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/debug/lib)
set(CMAKE_FIND_ROOT_PATH /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/debug/lib)
set(CMAKE_SYSROOT /Volumes/CaseSensitive/cross/x86_64-linux/)
# Find libraries, may be changed later
set(wt_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/share/wt/)
set(OPENSSL_INCLUDE_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include/openssl)
set(OPENSSL_ROOT_DIR /Volumes/CaseSensitive/cross/x86_64-linux/lib/)
set(cryptopp_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/share/cryptopp/)
set(cpr_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/share/cpr/)
# Find pthread
set(CMAKE_THREAD_LIBS_INIT /Volumes/CaseSensitive/cross/x86_64-linux/lib/libpthread.a)
include_directories(/Volumes/CaseSensitive/cross/x86_64-linux/lib/)
include_directories(/Volumes/CaseSensitive/cross/x86_64-linux/lib64/)
include_directories(/Volumes/CaseSensitive/cross/x86_64-linux/include/)
include_directories(/Volumes/CaseSensitive/cross/x86_64-linux/include/linux/)
include_directories(/Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/)
#include_directories(/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include)
#set(Boost_NO_SYSTEM_PATHS true)
#set(BOOST_INCLUDEDIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include/boost/)
#set(BOOST_LIBRARYDIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/debug/lib/)
#add_link_options(-g -isysroot /Volumes/CaseSensitive/cross/x86_64-linux)
find_package(boost REQUIRED)
find_package(Threads REQUIRED)
endif()
# Install packages
find_package(wt REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(cryptopp CONFIG REQUIRED)
find_package(cpr CONFIG REQUIRED)
add_library(json11 STATIC IMPORTED)
set_target_properties(json11 PROPERTIES IMPORTED_LOCATION ${LIB_DIR}/libjson11.a)
# Include sub-projects.
add_subdirectory ("ImpromptuServer")
But I get a ton of errors like this:
[main] Building folder: ImpromptuServer
[build] Starting build
[proc] Executing command: /usr/local/bin/cmake --build /Users/jackhogan/Desktop/Code/C++/ImpromptuServer/build --config Debug --target all -- -j 22
[build] [22/29 3% :: 0.087] Building CXX object ImpromptuServer/CMakeFiles/libapi.dir/api/internal/ios/AppStore.cpp.o
[build] [23/29 6% :: 0.091] Building CXX object ImpromptuServer/CMakeFiles/ImpromptuServer.dir/api/internal/ios/AppStore.cpp.o
[build] [24/29 10% :: 1.946] Building CXX object ImpromptuServer/CMakeFiles/ImpromptuServer.dir/web/pages/About.cpp.o
[build] FAILED: ImpromptuServer/CMakeFiles/ImpromptuServer.dir/web/pages/About.cpp.o
[build] /Volumes/CaseSensitive/cross/bin/x86_64-linux-g++ --sysroot=/Volumes/CaseSensitive/cross/x86_64-linux/ -DBOOST_ALL_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -I/Volumes/CaseSensitive/cross/x86_64-linux/lib -I/Volumes/CaseSensitive/cross/x86_64-linux/lib64 -isystem /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include -isystem /usr/local/include -isystem /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include/openssl -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -std=gnu++17 -MD -MT ImpromptuServer/CMakeFiles/ImpromptuServer.dir/web/pages/About.cpp.o -MF ImpromptuServer/CMakeFiles/ImpromptuServer.dir/web/pages/About.cpp.o.d -o ImpromptuServer/CMakeFiles/ImpromptuServer.dir/web/pages/About.cpp.o -c ../ImpromptuServer/web/pages/About.cpp
[build] In file included from /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/bits/localefwd.h:40,
[build] from /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/string:43,
[build] from /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/bitset:47,
[build] from /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include/Wt/WWebWidget.h:11,
[build] from /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include/Wt/WInteractWidget.h:10,
[build] from /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include/Wt/WContainerWidget.h:10,
[build] from ../ImpromptuServer/web/pages/About.hpp:3,
[build] from ../ImpromptuServer/web/pages/About.cpp:1:
[build] /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/x86_64-linux/bits/c++locale.h:52:23: error: 'uselocale' was not declared in this scope; did you mean 'setlocale'?
[build] 52 | extern "C" __typeof(uselocale) __uselocale;
[build] | ^~~~~~~~~
[build] | setlocale
[build] /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/x86_64-linux/bits/c++locale.h:62:11: error: '__locale_t' does not name a type
[build] 62 | typedef __locale_t __c_locale;
[build] | ^~~~~~~~~~
[build] /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/x86_64-linux/bits/c++locale.h:69:26: error: '__c_locale' does not name a type
[build] 69 | __convert_from_v(const __c_locale& __cloc __attribute__ ((__unused__)),
[build] | ^~~~~~~~~~
[build] /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/x86_64-linux/bits/c++locale.h: In function 'int std::__convert_from_v(const int&, char*, int, const char*, ...)':
[build] /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/x86_64-linux/bits/c++locale.h:75:5: error: '__c_locale' was not declared in this scope; did you mean '__cloc'?
[build] 75 | __c_locale __old = __gnu_cxx::__uselocale(__cloc);
[build] | ^~~~~~~~~~
[build] | __cloc
[build] /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/x86_64-linux/bits/c++locale.h:100:28: error: '__old' was not declared in this scope
[build] 100 | __gnu_cxx::__uselocale(__old);
[build] | ^~~~~
[build] /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/x86_64-linux/bits/c++locale.h:100:33: error: '__gnu_cxx::__uselocale' cannot be used as a function
[build] 100 | __gnu_cxx::__uselocale(__old);
[build] | ^
Edit 3
Here is my CMake output:
[main] Configuring folder: ImpromptuServer
[driver] Removing /Users/jackhogan/Desktop/Code/C++/ImpromptuServer/build/CMakeCache.txt
[driver] Removing /Users/jackhogan/Desktop/Code/C++/ImpromptuServer/build/CMakeFiles
[proc] Executing command: /usr/local/bin/cmake --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE=/Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake -DCMAKE_CROSSCOMPILING=True -Wno-dev -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/Volumes/CaseSensitive/cross/bin/x86_64-linux-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/Volumes/CaseSensitive/cross/bin/x86_64-linux-g++ -H/Users/jackhogan/Desktop/Code/C++/ImpromptuServer -B/Users/jackhogan/Desktop/Code/C++/ImpromptuServer/build -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The C compiler identification is GNU 10.2.0
[cmake] -- The CXX compiler identification is GNU 10.2.0
[cmake] -- Checking whether C compiler has -isysroot
[cmake] -- Checking whether C compiler has -isysroot - yes
[cmake] -- Checking whether C compiler supports OSX deployment target flag
[cmake] -- Checking whether C compiler supports OSX deployment target flag - no
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: /Volumes/CaseSensitive/cross/bin/x86_64-linux-gcc - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Checking whether CXX compiler has -isysroot
[cmake] -- Checking whether CXX compiler has -isysroot - yes
[cmake] -- Checking whether CXX compiler supports OSX deployment target flag
[cmake] -- Checking whether CXX compiler supports OSX deployment target flag - no
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: /Volumes/CaseSensitive/cross/bin/x86_64-linux-g++ - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] INFO Using Linux protocols
[cmake] -- Found Boost: /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found version "1.72.0")
[cmake] -- Looking for pthread.h
[cmake] -- Looking for pthread.h - not found
[cmake] -- Found Threads: TRUE
[cmake] -- Found OpenSSL: /usr/lib/libcrypto.dylib
[cmake] -- Found ZLIB: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libz.tbd (found version "1.2.11")
[cmake] -- Found CURL: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libcurl.tbd (found version "7.64.1")
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: /Users/jackhogan/Desktop/Code/C++/ImpromptuServer/build
[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.
[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.
After a week of trying to get this to work, I finally have a solution. The solution came from this answer. Here is my final working CMake file that can compile for both MacOS and Linux:
# CMakeList.txt : Top-level CMake project file, do global configuration
# and include sub-projects here.
#
cmake_minimum_required(VERSION 3.8)
# Target-specific stuff to be done before creating the project
if(${USE_LINUX})
# Prevents linker from not finding program entry point
set(HAVE_FLAG_SEARCH_PATHS_FIRST 0)
endif()
project (ImpromptuServer CXX)
if(NOT ${USE_LINUX})
message(INFO " Using MacOS protocols")
if(NOT ${CMAKE_TOOLCHAIN_FILE} STREQUAL /Users/jackhogan/Desktop/Code/Utilities/vcpkg/scripts/buildsystems/vcpkg.cmake)
message(FATAL_ERROR " Incorrect toolchain file")
endif()
set(LIB_DIR /Users/jackhogan/Desktop/Code/Utilities/vcpkg/installed/x64-osx/debug/lib)
add_compile_options(-std=c++17)
find_package(Threads REQUIRED)
else()
message(INFO " Using Linux protocols")
if(NOT ${CMAKE_TOOLCHAIN_FILE} STREQUAL /Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake)
message(FATAL_ERROR " Incorrect toolchain file")
endif()
set(CMAKE_C_LINK_FLAGS "")
set(CMAKE_CXX_LINK_FLAGS "")
add_compile_options(-std=gnu++17)
add_link_options(-Wl,--copy-dt-needed-entries)
set(CMAKE_CROSSCOMPILING true)
# Get rid of OSX SDK to prevent incorrect linking
set(CMAKE_OSX_SYSROOT "/Volumes/CaseSensitive/cross/x86_64-linux/include/")
set(LIB_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/debug/lib)
set(CMAKE_FIND_ROOT_PATH /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/debug/lib)
set(CMAKE_SYSROOT /)
# Find libraries, may be changed later
set(wt_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/share/wt/)
set(cryptopp_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/share/cryptopp/)
set(cpr_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/share/cpr/)
set(OPENSSL_INCLUDE_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include/openssl)
set(OPENSSL_ROOT_DIR /Volumes/CaseSensitive/cross/x86_64-linux/lib/)
# Cheat a little bit by linking a dynamic library
set(OPENSSL_CRYPTO_LIBRARY /Volumes/CaseSensitive/cross/x86_64-linux/lib/libcrypto.a)
set(OPENSSL_USE_STATIC_LIBS true)
# Special system library include directories
set(ZLIB_INCLUDE_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include/)
set(ZLIB_ROOT /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/lib/)
set(CURL_INCLUDE_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include/curl/)
# Find pthread and link to non-apple
set(CMAKE_THREAD_LIBS_INIT /Volumes/CaseSensitive/cross/x86_64-linux/lib/libpthread.a)
# GCC includes
include_directories(SYSTEM /Volumes/CaseSensitive/cross/lib/gcc/x86_64-linux/10.2.0/include/)
# System includes
include_directories(SYSTEM /Volumes/CaseSensitive/cross/x86_64-linux/include/c++/10.2.0/)
#set(BOOST_INCLUDE_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/include/boost/)
set(Boost_NO_BOOST_CMAKE on)
set(Boost_USE_STATIC_LIBS true)
set(Boost_LIBRARY_DIR /Volumes/CaseSensitive/vcpkgLinux/installed/x64-linux/lib/)
find_package(Boost COMPONENTS program_options filesystem thread chrono date_time REQUIRED)
find_package(Threads REQUIRED)
endif()
# Install packages
find_package(wt REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(cryptopp CONFIG REQUIRED)
find_package(cpr CONFIG REQUIRED)
add_library(json11 STATIC IMPORTED)
set_target_properties(json11 PROPERTIES IMPORTED_LOCATION ${LIB_DIR}/libjson11.a)
# Include sub-projects.
add_subdirectory ("ImpromptuServer")
While all of the paths are system-specific, this could be improved later with some more advanced scripting. Here are the arguments I pass in on MacOS and Linux respectively:
-DCMAKE_TOOLCHAIN_FILE=/Users/jackhogan/Desktop/Code/Utilities/vcpkg/scripts/buildsystems/vcpkg.cmake -DUSE_LINUX=false
-DCMAKE_TOOLCHAIN_FILE=/Volumes/CaseSensitive/vcpkgLinux/scripts/buildsystems/vcpkg.cmake -DUSE_LINUX=true
I am using vs code and CMake to generator the yuzu project, but the CMakeList.txt always report error on the conan code since line 127 ,and I have already install the conan in the CMD with pip command.
Yuzu project and the CMakeList.txt
CMake output
[proc] run command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli "-Dcmake.cmakePath:STRING=C:/Program Files/CMake/bin/cmake" -Dcmake.configureOnOpen:BOOL=TRUE "-Dcmake.generator:STRING=MinGW Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -He:/Visual_Studio_Code/yuzu_emulator/yuzu -Be:/Visual_Studio_Code/yuzu_emulator/yuzu/build -G "Visual Studio 16 2019" -T host=x86 -A win32
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Target architecture: x86
[cmake] -- Could NOT find Boost (missing: Boost_INCLUDE_DIR) (Required is at least version "1.71")
[cmake] -- Could NOT find Catch2 (missing: Catch2_INCLUDE_DIR Catch2_VERSION) (Required is at least version "2.11")
[cmake] -- Could NOT find fmt (missing: fmt_LIBRARY fmt_INCLUDE_DIR fmt_VERSION) (Required is at least version "6.2")
[cmake] -- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) (Required is at least version "1.1")
[cmake] -- Could NOT find lz4 (missing: lz4_LIBRARY lz4_INCLUDE_DIR) (Required is at least version "1.8")
[cmake] -- Could NOT find nlohmann_json (missing: nlohmann_json_INCLUDE_DIR nlohmann_json_VERSION) (Required is at least version "3.7")
[cmake] -- Could NOT find opus (missing: opus_LIBRARY opus_INCLUDE_DIR) (Required is at least version "1.3")
[cmake] -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) (Required is at least version "1.2")
[cmake] -- Could NOT find zstd (missing: zstd_LIBRARY zstd_INCLUDE_DIR zstd_VERSION) (Required is at least version "1.4")
[cmake] CMake Warning at CMakeLists.txt:217 (find_package):
[cmake] By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
[cmake] asked CMake to find a package configuration file provided by "Qt5", but
[cmake] CMake did not find one.
[cmake]
[cmake] Could not find a package configuration file provided by "Qt5" (requested
[cmake] version 5.9) with any of the following names:
[cmake]
[cmake] Qt5Config.cmake
[cmake] qt5-config.cmake
[cmake]
[cmake] Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
[cmake] to a directory containing one of the above files. If "Qt5" provides a
[cmake] separate development package or SDK, be sure it has been installed.
[cmake]
[cmake]
[cmake] CMake Warning at CMakeLists.txt:229 (find_package):
[cmake] By not providing "FindSDL2.cmake" in CMAKE_MODULE_PATH this project has
[cmake] asked CMake to find a package configuration file provided by "SDL2", but
[cmake] CMake did not find one.
[cmake]
[cmake] Could not find a package configuration file provided by "SDL2" with any of
[cmake] the following names:
[cmake]
[cmake] SDL2Config.cmake
[cmake] sdl2-config.cmake
[cmake]
[cmake] Add the installation prefix of "SDL2" to CMAKE_PREFIX_PATH or set
[cmake] "SDL2_DIR" to a directory containing one of the above files. If "SDL2"
[cmake] provides a separate development package or SDK, be sure it has been
[cmake] installed.
[cmake]
[cmake]
[cmake] -- Packages boost/1.72.0;catch2/2.11.0;fmt/6.2.0;openssl/1.1.1f;lz4/1.9.2;nlohmann_json/3.7.3;opus/1.3.1;zlib/1.2.11;zstd/1.4.4;qt/5.14.1#bincrafters/stable;sdl2/2.0.12#bincrafters/stable not found!
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "E:/Visual_Studio_Code/yuzu_emulator/yuzu/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "E:/Visual_Studio_Code/yuzu_emulator/yuzu/build/CMakeFiles/CMakeError.log".
[cmake] CMake Error at CMakeLists.txt:252 (conan_check):
[cmake] Unknown CMake command "conan_check".
generally its a problem that the CMakeList.txt file can't run the code about the conan and the lib can't be auto download, but how can i sovle the porblem, bro??????The project do not offer the conan.cmake. im a web developer,not familiar with the c++ proj construct.
The CMakeLists.txt of the yuzu repository (found at the parent directory) requires version 1.24.0 of conan, while the latest is 1.25.2. I assume you have installed the latest version.
Change line 252 from:
conan_check(VERSION 1.24.0 REQUIRED)
to:
conan_check(VERSION 1.25.2 REQUIRED)
and it should work.
Do not forget to delete the cmake cache in your build folder.