Enable building shared libraries

This commit is contained in:
Kenneth Moreland 2016-09-06 12:59:44 -06:00
parent 17194ff3a6
commit 7e0ec48cab
4 changed files with 14 additions and 0 deletions

@ -63,6 +63,7 @@ else()
set_and_check(VTKm_CMAKE_MODULE_PATH "@VTKm_SOURCE_DIR@/CMake")
endif()
set(VTKm_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
set(VTKm_ENABLE_CUDA "@VTKm_ENABLE_CUDA@")
set(VTKm_ENABLE_TBB "@VTKm_ENABLE_TBB@")
set(VTKm_ENABLE_OPENGL_INTEROP "@VTKm_ENABLE_OPENGL_INTEROP@")

@ -627,6 +627,14 @@ function(vtkm_library)
target_compile_options(${lib_name} PRIVATE ${VTKm_COMPILE_OPTIONS})
# Make sure libraries go to lib directory and dll go to bin directory.
# Mostly important on Windows.
set_target_properties(${lib_name} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
)
if(MSVC)
vtkm_setup_msvc_properties(${lib_name})
endif()

@ -114,6 +114,9 @@ option(VTKm_USE_DOUBLE_PRECISION
)
option(VTKm_USE_64BIT_IDS "Use 64-bit indices." ON)
option(BUILD_SHARED_LIBS "Build VTK-m with shared libraries" ON)
set(VTKm_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
if (VTKm_ENABLE_TESTING)
enable_testing()
include(CTest)

@ -119,6 +119,8 @@
# endif
#endif
#cmakedefine VTKm_BUILD_SHARED_LIBS
// Define a pair of macros, VTKM_THIRDPARTY_PRE_INCLUDE and VTKM_THIRDPARTY_POST_INCLUDE,
// that should be wrapped around any #include for a boost or thrust header file. Mostly
// this is used to set pragmas that dissable warnings that VTK-m checks for