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