Solution: Creating Our Professional Project
Let's see the implementation of your professional project.
We'll cover the following...
- Task 1 Solution: Specify basic project details and add the src and test directories
- Task 2 Solution: Add code for enabling test utility usage by two target groups
- Task 3 Solution: Include code that contains all necessary operations to be performed on this target
- Task 4 Solution: Add the configuration for generating Doxygen HTML documentation
- Task 5 Solution: Add the Valgrind Memcheck configuration to generate the report
- Project
Task 1 Solution: Specify basic project details and add the src and test directories 
cmake_minimum_required(VERSION 3.25.1)project(Calc VERSION 1.0.0 LANGUAGES CXX)list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")include(NoInSourceBuilds)add_subdirectory(src bin)add_subdirectory(test)include(Install)
- list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake"): This line appends a directory path- ${CMAKE_SOURCE_DIR}/cmaketo the- CMAKE_MODULE_PATHvariable. It's common to use this variable to specify additional paths where CMake should look for module files used in the project.
- include(NoInSourceBuilds): This line includes the- NoInSourceBuildsmodule. This module likely provides functionality to prevent building the project directly in the source directory, promoting out-of-source builds. It's a good practice to build CMake projects in separate build directories to keep the source directory clean.
- add_subdirectory(src bin): This line adds the- srcand- bindirectories as subdirectories to the project. This means that CMake will search for- CMakeLists.txtfiles in these directories and include them in the build process.
- add_subdirectory(test): This line adds the- testdirectory as a subdirectory to the project. Similarly to the previous line, it includes the- CMakeLists.txtfile in the- testdirectory in the build process.
- include(Install): This line includes the- Installmodule, which likely contains installation-related commands and configurations. This module defines what files should be installed and where during the installation process.
Task 2 Solution: Add code for enabling test utility usage by two target groups
include(Testing)add_subdirectory(calc)add_subdirectory(calc_console)
- add_subdirectory(calc): This line adds the- calcdirectory as a subdirectory to ...