19e86ff44Slooooocmake_minimum_required(VERSION 3.3 FATAL_ERROR)
2120ca870Swmayer
3a622d14cSwmayerif(COMMAND cmake_policy)
4a622d14cSwmayer    cmake_policy(SET CMP0003 NEW)
55eedcc46Swmayer    if(POLICY CMP0020)
65eedcc46Swmayer        cmake_policy(SET CMP0020 NEW)
75eedcc46Swmayer    endif(POLICY CMP0020)
8a622d14cSwmayer    # added in cmake 3.0
9a622d14cSwmayer    if(POLICY CMP0050)
103ffd4355Swmayer        cmake_policy(SET CMP0050 NEW)
11a622d14cSwmayer    endif(POLICY CMP0050)
12ce62b656Swmayer    if (POLICY CMP0045)
13ce62b656Swmayer        cmake_policy(SET CMP0045 NEW)
14ce62b656Swmayer    endif(POLICY CMP0045)
1582fbdbb3SMateusz Skowroński    if (POLICY CMP0072)
1682fbdbb3SMateusz Skowroński        cmake_policy(SET CMP0072 OLD)
1782fbdbb3SMateusz Skowroński    endif(POLICY CMP0072)
18a622d14cSwmayerendif(COMMAND cmake_policy)
1978fe9b57SMarkus Reitboeck
2078fe9b57SMarkus Reitboeckfind_program(CCACHE_PROGRAM ccache)  #This check should occur before project()
2178fe9b57SMarkus Reitboeckif(CCACHE_PROGRAM)
2278fe9b57SMarkus Reitboeck    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
2378fe9b57SMarkus Reitboeckendif()
2478fe9b57SMarkus Reitboeck
25487544d3SMarkus Reitboeckproject(FreeCAD)
26487544d3SMarkus Reitboeck
27487544d3SMarkus Reitboeckset(PACKAGE_VERSION_NAME "Vulcan")
28487544d3SMarkus Reitboeckset(PACKAGE_VERSION_MAJOR "0")
29487544d3SMarkus Reitboeckset(PACKAGE_VERSION_MINOR "19")
30487544d3SMarkus Reitboeckset(PACKAGE_VERSION_PATCH "16100")
314a6656d9Sdonovalyset(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string)
324a6656d9Sdonovalyset(FREECAD_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release)
33487544d3SMarkus Reitboeck
34487544d3SMarkus Reitboeckset(FREECAD_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
35487544d3SMarkus Reitboeckset(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
36487544d3SMarkus Reitboeckset(PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")
37a622d14cSwmayer
381c981e8fSluz.paz# include local modules
39120ca870Swmayerinclude(AddFileDependencies)
40e21972beSwmayerinclude(cMake/FreeCadMacros.cmake)
4163c45d3bSezzieyguywuf# include helper functions/macros
4263c45d3bSezzieyguywufadd_subdirectory(cMake/FreeCAD_Helpers)
43120ca870Swmayer
444d3c206fSMarkus Reitboecklist(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cMake")
45120ca870Swmayer
4663c45d3bSezzieyguywufCompilerChecksAndSetups()
4763c45d3bSezzieyguywufConfigureCMakeVariables()
4863c45d3bSezzieyguywufInitializeFreeCADBuildOptions()
4963c45d3bSezzieyguywufCheckInterModuleDependencies()
5063c45d3bSezzieyguywufFreeCADLibpackChecks()
51f13f5dc5SPeter Lamaif(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
5263c45d3bSezzieyguywuf    SetupPython()
5363c45d3bSezzieyguywuf    SetupPCL()
5463c45d3bSezzieyguywuf    SetupPybind11()
5563c45d3bSezzieyguywuf    SetupBoost()
5663c45d3bSezzieyguywuf    SetupXercesC()
57120ca870Swmayer    find_package(ZLIB REQUIRED)
583e5168a0Swmayer    find_package(PyCXX REQUIRED)
5963c45d3bSezzieyguywuf    SetupOpenCasCade()
6063c45d3bSezzieyguywuf    SetupSalomeSMESH()
61c24a5161Sjriegel    if (BUILD_FEM_NETGEN)
6266387458Swmayer        find_package(NETGEN)
63c24a5161Sjriegel    endif(BUILD_FEM_NETGEN)
64120ca870Swmayer    # not needed at the moment
65120ca870Swmayer    #find_package(OpenCV REQUIRED)
6663c45d3bSezzieyguywuf    SetupSwig()
6763c45d3bSezzieyguywuf    SetupEigen()
6863c45d3bSezzieyguywuf    # This file is included directly due to some cMake macros that are defined within.
6963c45d3bSezzieyguywuf    # If these macro definitions are embedded within another macro, it causes problems.
7063c45d3bSezzieyguywuf    include(cMake/FreeCAD_Helpers/SetupQt.cmake)
7163c45d3bSezzieyguywuf    SetupFreetype()
72aa5df7c9SWandererFan
73c24a5161Sjriegel    if(BUILD_GUI)
7463c45d3bSezzieyguywuf        SetupOpenGL()
7563c45d3bSezzieyguywuf        SetupCoin3D()
7663c45d3bSezzieyguywuf        SetupSpaceball()
7763c45d3bSezzieyguywuf        SetupShibokenAndPyside()
7863c45d3bSezzieyguywuf        SetupMatplotlib()
7963c45d3bSezzieyguywuf    endif(BUILD_GUI)
80f13f5dc5SPeter Lamaendif(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
81120ca870Swmayer
826ee9466cSjriegelif(BUILD_VR)
836ee9466cSjriegel    find_package(Rift)
846ee9466cSjriegelendif(BUILD_VR)
85f30e86bcSjriegel
8663c45d3bSezzieyguywufSetLibraryVersions()
8763c45d3bSezzieyguywufSetGlobalCompilerAndLinkerSettings()
88120ca870Swmayer
89120ca870Swmayeradd_subdirectory(src)
90120ca870Swmayeradd_subdirectory(data)
91120ca870Swmayer
9263c45d3bSezzieyguywufCreatePackagingTargets()
9371dd8934Slooooo
9463c45d3bSezzieyguywufPrintFinalReport()
95