I am trying to build project on Ubuntu with this command:
emcmake cmake .. -DCMAKE_PREFIX_PATH=/home/oleksiy/Qt/5.15.2/wasm_32/
and get this error
CMake Error at CMakeLists.txt:16 (find_package): By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5", but CMake did not find one. Could not find a package configuration file provided by "Qt5" with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files. If "Qt5" provides a separate development package or SDK, be sure it has been installed.
i checked in Qt5 folder for Qt5Config.cmake file - it's exist :/Now i don't know what to do.
Changed -DCMAKE_PREFIX_PATH few times, checked using chatGTP version of Qt, Cmake and Emscripten for comparability, reinstalled Emscripten, added this to cmake file:
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/home/oleksiy/Qt/5.15.2/wasm_32/lib/cmake/Qt5/")
That's the output when i've enabled verbose
/home/oleksiy/TestWebAssembly/CMakeLists.txt(10): set(CMAKE_AUTORCC ON )/home/oleksiy/TestWebAssembly/CMakeLists.txt(12): set(CMAKE_CXX_STANDARD 11 )/home/oleksiy/TestWebAssembly/CMakeLists.txt(13): set(CMAKE_CXX_STANDARD_REQUIRED ON )/home/oleksiy/TestWebAssembly/CMakeLists.txt(20): set(CMAKE_PREFIX_PATH /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/ )/home/oleksiy/TestWebAssembly/CMakeLists.txt(22): find_package(Qt5 COMPONENTS Widgets Core Gui Quick REQUIRED )CMake Error at CMakeLists.txt:22 (find_package): By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5", but CMake did not find one. Could not find a package configuration file provided by "Qt5" with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files. If "Qt5" provides a separate development package or SDK, be sure it has been installed.
i've added --debug-find flag to cmake comand, the output:
configure: cmake .. -DCMAKE_PREFIX_PATH=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten_debug/ --debug-find -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node;--experimental-wasm-threadsRunning with debug output on for the `find` commands.CMake Debug Log at CMakeLists.txt:22 (find_package): find_package considered the following paths for Qt5.cmake /usr/share/emscripten/cmake/Modules/FindQt5.cmake /usr/share/emscripten/cmake/Modules/FindQt5.cmake /usr/share/emscripten/cmake/Modules/FindQt5.cmake /usr/share/cmake-3.22/Modules/FindQt5.cmake The file was not found.<PackageName>_ROOT CMake variable [CMAKE_FIND_USE_PACKAGE_ROOT_PATH]. none CMAKE_PREFIX_PATH variable [CMAKE_FIND_USE_CMAKE_PATH]. /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten-debug CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables [CMAKE_FIND_USE_CMAKE_PATH]. Env variable Qt5_DIR [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH]. none CMAKE_PREFIX_PATH env variable [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH]. none CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH]. none Paths specified by the find_package HINTS option. none Standard system environment variables [CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH]. /usr/local /usr / /usr/games /usr/local/games /snap CMake User Package Registry [CMAKE_FIND_USE_PACKAGE_REGISTRY]. none CMake variables defined in the Platform file [CMAKE_FIND_USE_CMAKE_SYSTEM_PATH]. none CMake System Package Registry [CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY]. none Paths specified by the find_package PATHS option. none find_package considered the following locations for the Config module: /usr/share/emscripten/cache/sysroot/Qt5Config.cmake /usr/share/emscripten/cache/sysroot/qt5-config.cmake /usr/share/emscripten/cache/sysroot/Qt5Config.cmake /usr/share/emscripten/cache/sysroot/qt5-config.cmake /usr/share/emscripten/cache/sysroot/Qt5Config.cmake /usr/share/emscripten/cache/sysroot/qt5-config.cmake The file was not found.CMake Error at CMakeLists.txt:22 (find_package): By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5", but CMake did not find one. Could not find a package configuration file provided by "Qt5" with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files. If "Qt5" provides a separate development package or SDK, be sure it has been installed.CMake Debug Log at CMakeLists.txt:22 (find_package):-- Configuring incomplete, errors occurred!See also "/home/oleksiy/TestWebAssembly/build-debug/CMakeFiles/CMakeOutput.log".emcmake: error: 'cmake .. -DCMAKE_PREFIX_PATH=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten_debug/ --debug-find -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node;--experimental-wasm-threads' failed (returned 1)
I can't figure out why cmake search can't follow CMAKE_PREFIX_PATH.
CMakeLists.txt
cmake_minimum_required(VERSION 3.5)project(TestWebAssembly VERSION 0.1 LANGUAGES CXX)set(CMAKE_C_COMPILER "emcc")set(CMAKE_CXX_COMPILER "em++")set(CMAKE_AUTOUIC ON)set(CMAKE_AUTOMOC ON)set(CMAKE_AUTORCC ON)set(CMAKE_CXX_STANDARD 11)set(CMAKE_CXX_STANDARD_REQUIRED ON)#set(CMAKE_SYSTEM_NAME Emscripten)#set(QT_QMAKE_EXECUTABLE "/home/oleksiy/Qt/5.15.2/wasm_32/bin/qmake")#set(QT_QMAKE_EXECUTABLE "/home/oleksiy/Qt/5.15.2/wasm_32/")#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/home/oleksiy/Qt/5.15.2/wasm_32/lib/cmake/Qt5/")#set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)set(CMAKE_PREFIX_PATH "/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten_debug")find_package(Qt5 COMPONENTS Widgets Core Gui Quick REQUIRED)set(PROJECT_SOURCES main.cpp mainwindow.cpp mainwindow.h Main.qml)add_executable(TestWebAssembly ${PROJECT_SOURCES})qt5_add_resources(QT_RESOURCES qml.qrc)target_link_libraries(TestWebAssembly PRIVATE Qt5::Widgets Qt5::Core Qt5::Quick)