CMake workflow presets should be supported too #93
ClausKlein
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
See #28 Workflow presets were added in 3.25, so only the upcoming C++23 template could make use of it. However, I think that's something trivial to add by individual users once they have read the HACKING document. |
Beta Was this translation helpful? Give feedback.
4 replies
-
$> cmake --workflow --preset dev --fresh
Executing workflow step 1 of 4: configure preset "dev"
Preset CMake variables:
BUILD_MCSS_DOCS="OFF"
CMAKE_BUILD_TYPE="Coverage"
CMAKE_CXX_EXTENSIONS="OFF"
CMAKE_CXX_FLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast"
CMAKE_CXX_FLAGS_COVERAGE="-Og -g --coverage"
CMAKE_CXX_STANDARD="17"
CMAKE_CXX_STANDARD_REQUIRED="ON"
CMAKE_EXE_LINKER_FLAGS="-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now"
CMAKE_EXE_LINKER_FLAGS_COVERAGE="--coverage"
CMAKE_EXPORT_COMPILE_COMMANDS="ON"
CMAKE_INSTALL_PREFIX:PATH="/home/klein_cl/Workspace/cpp/cmake-init-conan/stagedir"
CMAKE_MAP_IMPORTED_CONFIG_COVERAGE="Coverage;RelWithDebInfo;Release;Debug;"
CMAKE_POLICY_DEFAULT_CMP0091="NEW"
CMAKE_PREFIX_PATH:STRING="/home/klein_cl/Workspace/cpp/cmake-init-conan/stagedir"
CMAKE_SHARED_LINKER_FLAGS="-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now"
CMAKE_SHARED_LINKER_FLAGS_COVERAGE="--coverage"
CMAKE_TOOLCHAIN_FILE="/home/klein_cl/Workspace/cpp/cmake-init-conan/conan/conan_toolchain.cmake"
ENABLE_COVERAGE="ON"
mytest_DEVELOPER_MODE="ON"
-- Using Conan toolchain: /home/klein_cl/Workspace/cpp/cmake-init-conan/conan/conan_toolchain.cmake
-- Conan toolchain: C++ Standard 14 with extensions ON
-- The CXX compiler identification is Clang 15.0.7
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/llvm-15/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Component target declared 'fmt::fmt'
-- Conan: Component target declared 'Catch2::Catch2'
-- Conan: Component target declared 'Catch2::Catch2WithMain'
-- Configuring done (0.4s)
-- Generating done (0.0s)
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_POLICY_DEFAULT_CMP0091
-- Build files have been written to: /home/klein_cl/Workspace/cpp/cmake-init-conan/build/coverage
Executing workflow step 2 of 4: build preset "all"
[6/6] Linking CXX executable test/mytest_test
Executing workflow step 3 of 4: build preset "check"
[0/4] Running tests...
Test project /home/klein_cl/Workspace/cpp/cmake-init-conan/build/coverage
Start 1: Name is mytest
1/1 Test #1: Name is mytest ................... Passed 0.00 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) = 0.00 sec
[1/4] cd /home/klein_cl/Workspace/cpp/cmake-init-conan/build/coverage && /home/klein_cl/Workspace/cpp/cmake-init-conan/build/coverage/mytest
Hello from mytest!
[2/4] Install the project...
-- Install configuration: "Coverage"
-- Installing: /home/klein_cl/Workspace/cpp/cmake-init-conan/stagedir/bin/mytest
-- Set runtime path of "/home/klein_cl/Workspace/cpp/cmake-init-conan/stagedir/bin/mytest" to ""
[4/4] Checking spelling
Executing workflow step 4 of 4: test preset "dev"
Test project /home/klein_cl/Workspace/cpp/cmake-init-conan/build/coverage
Start 1: Name is mytest
1/1 Test #1: Name is mytest ................... Passed 0.00 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) = 0.00 sec
$:~/Workspace/cpp/cmake-init-conan$ gcovr .
------------------------------------------------------------------------------
GCC Code Coverage Report
Directory: .
------------------------------------------------------------------------------
File Lines Exec Cover Missing
------------------------------------------------------------------------------
source/lib.cpp 3 3 100%
source/lib.hpp 0 0 --%
source/main.cpp 6 6 100%
test/source/mytest_test.cpp 4 4 100%
------------------------------------------------------------------------------
TOTAL 13 13 100%
------------------------------------------------------------------------------
$:~/Workspace/cpp/cmake-init-conan$ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
An example can be found her
see too We need support for macro expansion in inherits field
Beta Was this translation helpful? Give feedback.
All reactions