forked from laristra/cinch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (50 loc) · 2.52 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#------------------------------------------------------------------------------#
# Copyright (c) 2014 Los Alamos National Security, LLC
# All rights reserved.
#------------------------------------------------------------------------------#
project(cinch)
cmake_minimum_required(VERSION 3.0)
#------------------------------------------------------------------------------#
# Cinch cmake search path and includes
#------------------------------------------------------------------------------#
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(insource)
include(documentation)
include(version)
#------------------------------------------------------------------------------#
# Add distclean target
#------------------------------------------------------------------------------#
add_custom_target(distclean rm -rf ${CMAKE_BINARY_DIR}/*)
#------------------------------------------------------------------------------#
# Add version options and creation
#------------------------------------------------------------------------------#
set(VERSION_CREATION "git describe" CACHE STRING
"Set a static version instead of using git describe")
if(NOT ${VERSION_CREATION} STREQUAL "git describe")
set(${PROJECT_NAME}_VERSION ${VERSION_CREATION})
else()
cinch_make_version()
endif(NOT ${VERSION_CREATION} STREQUAL "git describe")
#------------------------------------------------------------------------------#
# Add documentation target
#------------------------------------------------------------------------------#
configure_file(${CMAKE_SOURCE_DIR}/doc/cinchheader.tex.in
${CMAKE_BINARY_DIR}/doc/cinchheader.tex)
configure_file(${CMAKE_SOURCE_DIR}/doc/cinchtitle.tex.in
${CMAKE_BINARY_DIR}/doc/cinchtitle.tex)
set(ug_pandoc_options
"--toc"
"--toc-depth=2"
"--include-in-header=${CMAKE_SOURCE_DIR}/tex/addtolength.tex"
"--include-in-header=${CMAKE_BINARY_DIR}/doc/cinchheader.tex"
"--include-in-header=${CMAKE_BINARY_DIR}/doc/cinchtitle.tex"
"--include-before-body=${CMAKE_SOURCE_DIR}/tex/maketitle.tex"
"--include-before-body=${CMAKE_SOURCE_DIR}/tex/firstpageempty.tex"
"--include-before-body=${CMAKE_SOURCE_DIR}/tex/titlebreak.tex"
)
cinch_add_doc(${PROJECT_NAME}-ug ugconfig.py . cinch-ug-${cinch_VERSION}.pdf
PANDOC_OPTIONS ${ug_pandoc_options})
#------------------------------------------------------------------------------#
# Formatting options for emacs and vim.
# vim: set tabstop=4 shiftwidth=4 expandtab :
#------------------------------------------------------------------------------#