96ccdfd0b Merge pull request #65 from borglab/fix/special-cases 04c06b7e6 Merge pull request #63 from borglab/fix/cmake bf2c91bd2 fix issue in template instantiation generator 152dbcb12 test for special cases d03004b24 fixed the cmake to discover the correct python version and set all corresponding variables 4cf66e0da Merge pull request #61 from borglab/fix/python-variables 80558e35b added more status messages and set the PYBIND11_PYTHON_VERSION each time 73afd1b0a set both sets of Python variables and find python version when including PybindWrap REVERT: 9a467794e Merge pull request #61 from borglab/fix/python-variables REVERT: 6bae7af99 added more status messages and set the PYBIND11_PYTHON_VERSION each time REVERT: 5129cf3b9 set both sets of Python variables and find python version when including PybindWrap git-subtree-dir: wrap git-subtree-split: 96ccdfd0b84a4dbf1b3e9ed31b95ebc2758be9cc |
||
|---|---|---|
| .. | ||
| example_cmake_find_gtsam | ||
| obsolete | ||
| CMakeLists.txt | ||
| Config.cmake.in | ||
| FindBoost.cmake | ||
| FindEigen3.cmake | ||
| FindGooglePerfTools.cmake | ||
| FindMKL.cmake | ||
| FindNumPy.cmake | ||
| FindTBB.cmake | ||
| GTSAMCMakeToolsConfig.cmake | ||
| GtsamAddPch.cmake | ||
| GtsamBuildTypes.cmake | ||
| GtsamMakeConfigFile.cmake | ||
| GtsamPrinting.cmake | ||
| GtsamTesting.cmake | ||
| HandleAllocators.cmake | ||
| HandleBoost.cmake | ||
| HandleCCache.cmake | ||
| HandleCPack.cmake | ||
| HandleEigen.cmake | ||
| HandleFinalChecks.cmake | ||
| HandleGeneralOptions.cmake | ||
| HandleGlobalBuildFlags.cmake | ||
| HandleMKL.cmake | ||
| HandleOpenMP.cmake | ||
| HandlePerfTools.cmake | ||
| HandlePrintConfiguration.cmake | ||
| HandlePython.cmake | ||
| HandleTBB.cmake | ||
| HandleUninstall.cmake | ||
| README.html | ||
| README.md | ||
| cmake_uninstall.cmake.in | ||
| dllexport.h.in | ||
README.md
GTSAMCMakeTools
This is the collection of GTSAM CMake tools that may be useful in external projects. The way to use this collection is by first making a find_package call:
find_package(GTSAMCMakeTools)
which will add a directory containing the GTSAM CMake tools to the CMAKE_MODULE_PATH variable. After that, you may include the files you would like to use. These files and the functions they define are explained below.
GtsamBuildTypes
include(GtsamBuildTypes)
Including this file immediately sets up the following build types and a drop-down list in cmake-gui:
DebugReleaseRelWithDebInfoProfiling: All optimizations enabled and minimal debug symbolsTiming: Defines the symbol GTSAM_ENABLE_TIMING for using GTSAM timing instrumentation
It also configures several minor details, as follows:
- The compile flag
-ftemplate-depth=1024is set for newer versions of Clang to handle complex templates. - On Windows, executable and dll output paths are set to
${CMAKE_BINARY_DIR}/binand import library output to${CMAKE_BINARY_DIR}/lib.
It defines the following functions:
gtsam_assign_source_folders( [files] )Organizes files in the IDE into folders to reflect the actual directory structure of those files. Folders will be determined relative to the current source folder when this function is called.gtsam_assign_all_source_folders()Callsgtsam_assign_source_folderson all cpp, c, and h files recursively in the current source folder.
GtsamTesting
include(GtsamTesting)
Defines two useful functions for creating CTest unit tests. Also immediately creates a check target that builds and runs all unit tests.
-
gtsamAddTestsGlob(groupName globPatterns excludedFiles linkLibraries)Add a group of unit tests. A list of unit test .cpp files or glob patterns specifies the tests to create. Tests are assigned into a group name so they can easily by run independently with a make target. Running 'make check' builds and runs all tests.Usage example:
gtsamAddTestsGlob(basic "test*.cpp" "testBroken.cpp" "gtsam;GeographicLib")Arguments:
groupName: A name that will allow this group of tests to be run independently, e.g. 'basic' causes a 'check.basic' target to be created to run this test group. globPatterns: The list of files or glob patterns from which to create unit tests, with one test created for each cpp file. e.g. "test*.cpp", or "testA*.cpp;testB*.cpp;testOneThing.cpp". excludedFiles: A list of files or globs to exclude, e.g. "testC*.cpp;testBroken.cpp". Pass an empty string "" if nothing needs to be excluded. linkLibraries: The list of libraries to link to in addition to CppUnitLite. -
gtsamAddExamplesGlob(globPatterns excludedFiles linkLibraries)Add scripts that will serve as examples of how to use the library. A list of files or glob patterns is specified, and one executable will be created for each matching .cpp file. These executables will not be installed. They are build with 'make all' if GTSAM_BUILD_EXAMPLES_ALWAYS is enabled. They may also be built with 'make examples'.Usage example:
gtsamAddExamplesGlob("*.cpp" "BrokenExample.cpp" "gtsam;GeographicLib")Arguments:
globPatterns: The list of files or glob patterns from which to create unit tests, with one test created for each cpp file. e.g. "*.cpp", or "A*.cpp;B*.cpp;MyExample.cpp". excludedFiles: A list of files or globs to exclude, e.g. "C*.cpp;BrokenExample.cpp". Pass an empty string "" if nothing needs to be excluded. linkLibraries: The list of libraries to link to.
GtsamMakeConfigFile
include(GtsamMakeConfigFile)
Defines a function for generating a config file so your project may be found with the CMake find_package function. TODO: Write documentation.