static lib and examples compiles
parent
eb1e75fd27
commit
0f80f9bf41
|
@ -128,7 +128,7 @@ option(GTSAM_DISABLE_NEW_TIMERS "Disables using Boost.chrono for timing" OFF)
|
|||
# Allow for not using the timer libraries on boost < 1.48 (GTSAM timing code falls back to old timer library)
|
||||
set(GTSAM_BOOST_LIBRARIES
|
||||
${Boost_SERIALIZATION_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY} ${Boost_DATE_TIME_LIBRARY})
|
||||
${Boost_THREAD_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_REGEX_LIBRARY})
|
||||
if (GTSAM_DISABLE_NEW_TIMERS)
|
||||
message("WARNING: GTSAM timing instrumentation manually disabled")
|
||||
add_definitions(-DGTSAM_DISABLE_NEW_TIMERS)
|
||||
|
|
|
@ -26,21 +26,28 @@
|
|||
// class __declspec(dllexport) MyClass { ... };
|
||||
// When included while compiling other code against GTSAM:
|
||||
// class __declspec(dllimport) MyClass { ... };
|
||||
|
||||
#pragma once
|
||||
|
||||
// Whether GTSAM is compiled as static or DLL in windows.
|
||||
// This will be used to decide whether include __declspec(dllimport) or not in headers
|
||||
// TODO: replace GTSAM by @library_name@
|
||||
#cmakedefine GTSAM_BUILD_STATIC_LIBRARY
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifdef @library_name@_EXPORTS
|
||||
# define @library_name@_EXPORT __declspec(dllexport)
|
||||
# define @library_name@_EXTERN_EXPORT __declspec(dllexport) extern
|
||||
# else
|
||||
# ifndef @library_name@_IMPORT_STATIC
|
||||
# ifdef @library_name@_BUILD_STATIC_LIBRARY
|
||||
# define @library_name@_EXPORT
|
||||
# define @library_name@_EXTERN_EXPORT extern
|
||||
# else /* @library_name@_BUILD_STATIC_LIBRARY */
|
||||
# ifdef @library_name@_EXPORTS
|
||||
# define @library_name@_EXPORT __declspec(dllexport)
|
||||
# define @library_name@_EXTERN_EXPORT __declspec(dllexport) extern
|
||||
# else /* @library_name@_EXPORTS */
|
||||
# define @library_name@_EXPORT __declspec(dllimport)
|
||||
# define @library_name@_EXTERN_EXPORT __declspec(dllimport)
|
||||
# else /* @library_name@_IMPORT_STATIC */
|
||||
# define @library_name@_EXPORT
|
||||
# define @library_name@_EXTERN_EXPORT extern
|
||||
# endif /* @library_name@_IMPORT_STATIC */
|
||||
# endif /* @library_name@_EXPORTS */
|
||||
# endif /* @library_name@_EXPORTS */
|
||||
# endif /* @library_name@_BUILD_STATIC_LIBRARY */
|
||||
#else /* _WIN32 */
|
||||
# define @library_name@_EXPORT
|
||||
# define @library_name@_EXTERN_EXPORT extern
|
||||
#endif
|
||||
|
||||
|
|
|
@ -110,8 +110,8 @@ if (GTSAM_BUILD_STATIC_LIBRARY)
|
|||
SOVERSION ${gtsam_soversion})
|
||||
if(WIN32) # Add 'lib' prefix to static library to avoid filename collision with shared library
|
||||
set_target_properties(gtsam PROPERTIES
|
||||
PREFIX "lib"
|
||||
COMPILE_DEFINITIONS GTSAM_IMPORT_STATIC)
|
||||
PREFIX "lib")
|
||||
#COMPILE_DEFINITIONS GTSAM_IMPORT_STATIC)
|
||||
endif()
|
||||
install(TARGETS gtsam EXPORT GTSAM-exports ARCHIVE DESTINATION lib)
|
||||
list(APPEND GTSAM_EXPORTED_TARGETS gtsam)
|
||||
|
|
Loading…
Reference in New Issue