This project is a simple C++ Solitaire game. The project is built using CMake and can be compiled and run on multiple platforms (Linux, macOS, Windows) using either GCC or Clang.
Ensure you have the following installed on your system:
-
C++ Compiler
- Install a compiler that supports C++17 or later (e.g., GCC, Clang).
-
Qt Framework (6.x.x)
- Download and install Qt 6.x.x from the official Qt website.
- Necessary for building (Application can be also run using Docker)
-
CMake
- Install CMake (version 3.10 or later).
-
Git
- Install Git to clone the repository.
- Open a terminal or command prompt.
- Clone the repository:
git clone [email protected]:runner1/qt-soliatire.git
- Navigate to the project directory:
(SIC)
cd qt-soliaire
- Update all the git submodules.
git submodule update --init --recursive
- Create a configured build directory:
Replace the
cmake -DCMAKE_PREFIX_PATH="<path-to-Qt/6.x.x/gcc_64>" -S . -B build
<path-to-Qt/6.x.x/gcc_64>
with the path to your Qt6 installation. - Navigate to the build directory
cd build
- Configure CMAKE:
cmake ..
- Build the program
make
- Navigate back to project folder
cd ..
- Run the application:
./build/solitaire
The program can also be run within a docker container removing the necessity of Qt6 installation.
Using Docker to run the Solitaire program ensures a consistent environment with all necessary dependencies, regardless of the host operating system.
- Example with linux machines
-
Install Docker:
sudo apt install -y docker.io
-
Allow local display access
xhost +local:docker
-
Run the Docker container with display access:
sudo docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -e LANG=C.UTF-8 dantemichaelii/qtsolitaire-linux
- The Docker container includes the Qt framework and all dependencies required to run the Solitaire application.
- Running the container launches the Solitaire game and connects to the host's display server for GUI rendering.