Go to the documentation of this file.00001 ##############################################################################
00002 # @file FindMOSEK.cmake
00003 # @brief Find MOSEK (http://www.mosek.com) package.
00004 #
00005 # @par Input variables:
00006 # <table border="0">
00007 # <tr>
00008 # @tp @b MOSEK_DIR @endtp
00009 # <td>The MOSEK package files are searched under the specified root
00010 # directory. If they are not found there, the default search paths
00011 # are considered. This variable can also be set as environment variable.</td>
00012 # </tr>
00013 # <tr>
00014 # @tp @b MOSEK_NO_OMP @endtp
00015 # <td>Whether to use the link libraries build without OpenMP, i.e.,
00016 # multi-threading, enabled. By default, the multi-threaded libraries
00017 # are used.</td>
00018 # </tr>
00019 # <tr>
00020 # @tp @b MOSEK_MATLAB @endtp
00021 # <td>Whether the MATLAB components of the MOSEK packages should be found.
00022 # Defaults to 1, if @c MATLAB_FOUND evaluates to true and 0 otherwise.</td>
00023 # </tr>
00024 # <tr>
00025 # @tp @b MOSEK_JAVA @endtp
00026 # <td>Whether the Java components of the MOSEK package should be found.
00027 # Defaults to 0.</td>
00028 # </tr>
00029 # <tr>
00030 # @tp @b MOSEK_PYTHON @endtp
00031 # <td>Whether the Python components of the MOSEK package should be found.
00032 # Defaults to 0.</td>
00033 # </tr>
00034 # <tr>
00035 # @tp @b MOSEK_TOOLS_SUFFIX @endtp
00036 # <td>Platform specific path suffix for tools, i.e., "tools/platform/linux64x86"
00037 # on 64-bit Linux systems. If not specified, this module determines the
00038 # right suffix depending on the CMake system variables.</td>
00039 # </tr>
00040 # <tr>
00041 # @tp @b MATLAB_RELEASE @endtp
00042 # <td>Release of MATLAB installation. Set to the 'Release' return value of
00043 # the "ver ('MATLAB')" command of MATLAB without brackets. If this
00044 # variable is not set and the basis_get_matlab_release() command is
00045 # available, it is invoked to determine the release version automatically.
00046 # Otherwise, the release version defaults to "R2009b".</td>
00047 # </tr>
00048 # <tr>
00049 # @tp @b MEX_EXT @endtp
00050 # <td>The extension of MEX-files. If this variable is not set and the
00051 # basis_mexext() command is available, it is invoked to determine the
00052 # extension automatically. Otherwise, the MEX extension defaults to "mexa64".</td>
00053 # </tr>
00054 # <tr>
00055 # @tp @b PYTHON_VERSION @endtp
00056 # <td>Version of Python installation. Set to first two or three return values of
00057 # "sys.version_info" separated by a period (.). If this variable is not set
00058 # and the basis_get_python_version() command is available, it is invoked to
00059 # determine the version automatically. Otherwise, the Python version
00060 # defaults to 2.6.</td>
00061 # </tr>
00062 # </table>
00063 #
00064 # @par Output variables:
00065 # <table border="0">
00066 # <tr>
00067 # @tp @b MOSEK_FOUND @endtp
00068 # <td>Whether the package was found and the following CMake variables are valid.</td>
00069 # </tr>
00070 # <tr>
00071 # @tp @b MOSEK_INCLUDE_DIR @endtp
00072 # <td>Package include directories.</td>
00073 # </tr>
00074 # <tr>
00075 # @tp @b MOSEK_INCLUDES @endtp
00076 # <td>Include directories including prerequisite libraries (non-cached).</td>
00077 # </tr>
00078 # <tr>
00079 # @tp @b MOSEK_LIBRARY @endtp
00080 # <td>Package libraries.</td>
00081 # </tr>
00082 # <tr>
00083 # @tp @b MOSEK_LIBRARIES @endtp
00084 # <td>Package libraries and prerequisite libraries (non-cached).</td>
00085 # </tr>
00086 # <tr>
00087 # @tp @b MOSEK_mosekopt_MEX @endtp
00088 # <td>Package mosekopt MEX-file.</td>
00089 # </tr>
00090 # <tr>
00091 # @tp @b MOSEK_MEX_FILES @endtp
00092 # <td>List of MEX-files (non-cached).</td>
00093 # </tr>
00094 # <tr>
00095 # @tp @b MOSEK_mosek_JAR @endtp
00096 # <td>Package mosek Java library (.jar file).</td>
00097 # </tr>
00098 # <tr>
00099 # @tp @b MOSEK_CLASSPATH @endtp
00100 # <td>List of Java package libraries and prerequisite libraries (non-cached).</td>
00101 # </tr>
00102 # <tr>
00103 # @tp @b MOSEK_PYTHONPATH @endtp
00104 # <td>Path to Python modules of this package.</td>
00105 # </tr>
00106 # </table>
00107 #
00108 # Copyright (c) 2011, 2012 University of Pennsylvania. All rights reserved.<br />
00109 # See https://www.cbica.upenn.edu/sbia/software/license.html or COPYING file.
00110 #
00111 # Contact: SBIA Group <sbia-software at uphs.upenn.edu>
00112 #
00113 # @ingroup CMakeFindModules
00114 ##############################################################################
00115
00116 # ----------------------------------------------------------------------------
00117 # initialize search
00118 if (NOT MOSEK_DIR)
00119 set (MOSEK_DIR "$ENV{MOSEK_DIR}" CACHE PATH "Installation prefix for MOSEK." FORCE)
00120 endif ()
00121
00122 # MATLAB components
00123 if (NOT DEFINED MOSEK_MATLAB)
00124 set (MOSEK_MATLAB ${MATLAB_FOUND})
00125 endif ()
00126
00127 if (MOSEK_MATLAB)
00128 # MATLAB version
00129 if (NOT MATLAB_RELEASE)
00130 if (COMMAND basis_get_matlab_release)
00131 basis_get_matlab_release ()
00132 if (NOT MATLAB_RELEASE)
00133 message (FATAL_ERROR "Failed to determine release version of MATLAB installation. "
00134 "This information is required to be able to find the right MOSEK MEX-files. "
00135 "Set MATLAB_RELEASE manually and try again.")
00136 endif ()
00137 else ()
00138 set (MATLAB_RELEASE "R2009b")
00139 endif ()
00140 endif ()
00141 string (TOLOWER "${MATLAB_RELEASE}" MATLAB_RELEASE_LOWER)
00142 # search path for MOSEK MATLAB toolbox
00143 if (NOT MOSEK_TOOLBOX_SUFFIX)
00144 if (MOSEK_DIR)
00145 file (
00146 GLOB_RECURSE
00147 MOSEK_TOOLBOX_SUFFIXES
00148 RELATIVE "${MOSEK_DIR}"
00149 "${MOSEK_DIR}/toolbox
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428