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
96
97
98
99
100
101
102
103
104
105
106
107
|
CMakeLists.txt -> File in each directory that contains classes, exe, etc
CMakeLists.txt contains the following:
# build targets
WIN32_SOURCE_FILES =
UNIX_SOURCE_FILES =
ABSTRACT_CLASSES =
SUBDIRS =
EXECUTABLES =
# make flags
# make flags can use these varibles:
# ${CMAKE_BINARY_DIR} The root of the build tree where the binaries are
# ${CMAKE_SOURCE_DIR} The root of the source tree where configure is
INCLUDE_DIRECTORIES =
LINK_DIRECTORIES =
LINK_LIBRARIES = # use the same name as ME =
WIN32_LIBRARIES =
UNIX_LIBRARIES =
# name of the library to build
ME =
# add make commands
BEGIN MAKE VERBATIM
... # copy stuff into CMakeTargets.make directly
LOCAL_BUILD_TARGETS = // These are done first before anything else
END MAKE VERBATIM
AUX_SOURCE_DIR =
Windows / Visual Studio 6.0 programs
CMakeSetup.exe -> window MFC based GUI for configure on windows
CMakeSetupCMD.exe -> windows command line version of CMakeConfigure
To Build on Windows:
load CMake/Source/CMakeSetup.dsw
Build it
Run it
Specify paths
Load ITK.dsw
Build Common, Numerics, then any of the many executables, or do a Batch build
with debug only.
Unix scripts and programs:
configure -> run on unix to configure for build
CMakeBuildTargets -> Unix program to read CMakeLists.txt and generate CMakeTargets.make
makefile fragments:
CMakeMaster.make -> main file to be included by makefiles
CMakeVariables.make -> all make varibles are set in this file
CMakeRules.make -> All build rules are here (except Simple Rules)
CMakeSimpleRules.make -> simple build rules for .o to .cxx, this is separate to be able
to build CMakeBuildTargets itself.
CMakeLocal.make -> Place for hand configuration
CMakeTargets.make -> generated rules for make style build in each directory
MakefileTemplate.make -> master makefile template used by configure to generate Makefiles
Note on adding targets inside "BEGIN/END MAKE VERBATIM" lines:
By default, after "includ"ing a makefile, make will attempt to bring
that included file up to date. So, when you first run configure, your
makefiles will _not_ contain the target you have asked for inside the
VERBATIM tags. However, it will be added by CMake when make attempts
to bring the included make files up to date. NOTE: this will make
your head hurt if you think about it too long. Just accept that it
works to ask for a build target that does not yet exist.
Unix install:
In place:
./configure
make
Other directory:
mkdir Insight-build
cd Insight-build
../Insight/configure
make
TODO:
FEATURES:
Add include and directories to the build on windows.
For unix just add them to the CMakeLocal.make.in
Add a --with idea, sets a #define in the config.h file
Create a directory
Run a command
CLEANUP:
Change ME to LIBRARY, and add PROJECT=
Remove the rest of the ITK_* stuff
move the libs used from the top into the testing...
FEATURES
1. run a command in the current build directory
2. make a directory
3. search for 3rd party software and define some variables
that can be used in the CMakeLists.txt files. Perhaps from
some central CMake.in file.
4. Have cmake define some stuff like:
SITE, OS-REV, COMPILER-VERSION
(use configure for unix, and add stuff to the pc version for windows.)
BUGS:
1. allow multiple registry entries on windows
|