Skip to content
Snippets Groups Projects
Commit 6d23e1fb authored by Mohcine Chraibi's avatar Mohcine Chraibi
Browse files

silence policy warnings

parent 89d21881
Branches
No related tags found
No related merge requests found
Pipeline #
......@@ -10,20 +10,24 @@
# example: >> cmake -DDESIRED_QT_VERSION=5 -DCMAKE_PREFIX_PATH=~/Qt/5.5/clang_64 ..
# Flags for VS: -G "Visual Studio ..." -DCMAKE_PREFIX_PATH=... -DCMAKE_C_FLAGS="-mwindows"
cmake_minimum_required(VERSION 2.8.9)
IF (POLICY CMP0048) # in CMake 3.0.0+
CMAKE_POLICY (SET CMP0048 OLD) # keep PROJECT() from clearing VERSION variables
ENDIF (POLICY CMP0048)
IF (POLICY CMP0043) # in CMake 3.0.0+
CMAKE_POLICY (SET CMP0043 OLD) # keep PROJECT() from clearing VERSION variables
ENDIF (POLICY CMP0043)
IF (POLICY CMP0020)
CMAKE_POLICY (SET CMP0020 OLD) # keep old POLICY (2.8.10 and lower) The OLD behavior for this policy is not to link executables to
ENDIF (POLICY CMP0020) #qtmain.lib automatically when they link to the QtCore IMPORTEDtarget
cmake_minimum_required(VERSION 3.1)
##IF (POLICY CMP0048) # in CMake 3.0.0+
# CMAKE_POLICY (SET CMP0048 OLD) # keep PROJECT() from clearing VERSION variables
#ENDIF (POLICY CMP0048)
#IF (POLICY CMP0043) # in CMake 3.0.0+
# CMAKE_POLICY (SET CMP0043 OLD) # keep PROJECT() from clearing VERSION variables
#ENDIF (POLICY CMP0043)
#IF (POLICY CMP0020)
# CMAKE_POLICY (SET CMP0020 OLD) # keep old POLICY (2.8.10 and lower) The OLD behavior for this policy is not to link executables to
#ENDIF (POLICY CMP0020) #qtmain.lib automatically when they link to the QtCore IMPORTEDtarget
IF (POLICY CMP0025)
cmake_policy(SET CMP0025 NEW) #fixes error No known features for CXX compiler (on mac)
ENDIF (POLICY CMP0025)
IF (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
ENDIF (POLICY CMP0054)
project(JPSeditor)
......@@ -190,14 +194,20 @@ ENDIF (WIN32)
if("${QT_QMAKE_EXECUTABLE}" STREQUAL "")
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake)
if ("${QT_QMAKE_EXECUTABLE}" STREQUAL "")
message(FATTAL_ERROR "QT not found - abort.")
message(FATAL_ERROR "QT not found - abort.")
endif()
endif()
message(STATUS "QT_Qmake_executable ........................... " ${QT_QMAKE_EXECUTABLE})
if("${QT_QMAKE_EXECUTABLE}" STREQUAL "QT_QMAKE_EXECUTABLE-NOTFOUND")
message(FATAL_ERROR "QT not found - abort.")
endif()
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_VERSION OUTPUT_VARIABLE QT_VERSION)
message(STATUS "QT_VERSION .................................... " ${QT_VERSION})
# qt version > 5 or qt version < 3 are not supported
if( ${QT_VERSION} VERSION_GREATER 6 OR ${QT_VERSION} VERSION_LESS 3)
if( "${QT_VERSION}" VERSION_GREATER 6 OR "${QT_VERSION}" VERSION_LESS 3)
message(FATAL_ERROR "QT version " ${DESIRED_QT_VERSION} " not supported. Try 4 or 5")
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment