File: CMakeLists.txt

package info (click to toggle)
mathgl 1.9-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 17,496 kB
  • ctags: 3,647
  • sloc: cpp: 36,386; sh: 10,198; ansic: 1,093; makefile: 325; pascal: 52; python: 35
file content (221 lines) | stat: -rw-r--r-- 6,226 bytes parent folder | download
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
cmake_minimum_required(VERSION 2.6)

project( MathGL )
set(CMAKE_VERBOSE_MAKEFILE ON)
option(enable-double "Enable double precision in MathGL library")
option(enable-all "Enable all features")
option(enable-langall "Enable all language interfaces")
option(enable-gsl "Enable gsl support")
option(enable-jpeg "Enable jpeg support")
option(enable-gif "Enable gif support")
option(enable-hdf5 "Enable hdf5 support")
option(enable-glut "Enable glut support")
option(enable-fltk "Enable fltk widget")
option(enable-wx "Enable wxWidget widget")
option(enable-qt "Enable Qt4 widget")
option(enable-python "Enable python interface")
option(enable-octave "Enable octave interface")
option(enable-doc "Enable documentation building")
if(enable-double)
    set(use_double 1)
endif(enable-double)
if(enable-all OR enable-gsl)
    set(use_gsl 1)
endif(enable-all OR enable-gsl)
if(enable-all OR enable-jpeg)
    set(use_jpeg 1)
endif(enable-all OR enable-jpeg)
if(enable-all OR enable-gif)
    set(use_gif 1)
endif(enable-all OR enable-gif)
if(enable-all OR enable-hdf5)
    set(use_hdf5 1)
endif(enable-all OR enable-hdf5)
if(enable-all OR enable-glut)
    set(use_glut 1)
endif(enable-all OR enable-glut)
if(enable-all OR enable-fltk)
    set(use_fltk 1)
endif(enable-all OR enable-fltk)
if(enable-all OR enable-wx)
    set(use_wx 0)
endif(enable-all OR enable-wx)
if(enable-all OR enable-qt)
    set(use_qt 1)
endif(enable-all OR enable-qt)
if(enable-all OR enable-doc)
    set(use_doc 1)
endif(enable-all OR enable-doc)
if(enable-langall OR enable-python)
    set(use_python 1)
endif(enable-langall OR enable-python)
if(enable-langall OR enable-octave)
    set(use_octave 1)
endif(enable-langall OR enable-octave)

include_directories( ${MathGL_SOURCE_DIR}/include )

include(FindOpenGL)
if(NOT OPENGL_FOUND)
	message(SEND_ERROR "Couldn't find OpenGL libraries.")
endif(NOT OPENGL_FOUND)

include(FindPNG)
if(NOT PNG_FOUND)
	message(SEND_ERROR "Couldn't find PNG libraries.")
endif(NOT PNG_FOUND)

find_library(GSL_LIB gsl)
find_library(GSL_CBLAS_LIB gslcblas)
find_path(GSL_INCLUDE_DIR gsl/gsl_fft_complex.h)
if(NOT GSL_LIB OR NOT GSL_CBLAS_LIB OR NOT GSL_INCLUDE_DIR)
	if(use_gsl)
		message(SEND_ERROR "${GSL_LIB}")
		message(SEND_ERROR "${GSL_CBLAS_LIB}")
		message(SEND_ERROR "${GSL_INCLUDE_DIR}")
		message(SEND_ERROR "Couldn't find GSL libraries.")
	endif(use_gsl)
endif(NOT GSL_LIB OR NOT GSL_CBLAS_LIB OR NOT GSL_INCLUDE_DIR)

include(FindJPEG)
if(NOT JPEG_FOUND)
	if(use_jpeg)
		message(SEND_ERROR "Couldn't find JPEG libraries.")
	endif(use_jpeg)
endif(NOT JPEG_FOUND)

include(FindGIF)
if(NOT GIF_FOUND)
	if(use_gif)
		message(SEND_ERROR "Couldn't find GIF libraries.")
	endif(use_gif)
endif(NOT GIF_FOUND)

find_library(HDF5_LIB hdf5)
find_path(HDF5_INCLUDE_DIR hdf5.h)
if(NOT HDF5_LIB OR NOT HDF5_INCLUDE_DIR)
	if(use_hdf5)
		message(SEND_ERROR "${HDF5_LIB}")
		message(SEND_ERROR "${HDF5_INCLUDE_DIR}")
		message(SEND_ERROR "Couldn't find HDF5 libraries.")
	endif(use_hdf5)
endif(NOT HDF5_LIB OR NOT HDF5_INCLUDE_DIR)

include(FindGLUT)
if(NOT GLUT_FOUND)
	if(use_glut)
		message(SEND_ERROR "Couldn't find GLUT libraries.")
	endif(use_glut)
endif(NOT GLUT_FOUND)

include(FindFLTK)
if(NOT FLTK_FOUND)
	if(use_fltk)
		message(SEND_ERROR "Couldn't find FLTK libraries.")
	endif(use_fltk)
endif(NOT FLTK_FOUND)

FIND_PACKAGE(wxWidgets COMPONENTS base core gl)
if(NOT wxWidgets_FOUND)
	if(use_wx)
		message(SEND_ERROR "Couldn't find wxWidgets libraries.")
	endif(use_wx)
endif(NOT wxWidgets_FOUND)

FIND_PACKAGE(Qt4)
if(NOT QT4_FOUND)
	if(use_qt)
		message(SEND_ERROR "Couldn't find Qt4 libraries.")
	endif(use_qt)
endif(NOT QT4_FOUND)

include(FindPythonInterp)
if(NOT PYTHONINTERP_FOUND)
	if(use_python)
		message(SEND_ERROR "Couldn't find python interpreter.")
	endif(use_python)
endif(NOT PYTHONINTERP_FOUND)
include(FindPythonLibs)
if(NOT PYTHONLIBS_FOUND)
	if(use_python)
		message(SEND_ERROR "Couldn't find python development libraries.")
	endif(use_python)
endif(NOT PYTHONLIBS_FOUND)

include(FindSWIG)
if(NOT SWIG_FOUND)
	if(use_python)
		message(SEND_ERROR "Couldn't find swig needed for interfaces compiling.")
	endif(use_python)
endif(NOT SWIG_FOUND)

find_path(OCTAVE_INCLUDE_DIR octave/oct.h)
if(NOT OCTAVE_INCLUDE_DIR)
	if(use_octave)
		message(SEND_ERROR "Couldn't find octave/oct.h needed for octave interfaces compiling.")
	endif(use_octave)
endif(NOT OCTAVE_INCLUDE_DIR)

find_program(oct_prog octave)
if(NOT oct_prog)
	if(use_octave)
		message(SEND_ERROR "Couldn't find octave needed for octave interfaces compiling.")
	endif(use_octave)
endif(NOT oct_prog)

find_program(oct_mk mkoctfile)
if(NOT oct_mk)
	if(use_octave)
		message(SEND_ERROR "Couldn't find mkoctfile needed for octave interfaces compiling.")
	endif(use_octave)
endif(NOT oct_mk)
#execute_process(
#	COMMAND ${oct_prog} -q --eval \'strcat\(octave_config_info\("canonical_host_type"\), "-", octave_config_info\("api_version"\)\)'|sed -e 's/ans = //'
#	OUTPUT_VARIABLE OCTAVE_ARCH
#	)
#message(SEND_ERROR "${OCTAVE_ARCH}")

find_program(findmi makeinfo)
if(NOT findmi)
	if(use_doc)
		message(SEND_ERROR "Couldn't find makeinfo needed for documentation building.")
	endif(use_doc)
endif(NOT findmi)
find_program(findth texi2html)
if(NOT findth)
	if(use_doc)
		message(SEND_ERROR "Couldn't find texi2html needed for documentation building.")
	endif(use_doc)
endif(NOT findth)
find_program(findtp texi2pdf)
if(NOT findtp)
	if(use_doc)
		message(SEND_ERROR "Couldn't find texi2pdf needed for documentation building.")
	endif(use_doc)
endif(NOT findtp)

if(UNIX)
        add_definitions(-DNO_COLOR_ARRAY)
endif(UNIX)

if(WIN32)
#        add_definitions(-DWIN32 -D_MSC_VER)
        add_definitions(-DWIN32)
endif(WIN32)

if(NOT WIN32)
set(MGL_DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/mathgl")
set(MGL_DOC_PATH "${CMAKE_INSTALL_PREFIX}/share/doc/mathgl")
set(MGL_FONT_PATH "${MGL_DATA_PATH}/fonts")
install(DIRECTORY fonts/ DESTINATION ${MGL_FONT_PATH}
                        PATTERN ".svn" EXCLUDE
                        PATTERN "*.vfm")
endif(NOT WIN32)

add_subdirectory( mgl )
add_subdirectory( widgets )
add_subdirectory( utils )
add_subdirectory( examples )
add_subdirectory( include )
add_subdirectory( lang )
add_subdirectory( texinfo )