xerpi / play-switch

Play! - PlayStation2 Emulator (Nintendo Switch port)
Other
39 stars 3 forks source link

Building Play for Switch requires Qt5 #1

Open fagirton opened 1 year ago

fagirton commented 1 year ago

Hello! Seems like cmake file for Nintendo Switch version requires Qt5 files to compile

When I try to build it, terminal returns this:


CMake Error at Source/ui_qt/CMakeLists.txt:249 (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.

-- Configuring incomplete, errors occurred!

Also, I didn't really get what Qt 5 package I should get to compile it, could you explain it in detail?

xerpi commented 1 year ago

Can you paste the CMake arguments? Are you following https://github.com/xerpi/play-switch#building-for-nintendo-switch ?

fagirton commented 1 year ago

Yes, I used same commands as in this section.

Maybe that's also because CMake ignored path "../deps/Dependencies/cmake-switch/switch.cmake" and Qt5 was among these dependencies, but I don't know why CMake ignores it

xerpi commented 1 year ago

Did you fetch all submodules? Did you mkdir build and cd build before running CMake?

fagirton commented 1 year ago

Yes, pasted all commands from readme file. Ones to clone submodules and ones to build.

xerpi commented 1 year ago

Can you paste the CMake log?

fagirton commented 1 year ago

Yes, here it is

PS H:\Console-files\Switch\builds\Play-> cd build
PS H:\Console-files\Switch\builds\Play-\build> cmake .. -DCMAKE_TOOLCHAIN_FILE=../deps/Dependencies/cmake-switch/switch.cmake -DBUILD_TESTS:BOOL=OFF -DENABLE_AMAZON_S3:BOOL=OFF
CMake Warning:
  Ignoring extra path from command line:

   "../deps/Dependencies/cmake-switch/switch.cmake"

-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
-- Generating for Win32 --
-- Arch: x86 --
-- Build type: Release
Building for 0.56-16-g9e814f6f.
-- Could NOT find Vulkan (missing: Vulkan_LIBRARY Vulkan_INCLUDE_DIR) (found version "")
Building without Vulkan support. If you want to enable Vulkan, please make sure VULKAN_SDK is set.
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Using Provided zlib source
-- ZSTD VERSION: 1.5.3
-- CMAKE_INSTALL_PREFIX: C:/Program Files (x86)/Play
-- CMAKE_INSTALL_LIBDIR: lib
-- ZSTD_LEGACY_SUPPORT defined!
-- ZSTD_MULTITHREAD_SUPPORT is enabled
-- Could NOT find ICUUC (missing: ICUUC_LIBRARY ICUUC_INCLUDE_DIR)
-- 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)
-- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
-- Using Provided BZip2 source
-- Could NOT find ICUUC (missing: ICUUC_LIBRARY ICUUC_INCLUDE_DIR)
-- Could NOT find GLEW (missing: GLEW_INCLUDE_DIRS GLEW_LIBRARIES)
CMake Deprecation Warning at deps/Dependencies/glew-2.0.0/CMakeLists.txt:7 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Could NOT find SQLite3 (missing: SQLite3_INCLUDE_DIR SQLite3_LIBRARY)
-- Using Provided sqlite3 source
-- Using Provided nlohmann_json source
-- Using the single-header code from H:/Console-files/Switch/builds/Play-/deps/Dependencies/nlohmann_json/single_include/
CMake Error at Source/ui_qt/CMakeLists.txt:249 (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.

-- Configuring incomplete, errors occurred!
See also "H:/Console-files/Switch/builds/Play-/build/CMakeFiles/CMakeOutput.log".
See also "H:/Console-files/Switch/builds/Play-/build/CMakeFiles/CMakeError.log".
xerpi commented 1 year ago

I think it's a problem of the Windows shell. Can you try with Windows terminal or WSL2?

fagirton commented 1 year ago

Tried using cmd terminal, gives same results. Installing Ubuntu right now to test it in WSL

fagirton commented 1 year ago

Ubuntu gives error a lot funnier:

 cmake .. -DCMAKE_TOOLCHAIN_FILE=../deps/Dependencies/cmake-switch/switch.cmake -DBUILD_TESTS:BOOL=OFF -DENABLE_AMAZON_S3:BOOL=OFF
CMake Error: The current CMakeCache.txt directory /mnt/h/Console-files/Switch/builds/Play-/build/CMakeCache.txt is different than the directory h:/Console-files/Switch/builds/Play-/build where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
xerpi commented 1 year ago

Remove the build directory and create it again.

fagirton commented 1 year ago

Did that, there's new error now:

 cmake .. -DCMAKE_TOOLCHAIN_FILE=../deps/Dependencies/cmake-switch/switch.cmake -DBUILD_TESTS:BOOL=OFF -DENABLE_AMAZON_S3:BOOL=OFF
CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:99 (message):
  Could not find toolchain file:
  ../deps/Dependencies/cmake-switch/switch.cmake
Call Stack (most recent call first):
  CMakeLists.txt:8 (project)

CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
xerpi commented 1 year ago

Does ../deps/Dependencies/cmake-switch/switch.cmake exist?