From e029204c01f714d9cfbe25e78da65d66138d35a8 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Wed, 19 Feb 2014 13:10:37 -0500 Subject: [PATCH] Added cmake code to install cmake tools, and a GTSAM-CMakeToolsConfig file to automatically find them. --- CMakeLists.txt | 3 +++ cmake/CMakeLists.txt | 26 ++++++++++++++++++++++++++ cmake/GTSAM-CMakeToolsConfig.cmake | 3 +++ 3 files changed, 32 insertions(+) create mode 100644 cmake/CMakeLists.txt create mode 100644 cmake/GTSAM-CMakeToolsConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index cf5a1a962..c6f5852b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,6 +321,9 @@ if (DOXYGEN_FOUND) add_subdirectory(doc) endif() +# CMake Tools +add_subdirectory(cmake) + ############################################################################### # Set up CPack diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt new file mode 100644 index 000000000..d201fc1d7 --- /dev/null +++ b/cmake/CMakeLists.txt @@ -0,0 +1,26 @@ +# This file installs the scripts from this directory that may be used in other +# projects. See README.txt in this directory for documentation. + +# Set the install directory depending on the platform so it will be found by +# find_package(GTSAM-CMakeTools) +if(WIN32 AND NOT CYGWIN) + set(SCRIPT_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/CMake") +else() + set(SCRIPT_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/cmake") +endif() + +# Install scripts +install(FILES + GTSAM-CMakeToolsConfig.cmake + Config.cmake.in + dllexport.h.in + GtsamBuildTypes.cmake + GtsamMakeConfigFile.cmake + GtsamMatlabWrap.cmake + GtsamPrinting.cmake + GtsamPythonWrap.cmake + GtsamTesting.cmake + GtsamTestingObsolete.cmake + DESTINATION "${SCRIPT_INSTALL_DIR}/GTSAM-CMakeTools") + + diff --git a/cmake/GTSAM-CMakeToolsConfig.cmake b/cmake/GTSAM-CMakeToolsConfig.cmake new file mode 100644 index 000000000..c79a2f5c2 --- /dev/null +++ b/cmake/GTSAM-CMakeToolsConfig.cmake @@ -0,0 +1,3 @@ +# This config file modifies CMAKE_MODULE_PATH so that the GTSAM-CMakeTools files may be included + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")