CMakeLists.txt 1.03 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
project(vtknetcdfcpp CXX)

vtk_add_library(vtknetcdfcpp
  cxx/netcdf.cpp
  cxx/ncvalues.cpp)
set_target_properties(vtknetcdfcpp
  PROPERTIES
    VERSION     4.2.0
    OUTPUT_NAME vtknetcdf_c++)
vtk_module_load(vtknetcdf)
target_link_libraries(vtknetcdfcpp
  PUBLIC
    ${vtknetcdf_LIBRARIES})

Ben Boeckel's avatar
Ben Boeckel committed
15
16
17
18
19
20
21
include(GenerateExportHeader)
generate_export_header(vtknetcdfcpp
  EXPORT_MACRO_NAME VTKNETCDFCPP_EXPORT)
target_include_directories(vtknetcdfcpp
  PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

22
23
set(headers
  cxx/ncvalues.h
Ben Boeckel's avatar
Ben Boeckel committed
24
25
  cxx/netcdfcpp.h
  cxx/vtk_netcdfcpp_mangle.h)
26
27
28
29
30
31
32
33
34

foreach (header IN LISTS headers)
  get_filename_component(header_name "${header}" NAME)
  configure_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/${header}"
    "${CMAKE_CURRENT_BINARY_DIR}/${header_name}"
    COPYONLY)
endforeach ()

Ben Boeckel's avatar
Ben Boeckel committed
35
36
37
list(APPEND headers
  "${CMAKE_CURRENT_BINARY_DIR}/vtknetcdfcpp_export.h")

38
39
40
if (NOT VTK_INSTALL_NO_DEVELOPMENT)
  install(
    FILES       ${headers}
41
    DESTINATION "${VTK_INSTALL_INCLUDE_DIR}/vtknetcdfcpp"
42
43
    COMPONENT   Development)
endif ()