]> git.rmz.io Git - dotfiles.git/blobdiff - vim/ultisnips/cmake.snippets
vim/fugitive: winfixheight FugitiveIndex window
[dotfiles.git] / vim / ultisnips / cmake.snippets
index b3e88610b53527f3054020e722e12e29e0f7ee87..318bf56b01e4426fcaaa8e1c65a8422b7b1628ec 100644 (file)
@@ -1,21 +1,28 @@
 snippet cmake "CMakeFiles Stub" b
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.12)
 project(${1:ProjectName})
 
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
 # find_package(Boost REQUIRED)
 
-add_executable(\${PROJECT_NAME}
-       ${1:main.cpp}
+add_executable(${2:$1}
+       ${3:main.cpp}
 )
 
-set_target_properties(\${PROJECT_NAME}
+set_target_properties($2
        PROPERTIES CXX_STANDARD 14
 )
 
-target_link_libraries(\${PROJECT_NAME}
+target_link_libraries($2
 )
 endsnippet
 
+snippet pprint "Pretty print variables" b
+include(CMakePrintHelpers)
+cmake_print_variables(${1:var1})
+endsnippet
+
 snippet qt5 "Find Qt5 Modules" b
 # Qt5 Modules
 set(qt5_modules
@@ -90,3 +97,25 @@ set(CMAKE_DEBUG_TARGET_PROPERTIES
        POSITION_INDEPENDENT_CODE
 )
 endsnippet
+
+snippet FPP "FPP Copyright" b
+# Copyright © Focal Point Positioning Limited `!v strftime("%Y")`. All Rights Reserved.
+# This code is the copyright of Focal Point Positioning Limited and
+# cannot be used, copied or distributed without the express written
+# permission of Focal Point Positioning Limited.
+${0}
+endsnippet
+
+snippet FetchContent_url "FetchContent" b
+FetchContent_Declare(${1:name}
+       URL ${2:https://example.com/project.tar.gz}
+)
+FetchContent_MakeAvailable(${1/\w+/\L$0\E/})
+endsnippet
+
+snippet FetchContent_git "FetchContent" b
+FetchContent_Declare(${1:name}
+       GIT_REPOSITORY ${2:https://github.com/${3:user/repo}}
+)
+FetchContent_MakeAvailable(${1/\w+/\L$0\E/})
+endsnippet