cmake codegen and install now works

release/4.3a0
Alex Cunningham 2012-01-31 19:59:16 +00:00
parent c43a9b4852
commit 2f44444efe
2 changed files with 12 additions and 5 deletions

View File

@ -6,6 +6,9 @@ set (GTSAM_VERSION_MAJOR 0)
set (GTSAM_VERSION_MINOR 9) set (GTSAM_VERSION_MINOR 9)
set (GTSAM_VERSION_PATCH 3) set (GTSAM_VERSION_PATCH 3)
# Set the default install path to home
set (CMAKE_INSTALL_PREFIX ${HOME} CACHE DOCSTRING "Install prefix for library")
# guard against in-source builds # guard against in-source builds
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt. ") message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt. ")
@ -38,7 +41,8 @@ option(GTSAM_BUILD_EXAMPLES "Enable/Disable building of examples" ON)
option(GTSAM_BUILD_WRAP "Enable/Disable building of matlab wrap utility (necessary for matlab interface)" ON) option(GTSAM_BUILD_WRAP "Enable/Disable building of matlab wrap utility (necessary for matlab interface)" ON)
# Avoid building non-installed exes and unit tests when installing # Avoid building non-installed exes and unit tests when installing
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE) # FIXME: breaks generation and install of matlab toolbox
#set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
# Pull in tests # Pull in tests
enable_testing() enable_testing()

View File

@ -92,7 +92,7 @@ message(STATUS "Detected Matlab mex extension: ${mex_bin_extension_default}")
message(STATUS "Current Matlab mex extension: ${mex_bin_extension}") message(STATUS "Current Matlab mex extension: ${mex_bin_extension}")
# Actual build commands - separated by OS # Actual build commands - separated by OS
add_custom_target(wrap_gtsam COMMAND add_custom_target(wrap_gtsam ALL COMMAND
./wrap ${mex_bin_extension} ${CMAKE_SOURCE_DIR} ${moduleName} ${toolbox_path} "${mexFlags}") ./wrap ${mex_bin_extension} ${CMAKE_SOURCE_DIR} ${moduleName} ${toolbox_path} "${mexFlags}")
option(GTSAM_INSTALL_MATLAB_TOOLBOX "Enable/Disable installation of matlab toolbox" ON) option(GTSAM_INSTALL_MATLAB_TOOLBOX "Enable/Disable installation of matlab toolbox" ON)
@ -104,9 +104,12 @@ set(toolbox_install_path ${CMAKE_INSTALL_PREFIX}/borg/toolbox CACHE DOCSTRING "P
if (GTSAM_INSTALL_MATLAB_TOOLBOX) if (GTSAM_INSTALL_MATLAB_TOOLBOX)
# Primary toolbox files # Primary toolbox files
message(STATUS "Installing Matlab Toolbox to ${toolbox_install_path}") message(STATUS "Installing Matlab Toolbox to ${toolbox_install_path}")
install(DIRECTORY ${toolbox_path} DESTINATION ${toolbox_install_path} FILES_MATCHING PATTERN "*.m") install(DIRECTORY DESTINATION ${toolbox_install_path})
install(DIRECTORY ${toolbox_path} DESTINATION ${toolbox_install_path} FILES_MATCHING PATTERN "*.cpp") install(DIRECTORY ${toolbox_path} DESTINATION ${toolbox_install_path})
install(DIRECTORY ${toolbox_path} DESTINATION ${toolbox_install_path} FILES_MATCHING PATTERN "Makefile")
#install(DIRECTORY ${toolbox_path} DESTINATION ${toolbox_install_path} FILES_MATCHING PATTERN "*.m")
#install(DIRECTORY ${toolbox_path} DESTINATION ${toolbox_install_path} FILES_MATCHING PATTERN "*.cpp")
#install(DIRECTORY ${toolbox_path} DESTINATION ${toolbox_install_path} FILES_MATCHING PATTERN "Makefile")
# Examples # Examples
if (GTSAM_INSTALL_MATLAB_EXAMPLES) if (GTSAM_INSTALL_MATLAB_EXAMPLES)