-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
80 lines (70 loc) · 3.08 KB
/
Copy pathCMakeLists.txt
File metadata and controls
80 lines (70 loc) · 3.08 KB
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
#
# $Id: CMakeLists.txt 11803 2013-06-24 23:06:22Z pwessel $
#
# Copyright (c) 1991-2017 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
# See LICENSE.TXT file for copying and redistribution conditions.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; version 3 or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# Contact info: gmt.soest.hawaii.edu
#-------------------------------------------------------------------------------
#
# To modify the cmake process: Edit your cmake/ConfigUser.cmake file
#
# To build out-of-source do (for example):
#
# mkdir build
# cd build
# cmake [-DCMAKE_INSTALL_PREFIX=custom] [-DCMAKE_BUILD_TYPE=RelWithDebInfo] ..
#
# CMAKE_BUILD_TYPE can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
#
# cmake creates a new file cmake/ConfigUser.cmake if it does not already
# exist. You can configure additional options there.
#
## Section 0: Define project name. Change this to what your plugin should be named.
project (custom)
#------------------------------------------------------------------------
# Make sure the user doesn't play dirty with symlinks
get_filename_component (srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
get_filename_component (bindir "${CMAKE_BINARY_DIR}" REALPATH)
# Disallow in-source builds
if (${srcdir} STREQUAL ${bindir})
message(FATAL_ERROR "In-source builds are not allowed. "
"Please create a directory and run cmake from there, passing the path "
"to this source directory as the last argument. This process created "
"the file `CMakeCache.txt' and the directory `CMakeFiles' in ${srcdir}. "
"Please remove them.")
endif (${srcdir} STREQUAL ${bindir})
# Define minimum CMake version required
cmake_minimum_required (VERSION 2.8.5)
# Where to find our CMake modules (this variable is visible in subdirectories).
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/"
CACHE INTERNAL "Location of our custom CMake modules." FORCE)
# Include configuration options (default options and options overridden by user).
include (ConfigCMake)
# Find UNIX commands
include (FindUnixCommands)
# Add subdirectories
add_subdirectory (src)
get_property(GMT_CUSTOM_LIB_PATH TARGET customlib PROPERTY LOCATION)
GET_FILENAME_COMPONENT (GMT_CUSTOM_LIB_NAME ${GMT_CUSTOM_LIB_PATH} NAME)
# Configuration done
message(
"* Options:\n"
"* GMT library : ${GMT_LIBRARY}\n"
"* GMT include dir : ${GMT_INCLUDE_DIR}\n"
"*\n"
"* Locations:\n"
"* Custom name : ${CMAKE_PROJECT_NAME}\n"
"* CUSTOM library : ${GMT_CUSTOM_LIB_NAME}\n"
"* Installing CUSTOM in : ${CMAKE_INSTALL_PREFIX}\n"
"* CUSTOM_SHARE_PATH : ${CMAKE_INSTALL_PREFIX}/${CUSTOM_SHARE_PATH}")
# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2