snippet cmake "CMakeFiles Stub" b cmake_minimum_required(VERSION 2.8.11) project(${1:ProjectName}) find_package(${2:LIBRARY}) include_directories( ${$2_INCLUDE_DIR} ) add_subdirectory(${0:src}) add_executable($1) set_target_properties($1 PROPERTIES CXX_STANDARD 11 ) target_link_libraries($1 ${$2_LIBRARIES} ) endsnippet snippet qt5 "Find Qt5 Modules" b # Qt5 Modules set(qt5_modules Qt5Core Qt5Gui Qt5Widgets ) foreach(qt5_module ${qt5_modules}) find_package(${qt5_module} QUIET) if(${qt5_module}_FOUND) else(${qt5_module}_FOUND) message(FATAL_ERROR "Qt5 module '${qt5_module}' not found") endif() endif() endforeach() endsnippet snippet include include_directories( ${${0:INCLUDE_DIR}} ) endsnippet snippet find find_package(${0:LIBRARY}) include_dir($0_INCLUDE_DIRS) link_directories($0_LIBRARY_DIRS) endsnippet snippet glob file(GLOB ${1:SRCS} *.${0:cpp}) endsnippet snippet subdir add_subdirectory(${0:src}) endsnippet snippet lib add_library(${1:lib} ${2:STATIC} ${${0:SRCS}} ) endsnippet snippet link target_link_libraries(${1:bin} ${0:somelib} ) endsnippet snippet bin add_executable(${1:bin}) endsnippet snippet set set(${1:var} ${0:val}) endsnippet snippet dep add_dependencies(${1:target} ${0:dep} ) endsnippet snippet props set_target_properties(${1:target} ${2:PROPERTIES} ${3:COMPILE_FLAGS} ${0:"-O3 -Wall -pedantic"} ) endsnippet