SuperBuild.cmake 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ###########################################################################
  2. #
  3. # Library: CTK
  4. #
  5. # Copyright (c) Kitware Inc.
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License");
  8. # you may not use this file except in compliance with the License.
  9. # You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0.txt
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. #
  19. ###########################################################################
  20. #-----------------------------------------------------------------------------
  21. # WARNING - No change should be required after this comment
  22. # when you are adding a new external project dependency.
  23. #-----------------------------------------------------------------------------
  24. #-----------------------------------------------------------------------------
  25. # Declare CTK_EXTERNAL_LIBRARY_DIRS variable - This variable stores
  26. # the library output directory associated with the different external project
  27. # It's then used in CMake/LastConfigureStep/CTKGenerateCTKConfig.cmake to
  28. # configure CTKConfig.cmake.in
  29. # This variable would then be exposed to project building against CTK
  30. set(CTK_EXTERNAL_LIBRARY_DIRS)
  31. #-----------------------------------------------------------------------------
  32. # Make sure ${CTK_BINARY_DIR}/CTK-build/bin exists
  33. # May be used by some external project to install libs
  34. if(NOT EXISTS ${CTK_BINARY_DIR}/CTK-build/bin)
  35. file(MAKE_DIRECTORY ${CTK_BINARY_DIR}/CTK-build/bin)
  36. endif()
  37. #-----------------------------------------------------------------------------
  38. set(proj CTK)
  39. ExternalProject_Add(${proj}
  40. ${CTK_EXTERNAL_PROJECT_ARGS}
  41. DOWNLOAD_COMMAND ""
  42. CMAKE_GENERATOR ${gen}
  43. LIST_SEPARATOR ${sep}
  44. CMAKE_CACHE_ARGS
  45. -DCTK_SUPERBUILD:BOOL=OFF
  46. -DCTK_SUPERBUILD_BINARY_DIR:PATH=${CTK_BINARY_DIR}
  47. -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
  48. -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
  49. -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
  50. -DCMAKE_CXX_FLAGS_INIT:STRING=${CMAKE_CXX_FLAGS_INIT}
  51. -DCMAKE_C_FLAGS_INIT:STRING=${CMAKE_C_FLAGS_INIT}
  52. -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  53. -DCTK_EXTERNAL_LIBRARY_DIRS:STRING=${CTK_EXTERNAL_LIBRARY_DIRS}
  54. SOURCE_DIR ${CTK_SOURCE_DIR}
  55. BINARY_DIR ${CTK_BINARY_DIR}/CTK-build
  56. INSTALL_COMMAND ""
  57. DEPENDS
  58. ${CTK_DEPENDENCIES}
  59. STEP_TARGETS configure
  60. )