From e480d8f5aa96b1a563798dcfa6bd45d96f699d12 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 25 May 2019 18:12:30 +0200 Subject: [PATCH] harmonize whitespace and case-sensitivity --- CMakeLists.txt | 1249 ++++++++++++++++++++++++------------------------ 1 file changed, 629 insertions(+), 620 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9537bbb586..aeac1a6305 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,18 +56,18 @@ endif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") # ================================================================================ # Allow developers to use Boost < 1.48 -if(NOT ${BOOST_MIN_VERSION}) - set(BOOST_MIN_VERSION 1.48) +if (NOT ${BOOST_MIN_VERSION}) + set(BOOST_MIN_VERSION 1.48) endif() # For older cmake versions the variable 'CMAKE_CXX_COMPILER_VERSION' is missing -IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION) - EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion +if(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION) + execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION) -ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION) +endif(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION) # Enabled C++11 for Freecad 0.17 and later -IF(FREECAD_VERSION VERSION_GREATER 0.16) +if (FREECAD_VERSION VERSION_GREATER 0.16) set(BUILD_ENABLE_CXX_STD "C++11" CACHE STRING "Enable C++ standard") set_property(CACHE BUILD_ENABLE_CXX_STD PROPERTY STRINGS "C++11" @@ -76,15 +76,15 @@ IF(FREECAD_VERSION VERSION_GREATER 0.16) "C++20" ) - IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) - MESSAGE(FATAL_ERROR "FreeCAD 0.17 and later requires C++11. G++ must be 4.7 or later, the used version is ${CMAKE_CXX_COMPILER_VERSION}") - ELSEIF(CMAKE_COMPILER_IS_CLANGXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3) - MESSAGE(FATAL_ERROR "FreeCAD 0.17 and later requires C++11. Clang must be 3.3 or later, the used version is ${CMAKE_CXX_COMPILER_VERSION}") - ENDIF() -ENDIF(FREECAD_VERSION VERSION_GREATER 0.16) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + message(FATAL_ERROR "FreeCAD 0.17 and later requires C++11. G++ must be 4.7 or later, the used version is ${CMAKE_CXX_COMPILER_VERSION}") + elseif(CMAKE_COMPILER_IS_CLANGXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3) + message(FATAL_ERROR "FreeCAD 0.17 and later requires C++11. Clang must be 3.3 or later, the used version is ${CMAKE_CXX_COMPILER_VERSION}") + endif() +endif(FREECAD_VERSION VERSION_GREATER 0.16) # Log the compiler and version -MESSAGE(STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID}, version: ${CMAKE_CXX_COMPILER_VERSION}") +message(STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID}, version: ${CMAKE_CXX_COMPILER_VERSION}") if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) include(cMake/ConfigureChecks.cmake) @@ -103,7 +103,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) endif() set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-write-strings ${CMAKE_CXX_FLAGS}") - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) # get linker errors as soon as possible and not at runtime e.g. for modules if(BUILD_DYNAMIC_LINK_PYTHON) @@ -125,13 +125,13 @@ if(CMAKE_COMPILER_IS_CLANGXX) # # https://en.wikipedia.org/wiki/Xcode#Latest_versions if (APPLE) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-var-template") - endif() + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-var-template") + endif() elseif (UNIX) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.9) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-var-template") - endif() + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.9) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-var-template") + endif() endif() # older boost.preprocessor turn off variadics for clang @@ -144,111 +144,111 @@ endif() # Output directories for install target if(WIN32) - SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "Installation root directory") + set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "Installation root directory") else(WIN32) - SET(CMAKE_INSTALL_PREFIX "/usr/lib${LIB_SUFFIX}/freecad" CACHE PATH "Installation root directory") + set(CMAKE_INSTALL_PREFIX "/usr/lib${LIB_SUFFIX}/freecad" CACHE PATH "Installation root directory") endif(WIN32) -SET(CMAKE_INSTALL_DATADIR data CACHE PATH "Output directory for data and resource files") -SET(CMAKE_INSTALL_INCLUDEDIR include CACHE PATH "Output directory for header files") -SET(CMAKE_INSTALL_DOCDIR doc CACHE PATH "Output directory for documentation and license files") +set(CMAKE_INSTALL_DATADIR data CACHE PATH "Output directory for data and resource files") +set(CMAKE_INSTALL_INCLUDEDIR include CACHE PATH "Output directory for header files") +set(CMAKE_INSTALL_DOCDIR doc CACHE PATH "Output directory for documentation and license files") # Don't set it without manual adoption of LibDir variable in src/App/FreeCADInit.py -SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries") +set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries") -if(NOT WIN32) +if (NOT WIN32) if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) - SET(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") endif(NOT IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) endif(NOT WIN32) -SET(PYCXX_INCLUDE_DIR +set(PYCXX_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/src" CACHE PATH "Path to the directory containing PyCXX's CXX/Config.hxx include file") -SET(PYCXX_SOURCE_DIR +set(PYCXX_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/CXX" CACHE PATH "Path to the directory containing PyCXX's cxxextensions.c source file") # used as compiler defines -SET(RESOURCEDIR "${CMAKE_INSTALL_DATADIR}") -SET(DOCDIR "${CMAKE_INSTALL_DOCDIR}") +set(RESOURCEDIR "${CMAKE_INSTALL_DATADIR}") +set(DOCDIR "${CMAKE_INSTALL_DOCDIR}") -MESSAGE(STATUS "prefix: ${CMAKE_INSTALL_PREFIX}") -MESSAGE(STATUS "datadir: ${CMAKE_INSTALL_DATADIR}") -MESSAGE(STATUS "docdir: ${CMAKE_INSTALL_DOCDIR}") -MESSAGE(STATUS "includedir: ${CMAKE_INSTALL_INCLUDEDIR}") -MESSAGE(STATUS "libdir: ${CMAKE_INSTALL_LIBDIR}") -MESSAGE(STATUS "cmake: ${CMAKE_VERSION}") +message(STATUS "prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "datadir: ${CMAKE_INSTALL_DATADIR}") +message(STATUS "docdir: ${CMAKE_INSTALL_DOCDIR}") +message(STATUS "includedir: ${CMAKE_INSTALL_INCLUDEDIR}") +message(STATUS "libdir: ${CMAKE_INSTALL_LIBDIR}") +message(STATUS "cmake: ${CMAKE_VERSION}") # ============================================================================== # ================= All the options for the build process ================= # ============================================================================== # Switch to build FreeCAD with Qt5 -OPTION(BUILD_GUI "Build FreeCAD Gui. Otherwise you have only the command line and the Python import module." ON) -OPTION(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF) -OPTION(FREECAD_USE_EXTERNAL_SMESH "Use system installed smesh instead of the bundled." OFF) -OPTION(FREECAD_USE_EXTERNAL_KDL "Use system installed orocos-kdl instead of the bundled." OFF) -OPTION(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON) -OPTION(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF) -OPTION(BUILD_WITH_CONDA "Set ON if you build freecad with conda" OFF) -OPTION(BUILD_DYNAMIC_LINK_PYTHON "If OFF extension-modules do not link against python-libraries" ON) -OPTION(OCCT_CMAKE_FALLBACK "disable usage of occt-config files" OFF) +option(BUILD_GUI "Build FreeCAD Gui. Otherwise you have only the command line and the Python import module." ON) +option(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF) +option(FREECAD_USE_EXTERNAL_SMESH "Use system installed smesh instead of the bundled." OFF) +option(FREECAD_USE_EXTERNAL_KDL "Use system installed orocos-kdl instead of the bundled." OFF) +option(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON) +option(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF) +option(BUILD_WITH_CONDA "Set ON if you build freecad with conda" OFF) +option(BUILD_DYNAMIC_LINK_PYTHON "If OFF extension-modules do not link against python-libraries" ON) +option(OCCT_CMAKE_FALLBACK "disable usage of occt-config files" OFF) if (WIN32 OR APPLE) - OPTION(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." OFF) + option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." OFF) else() - OPTION(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." ON) + option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." ON) endif() # == Win32 is default behaviour use the LibPack copied in Source tree ========== if(MSVC) - OPTION(FREECAD_RELEASE_PDB "Create PDB files for Release version." ON) - OPTION(FREECAD_RELEASE_SEH "Enable Structured Exception Handling for Release version." ON) - OPTION(FREECAD_LIBPACK_USE "Use the LibPack to Build FreeCAD (only Win32 so far)." ON) - OPTION(FREECAD_LIBPACK_USEPYSIDE "Use PySide in LibPack rather to PyQt and Swig." ON) - OPTION(FREECAD_USE_PCH "Activate precompiled headers where it's used." ON) + option(FREECAD_RELEASE_PDB "Create PDB files for Release version." ON) + option(FREECAD_RELEASE_SEH "Enable Structured Exception Handling for Release version." ON) + option(FREECAD_LIBPACK_USE "Use the LibPack to Build FreeCAD (only Win32 so far)." ON) + option(FREECAD_LIBPACK_USEPYSIDE "Use PySide in LibPack rather to PyQt and Swig." ON) + option(FREECAD_USE_PCH "Activate precompiled headers where it's used." ON) - IF(DEFINED ENV{FREECAD_LIBPACK_DIR}) + if (DEFINED ENV{FREECAD_LIBPACK_DIR}) set(FREECAD_LIBPACK_DIR $ENV{FREECAD_LIBPACK_DIR} CACHE PATH "Directory of the FreeCAD LibPack") - MESSAGE(STATUS "Found libpack env variable: ${FREECAD_LIBPACK_DIR}") - IF(EXISTS ${FREECAD_LIBPACK_DIR}/lib/Qt5Core.lib) - OPTION(BUILD_QT5 "Build with Qt5." ON) - ELSE() - OPTION(BUILD_QT5 "Build with Qt5." OFF) - ENDIF() - ELSE() + message(STATUS "Found libpack env variable: ${FREECAD_LIBPACK_DIR}") + if (EXISTS ${FREECAD_LIBPACK_DIR}/lib/Qt5Core.lib) + option(BUILD_QT5 "Build with Qt5." ON) + else() + option(BUILD_QT5 "Build with Qt5." OFF) + endif() + else() set(FREECAD_LIBPACK_DIR ${CMAKE_SOURCE_DIR} CACHE PATH "Directory of the FreeCAD LibPack") - IF(EXISTS ${FREECAD_LIBPACK_DIR}/lib/Qt5Core.lib) - OPTION(BUILD_QT5 "Build with Qt5." ON) - ELSE() - OPTION(BUILD_QT5 "Build with Qt5." OFF) - ENDIF() - ENDIF() + if (EXISTS ${FREECAD_LIBPACK_DIR}/lib/Qt5Core.lib) + option(BUILD_QT5 "Build with Qt5." ON) + else() + option(BUILD_QT5 "Build with Qt5." OFF) + endif() + endif() - SET(LIBPACK_FOUND OFF) - IF(EXISTS ${FREECAD_LIBPACK_DIR}/plugins/imageformats/qsvg.dll) - SET(LIBPACK_FOUND ON) - SET(COPY_LIBPACK_BIN_TO_BUILD OFF) - # Create install commands for dependencies for INSTALL project in FreeCAD solution - OPTION(FREECAD_INSTALL_DEPEND_DIRS "Create install dependency commands for the INSTALL project found + set(LIBPACK_FOUND OFF) + if (EXISTS ${FREECAD_LIBPACK_DIR}/plugins/imageformats/qsvg.dll) + set(LIBPACK_FOUND ON) + set(COPY_LIBPACK_BIN_TO_BUILD OFF) + # Create install commands for dependencies for INSTALL target in FreeCAD solution + option(FREECAD_INSTALL_DEPEND_DIRS "Create install dependency commands for the INSTALL target found in the FreeCAD solution." ON) # Copy libpack smaller dependency folders to build folder per user request - if non-existant at destination - IF(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/imageformats/qsvg.dll) - OPTION(FREECAD_COPY_DEPEND_DIRS_TO_BUILD "Copy smaller libpack dependency directories to build directory." OFF) - ENDIF() + if (NOT EXISTS ${CMAKE_BINARY_DIR}/bin/imageformats/qsvg.dll) + option(FREECAD_COPY_DEPEND_DIRS_TO_BUILD "Copy smaller libpack dependency directories to build directory." OFF) + endif() # Copy libpack 'bin' directory contents to build 'bin' per user request - only IF NOT EXISTS already - IF(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/DLLs) - SET(COPY_LIBPACK_BIN_TO_BUILD ON) - OPTION(FREECAD_COPY_LIBPACK_BIN_TO_BUILD "Copy larger libpack dependency 'bin' folder to the build direcctory." OFF) - ENDIF() - ELSE() - MESSAGE("Libpack NOT found.\nIf you intend to use a Windows libpack, set the FREECAD_LIBPACK_DIR to the libpack directory.") - MESSAGE(STATUS "Visit: https://github.com/apeltauer/FreeCAD/releases/ for Windows libpack downloads.") - ENDIF() -ELSE(MSVC) - OPTION(BUILD_QT5 "Build with Qt5." ON) - OPTION(FREECAD_LIBPACK_USE "Use the LibPack to Build FreeCAD (only Win32 so far)." OFF) - SET(FREECAD_LIBPACK_DIR "" CACHE PATH "Directory of the FreeCAD LibPack") -ENDIF(MSVC) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/bin/DLLs) + set(COPY_LIBPACK_BIN_TO_BUILD ON) + option(FREECAD_COPY_LIBPACK_BIN_TO_BUILD "Copy larger libpack dependency 'bin' folder to the build direcctory." OFF) + endif() + else() + message("Libpack NOT found.\nIf you intend to use a Windows libpack, set the FREECAD_LIBPACK_DIR to the libpack directory.") + message(STATUS "Visit: https://github.com/apeltauer/FreeCAD/releases/ for Windows libpack downloads.") + endif() +else(MSVC) + option(BUILD_QT5 "Build with Qt5." OFF) + option(FREECAD_LIBPACK_USE "Use the LibPack to Build FreeCAD (only Win32 so far)." OFF) + set(FREECAD_LIBPACK_DIR "" CACHE PATH "Directory of the FreeCAD LibPack") +endif(MSVC) # https://blog.kitware.com/constraining-values-with-comboboxes-in-cmake-cmake-gui/ set(FREECAD_USE_OCC_VARIANT "Community Edition" CACHE STRING "Official OpenCASCADE version or community edition") @@ -258,9 +258,9 @@ set_property(CACHE FREECAD_USE_OCC_VARIANT PROPERTY STRINGS ) if (BUILD_QT5) - OPTION(FREECAD_USE_QTOPENGL_WIDGET "Replace QGLWidget with QOpenGLWidget." ON) + option(FREECAD_USE_QTOPENGL_WIDGET "Replace QGLWidget with QOpenGLWidget." ON) if (FREECAD_USE_QTOPENGL_WIDGET) - set(HAVE_QT5_OPENGL 1) + set(HAVE_QT5_OPENGL 1) endif() set(FREECAD_USE_QTWEBMODULE "Automatic" CACHE STRING "Qt Webkit or Qt WebEngine") set_property(CACHE FREECAD_USE_QTWEBMODULE PROPERTY STRINGS @@ -272,7 +272,7 @@ endif() configure_file(${CMAKE_SOURCE_DIR}/src/QtOpenGL.h.cmake ${CMAKE_BINARY_DIR}/src/QtOpenGL.h) if(APPLE) - OPTION(FREECAD_CREATE_MAC_APP "Create app bundle on install" OFF) + option(FREECAD_CREATE_MAC_APP "Create app bundle on install" OFF) if(FREECAD_CREATE_MAC_APP) install( @@ -295,61 +295,61 @@ if(APPLE) set(CMAKE_MACOSX_RPATH TRUE) endif(APPLE) -OPTION(BUILD_FEM "Build the FreeCAD FEM module" ON) -OPTION(BUILD_SANDBOX "Build the FreeCAD Sandbox module which is only for testing purposes" OFF) -OPTION(BUILD_TEMPLATE "Build the FreeCAD template module which is only for testing purposes" OFF) -OPTION(BUILD_ADDONMGR "Build the FreeCAD addon manager module" ON) -OPTION(BUILD_ARCH "Build the FreeCAD Architecture module" ON) -OPTION(BUILD_ASSEMBLY "Build the FreeCAD Assembly module" OFF) -OPTION(BUILD_COMPLETE "Build the FreeCAD complete module" ON) -OPTION(BUILD_DRAFT "Build the FreeCAD draft module" ON) -OPTION(BUILD_DRAWING "Build the FreeCAD drawing module" ON) -OPTION(BUILD_IDF "Build the FreeCAD idf module" ON) -OPTION(BUILD_IMAGE "Build the FreeCAD image module" ON) -OPTION(BUILD_IMPORT "Build the FreeCAD import module" ON) -OPTION(BUILD_INSPECTION "Build the FreeCAD inspection module" ON) -OPTION(BUILD_JTREADER "Build the FreeCAD jt reader module" OFF) -OPTION(BUILD_MATERIAL "Build the FreeCAD material module" ON) -OPTION(BUILD_MESH "Build the FreeCAD mesh module" ON) -OPTION(BUILD_MESH_PART "Build the FreeCAD mesh part module" ON) -OPTION(BUILD_FLAT_MESH "Build the FreeCAD flat mesh module" OFF) -OPTION(BUILD_OPENSCAD "Build the FreeCAD openscad module" ON) -OPTION(BUILD_PART "Build the FreeCAD part module" ON) -OPTION(BUILD_PART_DESIGN "Build the FreeCAD part design module" ON) -OPTION(BUILD_PATH "Build the FreeCAD path module" ON) -OPTION(BUILD_PLOT "Build the FreeCAD plot module" OFF) -OPTION(BUILD_POINTS "Build the FreeCAD points module" ON) -OPTION(BUILD_RAYTRACING "Build the FreeCAD ray tracing module" ON) -OPTION(BUILD_REVERSEENGINEERING "Build the FreeCAD reverse engineering module" ON) -OPTION(BUILD_ROBOT "Build the FreeCAD robot module" ON) -OPTION(BUILD_SHIP "Build the FreeCAD ship module" OFF) -OPTION(BUILD_SHOW "Build the FreeCAD Show module (helper module for visibility automation)" ON) -OPTION(BUILD_SKETCHER "Build the FreeCAD sketcher module" ON) -OPTION(BUILD_SPREADSHEET "Build the FreeCAD spreadsheet module" ON) -OPTION(BUILD_START "Build the FreeCAD start module" ON) -OPTION(BUILD_TEST "Build the FreeCAD test module" ON) -OPTION(BUILD_TECHDRAW "Build the FreeCAD Technical Drawing module" ON) -OPTION(BUILD_TUX "Build the FreeCAD Tux module" ON) -OPTION(BUILD_WEB "Build the FreeCAD web module" ON) -OPTION(BUILD_SURFACE "Build the FreeCAD surface module" ON) -OPTION(BUILD_VR "Build the FreeCAD Oculus Rift support (need Oculus SDK 4.x or higher)" OFF) +option(BUILD_FEM "Build the FreeCAD FEM module" ON) +option(BUILD_SANDBOX "Build the FreeCAD Sandbox module which is only for testing purposes" OFF) +option(BUILD_TEMPLATE "Build the FreeCAD template module which is only for testing purposes" OFF) +option(BUILD_ADDONMGR "Build the FreeCAD addon manager module" ON) +option(BUILD_ARCH "Build the FreeCAD Architecture module" ON) +option(BUILD_ASSEMBLY "Build the FreeCAD Assembly module" OFF) +option(BUILD_COMPLETE "Build the FreeCAD complete module" ON) +option(BUILD_DRAFT "Build the FreeCAD draft module" ON) +option(BUILD_DRAWING "Build the FreeCAD drawing module" ON) +option(BUILD_IDF "Build the FreeCAD idf module" ON) +option(BUILD_IMAGE "Build the FreeCAD image module" ON) +option(BUILD_IMPORT "Build the FreeCAD import module" ON) +option(BUILD_INSPECTION "Build the FreeCAD inspection module" ON) +option(BUILD_JTREADER "Build the FreeCAD jt reader module" OFF) +option(BUILD_MATERIAL "Build the FreeCAD material module" ON) +option(BUILD_MESH "Build the FreeCAD mesh module" ON) +option(BUILD_MESH_PART "Build the FreeCAD mesh part module" ON) +option(BUILD_FLAT_MESH "Build the FreeCAD flat mesh module" OFF) +option(BUILD_OPENSCAD "Build the FreeCAD openscad module" ON) +option(BUILD_PART "Build the FreeCAD part module" ON) +option(BUILD_PART_DESIGN "Build the FreeCAD part design module" ON) +option(BUILD_PATH "Build the FreeCAD path module" ON) +option(BUILD_PLOT "Build the FreeCAD plot module" OFF) +option(BUILD_POINTS "Build the FreeCAD points module" ON) +option(BUILD_RAYTRACING "Build the FreeCAD ray tracing module" ON) +option(BUILD_REVERSEENGINEERING "Build the FreeCAD reverse engineering module" ON) +option(BUILD_ROBOT "Build the FreeCAD robot module" ON) +option(BUILD_SHIP "Build the FreeCAD ship module" OFF) +option(BUILD_SHOW "Build the FreeCAD Show module (helper module for visibility automation)" ON) +option(BUILD_SKETCHER "Build the FreeCAD sketcher module" ON) +option(BUILD_SPREADSHEET "Build the FreeCAD spreadsheet module" ON) +option(BUILD_START "Build the FreeCAD start module" ON) +option(BUILD_TEST "Build the FreeCAD test module" ON) +option(BUILD_TECHDRAW "Build the FreeCAD Technical Drawing module" ON) +option(BUILD_TUX "Build the FreeCAD Tux module" ON) +option(BUILD_WEB "Build the FreeCAD web module" ON) +option(BUILD_SURFACE "Build the FreeCAD surface module" ON) +option(BUILD_VR "Build the FreeCAD Oculus Rift support (need Oculus SDK 4.x or higher)" OFF) if(MSVC) - OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON) - OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON) + option(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON) + option(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON) elseif(APPLE) find_library(3DCONNEXIONCLIENT_FRAMEWORK 3DconnexionClient) if(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK}) - OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON) + option(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON) else(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK}) - OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." OFF) + option(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." OFF) endif(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK}) else(MSVC) set(FREECAD_USE_3DCONNEXION OFF) endif(MSVC) if(NOT MSVC) - OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF) - OPTION(FREECAD_USE_PCL "Build the features that use PCL libs" OFF) + option(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF) + option(FREECAD_USE_PCL "Build the features that use PCL libs" OFF) endif(NOT MSVC) # if this is set override some options @@ -358,6 +358,7 @@ if (FREECAD_BUILD_DEBIAN) # A Debian package for SMESH doesn't exist #set(FREECAD_USE_EXTERNAL_SMESH ON) endif (FREECAD_BUILD_DEBIAN) + if(BUILD_FEM) set(BUILD_SMESH ON) endif() @@ -430,10 +431,10 @@ if(FREECAD_LIBPACK_USE) set(FREECAD_LIBPACK_CHECKCUSTOM "${FREECAD_LIBPACK_CHECKCUSTOM}" CACHE INTERNAL "Find libpack") set(FREECAD_LIBPACK_CHECKFILE_CLBUNDLER "${FREECAD_LIBPACK_CHECKFILE_CLBUNDLER}" CACHE INTERNAL "Find libpack") - IF(FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) + if (FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) set(FREECAD_LIBPACK_VERSION "CLbundler" CACHE STRING "Displays if the libpack has been found" FORCE) include(cMake/UseLibPackCLbundler.cmake) - ELSEIF(FREECAD_LIBPACK_CHECKFILE9X) + elseif(FREECAD_LIBPACK_CHECKFILE9X) set(FREECAD_LIBPACK_VERSION "9.x" CACHE STRING "Displays if the libpack has been found" FORCE) include(cMake/UseLibPack9x.cmake) set(SWIG_EXECUTABLE ${FREECAD_LIBPACK_DIR}/tools/swigwin-2.0.11/swig.exe CACHE STRING "Swig" FORCE) @@ -443,17 +444,17 @@ if(FREECAD_LIBPACK_USE) file(GLOB FREECAD_LIBPACK_PYSIDE "${FREECAD_LIBPACK_DIR}/pyside/lib/site-packages/PySide/*.py*") file(GLOB_RECURSE FREECAD_LIBPACK_PYSIDEUIC RELATIVE "${FREECAD_LIBPACK_PYSIDEUIC_REL}" "${FREECAD_LIBPACK_PYSIDEUIC_REL}/pysideuic/*.py") file(GLOB FREECAD_LIBPACK_PYTHON "${FREECAD_LIBPACK_DIR}/bin/*.py*") - ELSEIF(FREECAD_LIBPACK_CHECKFILE10X) + elseif(FREECAD_LIBPACK_CHECKFILE10X) set(FREECAD_LIBPACK_VERSION "10.x" CACHE STRING "Displays if the libpack has been found" FORCE) include(cMake/UseLibPack10x.cmake) set(SWIG_EXECUTABLE ${FREECAD_LIBPACK_DIR}/tools/swigwin-3.0.2/swig.exe CACHE STRING "Swig" FORCE) - ELSEIF(FREECAD_LIBPACK_CHECKCUSTOM) + elseif(FREECAD_LIBPACK_CHECKCUSTOM) set(FREECAD_LIBPACK_VERSION "Custom" CACHE STRING "Displays if the libpack has been found" FORCE) include(cMake/UseLibPackCustom.cmake) - ELSE(FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) + else(FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) set(FREECAD_LIBPACK_VERSION "NOTFOUND" CACHE STRING "Displays if the libpack has been found" FORCE) message(SEND_ERROR "Could not find libpack in specified location:" ${FREECAD_LIBPACK_DIR}) - ENDIF(FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) + endif(FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) # -------------------------------- PyCXX -------------------------------- @@ -463,11 +464,11 @@ if(FREECAD_LIBPACK_USE) find_package(SWIG) - IF(NOT SWIG_FOUND) - MESSAGE("==================================================\n" + if(NOT SWIG_FOUND) + message("==================================================\n" "SWIG not found, don't build SWIG binding for pivy.\n" "==================================================\n") - ENDIF(NOT SWIG_FOUND) + endif(NOT SWIG_FOUND) # -------------------------------- Salome SMESH -------------------------- @@ -480,168 +481,171 @@ endif(FREECAD_LIBPACK_USE) if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) # ================================================================================ -# == for other OSes search the packages ========================================== +# == Search the packages ========================================================= # -------------------------------- Python -------------------------------- -# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677598 -# Acceptable versions of Python -set(Python_ADDITIONAL_VERSIONS "2.7") + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677598 + # Acceptable versions of Python + set(Python_ADDITIONAL_VERSIONS "2.7") -# For building on OS X -if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_WITH_CONDA) + # For building on OS X + if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_WITH_CONDA) - # If the user doesn't tell us which package manager they're using - if(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX) + # If the user doesn't tell us which package manager they're using + if(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX) - # Try to find MacPorts path - find_program(MACPORTS_EXECUTABLE port) - if(EXISTS ${MACPORTS_EXECUTABLE}) - string(REPLACE "/bin/port" "" - MACPORTS_PREFIX ${MACPORTS_EXECUTABLE}) - message(STATUS "Detected MacPorts install at ${MACPORTS_PREFIX}") - endif(EXISTS ${MACPORTS_EXECUTABLE}) + # Try to find MacPorts path + find_program(MACPORTS_EXECUTABLE port) + if(EXISTS ${MACPORTS_EXECUTABLE}) + string(REPLACE "/bin/port" "" + MACPORTS_PREFIX ${MACPORTS_EXECUTABLE}) + message(STATUS "Detected MacPorts install at ${MACPORTS_PREFIX}") + endif(EXISTS ${MACPORTS_EXECUTABLE}) - # Try to find Homebrew path - find_program(HOMEBREW_EXECUTABLE brew) - if(EXISTS ${HOMEBREW_EXECUTABLE}) - string(REPLACE "/bin/brew" "" - HOMEBREW_PREFIX ${HOMEBREW_EXECUTABLE}) - message(STATUS "Detected Homebrew install at ${HOMEBREW_PREFIX}") - endif() + # Try to find Homebrew path + find_program(HOMEBREW_EXECUTABLE brew) + if(EXISTS ${HOMEBREW_EXECUTABLE}) + string(REPLACE "/bin/brew" "" + HOMEBREW_PREFIX ${HOMEBREW_EXECUTABLE}) + message(STATUS "Detected Homebrew install at ${HOMEBREW_PREFIX}") + endif() - endif(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX) + endif(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX) - # In case someone tries to shoot themselves in the foot - if(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX) - message(SEND_ERROR - "Multiple package management systems detected - ") - message(SEND_ERROR - "define either MACPORTS_PREFIX or HOMEBREW_PREFIX") + # In case someone tries to shoot themselves in the foot + if(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX) + message(SEND_ERROR + "Multiple package management systems detected - ") + message(SEND_ERROR + "define either MACPORTS_PREFIX or HOMEBREW_PREFIX") - # No package manager - elseif(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX) - message(SEND_ERROR - "No package manager detected - install MacPorts or Homebrew") + # No package manager + elseif(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX) + message(SEND_ERROR + "No package manager detected - install MacPorts or Homebrew") - # The hopefully-normal case - one package manager identified - else(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX) + # The hopefully-normal case - one package manager identified + else(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX) - # Construct a list like python;python2.9;python2.8;... - set(Python_ADDITIONAL_VERSIONS_REV ${Python_ADDITIONAL_VERSIONS}) - list(REVERSE Python_ADDITIONAL_VERSIONS_REV) - set(_PYTHON_NAMES "python") - foreach(_PYTHON_VERSION IN LISTS Python_ADDITIONAL_VERSIONS_REV) - list(APPEND _PYTHON_NAMES "python${_PYTHON_VERSION}") - endforeach(_PYTHON_VERSION) + # Construct a list like python;python2.9;python2.8;... + set(Python_ADDITIONAL_VERSIONS_REV ${Python_ADDITIONAL_VERSIONS}) + list(REVERSE Python_ADDITIONAL_VERSIONS_REV) + set(_PYTHON_NAMES "python") + foreach(_PYTHON_VERSION IN LISTS Python_ADDITIONAL_VERSIONS_REV) + list(APPEND _PYTHON_NAMES "python${_PYTHON_VERSION}") + endforeach(_PYTHON_VERSION) - # Find python in the package management systems, using names in that - # list in decreasing priority. Note that a manually specified - # PYTHON_EXECUTABLE still has prescedence over this. - find_program(PYTHON_EXECUTABLE - NAMES ${_PYTHON_NAMES} - PATHS ${MACPORTS_PREFIX} ${HOMEBREW_PREFIX} - PATH_SUFFIXES /bin - NO_DEFAULT_PATH) + # Find python in the package management systems, using names in that + # list in decreasing priority. Note that a manually specified + # PYTHON_EXECUTABLE still has prescedence over this. + find_program(PYTHON_EXECUTABLE + NAMES ${_PYTHON_NAMES} + PATHS ${MACPORTS_PREFIX} ${HOMEBREW_PREFIX} + PATH_SUFFIXES /bin + NO_DEFAULT_PATH) - endif(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX) + endif(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX) - # Warn user if we still only have the system Python - string(FIND ${PYTHON_EXECUTABLE} "/usr/bin/python" _FIND_SYS_PYTHON) - if(_FIND_SYS_PYTHON EQUAL 0) - message(SEND_ERROR - "Only found the stock Python, that's probably bad.") - endif(_FIND_SYS_PYTHON EQUAL 0) + # Warn user if we still only have the system Python + string(FIND ${PYTHON_EXECUTABLE} "/usr/bin/python" _FIND_SYS_PYTHON) + if(_FIND_SYS_PYTHON EQUAL 0) + message(SEND_ERROR + "Only found the stock Python, that's probably bad.") + endif(_FIND_SYS_PYTHON EQUAL 0) - # Ask Python to tell us it's include directory, if nobody else has - if(NOT DEFINED PYTHON_INCLUDE_DIR) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c - "from distutils.sysconfig import get_python_inc;print get_python_inc()" - OUTPUT_VARIABLE PYTHON_INCLUDE_DIR - RESULT_VARIABLE PYTHON_INCLUDE_DIR_RESULT - ERROR_QUIET) - if(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0) - message(SEND_ERROR "Failed to determine PYTHON_INCLUDE_DIR") - endif(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0) - endif(NOT DEFINED PYTHON_INCLUDE_DIR) + # Ask Python to tell us it's include directory, if nobody else has + if(NOT DEFINED PYTHON_INCLUDE_DIR) + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c + "from distutils.sysconfig import get_python_inc;print get_python_inc()" + OUTPUT_VARIABLE PYTHON_INCLUDE_DIR + RESULT_VARIABLE PYTHON_INCLUDE_DIR_RESULT + ERROR_QUIET) + if(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0) + message(SEND_ERROR "Failed to determine PYTHON_INCLUDE_DIR") + endif(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0) + endif(NOT DEFINED PYTHON_INCLUDE_DIR) - # Similar for the Python library - there must be an easier way... - if(NOT DEFINED PYTHON_LIBRARY) - # Get the library path - execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c - "from distutils import sysconfig;print sysconfig.get_config_var('LIBDIR')" - OUTPUT_VARIABLE PYTHON_LIBRARY_DIR - RESULT_VARIABLE PYTHON_LIBRARY_DIR_RESULT - ERROR_QUIET) - string(STRIP ${PYTHON_LIBRARY_DIR} PYTHON_LIBRARY_DIR) - if(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0) - message(SEND_ERROR "Failed to determine PYTHON_LIBRARY") - endif(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0) + # Similar for the Python library - there must be an easier way... + if(NOT DEFINED PYTHON_LIBRARY) + # Get the library path + execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c + "from distutils import sysconfig;print sysconfig.get_config_var('LIBDIR')" + OUTPUT_VARIABLE PYTHON_LIBRARY_DIR + RESULT_VARIABLE PYTHON_LIBRARY_DIR_RESULT + ERROR_QUIET) + string(STRIP ${PYTHON_LIBRARY_DIR} PYTHON_LIBRARY_DIR) + if(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0) + message(SEND_ERROR "Failed to determine PYTHON_LIBRARY") + endif(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0) - # Get library filename - might not be safe to assume .dylib extension? - execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c - "import sys;print 'libpython%d.%d.dylib'%sys.version_info[0:2]" - OUTPUT_VARIABLE PYTHON_LIBRARY_FILE - RESULT_VARIABLE PYTHON_LIBRARY_FILE_RESULT - ERROR_QUIET) - string(STRIP ${PYTHON_LIBRARY_FILE} PYTHON_LIBRARY_FILE) - if(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0) - message(SEND_ERROR "Failed to determine PYTHON_LIBRARY") - endif(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0) + # Get library filename - might not be safe to assume .dylib extension? + execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c + "import sys;print 'libpython%d.%d.dylib'%sys.version_info[0:2]" + OUTPUT_VARIABLE PYTHON_LIBRARY_FILE + RESULT_VARIABLE PYTHON_LIBRARY_FILE_RESULT + ERROR_QUIET) + string(STRIP ${PYTHON_LIBRARY_FILE} PYTHON_LIBRARY_FILE) + if(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0) + message(SEND_ERROR "Failed to determine PYTHON_LIBRARY") + endif(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0) - set(PYTHON_LIBRARY "${PYTHON_LIBRARY_DIR}/${PYTHON_LIBRARY_FILE}") + set(PYTHON_LIBRARY "${PYTHON_LIBRARY_DIR}/${PYTHON_LIBRARY_FILE}") - else(NOT DEFINED PYTHON_LIBRARY) - # Used on MacPorts systems for finding Shiboken and PySide - # TODO: When we start requiring minimum CMake version above - # 2.8.11, change PATH below to DIRECTORY - get_filename_component(PYTHON_LIBRARY_DIR ${PYTHON_LIBRARY} PATH) - endif(NOT DEFINED PYTHON_LIBRARY) + else(NOT DEFINED PYTHON_LIBRARY) + # Used on MacPorts systems for finding Shiboken and PySide + # TODO: When we start requiring minimum CMake version above + # 2.8.11, change PATH below to DIRECTORY + get_filename_component(PYTHON_LIBRARY_DIR ${PYTHON_LIBRARY} PATH) + endif(NOT DEFINED PYTHON_LIBRARY) -endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_WITH_CONDA) + endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_WITH_CONDA) find_package(PythonInterp REQUIRED) set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) - IF (NOT DEFINED PYTHON_VERSION_STRING) + if (NOT DEFINED PYTHON_VERSION_STRING) find_package(PythonLibs REQUIRED) - ELSE (NOT DEFINED PYTHON_VERSION_STRING) + else (NOT DEFINED PYTHON_VERSION_STRING) find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT) - ENDIF(NOT DEFINED PYTHON_VERSION_STRING) + endif(NOT DEFINED PYTHON_VERSION_STRING) - IF(NOT PYTHONLIBS_FOUND) - MESSAGE(FATAL_ERROR "=================================\n" + if(NOT PYTHONLIBS_FOUND) + message(FATAL_ERROR "=================================\n" "Python not found, install Python!\n" "=================================\n") - ELSE(NOT PYTHONLIBS_FOUND) + else(NOT PYTHONLIBS_FOUND) # prevent python3 lower than 3.3 (not enough utf8<->unicode tools) - IF(PYTHON_VERSION_MAJOR EQUAL 3) - IF(PYTHON_VERSION_MINOR LESS 4) - MESSAGE(FATAL_ERROR "To build FreeCAD with Python3, you need at least version 3.4\n") - ENDIF(PYTHON_VERSION_MINOR LESS 4) - ENDIF(PYTHON_VERSION_MAJOR EQUAL 3) - ENDIF(NOT PYTHONLIBS_FOUND) + if(PYTHON_VERSION_MAJOR EQUAL 3) + if(PYTHON_VERSION_MINOR LESS 4) + message(FATAL_ERROR "To build FreeCAD with Python3, you need at least version 3.4\n") + endif(PYTHON_VERSION_MINOR LESS 4) + endif(PYTHON_VERSION_MAJOR EQUAL 3) + endif(NOT PYTHONLIBS_FOUND) # -------------------------------- pcl ---------------------------------- -# Can be used by ReverseEngineering module" -# -# PCL needs to be found before boost because the PCLConfig also calls find_package(Boost ...), -# but with different components + + # Can be used by ReverseEngineering module" + # + # PCL needs to be found before boost because the PCLConfig also calls find_package(Boost ...), + # but with different components if(FREECAD_USE_PCL) find_package(PCL REQUIRED COMPONENTS common kdtree features surface io filters segmentation sample_consensus) endif(FREECAD_USE_PCL) # -------------------------------- PyBind11 ----------------------------- -# necessary for flat-mesh feature -OPTION(FREECAD_USE_PYBIND11 "Use pybind11" OFF) -if (FREECAD_USE_PYBIND11) - find_package(pybind11 REQUIRED) -endif() + + # necessary for flat-mesh feature + option(FREECAD_USE_PYBIND11 "Use pybind11" OFF) + if (FREECAD_USE_PYBIND11) + find_package(pybind11 REQUIRED) + endif() + # -------------------------------- Boost -------------------------------- - SET(_boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS}) + set(_boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS}) set (BOOST_COMPONENTS filesystem program_options regex system thread) find_package(Boost ${BOOST_MIN_VERSION} @@ -652,7 +656,7 @@ endif() list(APPEND Boost_LIBRARIES pthread) endif() - IF(NOT Boost_FOUND) + if(NOT Boost_FOUND) set (NO_BOOST_COMPONENTS) foreach (comp ${BOOST_COMPONENTS}) string(TOUPPER ${comp} uppercomp) @@ -660,22 +664,22 @@ endif() list(APPEND NO_BOOST_COMPONENTS ${comp}) endif() endforeach() - MESSAGE(FATAL_ERROR "=============================================\n" + message(FATAL_ERROR "=============================================\n" "Required components:\n" " ${BOOST_COMPONENTS}\n" "Not found, install the components:\n" " ${NO_BOOST_COMPONENTS}\n" "=============================================\n") - ENDIF(NOT Boost_FOUND) + endif(NOT Boost_FOUND) # -------------------------------- XercesC -------------------------------- find_package(XercesC REQUIRED) - IF(NOT XercesC_FOUND) - MESSAGE(FATAL_ERROR "==================\n" + if(NOT XercesC_FOUND) + message(FATAL_ERROR "==================\n" "XercesC not found.\n" "==================\n") - ENDIF(NOT XercesC_FOUND) + endif(NOT XercesC_FOUND) # -------------------------------- ZLIB -------------------------------- @@ -688,16 +692,16 @@ endif() # -------------------------------- OpenCasCade -------------------------------- find_package(OpenCasCade) - IF(NOT OCC_FOUND) - MESSAGE(FATAL_ERROR "================================================================\n" + if(NOT OCC_FOUND) + message(FATAL_ERROR "================================================================\n" "Neither OpenCASCADE Community Edition nor OpenCASCADE was found!\n" "================================================================\n") - ENDIF(NOT OCC_FOUND) + endif(NOT OCC_FOUND) # -------------------------------- Salome SMESH -------------------------- # Salome SMESH sources are under src/3rdParty now - IF(BUILD_SMESH) + if(BUILD_SMESH) # set the internal smesh version: # see src/3rdParty/salomonemesh/CMakeLists.txt and commit https://github.com/FreeCAD/FreeCAD/commit/666a3e5 and https://forum.freecadweb.org/viewtopic.php?f=10&t=30838 set(SMESH_VERSION_MAJOR 7) @@ -763,16 +767,16 @@ endif() find_package(HDF5 COMPONENTS NO_MODULE REQUIRED static) else() find_package(PkgConfig) - FILE(READ ${meddotH} TMPTXT) - STRING(FIND "${TMPTXT}" "#define MED_HAVE_MPI" matchres) - if(${matchres} EQUAL -1) - message(STATUS "We guess that libmed was built using hdf5-serial version") - set(HDF5_VARIANT "hdf5-serial") - else() - message(STATUS "We guess that libmed was built using hdf5-openmpi version") - set(HDF5_VARIANT "hdf5-openmpi") - set(HDF5_PREFER_PARALLEL TRUE) # if pkg-config fails, find_package(HDF5) needs this - endif() + file(READ ${meddotH} TMPTXT) + string(FIND "${TMPTXT}" "#define MED_HAVE_MPI" matchres) + if(${matchres} EQUAL -1) + message(STATUS "We guess that libmed was built using hdf5-serial version") + set(HDF5_VARIANT "hdf5-serial") + else() + message(STATUS "We guess that libmed was built using hdf5-openmpi version") + set(HDF5_VARIANT "hdf5-openmpi") + set(HDF5_PREFER_PARALLEL TRUE) # if pkg-config fails, find_package(HDF5) needs this + endif() pkg_search_module(HDF5 ${HDF5_VARIANT}) if(NOT HDF5_FOUND) find_package(HDF5 REQUIRED) @@ -805,7 +809,7 @@ endif() else(NOT FREECAD_USE_EXTERNAL_SMESH) find_package(SMESH CONFIG) set (SMESH_INCLUDE_DIR ${SMESH_INCLUDE_PATH}) - SET(EXTERNAL_SMESH_LIBS ${SMESH_LIBRARIES}) + set(EXTERNAL_SMESH_LIBS ${SMESH_LIBRARIES}) if(NOT SMESH_FOUND) message(ERROR "================\n" "SMESH not found.\n" @@ -816,7 +820,7 @@ endif() set(SMESH_FOUND TRUE) configure_file(SMESH_Version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/SMESH_Version.h) - ENDIF(BUILD_SMESH) + endif(BUILD_SMESH) # -------------------------------- Netgen -------------------------------- @@ -833,23 +837,23 @@ endif() find_package(SWIG) - IF(NOT SWIG_FOUND) - MESSAGE("=====================================================\n" + if (NOT SWIG_FOUND) + message("=====================================================\n" "SWIG not found, will not build SWIG binding for pivy.\n" "=====================================================\n") - ENDIF(NOT SWIG_FOUND) + endif(NOT SWIG_FOUND) # -------------------------------- Eigen -------------------------------- -# necessary for Sketcher module -# necessary for Robot module + # necessary for Sketcher module + # necessary for Robot module find_package(Eigen3) - IF(NOT EIGEN3_FOUND) - MESSAGE("=================\n" + if(NOT EIGEN3_FOUND) + message("=================\n" "Eigen3 not found.\n" "=================\n") - ENDIF(NOT EIGEN3_FOUND) + endif(NOT EIGEN3_FOUND) if (${EIGEN3_VERSION} VERSION_LESS "3.3.1") message(WARNING "Disable module flatmesh because it requires " @@ -867,7 +871,7 @@ endif() endif() endif() - SET(QT_MIN_VERSION 4.5.0) + set(QT_MIN_VERSION 4.5.0) set(QT_USE_QTNETWORK TRUE) set(QT_USE_QTXML TRUE) if(BUILD_GUI) @@ -881,17 +885,17 @@ endif() include(${QT_USE_FILE}) - IF(NOT QT4_FOUND) - MESSAGE(FATAL_ERROR "========================\n" + if(NOT QT4_FOUND) + message(FATAL_ERROR "========================\n" "Qt4 libraries not found.\n" "========================\n") - ENDIF(NOT QT4_FOUND) + endif(NOT QT4_FOUND) - IF(NOT QT_QTWEBKIT_FOUND) - MESSAGE("========================================================\n" + if(NOT QT_QTWEBKIT_FOUND) + message("========================================================\n" "Qt Webkit not found, will not build browser integration.\n" "========================================================\n") - ENDIF(NOT QT_QTWEBKIT_FOUND) + endif(NOT QT_QTWEBKIT_FOUND) # This is a special version of the built in macro qt4_wrap_cpp # It is required since moc'ed files are now included instead of being added to projects directly @@ -903,7 +907,7 @@ endif() QT4_GET_MOC_FLAGS(moc_flags) QT4_EXTRACT_OPTIONS(moc_files moc_options moc_target ${ARGN}) # fixes bug 0000585: bug with boost 1.48 - SET(moc_options ${moc_options} -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED) + set(moc_options ${moc_options} -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED) foreach(it ${moc_files}) get_filename_component(it ${it} ABSOLUTE) @@ -980,7 +984,7 @@ endif() if(FREECAD_USE_FREETYPE) find_package(Freetype) if(NOT FREETYPE_FOUND) - MESSAGE("===============================================================\n" + message("===============================================================\n" "FreeType2 not found. Part module will lack of makeWireString().\n" "===============================================================\n") endif(NOT FREETYPE_FOUND) @@ -991,34 +995,34 @@ endif() if(BUILD_GUI) # -------------------------------- OpenGL -------------------------------- - find_package(OpenGL) - include(FindPackageMessage) - if(OPENGL_GLU_FOUND) - find_package_message(OPENGL_GLU - "Found OpenGLU: ${OPENGL_glu_LIBRARY}" - "[${OPENGL_glu_LIBRARY}][${OPENGL_INCLUDE_DIR}]") - else(OPENGL_GLU_FOUND) - message(FATAL_ERROR "======================\n" - "GLU library not found.\n" - "======================\n") - endif(OPENGL_GLU_FOUND) + find_package(OpenGL) + include(FindPackageMessage) + if(OPENGL_GLU_FOUND) + find_package_message(OPENGL_GLU + "Found OpenGLU: ${OPENGL_glu_LIBRARY}" + "[${OPENGL_glu_LIBRARY}][${OPENGL_INCLUDE_DIR}]") + else(OPENGL_GLU_FOUND) + message(FATAL_ERROR "======================\n" + "GLU library not found.\n" + "======================\n") + endif(OPENGL_GLU_FOUND) # -------------------------------- Coin3D -------------------------------- - find_package(Coin3D REQUIRED) - if(NOT COIN3D_FOUND) - MESSAGE(FATAL_ERROR "=================\n" - "Coin3D not found.\n" - "=================\n") - endif(NOT COIN3D_FOUND) + find_package(Coin3D REQUIRED) + if(NOT COIN3D_FOUND) + message(FATAL_ERROR "=================\n" + "Coin3D not found.\n" + "=================\n") + endif(NOT COIN3D_FOUND) # ------------------------------ Spaceball ------------------------------- - if (WIN32) - #future - else(WIN32) - find_package(Spnav) - endif(WIN32) + if (WIN32) + #future + else(WIN32) + find_package(Spnav) + endif(WIN32) # -------------------------------- Shiboken/PySide ------------------------ @@ -1027,11 +1031,11 @@ endif() # Below are two variables that can be left empty for standard python 3 version, # but must be set by the user for different python versions such as 2.7, 3.5 ... if (PYTHON_VERSION_MAJOR LESS 3) - SET(PYTHON_CONFIG_SUFFIX -python2.7 CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: ") - SET(PYTHON_BASENAME -python2.7 CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: ") + set(PYTHON_CONFIG_SUFFIX -python2.7 CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: ") + set(PYTHON_BASENAME -python2.7 CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: ") else() - #SET(PYTHON_CONFIG_SUFFIX "" CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: ") - #SET(PYTHON_BASENAME "" CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: ") + #set(PYTHON_CONFIG_SUFFIX "" CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: ") + #set(PYTHON_BASENAME "" CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: ") endif() if(DEFINED MACPORTS_PREFIX) @@ -1054,27 +1058,27 @@ endif() get_filename_component(SHIBOKEN_CONFIG_SUFFIX ${SHIBOKEN_CONFIG} NAME) string(SUBSTRING ${SHIBOKEN_CONFIG_SUFFIX} 15 -1 SHIBOKEN_CONFIG_SUFFIX) string(REPLACE ".cmake" "" PYTHON_CONFIG_SUFFIX ${SHIBOKEN_CONFIG_SUFFIX}) - MESSAGE(STATUS "PYTHON_CONFIG_SUFFIX: ${PYTHON_CONFIG_SUFFIX}") + message(STATUS "PYTHON_CONFIG_SUFFIX: ${PYTHON_CONFIG_SUFFIX}") find_package(Shiboken2 QUIET) endif() endif() if(NOT SHIBOKEN_INCLUDE_DIR) - MESSAGE("====================\n" + message("====================\n" "shiboken2 not found.\n" "====================\n") endif(NOT SHIBOKEN_INCLUDE_DIR) find_package(PySide2 QUIET)# REQUIRED if(NOT PYSIDE_INCLUDE_DIR) - MESSAGE("==================\n" + message("==================\n" "PySide2 not found.\n" "==================\n") endif(NOT PYSIDE_INCLUDE_DIR) find_package(PySide2Tools QUIET) #REQUIRED # PySide2 utilities (pyside2-uic & pyside2-rcc) if(NOT PYSIDE2_TOOLS_FOUND) - MESSAGE("=======================\n" + message("=======================\n" "PySide2Tools not found.\n" "=======================\n") endif(NOT PYSIDE2_TOOLS_FOUND) @@ -1092,31 +1096,31 @@ endif() file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtSvg.py "from PySide2.QtSvg import *\n") file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtUiTools.py "from PySide2.QtUiTools import *\n") - if(APPLE AND NOT BUILD_WITH_CONDA) - INSTALL( - DIRECTORY + if(APPLE AND NOT BUILD_WITH_CONDA) + install( + DIRECTORY ${CMAKE_BINARY_DIR}/Ext/PySide - DESTINATION + DESTINATION MacOS ) - else() - INSTALL( - DIRECTORY + else() + install( + DIRECTORY ${CMAKE_BINARY_DIR}/Ext/PySide DESTINATION Ext ) - endif() - else() + endif() + else(BUILD_QT5) # set(PYTHON_SUFFIX -python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) # Below are two variables that can be left empty for standard python 3 version, # but must be set by the user for different python versions such as 2.7, 3.5 ... if (PYTHON_VERSION_MAJOR LESS 3) - SET(PYTHON_CONFIG_SUFFIX -python2.7 CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: ") - SET(PYTHON_BASENAME -python2.7 CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: ") + set(PYTHON_CONFIG_SUFFIX -python2.7 CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: ") + set(PYTHON_BASENAME -python2.7 CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: ") else() - SET(PYTHON_CONFIG_SUFFIX "" CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: ") - SET(PYTHON_BASENAME "" CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: ") + set(PYTHON_CONFIG_SUFFIX "" CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: ") + set(PYTHON_BASENAME "" CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: ") endif() if(DEFINED MACPORTS_PREFIX) @@ -1126,36 +1130,36 @@ endif() find_package(Shiboken)# REQUIRED if(NOT SHIBOKEN_INCLUDE_DIR) - MESSAGE(FATAL_ERROR "===================\n" + message(FATAL_ERROR "===================\n" "shiboken not found.\n" "===================\n") endif(NOT SHIBOKEN_INCLUDE_DIR) find_package(PySide)# REQUIRED if(NOT PYSIDE_INCLUDE_DIR) - MESSAGE(FATAL_ERROR "=================\n" + message(FATAL_ERROR "=================\n" "PySide not found.\n" "=================\n") endif(NOT PYSIDE_INCLUDE_DIR) find_package(PySideTools REQUIRED) # PySide utilities (pyside-uic & pyside-rcc) - endif() + endif(BUILD_QT5) # ------------------------------ Matplotlib ------------------------------ - find_package(Matplotlib) - IF(MATPLOTLIB_FOUND) - message(STATUS "-- matplotlib-${MATPLOTLIB_VERSION} has been found.") - ELSE(MATPLOTLIB_FOUND) - message("=====================================================\n" - "matplotlib not found, Plot module won't be available.\n" - "=====================================================\n") - ENDIF(MATPLOTLIB_FOUND) + find_package(Matplotlib) + if (MATPLOTLIB_FOUND) + message(STATUS "-- matplotlib-${MATPLOTLIB_VERSION} has been found.") + else(MATPLOTLIB_FOUND) + message("=====================================================\n" + "matplotlib not found, Plot module won't be available.\n" + "=====================================================\n") + endif(MATPLOTLIB_FOUND) # ------------------------------------------------------------------------ - endif(BUILD_GUI) +endif(BUILD_GUI) endif(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) @@ -1186,75 +1190,75 @@ configure_file(LibraryVersions.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/LibraryVersio # == Global Compiler and Linker Settings ========================================= include_directories(${CMAKE_BINARY_DIR}/src - ${CMAKE_SOURCE_DIR}/src) + ${CMAKE_SOURCE_DIR}/src) # check for 64-bit platform -IF(CMAKE_SIZEOF_VOID_P EQUAL 8) - MESSAGE(STATUS "Platform is 64-bit, set -D_OCC64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_OCC64") - add_definitions(-D_OCC64 ) -ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) - MESSAGE(STATUS "Platform is 32-bit") -ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + message(STATUS "Platform is 64-bit, set -D_OCC64") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_OCC64") + add_definitions(-D_OCC64 ) +else(CMAKE_SIZEOF_VOID_P EQUAL 8) + message(STATUS "Platform is 32-bit") +endif(CMAKE_SIZEOF_VOID_P EQUAL 8) -IF(MSVC) - # set default compiler settings - SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zm150") - SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFC_DEBUG /Zm150 /bigobj") - # set default libs - SET (CMAKE_C_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib SHFolder.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib comsupp.lib Ws2_32.lib dbghelp.lib ") - set (CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}") - # set linker flag /nodefaultlib - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB") - set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB") - IF(FREECAD_RELEASE_PDB) - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") - set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG") - ENDIF(FREECAD_RELEASE_PDB) - IF(FREECAD_RELEASE_SEH) - SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHa") - ENDIF(FREECAD_RELEASE_SEH) +if(MSVC) + # set default compiler settings + set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zm150") + set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFC_DEBUG /Zm150 /bigobj") + # set default libs + set (CMAKE_C_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib SHFolder.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib comsupp.lib Ws2_32.lib dbghelp.lib ") + set (CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}") + # set linker flag /nodefaultlib + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB") + set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB") + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB") + if(FREECAD_RELEASE_PDB) + set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") + set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG") + endif(FREECAD_RELEASE_PDB) + if(FREECAD_RELEASE_SEH) + set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHa") + endif(FREECAD_RELEASE_SEH) - OPTION(FREECAD_USE_MP_COMPILE_FLAG "Add /MP flag to the compiler definitions. Speeds up the compile on multi processor machines" OFF) + option(FREECAD_USE_MP_COMPILE_FLAG "Add /MP flag to the compiler definitions. Speeds up the compile on multi processor machines" OFF) if(FREECAD_USE_MP_COMPILE_FLAG) # set "Build with Multiple Processes" - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP") endif() # Mark 32 bit executables large address aware so they can use > 2GB address space - # NOTE: This setting only has an effect on machines with at least 3GB of RAM, although it sets the linker option it doesn't set the linker switch 'Enable Large Addresses' - IF(CMAKE_SIZEOF_VOID_P EQUAL 4) - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE") - SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") - ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4) -ELSE(MSVC) - SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFC_DEBUG") - #MESSAGE(STATUS "DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}") - MESSAGE(STATUS "Build type: ${CMAKE_BUILD_TYPE}") -ENDIF(MSVC) + # NOTE: This setting only has an effect on machines with at least 3GB of RAM, although it sets the linker option it doesn't set the linker switch 'Enable Large Addresses' + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE") + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") + endif(CMAKE_SIZEOF_VOID_P EQUAL 4) +else(MSVC) + set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFC_DEBUG") + #message(STATUS "DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}") + message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") +endif(MSVC) -IF(MINGW) - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12477 - # Actually '-Wno-inline-dllimport' should work to suppress warnings of the form: - # inline function 'foo' is declared as dllimport: attribute ignored - # But it doesn't work with MinGW gcc 4.5.0 while using '-Wno-attributes' seems to - # do the trick. - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthreads -Wno-attributes") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthreads -Wno-attributes") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols") - SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols") - # http://stackoverflow.com/questions/8375310/warning-auto-importing-has-been-activated-without-enable-auto-import-specifie - # SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") - LINK_LIBRARIES(-lgdi32) -ENDIF(MINGW) +if(MINGW) + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12477 + # Actually '-Wno-inline-dllimport' should work to suppress warnings of the form: + # inline function 'foo' is declared as dllimport: attribute ignored + # But it doesn't work with MinGW gcc 4.5.0 while using '-Wno-attributes' seems to + # do the trick. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthreads -Wno-attributes") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthreads -Wno-attributes") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols") + # http://stackoverflow.com/questions/8375310/warning-auto-importing-has-been-activated-without-enable-auto-import-specifie + # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") + link_libraries(-lgdi32) +endif(MINGW) # force build directory to be different to source directory #if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) -#MESSAGE(SEND_ERROR "The build directory (${CMAKE_BINARY_DIR}) must be different to the source directory " +#message(SEND_ERROR "The build directory (${CMAKE_BINARY_DIR}) must be different to the source directory " # "(${CMAKE_SOURCE_DIR}). Please choose another build directory!") #elseif() add_subdirectory(src) @@ -1263,25 +1267,26 @@ add_subdirectory(data) # ================================================================================ # == Packaging =================================================================== +# #add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) add_custom_target(dist-git - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py - --srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py + --srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) add_custom_target(distdfsg-git - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py - --srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR} --dfsg - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py + --srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR} --dfsg + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) if(CMAKE_COMPILER_IS_GNUCXX OR MINGW) add_custom_target(distcheck-git - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py --srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR} --check WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) add_custom_target(distcheckdfsg-git - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py --srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR} --dfsg --check WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) @@ -1289,242 +1294,246 @@ endif(CMAKE_COMPILER_IS_GNUCXX OR MINGW) # -------------------------------- The final report ---------------------------------- -MESSAGE(STATUS "\n==============\n" +message(STATUS "\n==============\n" "Summary report\n" "==============\n") # Qt5 needs/sets PYTHON_CONFIG_SUFFIX regarding Shiboken -MESSAGE(STATUS "Python: [${PYTHON_EXECUTABLE}] [${PYTHON_CONFIG_SUFFIX}]") +message(STATUS "Python: [${PYTHON_EXECUTABLE}] [${PYTHON_CONFIG_SUFFIX}]") -IF(DEFINED PCL_FOUND) - MESSAGE(STATUS "PCL: ${PCL_VERSION}") -ELSE(DEFINED PCL_FOUND) - MESSAGE(STATUS "PCL: not enabled") -ENDIF(DEFINED PCL_FOUND) +if(DEFINED PCL_FOUND) + message(STATUS "PCL: ${PCL_VERSION}") +else(DEFINED PCL_FOUND) + message(STATUS "PCL: not enabled") +endif(DEFINED PCL_FOUND) -IF(DEFINED pybind11_FOUND) - MESSAGE(STATUS "pybind11: ${pybind11_VERSION}") -ELSE(DEFINED pybind11_FOUND) - MESSAGE(STATUS "pybind11: not enabled") -ENDIF(DEFINED pybind11_FOUND) +if(DEFINED pybind11_FOUND) + message(STATUS "pybind11: ${pybind11_VERSION}") +else(DEFINED pybind11_FOUND) + message(STATUS "pybind11: not enabled") +endif(DEFINED pybind11_FOUND) -MESSAGE(STATUS "Boost: ${Boost_VERSION}") +message(STATUS "Boost: ${Boost_VERSION}") -MESSAGE(STATUS "XercesC: [${XercesC_LIBRARIES}] [${XercesC_INCLUDE_DIRS}]") +message(STATUS "XercesC: [${XercesC_LIBRARIES}] [${XercesC_INCLUDE_DIRS}]") -MESSAGE(STATUS "ZLIB: ${ZLIB_VERSION_STRING}") +message(STATUS "ZLIB: ${ZLIB_VERSION_STRING}") -MESSAGE(STATUS "PyCXX: [${PYCXX_INCLUDE_DIR}]") +message(STATUS "PyCXX: [${PYCXX_INCLUDE_DIR}]") -MESSAGE(STATUS "OCC: ${OCC_VERSION_STRING} [${OCC_LIBRARIES}]") +message(STATUS "OCC: ${OCC_VERSION_STRING} [${OCC_LIBRARIES}]") -IF(BUILD_SMESH) - IF(FREECAD_USE_EXTERNAL_SMESH) - MESSAGE(STATUS "SMESH: ${SMESH_VERSION}") - ELSE(FREECAD_USE_EXTERNAL_SMESH) - MESSAGE(STATUS "SMESH: build internal") - MESSAGE(STATUS " MEDFile: [${MEDFILE_LIBRARIES}] [${MEDFILE_INCLUDE_DIRS}]") - MESSAGE(STATUS " HDF5: ${HDF5_VERSION}") - MESSAGE(STATUS " VTK: ${VTK_VERSION}") - ENDIF(FREECAD_USE_EXTERNAL_SMESH) -ELSE(BUILD_SMESH) - MESSAGE(STATUS "SMESH: do not build") -ENDIF(BUILD_SMESH) +if(BUILD_SMESH) + if(FREECAD_USE_EXTERNAL_SMESH) + message(STATUS "SMESH: ${SMESH_VERSION}") + else(FREECAD_USE_EXTERNAL_SMESH) + message(STATUS "SMESH: build internal") + message(STATUS " MEDFile: [${MEDFILE_LIBRARIES}] [${MEDFILE_INCLUDE_DIRS}]") + message(STATUS " HDF5: ${HDF5_VERSION}") + message(STATUS " VTK: ${VTK_VERSION}") + endif(FREECAD_USE_EXTERNAL_SMESH) +else(BUILD_SMESH) + message(STATUS "SMESH: do not build") +endif(BUILD_SMESH) -IF(DEFINED NETGEN_FOUND) - MESSAGE(STATUS "NETGEN: ${NETGEN_VERSION} [${NETGEN_DEFINITIONS}] [${NETGEN_CXX_FLAGS}] [${NGLIB_INCLUDE_DIR}] [${NGLIB_LIBRARIES}] [${NETGEN_INCLUDE_DIRS}]") -ELSE(DEFINED NETGEN_FOUND) - MESSAGE(STATUS "NETGEN: not enabled") -ENDIF(DEFINED NETGEN_FOUND) +if(DEFINED NETGEN_FOUND) + message(STATUS "NETGEN: ${NETGEN_VERSION} [${NETGEN_DEFINITIONS}] [${NETGEN_CXX_FLAGS}] [${NGLIB_INCLUDE_DIR}] [${NGLIB_LIBRARIES}] [${NETGEN_INCLUDE_DIRS}]") +else(DEFINED NETGEN_FOUND) + message(STATUS "NETGEN: not enabled") +endif(DEFINED NETGEN_FOUND) -#MESSAGE(STATUS "OpenCV: ${OpenCV_VERSION}") +#message(STATUS "OpenCV: ${OpenCV_VERSION}") -IF(DEFINED SWIG_FOUND) - MESSAGE(STATUS "SWIG: ${SWIG_VERSION}") -ELSE(DEFINED SWIG_FOUND) - MESSAGE(STATUS "SWIG: not found") -ENDIF(DEFINED SWIG_FOUND) +if(DEFINED SWIG_FOUND) + message(STATUS "SWIG: ${SWIG_VERSION}") +else(DEFINED SWIG_FOUND) + message(STATUS "SWIG: not found") +endif(DEFINED SWIG_FOUND) -IF(DEFINED EIGEN3_FOUND) - MESSAGE(STATUS "Eigen3 ${EIGEN3_VERSION}") -ELSE(DEFINED EIGEN3_FOUND) - MESSAGE(STATUS "Eigen3: not found") -ENDIF(DEFINED EIGEN3_FOUND) +if(DEFINED EIGEN3_FOUND) + message(STATUS "Eigen3 ${EIGEN3_VERSION}") +else(DEFINED EIGEN3_FOUND) + message(STATUS "Eigen3: not found") +endif(DEFINED EIGEN3_FOUND) -IF(NOT BUILD_QT5) - MESSAGE(STATUS "Qt4: ${Qt4_VERSION}") - IF(QT_QTWEBKIT_FOUND) - MESSAGE(STATUS "QtWebKit: found") - ELSE(QT_QTWEBKIT_FOUND) - MESSAGE(STATUS "QtWebKit: not found") - ENDIF(QT_QTWEBKIT_FOUND) - MESSAGE(STATUS "Shiboken: ${Shiboken_VERSION} [${SHIBOKEN_INCLUDE_DIR}]") - MESSAGE(STATUS "PySide: ${PySide_VERSION} [${PYSIDE_INCLUDE_DIR}]") - MESSAGE(STATUS "PySideTools: [${PYSIDEUIC4BINARY}] [${PYSIDERCC4BINARY}]") -ELSE(NOT BUILD_QT5) - MESSAGE(STATUS "Qt5Core: ${Qt5Core_VERSION}") - MESSAGE(STATUS "Qt5Network: ${Qt5Network_VERSION}") - MESSAGE(STATUS "Qt5Xml: ${Qt5Xml_VERSION}") - IF (BUILD_GUI) - MESSAGE(STATUS "Qt5Widgets: ${Qt5Widgets_VERSION}") - MESSAGE(STATUS "Qt5PrintSupport: ${Qt5PrintSupport_VERSION}") - MESSAGE(STATUS "Qt5OpenGL: ${Qt5OpenGL_VERSION}") - MESSAGE(STATUS "Qt5Svg: ${Qt5Svg_VERSION}") - MESSAGE(STATUS "Qt5UiTools: ${Qt5UiTools_VERSION}") - MESSAGE(STATUS "Qt5Concurrent: ${Qt5Concurrent_VERSION}") - IF(BUILD_WEB) - MESSAGE(STATUS "Qt5WebKitWidgets: ${Qt5WebKitWidgets_VERSION}") - MESSAGE(STATUS "Qt5WebEngineWidgets: ${Qt5WebEngineWidgets_VERSION}") - ELSE(BUILD_WEB) - MESSAGE(STATUS "Qt5WebKitWidgets: not needed (BUILD_WEB)") - MESSAGE(STATUS "Qt5WebEngineWidgets: not needed (BUILD_WEB)") - ENDIF(BUILD_WEB) - IF(${Qt5WinExtras_FOUND}) - MESSAGE(STATUS "Qt5WinExtras: ${Qt5WinExtras_VERSION}") - ENDIF() - - ELSE(BUILD_GUI) - MESSAGE(STATUS "Qt5Widgets: not needed") - MESSAGE(STATUS "Qt5PrintSupport: not needed") - MESSAGE(STATUS "Qt5OpenGL: not needed") - MESSAGE(STATUS "Qt5Svg: not needed") - MESSAGE(STATUS "Qt5UiTools: not needed") - MESSAGE(STATUS "Qt5Concurrent: not needed") - MESSAGE(STATUS "Qt5WebKitWidgets: not needed") - ENDIF(BUILD_GUI) +if(NOT BUILD_QT5) + message(STATUS "Qt4: ${Qt4_VERSION}") + if(QT_QTWEBKIT_FOUND) + message(STATUS "QtWebKit: found") + else(QT_QTWEBKIT_FOUND) + message(STATUS "QtWebKit: not found") + endif(QT_QTWEBKIT_FOUND) + message(STATUS "Shiboken: ${Shiboken_VERSION} [${SHIBOKEN_INCLUDE_DIR}]") + message(STATUS "PySide: ${PySide_VERSION} [${PYSIDE_INCLUDE_DIR}]") + message(STATUS "PySideTools: [${PYSIDEUIC4BINARY}] [${PYSIDERCC4BINARY}]") +else(NOT BUILD_QT5) + message(STATUS "Qt5Core: ${Qt5Core_VERSION}") + message(STATUS "Qt5Network: ${Qt5Network_VERSION}") + message(STATUS "Qt5Xml: ${Qt5Xml_VERSION}") + if (BUILD_GUI) + message(STATUS "Qt5Widgets: ${Qt5Widgets_VERSION}") + message(STATUS "Qt5PrintSupport: ${Qt5PrintSupport_VERSION}") + message(STATUS "Qt5OpenGL: ${Qt5OpenGL_VERSION}") + message(STATUS "Qt5Svg: ${Qt5Svg_VERSION}") + message(STATUS "Qt5UiTools: ${Qt5UiTools_VERSION}") + message(STATUS "Qt5Concurrent: ${Qt5Concurrent_VERSION}") + if(BUILD_WEB) + if (Qt5WebKitWidgets_FOUND) + message(STATUS "Qt5WebKitWidgets: ${Qt5WebKitWidgets_VERSION}") + endif() + if (Qt5WebEngineWidgets_FOUND) + message(STATUS "Qt5WebEngineWidgets: ${Qt5WebEngineWidgets_VERSION}") + endif() + else(BUILD_WEB) + message(STATUS "Qt5WebKitWidgets: not needed (BUILD_WEB)") + message(STATUS "Qt5WebEngineWidgets: not needed (BUILD_WEB)") + endif(BUILD_WEB) + if(${Qt5WinExtras_FOUND}) + message(STATUS "Qt5WinExtras: ${Qt5WinExtras_VERSION}") + endif() - IF(DEFINED MACPORTS_PREFIX) - IF(DEFINED Shiboken_FOUND) - MESSAGE(STATUS "Shiboken: ${Shiboken_VERSION} [${SHIBOKEN_INCLUDE_DIR}]") - ELSE(DEFINED Shiboken_FOUND) - MESSAGE(STATUS "Shiboken: not found (only searched if MACPORTS_PREFIX is defined)") - ENDIF(DEFINED Shiboken_FOUND) - IF(DEFINED PySide_FOUND) - MESSAGE(STATUS "PySide: ${PySide_VERSION} [${PYSIDE_INCLUDE_DIR}]") - IF(NOT PYSIDE_INCLUDE_DIR) - MESSAGE(STATUS " IncludeDir: Unable to find, python version mismatch?") - ENDIF(NOT PYSIDE_INCLUDE_DIR) - ELSE(DEFINED PySide_FOUND) - MESSAGE(STATUS "PySide: not found (only searched if MACPORTS_PREFIX is defined)") - ENDIF(DEFINED PySide_FOUND) - ENDIF(DEFINED MACPORTS_PREFIX) + else(BUILD_GUI) + message(STATUS "Qt5Widgets: not needed") + message(STATUS "Qt5PrintSupport: not needed") + message(STATUS "Qt5OpenGL: not needed") + message(STATUS "Qt5Svg: not needed") + message(STATUS "Qt5UiTools: not needed") + message(STATUS "Qt5Concurrent: not needed") + message(STATUS "Qt5WebKitWidgets: not needed") + endif(BUILD_GUI) - IF(DEFINED Shiboken2_FOUND) - MESSAGE(STATUS "Shiboken2: ${Shiboken2_VERSION} [${Shiboken2_DIR}] [${SHIBOKEN_INCLUDE_DIR}]") - ELSE(DEFINED Shiboken2_FOUND) - MESSAGE(STATUS "Shiboken2: not found") - ENDIF(DEFINED Shiboken2_FOUND) - IF(DEFINED PySide2_FOUND) - MESSAGE(STATUS "PySide2: ${PySide2_VERSION} [${PYSIDE_INCLUDE_DIR}]") - IF(NOT PYSIDE_INCLUDE_DIR) - MESSAGE(STATUS " IncludeDir: Unable to find, python version mismatch?") - ENDIF(NOT PYSIDE_INCLUDE_DIR) - ELSE(DEFINED PySide2_FOUND) - MESSAGE(STATUS "PySide2: not found") - ENDIF(DEFINED PySide2_FOUND) - IF(DEFINED PYSIDE2_TOOLS_FOUND) - MESSAGE(STATUS "PySide2Tools: [${PYSIDE2UICBINARY}] [${PYSIDE2RCCBINARY}]") - ELSE(DEFINED PYSIDE2_TOOLS_FOUND) - MESSAGE(STATUS "PySide2Tools: not found") - ENDIF(DEFINED PYSIDE2_TOOLS_FOUND) -ENDIF(NOT BUILD_QT5) + if(DEFINED MACPORTS_PREFIX) + if(DEFINED Shiboken_FOUND) + message(STATUS "Shiboken: ${Shiboken_VERSION} [${SHIBOKEN_INCLUDE_DIR}]") + else(DEFINED Shiboken_FOUND) + message(STATUS "Shiboken: not found (only searched if MACPORTS_PREFIX is defined)") + endif(DEFINED Shiboken_FOUND) + if(DEFINED PySide_FOUND) + message(STATUS "PySide: ${PySide_VERSION} [${PYSIDE_INCLUDE_DIR}]") + if(NOT PYSIDE_INCLUDE_DIR) + message(STATUS " IncludeDir: Unable to find, python version mismatch?") + endif(NOT PYSIDE_INCLUDE_DIR) + else(DEFINED PySide_FOUND) + message(STATUS "PySide: not found (only searched if MACPORTS_PREFIX is defined)") + endif(DEFINED PySide_FOUND) + endif(DEFINED MACPORTS_PREFIX) -IF(FREECAD_USE_FREETYPE) - IF(DEFINED FREETYPE_FOUND) - MESSAGE(STATUS "Freetype: ${FREETYPE_VERSION_STRING}") - ELSE(DEFINED FREETYPE_FOUND) - MESSAGE(STATUS "Freetype: not found") - ENDIF(DEFINED FREETYPE_FOUND) -ELSE(FREECAD_USE_FREETYPE) - MESSAGE(STATUS "Freetype: disabled") -ENDIF(FREECAD_USE_FREETYPE) + if(DEFINED Shiboken2_FOUND) + message(STATUS "Shiboken2: ${Shiboken2_VERSION} [${Shiboken2_DIR}] [${SHIBOKEN_INCLUDE_DIR}]") + else(DEFINED Shiboken2_FOUND) + message(STATUS "Shiboken2: not found") + endif(DEFINED Shiboken2_FOUND) + if(DEFINED PySide2_FOUND) + message(STATUS "PySide2: ${PySide2_VERSION} [${PYSIDE_INCLUDE_DIR}]") + if(NOT PYSIDE_INCLUDE_DIR) + message(STATUS " IncludeDir: Unable to find, python version mismatch?") + endif(NOT PYSIDE_INCLUDE_DIR) + else(DEFINED PySide2_FOUND) + message(STATUS "PySide2: not found") + endif(DEFINED PySide2_FOUND) + if(DEFINED PYSIDE2_TOOLS_FOUND) + message(STATUS "PySide2Tools: [${PYSIDE2UICBINARY}] [${PYSIDE2RCCBINARY}]") + else(DEFINED PYSIDE2_TOOLS_FOUND) + message(STATUS "PySide2Tools: not found") + endif(DEFINED PYSIDE2_TOOLS_FOUND) +endif(NOT BUILD_QT5) -MESSAGE(STATUS "OpenGLU: ${OPENGL_glu_LIBRARY} [${OPENGL_glu_LIBRARY}][${OPENGL_INCLUDE_DIR}]") +if(FREECAD_USE_FREETYPE) + if(DEFINED FREETYPE_FOUND) + message(STATUS "Freetype: ${FREETYPE_VERSION_STRING}") + else(DEFINED FREETYPE_FOUND) + message(STATUS "Freetype: not found") + endif(DEFINED FREETYPE_FOUND) +else(FREECAD_USE_FREETYPE) + message(STATUS "Freetype: disabled") +endif(FREECAD_USE_FREETYPE) -MESSAGE(STATUS "Coin3D: [${COIN3D_LIBRARIES}] [${COIN3D_INCLUDE_DIRS}]") +message(STATUS "OpenGLU: ${OPENGL_glu_LIBRARY} [${OPENGL_glu_LIBRARY}][${OPENGL_INCLUDE_DIR}]") + +message(STATUS "Coin3D: [${COIN3D_LIBRARIES}] [${COIN3D_INCLUDE_DIRS}]") -IF (WIN32) -#MESSAGE(STATUS "SPNAV: not available yet for your OS") # FREECAD_USE_3DCONNEXION instead... -ELSE(WIN32) - IF(DEFINED SPNAV_FOUND) - MESSAGE(STATUS "SPNAV: [${SPNAV_LIBRARY}] [${SPNAV_INCLUDE_DIR}]") - ELSE(DEFINED SPNAV_FOUND) - MESSAGE(STATUS "SPNAV: not found") - ENDIF(DEFINED SPNAV_FOUND) -ENDIF(WIN32) +if (WIN32) +#message(STATUS "SPNAV: not available yet for your OS") # FREECAD_USE_3DCONNEXION instead... +else(WIN32) + if(DEFINED SPNAV_FOUND) + message(STATUS "SPNAV: [${SPNAV_LIBRARY}] [${SPNAV_INCLUDE_DIR}]") + else(DEFINED SPNAV_FOUND) + message(STATUS "SPNAV: not found") + endif(DEFINED SPNAV_FOUND) +endif(WIN32) -IF(MATPLOTLIB_FOUND) - MESSAGE(STATUS "Matplotlib: ${MATPLOTLIB_VERSION}") -ELSE(MATPLOTLIB_FOUND) - MESSAGE(STATUS "Matplotlib: not found") -ENDIF(MATPLOTLIB_FOUND) +if(MATPLOTLIB_FOUND) + message(STATUS "Matplotlib: ${MATPLOTLIB_VERSION}") +else(MATPLOTLIB_FOUND) + message(STATUS "Matplotlib: not found") +endif(MATPLOTLIB_FOUND) -IF(BUILD_VR) - IF(DEFINED RIFT_FOUND) - MESSAGE(STATUS "Rift: ${Rift_VERSION}") - ELSE(DEFINED RIFT_FOUND) - MESSAGE(STATUS "Rift: not found") - ENDIF(DEFINED RIFT_FOUND) -ELSE(BUILD_VR) - MESSAGE(STATUS "Rift: not enabled (BUILD_VR)") -ENDIF(BUILD_VR) +if(BUILD_VR) + if(DEFINED RIFT_FOUND) + message(STATUS "Rift: ${Rift_VERSION}") + else(DEFINED RIFT_FOUND) + message(STATUS "Rift: not found") + endif(DEFINED RIFT_FOUND) +else(BUILD_VR) + message(STATUS "Rift: not enabled (BUILD_VR)") +endif(BUILD_VR) -IF(DOXYGEN_FOUND) - MESSAGE(STATUS "Doxygen: ${DOXYGEN_VERSION}") - MESSAGE(STATUS " Language: ${DOXYGEN_LANGUAGE}") - IF(COIN3D_DOC_FOUND) - MESSAGE(STATUS " Coin3D_DOC: found [${COIN3D_DOC_PATH}]") - ELSE(COIN3D_DOC_FOUND) - MESSAGE(STATUS " Coin3D_DOC: not found") - ENDIF(COIN3D_DOC_FOUND) -ELSE(DOXYGEN_FOUND) - MESSAGE(STATUS "Doxygen: not found") -ENDIF(DOXYGEN_FOUND) +if(DOXYGEN_FOUND) + message(STATUS "Doxygen: ${DOXYGEN_VERSION}") + message(STATUS " Language: ${DOXYGEN_LANGUAGE}") + if(COIN3D_DOC_FOUND) + message(STATUS " Coin3D_DOC: found [${COIN3D_DOC_PATH}]") + else(COIN3D_DOC_FOUND) + message(STATUS " Coin3D_DOC: not found") + endif(COIN3D_DOC_FOUND) +else(DOXYGEN_FOUND) + message(STATUS "Doxygen: not found") +endif(DOXYGEN_FOUND) -IF(MSVC) +if(MSVC) # Copy libpack dependency directories to build folder for user as part of overall build process - IF(FREECAD_LIBPACK_USE AND LIBPACK_FOUND) - IF(FREECAD_COPY_DEPEND_DIRS_TO_BUILD) - MESSAGE(STATUS "=======================================\n" + if(FREECAD_LIBPACK_USE AND LIBPACK_FOUND) + if(FREECAD_COPY_DEPEND_DIRS_TO_BUILD) + message(STATUS "=======================================\n" "Copying libpack dependency directories to build directory for Windows MSVC build.\n") - FILE(COPY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_BINARY_DIR}/bin) - FILE(COPY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_BINARY_DIR}/bin) - FILE(COPY ${FREECAD_LIBPACK_DIR}/plugins/iconengines DESTINATION ${CMAKE_BINARY_DIR}/bin) - FILE(COPY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_BINARY_DIR}/bin) - FILE(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR}) - FILE(COPY ${FREECAD_LIBPACK_DIR}/bin/Lib/site-packages/PySide2/translations/qtwebengine_locales + file(COPY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_BINARY_DIR}/bin) + file(COPY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_BINARY_DIR}/bin) + file(COPY ${FREECAD_LIBPACK_DIR}/plugins/iconengines DESTINATION ${CMAKE_BINARY_DIR}/bin) + file(COPY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_BINARY_DIR}/bin) + file(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR}) + file(COPY ${FREECAD_LIBPACK_DIR}/bin/Lib/site-packages/PySide2/translations/qtwebengine_locales DESTINATION ${CMAKE_BINARY_DIR}/bin) - MESSAGE(STATUS "... end copying.\n=======================================\n") - ENDIF(FREECAD_COPY_DEPEND_DIRS_TO_BUILD) + message(STATUS "... end copying.\n=======================================\n") + endif(FREECAD_COPY_DEPEND_DIRS_TO_BUILD) - IF(COPY_LIBPACK_BIN_TO_BUILD) - IF(FREECAD_COPY_LIBPACK_BIN_TO_BUILD) - MESSAGE("=======================================\n" + if(COPY_LIBPACK_BIN_TO_BUILD) + if(FREECAD_COPY_LIBPACK_BIN_TO_BUILD) + message("=======================================\n" "Copying libpack 'bin' directory to build directory.\n") - FILE(COPY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_BINARY_DIR}) - MESSAGE("... done copying libpack 'bin' directory.\n=======================================\n") - ENDIF() - ENDIF() + file(COPY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_BINARY_DIR}) + message("... done copying libpack 'bin' directory.\n=======================================\n") + endif() + endif() - IF(FREECAD_INSTALL_DEPEND_DIRS) + if(FREECAD_INSTALL_DEPEND_DIRS) # Test install command for installing/copying directories - MESSAGE(STATUS "=======================================") - INSTALL(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) - INSTALL(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) - INSTALL(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/iconengines DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) - INSTALL(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) - INSTALL(DIRECTORY ${FREECAD_LIBPACK_DIR}/bin/Lib/site-packages/PySide2/translations/qtwebengine_locales DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) - INSTALL(DIRECTORY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_INSTALL_PREFIX}) - INSTALL(DIRECTORY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX}) - MESSAGE(STATUS "Created install commands for INSTALL project.\n") - ENDIF(FREECAD_INSTALL_DEPEND_DIRS) - ENDIF(FREECAD_LIBPACK_USE AND LIBPACK_FOUND) -ENDIF() + message(STATUS "=======================================") + install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/iconengines DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + install(DIRECTORY ${FREECAD_LIBPACK_DIR}/bin/Lib/site-packages/PySide2/translations/qtwebengine_locales DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + install(DIRECTORY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_INSTALL_PREFIX}) + install(DIRECTORY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX}) + message(STATUS "Created install commands for INSTALL target.\n") + endif(FREECAD_INSTALL_DEPEND_DIRS) + endif(FREECAD_LIBPACK_USE AND LIBPACK_FOUND) +endif() # Print message to start build process if (${CMAKE_BUILD_TOOL} MATCHES "make") - MESSAGE("=======================================\n" + message("=======================================\n" "Now run 'make' to build ${PACKAGE_NAME}\n" "=======================================\n") endif()