File: SampleCMakeLists.txt

package info (click to toggle)
insighttoolkit 3.20.1%2Bgit20120521-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 80,652 kB
  • sloc: cpp: 458,133; ansic: 196,223; fortran: 28,000; python: 3,839; tcl: 1,811; sh: 1,184; java: 583; makefile: 430; csh: 220; perl: 193; xml: 20
file content (83 lines) | stat: -rw-r--r-- 4,177 bytes parent folder | download | duplicates (4)
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
# Sample CMakeLists that demonstrates all of the possible options for creating a
# wrapper library. In this case, the ITKAlgorirhms library is being created.

################################################################################
# (1) Set all wrapper library config variables to their default values.
# The parameter is the name of the wrapper library; this value is stored in
# the variable WRAPPER_LIBRARY_NAME.
BEGIN_WRAPPER_LIBRARY("ITKAlgorithms")

################################################################################
# (2) Set the configuration variables for the library.

# WRAPPER_LIBRARY_SOURCE_DIR: Optional. Directory to be scanned for wrap_*.cmake files. 
# Defaults to CMAKE_CURRENT_SOURCE_DIR.
SET(WRAPPER_LIBRARY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")

# WRAPPER_LIBRARY_OUTPUT_DIR: Optional. Directory in which generated cxx, xml, and idx
# files will be placed. Defaults to CMAKE_CURRENT_BINARY_DIR.
SET(WRAPPER_LIBRARY_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")

# WRAPPER_LIBRARY_DEPENDS: Optional. List of names of other wrapper libraries that
# define symbols used by this wrapper library. Defaults to an empty list.
SET(WRAPPER_LIBRARY_DEPENDS
  VXLNumerics
  Base)

# WRAPPER_LIBRARY_LINK_LIBRARIES: Optional. List of other libraries that should
# be linked to the wrapper library. The SWIG runtime library is always linked.
# Defaults to an empty list.
SET(WRAPPER_LIBRARY_LINK_LIBRARIES 
  ITKAlgorithms)

# WRAPPER_LIBRARY_GROUPS: Optional. List of wrap_*.cmake groups in the source dir
# that should be included/wrapped before the rest. Just the group name is needed,
# not the full path or file name. Defaults to an empty list.
SET(WRAPPER_LIBRARY_GROUPS ) 

# WRAPPER_LIBRARY_CABLESWIG_INPUTS: Optional. List of C++ source files to be used
# as input for CableSwig. Defaults to an empty list, that is then appended to by
# WRAPPER_LIBRARY_CREATE_WRAP_FILES. A full path to each input is required.
# If any of these CableSwig inputs declares a new wrap group, that group's name
# MUST be added to WRAPPER_LIBRARY_GROUPS above. (It is not an error to declare
# a group for which no wrap_*.cmake file exists: the build system assumes that
# this group will be declared elsewhere.)
# A second option would to append to the WRAPPER_LIBRARY_CABLESWIG_INPUTS variable
# in a wrap_*.cmake file: then the group gets set automatically. See 
# wrap_vcl_complex.cmake for an example.
SET(WRAPPER_LIBRARY_CABLESWIG_INPUTS )

# WRAPPER_LIBRARY_SWIG_INPUTS: Optional. SWIG input files to be fed to swig (not
# CableSwig). Defaults to an empty list. A full path to each input is required.
SET(WRAPPER_LIBRARY_SWIG_INPUTS ) 

# WRAPPER_LIBRARY_CXX_SOURCES: Optional. C++ sources to be compiled and linked in
# to the wrapper library (with no prior processing by swig, etc.)
# Defaults to an empty list. A full path to each input is required.
SET(WRAPPER_LIBRARY_CXX_SOURCES ) 


################################################################################
# (3) Include the wrap_*.cmake files in the source dir. This causes equivalent 
# wrap_*.cxx files to be generated in the output directory, and added to the 
# WRAPPER_LIBRARY_CABLESWIG_INPUTS list.
# In addition, this causes the other required wrap_*.cxx files for the entire
# library and each wrapper language to be created.
# Finally, this macro records information about the template instances that are
# wrapped. This information is needed for the language support files created 
# below.

WRAPPER_LIBRARY_CREATE_WRAP_FILES()

################################################################################
# (4) Cause the library to be added: this entails (a) generation of xml files
# from the files in WRAPPER_LIBRARY_CABLESWIG_INPUTS via gcc_xml, (b) generation
# index files  (and the associated master index file) from the xml via cableidx,
# (c) generation of C and language-specific wrapper code from index files via 
# cswig, and (d) adding a library target with the generated C code.
# This also creates the language support files for properly loading the library
# and supporting templated instances. (Currently Python-only.)

WRAPPER_LIBRARY_CREATE_LIBRARY()