Skip to content

Commit

Permalink
[NOBIN] In CMake: select between Qt5 and Qt6 explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Jul 7, 2024
1 parent b0063c4 commit e863a85
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ before_build:
- mkdir build
- cd build
- if [%env_arch%]==[x64] (
cmake .. -A x64 )
cmake .. -A x64 -DUSE_QT5=ON)
- if [%env_arch%]==[x86] (
cmake .. )
cmake .. -A Win32 -DUSE_QT5=ON)

build_script:
- cmake --build . --config %CONFIGURATION%
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ option(CMD_BUILD_TESTING "Enable testing for bearcommander" ON)
set ( M_BEARPARSER "parser" )
set ( M_BEARCOMMANDER "commander" )

option( USE_QT4 "Use Qt4 (Qt5 by default)" OFF )
option(USE_QT4 "Use Qt4" OFF )
option(USE_QT5 "Use Qt5" OFF )

# modules paths:
set (BEARPARSER_INC "${M_BEARPARSER}/include")
Expand Down
6 changes: 5 additions & 1 deletion parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ if(USE_QT4)
INCLUDE( ${QT_USE_FILE} )
ADD_DEFINITIONS( ${QT_DEFINITIONS} )
else()
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
if(USE_QT5)
find_package(QT NAMES Qt5 COMPONENTS Core REQUIRED)
else()
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
get_target_property(QtCore_location Qt${QT_VERSION_MAJOR}::Core LOCATION)
endif()
Expand Down

0 comments on commit e863a85

Please sign in to comment.