From b103fea40c95c1c7df89591e2c122f0295739cf7 Mon Sep 17 00:00:00 2001 From: Lawrence Ibarria Date: Wed, 15 Feb 2023 07:42:52 -0800 Subject: [PATCH] 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 --- gtsam/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtsam/CMakeLists.txt b/gtsam/CMakeLists.txt index 916ec9af7..4e1f39762 100644 --- a/gtsam/CMakeLists.txt +++ b/gtsam/CMakeLists.txt @@ -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 (NOT GTSAM_SHARED_LIB) set_target_properties(gtsam PROPERTIES - PREFIX "lib" - COMPILE_DEFINITIONS GTSAM_IMPORT_STATIC) + PREFIX "lib") + target_compile_definitions(gtsam PRIVATE GTSAM_IMPORT_STATIC) else() set_target_properties(gtsam PROPERTIES PREFIX ""