ParaViewCommandLineExecutables.cmake
Go to the documentation of this file.
2  # Set up rpaths
3  set(CMAKE_BUILD_RPATH_USE_ORIGIN 1)
4  if (UNIX AND NOT APPLE)
5  file(RELATIVE_PATH _paraview_client_relpath
6  "/prefix/${CMAKE_INSTALL_BINDIR}"
7  "/prefix/${CMAKE_INSTALL_LIBDIR}")
8  set(_paraview_client_origin_rpath
9  "$ORIGIN/${_paraview_client_relpath}")
10 
11  list(APPEND CMAKE_INSTALL_RPATH
12  "${_paraview_client_origin_rpath}")
13  endif()
14 
15  add_executable("${name}")
16  target_sources("${name}"
17  PRIVATE
18  ${ARGN})
19  # Add a dummy file set to optimize dependencies. See CMP0154.
20  _vtk_module_add_file_set("${name}"
21  BASE_DIRS "${CMAKE_CURRENT_BINARY_DIR}"
22  NAME dummy)
23  add_executable("ParaView::${name}" ALIAS "${name}")
24 
25  target_link_libraries("${name}"
26  PRIVATE
27  ParaView::RemotingApplication)
28 
29  target_link_libraries("${name}"
30  PRIVATE
31  ParaView::paraview_plugins)
32  target_compile_definitions("${name}"
33  PRIVATE
34  "PARAVIEW_USE_EXTERNAL_VTK=$<BOOL:${PARAVIEW_USE_EXTERNAL_VTK}>"
35  "PARAVIEW_USE_PYTHON=$<BOOL:${PARAVIEW_USE_PYTHON}>")
36  if (PARAVIEW_USE_PYTHON)
37  target_link_libraries("${name}"
38  PRIVATE
39  VTK::PythonInterpreter
40  ParaView::PythonInitializer
41  ParaView::PythonInterpreterPath)
42  endif ()
43 
44  if (paraview_exe_job_link_pool)
45  set_property(TARGET "${name}"
46  PROPERTY
47  JOB_POOL_LINK "${paraview_exe_job_link_pool}")
48  endif ()
49 
50  install(
51  TARGETS "${name}"
52  DESTINATION "${CMAKE_INSTALL_BINDIR}"
53  COMPONENT runtime
54  EXPORT ParaViewTools)
55 endfunction ()
function paraview_add_executable(name)
name
#define PARAVIEW_USE_EXTERNAL_VTK
Definition: moc_predefs.h:103
#define PARAVIEW_USE_PYTHON
Definition: moc_predefs.h:262