CMake module for Mathematica.
CMake Mathematica Other
Latest commit a52edaf Aug 17, 2016 @sakra doc updates
Permalink
Failed to load latest commit information.
CMake/Mathematica add 11.0 to list of supported versions Aug 17, 2016
CodeGenerationExamples fix rpath handling for OS X and Linux Aug 17, 2016
DocumentationExamples add timestamp check for HTML docu generation Oct 10, 2015
JLinkExamples
LibraryLinkExamples
MUnitExamples FindMathematica 3.0 Aug 19, 2014
MathLinkExamples apply LINK_FLAGS Mar 20, 2016
MathematicaExamples
WSTPExamples apply LINK_FLAGS Mar 20, 2016
.gitattributes FindMathematica 2.2.0 Sep 22, 2012
.gitignore FindMathematica 2.0.9 Aug 17, 2012
CMakeLists.txt FindMathematica 3.1.2 Jul 25, 2015
HISTORY.md doc updates Aug 17, 2016
LICENSE FindMathematica 3.0.3 Feb 11, 2015
MANUAL.md docu updates Mar 20, 2016
README.md doc updates Aug 17, 2016

README.md

FindMathematica

FindMathematica is a CMake module that tries to find a Mathematica installation and provides CMake functions for Mathematica's C/C++ interface.

Features

  • Works with Windows, Linux and OS X versions of Mathematica.
  • Finds Mathematica versions from 5.2 to 11.0.
  • Finds include directories and libraries for LibraryLink (Mathematica 8 to 11).
  • Finds include directories and libraries for WSTP (Mathematica 10 to 11).
  • Finds installation directory and JAR file of J/Link.
  • Finds include directories and libraries for MathLink (obsolete as of Mathematica 10).
  • Finds installation directory of Wolfram MUnit testing package.
  • Provides exact version info for Mathematica, LibraryLink, WSTP, MathLink, J/Link and MUnit.
  • Allows for running Mathematica code during CMake configure or build time.
  • Allows for running Mathematica code as a pre-link, pre-build or post-build action.
  • Allows for running Mathematica code in CMake test targets.
  • Allows for running Mathematica MUnit test files and suites as CMake test targets.
  • Supports generating C code from WSTP template files using wsprp executable.
  • Supports generating C code from MathLink template files using mprep executable.
  • Supports building dynamic libraries loadable with LibraryLink (Mathematica 8 to 11).
  • Supports generating stand-alone C code from Mathematica code with CCodeGenerator (Mathematica 8 to 11).
  • Provides CMake interface to Mathematica's Encode function.
  • Supports generating Mathematica documentation with the DocumentationBuild package.
  • Fully leverages CMake's cross-compiling support.

Requirements

Installation

Copy the directory CMake/Mathematica to the root directory of your CMake project. In the top-level CMakeList.txt file, add the module directory to the CMake module search path:

set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/Mathematica" ${CMAKE_MODULE_PATH})

Usage

To find the newest Mathematica installation in a CMake listfile, run the find_package command:

find_package(Mathematica)

See the FindMathematica manual for more information.