Skip to content

Mher594/ACA

Repository files navigation

ACA

Example projects

cmake-ctest

cmake-ctest is a simple CMake/CTest project. We can compile and run test:

$ cmake -S. -Bbuild
$ cd build
$ cmake --build .
$ ctest -C Debug

sqrt-gtest-visualstudio.

sqrt-gtest-visualstudio is a visual studio solution using simple library project and google test project.

static library project vs_static_lib

google test project vs_gtest

Requirement for sqrt-gtest-visualstudio: Test adapter for google test gtest1 gtest2

Make sure that include directories for sqrt-gtest-visualstudio project are set properly

include_directories

sqrt-gtest-vcpkg-cmake.

sqrt-gtest-vcpkg-cmake is a CMake project, it creates a simple library with my_sqrt function and test it using google test. In order to install google test it uses vcpkg package manager.

a) In order to build the project using visual studio code:

  1. Install CMake plugin in visual studio code.
  2. Install vcpkg (https://vcpkg.io/en/getting-started.html)
  3. View -> Command Palette -> Open User Settings (JSON)
  4. Add
"cmake.configureOnOpen": true,
"cmake.configureSettings": {
  "CMAKE_TOOLCHAIN_FILE": "[Path to vcpkg]/scripts/buildsystems/vcpkg.cmake"
}

Final settings json file should look like something similar to

{
    "go.toolsManagement.autoUpdate": true,
    "cmake.configureOnOpen": true,
    "cmake.configureSettings": {
        "CMAKE_TOOLCHAIN_FILE": "D:/Workspace/vcpkg/scripts/buildsystems/vcpkg.cmake"
    },
    "redhat.telemetry.enabled": true
}
  1. Build the project using CMake plugin (pick a kit when prompted)
  2. Run my_sqrt_test project using CMake plugin

b) In order to build the project using command line:

cmake_cmd

About

Example projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors