An official mirror (for now...) of the FreeCAD project. Currently maintained in sync manually by Yorik. Please check https://www.freecadweb.org for issues and pull requests https://www.freecadweb.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.5KB

  1. cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
  2. if(COMMAND cmake_policy)
  3. cmake_policy(SET CMP0003 NEW)
  4. if(POLICY CMP0020)
  5. cmake_policy(SET CMP0020 NEW)
  6. endif(POLICY CMP0020)
  7. # added in cmake 3.0
  8. if(POLICY CMP0050)
  9. cmake_policy(SET CMP0050 NEW)
  10. endif(POLICY CMP0050)
  11. if (POLICY CMP0045)
  12. cmake_policy(SET CMP0045 NEW)
  13. endif(POLICY CMP0045)
  14. if (POLICY CMP0072)
  15. cmake_policy(SET CMP0072 OLD)
  16. endif(POLICY CMP0072)
  17. endif(COMMAND cmake_policy)
  18. find_program(CCACHE_PROGRAM ccache) #This check should occur before project()
  19. if(CCACHE_PROGRAM)
  20. set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
  21. endif()
  22. project(FreeCAD)
  23. set(PACKAGE_VERSION_NAME "Vulcan")
  24. set(PACKAGE_VERSION_MAJOR "0")
  25. set(PACKAGE_VERSION_MINOR "19")
  26. set(PACKAGE_VERSION_PATCH "16100")
  27. set(FREECAD_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
  28. set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
  29. set(PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")
  30. # include local modules
  31. include(AddFileDependencies)
  32. include(cMake/FreeCadMacros.cmake)
  33. # include helper functions/macros
  34. add_subdirectory(cMake/FreeCAD_Helpers)
  35. list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cMake")
  36. CompilerChecksAndSetups()
  37. ConfigureCMakeVariables()
  38. InitializeFreeCADBuildOptions()
  39. CheckInterModuleDependencies()
  40. FreeCADLibpackChecks()
  41. if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
  42. SetupPython()
  43. SetupPCL()
  44. SetupPybind11()
  45. SetupBoost()
  46. SetupXercesC()
  47. find_package(ZLIB REQUIRED)
  48. find_package(PyCXX REQUIRED)
  49. SetupOpenCasCade()
  50. SetupSalomeSMESH()
  51. if (BUILD_FEM_NETGEN)
  52. find_package(NETGEN)
  53. endif(BUILD_FEM_NETGEN)
  54. # not needed at the moment
  55. #find_package(OpenCV REQUIRED)
  56. SetupSwig()
  57. SetupEigen()
  58. # This file is included directly due to some cMake macros that are defined within.
  59. # If these macro definitions are embedded within another macro, it causes problems.
  60. include(cMake/FreeCAD_Helpers/SetupQt.cmake)
  61. SetupFreetype()
  62. if(BUILD_GUI)
  63. SetupOpenGL()
  64. SetupCoin3D()
  65. SetupSpaceball()
  66. SetupShibokenAndPyside()
  67. SetupMatplotlib()
  68. endif(BUILD_GUI)
  69. endif(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
  70. if(BUILD_VR)
  71. find_package(Rift)
  72. endif(BUILD_VR)
  73. SetLibraryVersions()
  74. SetGlobalCompilerAndLinkerSettings()
  75. add_subdirectory(src)
  76. add_subdirectory(data)
  77. CreatePackagingTargets()
  78. PrintFinalReport()