2012-08-16 23:41:25 -04:00
|
|
|
snippet cmake
|
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|
|
|
PROJECT(${1:ProjectName})
|
|
|
|
|
|
|
|
FIND_PACKAGE(${2:LIBRARY})
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(
|
|
|
|
${$2_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
2013-11-16 14:45:48 -05:00
|
|
|
ADD_SUBDIRECTORY(${0:src})
|
2012-08-16 23:41:25 -04:00
|
|
|
|
|
|
|
ADD_EXECUTABLE($1)
|
|
|
|
|
|
|
|
TARGET_LINK_LIBRARIES($1
|
|
|
|
${$2_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
snippet include
|
|
|
|
INCLUDE_DIRECTORIES(
|
2013-11-16 14:45:48 -05:00
|
|
|
${${0:INCLUDE_DIR}}
|
2012-08-16 23:41:25 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
snippet find
|
2013-11-16 14:45:48 -05:00
|
|
|
FIND_PACKAGE(${0:LIBRARY})
|
2012-08-16 23:41:25 -04:00
|
|
|
|
|
|
|
snippet glob
|
2013-11-16 14:45:48 -05:00
|
|
|
FILE(GLOB ${1:SRCS} *.${0:cpp})
|
2012-08-16 23:41:25 -04:00
|
|
|
|
|
|
|
snippet subdir
|
2013-11-16 14:45:48 -05:00
|
|
|
ADD_SUBDIRECTORY(${0:src})
|
2012-08-16 23:41:25 -04:00
|
|
|
|
|
|
|
snippet lib
|
|
|
|
ADD_LIBRARY(${1:lib} ${2:STATIC}
|
2013-11-16 14:45:48 -05:00
|
|
|
${${0:SRCS}}
|
2012-08-16 23:41:25 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
snippet link
|
|
|
|
TARGET_LINK_LIBRARIES(${1:bin}
|
2013-11-16 14:45:48 -05:00
|
|
|
${0:somelib}
|
2012-08-16 23:41:25 -04:00
|
|
|
)
|
2013-07-17 19:06:05 -04:00
|
|
|
|
2012-08-16 23:41:25 -04:00
|
|
|
snippet bin
|
|
|
|
ADD_EXECUTABLE(${1:bin})
|
|
|
|
|
|
|
|
snippet set
|
2013-11-16 14:45:48 -05:00
|
|
|
SET(${1:var} ${0:val})
|
2012-08-16 23:41:25 -04:00
|
|
|
|
|
|
|
snippet dep
|
|
|
|
ADD_DEPENDENCIES(${1:target}
|
2013-11-16 14:45:48 -05:00
|
|
|
${0:dep}
|
2012-08-16 23:41:25 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
snippet props
|
2013-07-17 19:06:05 -04:00
|
|
|
SET_TARGET_PROPERTIES(${1:target}
|
|
|
|
${2:PROPERTIES} ${3:COMPILE_FLAGS}
|
2013-11-16 14:45:48 -05:00
|
|
|
${0:"-O3 -Wall -pedantic"}
|
2012-08-16 23:41:25 -04:00
|
|
|
)
|