cgns.cmake 1.06 KB
Newer Older
1
add_external_project(
2 3
  cgns
  DEPENDS zlib hdf5
4

5 6 7 8 9
  PATCH_COMMAND
    # this patch fixes following issues:
    # 1. incorrect target links when HDF5 support is enabeld
    # 2. incorrect install rules on windows (and cleans up install rules on other
    #    platforms too).
10
    ${CMAKE_COMMAND} -E copy_if_different ${SuperBuild_PROJECTS_DIR}/patches/cgns.src.CMakeLists.txt
11
	                                        <SOURCE_DIR>/src/CMakeLists.txt
12 13 14
  CMAKE_ARGS
  -DCGNS_BUILD_SHARED:BOOL=ON
  -DENABLE_64BIT:BOOL=ON
15 16 17
  -DENABLE_HDF5:BOOL=ON
  -DHDF5_NEED_SZIP:BOOL=ON
  -DHDF5_NEED_ZLIB:BOOL=ON
18
)
19 20

if (WIN32)
21 22
  # This patch fixes the unnecessary installation rule for the cgns.dll which was incorrect
  # anyways when using MSVC (since the path didn't consider build configuration).
23
  add_external_project_step(patch1
24
    COMMENT "Fixing Windows install rules for CGNS tools"
25
	  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SuperBuild_PROJECTS_DIR}/patches/cgns.src.tools.CMakeLists.txt
26 27
	          <SOURCE_DIR>/src/tools/CMakeLists.txt
	  DEPENDEES update
28
    DEPENDERS patch)
29
endif()