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