13acc1c66Smidgetfc# april 2020, the oldest we have to support : Ununtu 16.04 LTS (Xenial)
2b66732b2Smidgetfccmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)
3120ca870Swmayer
43acc1c66Smidgetfc# policy CMP0072 was introduced with CMake 3.11
53acc1c66Smidgetfc# relates to FindOpenGL module
63acc1c66Smidgetfc# and cache variables OPENGL_gl_LIBRARY, OPENGL_glu_LIBRARY
73acc1c66Smidgetfcif (POLICY CMP0072)
83acc1c66Smidgetfc    cmake_policy(SET CMP0072 OLD)
93acc1c66Smidgetfcendif(POLICY CMP0072)
1078fe9b57SMarkus Reitboeck
1178fe9b57SMarkus Reitboeckfind_program(CCACHE_PROGRAM ccache)  #This check should occur before project()
1278fe9b57SMarkus Reitboeckif(CCACHE_PROGRAM)
1378fe9b57SMarkus Reitboeck    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
1478fe9b57SMarkus Reitboeckendif()
1578fe9b57SMarkus Reitboeck
16487544d3SMarkus Reitboeckproject(FreeCAD)
17487544d3SMarkus Reitboeck
18487544d3SMarkus Reitboeckset(PACKAGE_VERSION_NAME "Vulcan")
19487544d3SMarkus Reitboeckset(PACKAGE_VERSION_MAJOR "0")
20487544d3SMarkus Reitboeckset(PACKAGE_VERSION_MINOR "19")
21487544d3SMarkus Reitboeckset(PACKAGE_VERSION_PATCH "16100")
224a6656d9Sdonovalyset(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string)
234a6656d9Sdonovalyset(FREECAD_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release)
24487544d3SMarkus Reitboeck
25487544d3SMarkus Reitboeckset(FREECAD_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
26487544d3SMarkus Reitboeckset(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
27487544d3SMarkus Reitboeckset(PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")
28a622d14cSwmayer
291c981e8fSluz.paz# include local modules
30300e8874Swmayerinclude(CheckCXXCompilerFlag)
31120ca870Swmayerinclude(AddFileDependencies)
32e21972beSwmayerinclude(cMake/FreeCadMacros.cmake)
3363c45d3bSezzieyguywuf# include helper functions/macros
3463c45d3bSezzieyguywufadd_subdirectory(cMake/FreeCAD_Helpers)
35120ca870Swmayer
364d3c206fSMarkus Reitboecklist(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cMake")
37120ca870Swmayer
3863c45d3bSezzieyguywufCompilerChecksAndSetups()
3963c45d3bSezzieyguywufConfigureCMakeVariables()
4063c45d3bSezzieyguywufInitializeFreeCADBuildOptions()
4163c45d3bSezzieyguywufCheckInterModuleDependencies()
4263c45d3bSezzieyguywufFreeCADLibpackChecks()
434d8db647SwmayerSetupDoxygen()
44f13f5dc5SPeter Lamaif(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
4563c45d3bSezzieyguywuf    SetupPython()
4663c45d3bSezzieyguywuf    SetupPCL()
4763c45d3bSezzieyguywuf    SetupPybind11()
4863c45d3bSezzieyguywuf    SetupBoost()
4963c45d3bSezzieyguywuf    SetupXercesC()
50120ca870Swmayer    find_package(ZLIB REQUIRED)
513e5168a0Swmayer    find_package(PyCXX REQUIRED)
5263c45d3bSezzieyguywuf    SetupOpenCasCade()
5363c45d3bSezzieyguywuf    SetupSalomeSMESH()
54c24a5161Sjriegel    if (BUILD_FEM_NETGEN)
5566387458Swmayer        find_package(NETGEN)
56c24a5161Sjriegel    endif(BUILD_FEM_NETGEN)
57120ca870Swmayer    # not needed at the moment
58120ca870Swmayer    #find_package(OpenCV REQUIRED)
5963c45d3bSezzieyguywuf    SetupSwig()
6063c45d3bSezzieyguywuf    SetupEigen()
6163c45d3bSezzieyguywuf    # This file is included directly due to some cMake macros that are defined within.
6263c45d3bSezzieyguywuf    # If these macro definitions are embedded within another macro, it causes problems.
6363c45d3bSezzieyguywuf    include(cMake/FreeCAD_Helpers/SetupQt.cmake)
6463c45d3bSezzieyguywuf    SetupFreetype()
65aa5df7c9SWandererFan
66c24a5161Sjriegel    if(BUILD_GUI)
6763c45d3bSezzieyguywuf        SetupOpenGL()
6863c45d3bSezzieyguywuf        SetupCoin3D()
6963c45d3bSezzieyguywuf        SetupSpaceball()
7063c45d3bSezzieyguywuf        SetupShibokenAndPyside()
7163c45d3bSezzieyguywuf        SetupMatplotlib()
7263c45d3bSezzieyguywuf    endif(BUILD_GUI)
73f13f5dc5SPeter Lamaendif(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
74120ca870Swmayer
756ee9466cSjriegelif(BUILD_VR)
766ee9466cSjriegel    find_package(Rift)
776ee9466cSjriegelendif(BUILD_VR)
78f30e86bcSjriegel
7963c45d3bSezzieyguywufSetLibraryVersions()
8063c45d3bSezzieyguywufSetGlobalCompilerAndLinkerSettings()
81120ca870Swmayer
82120ca870Swmayeradd_subdirectory(src)
83120ca870Swmayeradd_subdirectory(data)
84120ca870Swmayer
8563c45d3bSezzieyguywufCreatePackagingTargets()
8671dd8934Slooooo
8763c45d3bSezzieyguywufPrintFinalReport()
88