Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
CMake module for Mathematica.
Failed to load latest commit information.
CMake/Mathematica FindMathematica 3.0.3
CodeGenerationExamples FindMathematica 3.0
DocumentationExamples FindMathematica 2.0
LibraryLinkExamples FindMathematica 3.0.1
MathLinkExamples FindMathematica 3.0.1
MathematicaExamples FindMathematica 3.0
WSTPExamples FindMathematica 3.0.1
.gitattributes FindMathematica 2.2.0
.gitignore FindMathematica 2.0.9
CMakeLists.txt FindMathematica 3.0.1
LICENSE FindMathematica 3.0.3 FindMathematica 3.0.1 Documentation fixes


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


  • Works with Windows, Linux and OS X versions of Mathematica.
  • Finds Mathematica versions from 5.2 to 10.0.
  • Finds include directories and libraries for LibraryLink (Mathematica 8 to 10).
  • Finds include directories and libraries for WSTP (Mathematica 10).
  • 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 10).
  • Supports generating stand-alone C code from Mathematica code with CCodeGenerator (Mathematica 8 to 10).
  • Provides CMake interface to Mathematica's Splice function.
  • Provides CMake interface to Mathematica's Encode function.
  • Supports generating Mathematica documentation with the DocumentationBuild package.
  • Fully leverages CMake's cross-compiling support.


  • A Wolfram Mathematica product (Mathematica 5.2 to 10.0, gridMathematica 7.0 to 10.0 or Wolfram Finance Platform).
  • CMake 2.8.9 or newer. The executable cmake should be on the system path.
  • Visual Studio C++, MinGW or Cygwin under Windows.
  • GCC (including g++) under Linux.
  • Xcode developer tools package under OS X.


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:



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


See the FindMathematica manual for more information.

Something went wrong with that request. Please try again.