mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Merge topic 'external-lib-lists'
73cb38d86 Output complete list of libraries for external Makefiles d87316fbf Create a list of all modules being built Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Nicole Marsaglia <marsaglia1@llnl.gov> Merge-request: !2901
This commit is contained in:
commit
972a96b6c6
@ -50,6 +50,19 @@ function(vtkm_module_exists out_var module_name)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#[==[
|
||||
Sets out_var to a list of all modules that are being built. This list includes
|
||||
all modules that are enabled and have an associated target. Any modules not being
|
||||
built will not be listed.
|
||||
|
||||
The modules are listed in an order such that any module will be listed _after_
|
||||
any modules that it depends on.
|
||||
#]==]
|
||||
function(vtkm_module_get_list out_var)
|
||||
get_property(_vtkm_module_list GLOBAL PROPERTY "_vtkm_module_list")
|
||||
set("${out_var}" "${_vtkm_module_list}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#[==[
|
||||
Forces the enable value of a module group to be a particular value. This is
|
||||
useful for converting a CMake `option` to a group of modules to turn on or
|
||||
@ -541,6 +554,9 @@ so that other modules know this module is loaded.")
|
||||
endif()
|
||||
add_library(${target_module} INTERFACE)
|
||||
endif()
|
||||
get_property(_vtkm_module_list GLOBAL PROPERTY "_vtkm_module_list")
|
||||
list(APPEND _vtkm_module_list ${target_module})
|
||||
set_property(GLOBAL PROPERTY "_vtkm_module_list" "${_vtkm_module_list}")
|
||||
endfunction()
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
@ -330,6 +330,33 @@ write_basic_package_version_file(
|
||||
VERSION ${VTKm_VERSION}
|
||||
COMPATIBILITY ExactVersion )
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Create makefile/package files for projects not using CMake
|
||||
|
||||
set(lib_args)
|
||||
vtkm_module_get_list(module_list)
|
||||
list(REVERSE module_list)
|
||||
foreach(module IN LISTS module_list)
|
||||
get_target_property(type ${module} TYPE)
|
||||
if (NOT type MATCHES "LIBRARY" OR type STREQUAL "INTERFACE_LIBRARY")
|
||||
continue()
|
||||
endif()
|
||||
get_target_property(library ${module} OUTPUT_NAME)
|
||||
if (NOT library)
|
||||
continue()
|
||||
endif()
|
||||
set(lib_args "${lib_args} \\
|
||||
-l${library}")
|
||||
endforeach()
|
||||
if (TARGET vtkmdiympi)
|
||||
set(lib_args "${lib_args} \\
|
||||
-lvtkmdiympi")
|
||||
endif()
|
||||
if (TARGET vtkmdiympi_nompi)
|
||||
set(lib_args "${lib_args} \\
|
||||
-lvtkmdiympi_nompi")
|
||||
endif()
|
||||
|
||||
configure_file(${VTKm_SOURCE_DIR}/config/vtkm_config.mk.in
|
||||
${VTKm_BINARY_DIR}/config/vtkm_config.mk @ONLY)
|
||||
install(FILES ${VTKm_BINARY_DIR}/config/vtkm_config.mk
|
||||
|
@ -18,14 +18,4 @@ Name: VTKm
|
||||
Description: The VTKm library
|
||||
Version: @VTKm_VERSION@
|
||||
Cflags: -I${includedir}/vtkm-@CMAKE_INSTALL_PREFIX@
|
||||
Libs: -L${libdir} \
|
||||
-lvtkm_rendering-@VTKm_VERSION@ \
|
||||
-lvtkm_filter_contour-@VTKm_VERSION@ \
|
||||
-lvtkm_filter_gradient-@VTKm_VERSION@ \
|
||||
-lvtkm_filter_extra-@VTKm_VERSION@ \
|
||||
-lvtkm_filter_common-@VTKm_VERSION@ \
|
||||
-lvtkm_worklet-@VTKm_VERSION@ \
|
||||
-lvtkm_source-@VTKm_VERSION@ \
|
||||
-lvtkm_io-@VTKm_VERSION@ \
|
||||
-lvtkm_cont-@VTKm_VERSION@ \
|
||||
-lvtkmdiympi_nompi
|
||||
Libs: -L${libdir}@lib_args@
|
||||
|
@ -25,14 +25,4 @@ VTKm_ENABLE_EGL_CONTEXT = @VTKm_ENABLE_EGL_CONTEXT@
|
||||
VTKm_ENABLE_MPI = @VTKm_ENABLE_MPI@
|
||||
|
||||
VTKm_INCLUDE_FLAGS = -I $(VTKm_DIR)/include
|
||||
VTKm_LIB_FLAGS = -L $(VTKm_DIR)/lib \
|
||||
-lvtkm_rendering-$(VTKM_VERSION) \
|
||||
-lvtkm_filter_contour-$(VTKM_VERSION) \
|
||||
-lvtkm_filter_gradient-$(VTKM_VERSION) \
|
||||
-lvtkm_filter_extra-$(VTKM_VERSION) \
|
||||
-lvtkm_filter_common-$(VTKM_VERSION) \
|
||||
-lvtkm_worklet-$(VTKM_VERSION) \
|
||||
-lvtkm_source-$(VTKM_VERSION) \
|
||||
-lvtkm_io-$(VTKM_VERSION) \
|
||||
-lvtkm_cont-$(VTKM_VERSION) \
|
||||
-lvtkmdiympi_nompi
|
||||
VTKm_LIB_FLAGS = -L $(VTKm_DIR)/lib@lib_args@
|
||||
|
11
docs/changelog/external-lib-lists.md
Normal file
11
docs/changelog/external-lib-lists.md
Normal file
@ -0,0 +1,11 @@
|
||||
# Output complete list of libraries for external Makefiles
|
||||
|
||||
There is a Makefile include, `vtkm_config.mk`, and a package include,
|
||||
`vtkm.pc`, that are configured so that external programs that do not use
|
||||
CMake have a way of importing VTK-m's configuration. However, the set of
|
||||
libraries was hardcoded. In particular, many of the new filter libraries
|
||||
were missing.
|
||||
|
||||
Rather than try to maintain this list manually, the new module mechanism
|
||||
in the CMake configuration is used to get a list of libraries built and
|
||||
automatically build these lists.
|
Loading…
Reference in New Issue
Block a user