forked from laristra/cinch-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
95 lines (68 loc) · 3.54 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#------------------------------------------------------------------------------#
# Copyright (c) 2014 Los Alamos National Security, LLC
# All rights reserved.
#------------------------------------------------------------------------------#
project(cinch-utils)
cmake_minimum_required(VERSION 2.8)
#------------------------------------------------------------------------------#
# Cinch cmake search path and includes
#------------------------------------------------------------------------------#
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cinch/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(STATIC_VERSION "" CACHE STRING
"Set a static version instead of using 'git describe'")
if(STATIC_VERSION)
set(${PROJECT_NAME}_VERSION ${STATIC_VERSION})
else()
cinch_make_version()
endif(STATIC_VERSION)
#------------------------------------------------------------------------------#
# Setup for command-line interface
#------------------------------------------------------------------------------#
find_package(PythonInterp 2.7 REQUIRED)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig as cg; print cg.get_python_lib(0,0,prefix='${CMAKE_INSTALL_PREFIX}')" OUTPUT_VARIABLE PYTHON_INSTDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
install(DIRECTORY ccli/ccli DESTINATION ${PYTHON_INSTDIR}
FILES_MATCHING PATTERN "*.py")
install(PROGRAMS ccli/bin/ccli DESTINATION bin)
install(PROGRAMS ccli/bin/ccli DESTINATION bin RENAME cinch-cli)
#------------------------------------------------------------------------------#
# Setup for shell configuration files
#------------------------------------------------------------------------------#
# bash
configure_file(${CMAKE_SOURCE_DIR}/env/cinchenv.sh.in
${CMAKE_BINARY_DIR}/env/cinchenv.sh @ONLY)
# csh
configure_file(${CMAKE_SOURCE_DIR}/env/cinchenv.csh.in
${CMAKE_BINARY_DIR}/env/cinchenv.csh @ONLY)
# environment modules
configure_file(${CMAKE_SOURCE_DIR}/env/cinch.in
${CMAKE_BINARY_DIR}/env/cinch @ONLY)
file(GLOB ENV_HELPERS ${CMAKE_BINARY_DIR}/env/*)
install(FILES ${ENV_HELPERS} DESTINATION bin)
#------------------------------------------------------------------------------#
# Install git utilities
#------------------------------------------------------------------------------#
file(GLOB GIT_HELPERS ${CMAKE_SOURCE_DIR}/git/*)
install(FILES ${GIT_HELPERS} DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
#------------------------------------------------------------------------------#
# Install cmake utilities
#------------------------------------------------------------------------------#
file(GLOB CMAKE_HELPERS ${CMAKE_SOURCE_DIR}/cmake/*)
install(FILES ${CMAKE_HELPERS} DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
#------------------------------------------------------------------------------#
# Formatting options for emacs and vim.
# vim: set tabstop=4 shiftwidth=4 expandtab :
#------------------------------------------------------------------------------#