diff --git a/template/.copier-answers.ss-cmake.yml b/template/.copier-answers.ss-cmake.yml index 731243e..e123d17 100644 --- a/template/.copier-answers.ss-cmake.yml +++ b/template/.copier-answers.ss-cmake.yml @@ -1,3 +1,3 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: v0.0.7 +_commit: v0.0.10 _src_path: https://github.com/serious-scaffold/ss-cmake diff --git a/template/cmake/presets/base.json b/template/cmake/presets/base.json index f1b7667..f41a688 100644 --- a/template/cmake/presets/base.json +++ b/template/cmake/presets/base.json @@ -5,63 +5,68 @@ "toolchains/vcpkg.json" ], "configurePresets": [ + { + "name": "base-common", + "hidden":true, + "binaryDir":"${sourceDir}/out/build/${presetName}", + "installDir":"${sourceDir}/out/install/${presetName}", + "cacheVariables":{ + "CMAKE_COMPILE_WARNING_AS_ERROR":false, + "CMAKE_EXPORT_COMPILE_COMMANDS":true, + "CMAKE_VERBOSE_MAKEFILE":"FALSE" + } + }, { "name": "base", "hidden": true, "inherits": [ + "base-common", "ninja", "vcpkg" ], - "binaryDir": "${sourceDir}/out/build/${presetName}", - "installDir": "${sourceDir}/out/install/${presetName}", "cacheVariables": { - "CMAKE_EXPORT_COMPILE_COMMANDS": true, - "CMAKE_COMPILE_WARNING_AS_ERROR": false, - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_VERBOSE_MAKEFILE": "FALSE" + "CMAKE_BUILD_TYPE": "Debug" } }, { "name": "base-config", "hidden": true, "inherits": [ + "base-common", "ninja-config", "vcpkg" - ], - "binaryDir": "${sourceDir}/out/build/${presetName}", - "installDir": "${sourceDir}/out/install/${presetName}", - "cacheVariables": { - "CMAKE_EXPORT_COMPILE_COMMANDS": true, - "CMAKE_COMPILE_WARNING_AS_ERROR": false, - "CMAKE_VERBOSE_MAKEFILE": "FALSE" - } + ] } ], "buildPresets": [ { "name": "base", "hidden": true, - "inherits": "ninja", "configurePreset": "base" }, + { + "name": "base-config-debug", + "hidden": true, + "configurePreset": "base-config", + "configuration": "Debug" + }, { "name": "base-config-relwithdebinfo", "hidden": true, - "inherits": "ninja-config-relwithdebinfo", - "configurePreset": "base-config" + "configurePreset": "base-config", + "configuration": "RelWithDebInfo" }, { - "name": "base-config-debug", + "name": "base-config-release", "hidden": true, - "inherits": "ninja-config-debug", - "configurePreset": "base-config" + "configurePreset": "base-config", + "configuration": "Release" } ], "testPresets": [ { "name": "base", "hidden": true, - "inherits": "ninja", "configurePreset": "base", "output": { "outputOnFailure": true @@ -74,28 +79,29 @@ { "name": "base-config-relwithdebinfo", "hidden": true, - "inherits": "ninja-config-relwithdebinfo", + "inherits": [ + "base" + ], "configurePreset": "base-config", - "output": { - "outputOnFailure": true - }, - "execution": { - "noTestsAction": "error", - "stopOnFailure": true - } + "configuration": "RelWithDebInfo" }, { "name": "base-config-debug", "hidden": true, - "inherits": "ninja-config-debug", + "inherits": [ + "base" + ], "configurePreset": "base-config", - "output": { - "outputOnFailure": true - }, - "execution": { - "noTestsAction": "error", - "stopOnFailure": true - } + "configuration": "Debug" + }, + { + "name": "base-config-release", + "hidden": true, + "inherits": [ + "base" + ], + "configurePreset": "base-config", + "configuration": "Release" } ] } diff --git a/template/cmake/presets/default.json b/template/cmake/presets/default.json index 7423711..0db1eb6 100644 --- a/template/cmake/presets/default.json +++ b/template/cmake/presets/default.json @@ -32,6 +32,11 @@ "name": "default-config-debug", "inherits": "base-config-debug", "configurePreset": "default-config" + }, + { + "name": "default-config-release", + "inherits": "base-config-release", + "configurePreset": "default-config" } ], "testPresets": [ @@ -49,6 +54,11 @@ "name": "default-config-debug", "inherits": "base-config-debug", "configurePreset": "default-config" + }, + { + "name": "default-config-release", + "inherits": "base-config-release", + "configurePreset": "default-config" } ] } diff --git a/template/cmake/presets/generators/ninja.json b/template/cmake/presets/generators/ninja.json index 424407d..2280f4e 100644 --- a/template/cmake/presets/generators/ninja.json +++ b/template/cmake/presets/generators/ninja.json @@ -11,43 +11,5 @@ "hidden": true, "generator": "Ninja Multi-Config" } - ], - "buildPresets": [ - { - "name": "ninja", - "hidden": true, - "configurePreset": "ninja" - }, - { - "name": "ninja-config-relwithdebinfo", - "hidden": true, - "configurePreset": "ninja-config", - "configuration": "RelWithDebInfo" - }, - { - "name": "ninja-config-debug", - "hidden": true, - "configurePreset": "ninja-config", - "configuration": "Debug" - } - ], - "testPresets": [ - { - "name": "ninja", - "hidden": true, - "configurePreset": "ninja" - }, - { - "name": "ninja-config-relwithdebinfo", - "hidden": true, - "configurePreset": "ninja-config", - "configuration": "RelWithDebInfo" - }, - { - "name": "ninja-config-debug", - "hidden": true, - "configurePreset": "ninja-config", - "configuration": "Debug" - } ] } diff --git a/template/cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake b/template/cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake index c697a0c..5546f78 100644 --- a/template/cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake +++ b/template/cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake @@ -188,6 +188,10 @@ function(_vcpkg_bootstrap) "${arg_UNPARSED_ARGUMENTS}") endif() + if(NOT DEFINED arg_REPO) + set(arg_REPO https://github.com/microsoft/vcpkg.git) + endif() + find_package(Git QUIET REQUIRED) if(DEFINED CACHE{_VCPKG_ROOT}) diff --git a/template/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake b/template/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake index 6ceb2f0..95722b1 100644 --- a/template/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake +++ b/template/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake @@ -207,19 +207,22 @@ macro(_vcpkg_load_triplet) set(_community_triplet "triplets/community/${VCPKG_TARGET_TRIPLET}.cmake") if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${_triplet}") - include("${CMAKE_CURRENT_LIST_DIR}/${_triplet}") + set(_load_triplet "${CMAKE_CURRENT_LIST_DIR}/${_triplet}") elseif(EXISTS "${_VCPKG_ROOT}/${_triplet}") - include("${_VCPKG_ROOT}/${_triplet}") - elseif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${_community_triplet}") - include("${CMAKE_CURRENT_LIST_DIR}/${_community_triplet}") + set(_load_triplet "${_VCPKG_ROOT}/${_triplet}") elseif(EXISTS "${_VCPKG_ROOT}/${_community_triplet}") - include("${_VCPKG_ROOT}/${_community_triplet}") + set(_load_triplet "${_VCPKG_ROOT}/${_community_triplet}") else() message( FATAL_ERROR "Triplet ${VCPKG_TARGET_TRIPLET} not found at ${CMAKE_CURRENT_LIST_DIR}/${_triplet} or ${_VCPKG_ROOT}/${_triplet}" ) endif() + + message(STATUS "Loading triplet: ${_load_triplet}") + include(${_load_triplet}) + unset(_triplet) unset(_community_triplet) + unset(_load_triplet) endmacro(_vcpkg_load_triplet) diff --git a/template/cmake/vcpkg/vcpkg.toolchain.cmake.jinja b/template/cmake/vcpkg/vcpkg.toolchain.cmake.jinja index acf91aa..ae52534 100644 --- a/template/cmake/vcpkg/vcpkg.toolchain.cmake.jinja +++ b/template/cmake/vcpkg/vcpkg.toolchain.cmake.jinja @@ -27,5 +27,4 @@ set(VCPKG_VERBOSE file(READ ${CMAKE_SOURCE_DIR}/vcpkg.json _vcpkg_json) string(JSON _builtin_baseline GET ${_vcpkg_json} builtin-baseline) -vcpkg_configure(CACHE_DIR_NAME {{ ss_cmake_repo_name}} REPO - https://github.com/microsoft/vcpkg.git REF ${_builtin_baseline}) +vcpkg_configure(CACHE_DIR_NAME {{ ss_cmake_repo_name}} REF ${_builtin_baseline}) diff --git a/template/vcpkg.json.jinja b/template/vcpkg.json.jinja index a9852b7..c294ed5 100644 --- a/template/vcpkg.json.jinja +++ b/template/vcpkg.json.jinja @@ -1,10 +1,17 @@ [%- from pathjoin("includes", "variable.jinja") import repo_url with context -%] { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", +<<<<<<< before updating "name": "{{ repo_name }}", "description": "{{ project_description }}", "builtin-baseline": "4b6c50d962cc20aaa3ef457f8ba683b586263cfb", "homepage": "https://{{ repo_url() }}", +======= + "name": "{{ ss_cmake_repo_name }}", + "description": "{{ ss_cmake_project_description }}", + "builtin-baseline": "2dc91c6439568f694052c3fa25859dc78d9ff8e4", + "homepage": "https://{{ ss_cmake_repo_url }}", +>>>>>>> after updating "dependencies": [ [%- if compiled == true %] "pybind11", @@ -42,8 +49,12 @@ { "name": "cmake-modules", "version": "1.6.11" +<<<<<<< before updating } [%- if compiled == true %], +======= + }, +>>>>>>> after updating { "name": "robotology-cmake-ycm", "version": "0.16.3" @@ -54,7 +65,11 @@ "registries": [ { "kind": "git", +<<<<<<< before updating "baseline": "e5e9b32228141212c78eace81718ca9894055b7b", +======= + "baseline": "09ae1472980f5e2132654900bb48061444b1cea5", +>>>>>>> after updating "repository": "https://github.com/msclock/cmake-registry", "packages": [ [%- if ss_cmake_use_conan == true %]