Bugs in CMakeLists.txt of VTK

1. 将Utilities/MaterialLibray/CMakeLists.txt 第78_84行

IF (NOT "${VTK_BINARY_DIR}" MATCHES "^${VTK_SOURCE_DIR}$")
  # Ensure that the Source and Build dir are not same.
  # In that case we don't need to copy anything.
  COPY_FILES_TO_DIR(${MaterialLibrary_SOURCE_DIR}/Repository
    ${VTK_DEFAULT_SHADERS_DIR})
ENDIF (NOT "${VTK_BINARY_DIR}" MATCHES "^${VTK_SOURCE_DIR}$")

改写为
STRING(COMPARE EQUAL "${VTK_BINARY_DIR}" "${VTK_SOURCE_DIR}" INSOURCE)
IF (NOT INSOURCE)
  # Ensure that the Source and Build dir are not same.
  # In that case we don't need to copy anything.
  COPY_FILES_TO_DIR(${MaterialLibrary_SOURCE_DIR}/Repository
    ${VTK_DEFAULT_SHADERS_DIR})
ENDIF (NOT INSOURCE

2.  将Testing/Intsall/CMakeLists.txt内

if("x${CMAKE_INSTALL_PREFIX}" MATCHES "^x${VTK_BINARY_DIR}/InstallTest$")
  add_test(NAME Install
    COMMAND ${CMAKE_COMMAND} -DCONFIGURATION=$<CONFIGURATION>
                             -DVTK_BINARY_DIR=${VTK_BINARY_DIR}
                             -P ${CMAKE_CURRENT_SOURCE_DIR}/InstallTest.cmake
    )
endif()

改写为
STRING(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${VTK_BINARY_DIR}/InstallTest" INSOURCE)
if(INSOURCE)
  add_test(NAME Install
    COMMAND ${CMAKE_COMMAND} -DCONFIGURATION=$<CONFIGURATION>
                             -DVTK_BINARY_DIR=${VTK_BINARY_DIR}
                             -P ${CMAKE_CURRENT_SOURCE_DIR}/InstallTest.cmake
    )
endif()

没有评论:

发表评论

VS Code下cmake, c++编译,调试环境的构成步骤

1   下载必须extension      按[Ctrl+Shift+X]打开extension窗口,选择安装"C/C++", "CMake", "CMake Tools" 2   在VSCode下打开作业目录 ...