This blog consists of the following parts:
-
Tool required for the setup
-
Steps involved in the setup
-
Points to remember
-
Creating a basic cutelyst application
-
Tools required for the setup : Following tools are required for the setup
- Cutelyst Framework - source - https://github.com/cutelyst/cutelyst
- CMake - for Windows x64 platform - https://cmake.org/download/
- Qt 5.6 or higher - https://www.qt.io/download (Qt 5.12.0 in my case)
- Visual Studio 2017 Community.
- Microsoft Visual C++ compiler (MSVC 2017 32bit in my case)
Note: I assume that Visual Studio, Qt and CMake are already set up on your computer.
-
Steps involved in the setup
Note: Open CMake-GUI with admin rights to avoid errors due to access permissions
- Provide source(C:\cutelyst-2.7.0) and build(C:\cutelyst_build) paths.??
- Now click on the Configure button and select MS Visual Studio 2017 as a generator and select “Use native compilers” and then click OK.
- At this, you will get some errors but don’t worry just look for the red values, update them and then again click on Configure button
Note: The possible errors at this point may be regarding the paths of Qt5 and Cutelyst2Qt5. Just update the following entries in the CMake as mentioned below.
Qt5_DIR => “C:\Qt\5.12.0\msvc2017\lib\cmake\Qt5”
Cutelyst2Qt5_DIR => “C:\cutelyst_build\Cutelyst\Debug”
Create a folder named cutelyst in “C:\Program Files(x86)” and then click on Configure, you will see “Configuration done” in the output window in the CMake-GUI.
- Click on Generate button and you will see “Generating done” message in the CMake-GUI output window.
- Now open Qt 5.12.0 (MSVC 2017 - 32bit) command prompt with admin rights and navigate to your cutelyst build folder “C:\cutelyst_build” and run the following command
cmake -- build. --config Release
Once build is finished then run the following command
cmake -- build. --target INSTALL --config Release
That’s it, cutelyst installation is done.
-
Points to remember
- Install all the required tools before starting the installation.
- Open all the tools with admin rights to avoid errors regarding access permissions.
- Source and build paths should not contain any spaces
- Make sure you select the appropriate Qt version and C++ compiler.
Qt 5.12.0 and MSVC 2017(32bit) in my case
- Same version(as of C++ compiler) of Visual Studio should be installed on your computer prior to installation
-
Creating a basic cutelyst application
- Before creating an application add the following path variable to your system settings “C:\Program Files (x86)\cutelyst\bin”
- In the MSVC command prompt navigate to your desired location(say C:\Cutelyst_Apps) and run the following command cutelyst2 --create-app Hello
A folder Hello will be created inside the Cutelyst_App folder.
- Navigate to “C:\Cutelyst_Apps\Hello\build” and run the following command
cmake --build . --config Debug
Now the libraries will be generated inside the following path
“C:\Cutelyst_Apps\Hello\build\src\Debug”
Note: If you can't find the build folder you can create it manually
- Navigate to “C:\Cutelyst_Apps\Hello” and run the following command
cutelyst2 -r --server --app-file .\build\src\Debug\Hello.dll
- Test the application by running the url “localhost:3000” in your web browser. You will see the message “Welcome to Cutelyst!” in your web browser.
That’s it, cutelyst app created successfully.