Small cleanups / fixes in handling of compile options

release/4.3a0
Richard Roberts 2012-07-13 21:55:00 +00:00
parent 4ae96c6642
commit 6c9608752e
3 changed files with 13 additions and 8 deletions

View File

@ -63,7 +63,7 @@ option(GTSAM_BUILD_WRAP "Enable/Disable building of matlab wrap
option(GTSAM_INSTALL_WRAP "Enable/Disable installation of wrap utility for wrapping other libraries" ON)
set(GTSAM_TOOLBOX_INSTALL_PATH "" CACHE DOCSTRING "Matlab toolbox destination, blank defaults to CMAKE_INSTALL_PREFIX/borg/toolbox")
set(GTSAM_BUILD_MEX_BINARY_FLAGS "" CACHE STRING "Extra flags for running Matlab MEX compilation")
set(MEX_COMMAND "mex" CACHE STRING "Command to use for executing mex (if on path, 'mex' will work)")
set(MEX_COMMAND "mex" CACHE FILEPATH "Command to use for executing mex (if on path, 'mex' will work)")
# Check / set dependent variables for MATLAB wrapper
set(GTSAM_WRAP_HEADER_PATH "${PROJECT_SOURCE_DIR}/wrap")
@ -109,7 +109,8 @@ endif()
if(CYGWIN OR MSVC OR WIN32)
set(Boost_USE_STATIC_LIBS 1)
endif()
find_package(Boost 1.43 COMPONENTS serialization REQUIRED)
find_package(Boost 1.43 COMPONENTS serialization system filesystem thread date_time REQUIRED)
set(GTSAM_BOOST_LIBRARIES ${Boost_SERIALIZATION_LIBRARY})
# General build settings
include_directories(

View File

@ -15,10 +15,12 @@ add_custom_target(check.unstable COMMAND ${CMAKE_CTEST_COMMAND} --output-on-fail
foreach(subdir ${gtsam_unstable_subdirs})
# Build convenience libraries
file(GLOB subdir_srcs "${subdir}/*.cpp")
set(${subdir}_srcs ${subdir_srcs})
file(GLOB subdir_headers "${subdir}/*.h")
set(${subdir}_srcs ${subdir_srcs} ${subdir_headers})
gtsam_assign_source_folders("${${subdir}_srcs}") # Create MSVC structure
if (subdir_srcs AND GTSAM_BUILD_CONVENIENCE_LIBRARIES)
message(STATUS "Building Convenience Library: ${subdir}_unstable")
add_library("${subdir}_unstable" STATIC ${subdir_srcs})
add_library("${subdir}_unstable" STATIC ${${subdir}_srcs})
endif()
# Build local library and tests
@ -36,7 +38,9 @@ set(gtsam_unstable_srcs
${slam_srcs}
)
option (GTSAM_UNSTABLE_BUILD_SHARED_LIBRARY "Enable/Disable building of a shared version of gtsam_unstable" ON)
if(NOT MSVC)
option (GTSAM_UNSTABLE_BUILD_SHARED_LIBRARY "Enable/Disable building of a shared version of gtsam_unstable" ON)
endif()
# Versions - same as core gtsam library
set(gtsam_unstable_version ${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH})

View File

@ -1,6 +1,6 @@
# Build/install Wrap
find_package(Boost 1.43 COMPONENTS system filesystem thread REQUIRED)
set(WRAP_BOOST_LIBRARIES ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY})
# Build the executable itself
file(GLOB wrap_srcs "*.cpp")
@ -9,7 +9,7 @@ list(REMOVE_ITEM wrap_srcs ${CMAKE_CURRENT_SOURCE_DIR}/wrap.cpp)
add_library(wrap_lib STATIC ${wrap_srcs} ${wrap_headers})
gtsam_assign_source_folders(${wrap_srcs} ${wrap_headers})
add_executable(wrap wrap.cpp)
target_link_libraries(wrap wrap_lib ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
target_link_libraries(wrap wrap_lib ${WRAP_BOOST_LIBRARIES})
# Install wrap binary and export target
if (GTSAM_INSTALL_WRAP)
@ -23,7 +23,7 @@ install(FILES matlab.h DESTINATION include/wrap)
# Build tests
if (GTSAM_BUILD_TESTS)
set(wrap_local_libs wrap_lib ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
set(wrap_local_libs wrap_lib ${WRAP_BOOST_LIBRARIES})
gtsam_add_subdir_tests("wrap" "${wrap_local_libs}" "${wrap_local_libs}" "")
endif(GTSAM_BUILD_TESTS)