Fix cmake issue with msvc

The cmake call to set_properties is fully overriding a property,
in this case the COMPILE_DEFINITIONS and we were losing an eigen
definition needed. The correct way to do this is to use the cmake
function target_compile_definitions
release/4.3a0
Lawrence Ibarria 2023-02-15 07:42:52 -08:00
parent 5851656544
commit b103fea40c
1 changed files with 2 additions and 2 deletions

View File

@ -177,8 +177,8 @@ target_include_directories(gtsam SYSTEM BEFORE PUBLIC
if(WIN32) # Add 'lib' prefix to static library to avoid filename collision with shared library if(WIN32) # Add 'lib' prefix to static library to avoid filename collision with shared library
if (NOT GTSAM_SHARED_LIB) if (NOT GTSAM_SHARED_LIB)
set_target_properties(gtsam PROPERTIES set_target_properties(gtsam PROPERTIES
PREFIX "lib" PREFIX "lib")
COMPILE_DEFINITIONS GTSAM_IMPORT_STATIC) target_compile_definitions(gtsam PRIVATE GTSAM_IMPORT_STATIC)
else() else()
set_target_properties(gtsam PROPERTIES set_target_properties(gtsam PROPERTIES
PREFIX "" PREFIX ""