Windows: Reordered libraries with gtsam at the end (which is static on Windows)

This commit is contained in:
matlabbe
2018-03-28 11:04:18 -04:00
parent d886c788e7
commit 99acc9a6e7
2 changed files with 24 additions and 20 deletions

View File

@@ -238,25 +238,6 @@ IF(G2O_FOUND)
ENDIF(WITH_VERTIGO)
ENDIF(G2O_FOUND)
IF(GTSAM_FOUND)
IF(GTSAM_INCLUDE_DIR)
SET(INCLUDE_DIRS
${GTSAM_INCLUDE_DIR} # place it in front to use Eigen installed by GTSAM
${INCLUDE_DIRS}
)
ELSE()
SET(INCLUDE_DIRS
${GTSAM_INCLUDE_DIRS} # cmake standard
${INCLUDE_DIRS}
)
ENDIF()
add_definitions("-DGTSAM_IMPORT_STATIC")
SET(LIBRARIES
${LIBRARIES}
gtsam
)
ENDIF(GTSAM_FOUND)
IF(cvsba_FOUND)
SET(INCLUDE_DIRS
${INCLUDE_DIRS}
@@ -376,6 +357,29 @@ IF(ORB_SLAM2_FOUND)
)
ENDIF(ORB_SLAM2_FOUND)
IF(GTSAM_FOUND)
# Make sure GTSAM is built with system Eigen, not the included one in its package
IF(GTSAM_INCLUDE_DIR)
SET(INCLUDE_DIRS
${INCLUDE_DIRS}
${GTSAM_INCLUDE_DIR}
)
ELSE()
SET(INCLUDE_DIRS
${INCLUDE_DIRS}
${GTSAM_INCLUDE_DIRS}
)
ENDIF()
IF(WIN32)
# GTSAM should be built in STATIC on Windows to avoid "error C2338: THIS_METHOD_IS_ONLY_FOR_1x1_EXPRESSIONS" when building GTSAM
add_definitions("-DGTSAM_IMPORT_STATIC")
ENDIF(WIN32)
SET(LIBRARIES
${LIBRARIES}
gtsam # Windows: Place static libs at the end
)
ENDIF(GTSAM_FOUND)
####################################
# Generate resources files
####################################