Skip to content

Commit

Permalink
fix and improve handling of BUILD_QT5 option
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed May 25, 2019
1 parent d887735 commit e2d2734
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Expand Up @@ -184,7 +184,6 @@ MESSAGE(STATUS "cmake: ${CMAKE_VERSION}")
# ==============================================================================

# Switch to build FreeCAD with Qt5
OPTION(BUILD_QT5 "Build with Qt5." 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)
Expand Down Expand Up @@ -218,6 +217,11 @@ if(MSVC)
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()

SET(LIBPACK_FOUND OFF)
Expand All @@ -236,15 +240,12 @@ if(MSVC)
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()
# Default Qt5 ON if present in libpack
IF(EXISTS ${CMAKE_BINARY_DIR}/bin/Qt5Core.dll)
OPTION(BUILD_QT5 "Build with Qt5." 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)
Expand Down

0 comments on commit e2d2734

Please sign in to comment.