Create a test folder:
Create a subfolder called tests in the main project.
In this folder, create a separate CMake file for the test.
Create a CMakeLists.txt file for the test:
In the tests folder, create a CMakeLists.txt file with the following contents:
cmake_minimum_required(VERSION 3.14)
project(CalculatriceTests)
find_package(Qt5 REQUIRED COMPONENTS Test)
add_executable(test_calculatrice
test_calculatrice.cpp
)
target_link_libraries(test_calculatrice Qt5::Test)
cmake_minimum_required(VERSION 3.14)
project(CalculatriceTests)
find_package(Qt5 REQUIRED COMPONENTS Test)
add_executable(test_calculatrice
test_calculatrice.cpp
)
target_link_libraries(test_calculatrice Qt5::Test)
To copy to clipboard, switch view to plain text mode
Bookmarks