forked from ruslo/hunter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New module hunter_generate_qt_info and tests
hunter_generate_qt_info is a wrapper which will call: * hunter_generate_qt_5_5_info * hunter_generate_qt_5_6_info
- Loading branch information
Showing
3 changed files
with
189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Copyright (c) 2015, Ruslan Baratov | ||
# All rights reserved. | ||
|
||
include(hunter_generate_qt_5_5_info) | ||
include(hunter_generate_qt_5_6_info) | ||
include(hunter_test_string_not_empty) | ||
include(hunter_user_error) | ||
|
||
# See cmake/projects/Qt/generate.sh | ||
|
||
function( | ||
hunter_generate_qt_info | ||
component_name | ||
skip_components_varname | ||
component_depends_on_varname | ||
nobuild_varname | ||
qt_version | ||
is_android | ||
is_win32 | ||
) | ||
hunter_test_string_not_empty("${component_name}") | ||
hunter_test_string_not_empty("${skip_components_varname}") | ||
hunter_test_string_not_empty("${component_depends_on_varname}") | ||
hunter_test_string_not_empty("${nobuild_varname}") | ||
hunter_test_string_not_empty("${qt_version}") | ||
|
||
if(qt_version MATCHES "^5\\.5\\.") | ||
hunter_generate_qt_5_5_info( | ||
"${component_name}" | ||
toskip | ||
depends_on | ||
"${is_android}" | ||
"${is_win32}" | ||
) | ||
elseif(qt_version MATCHES "^5\\.6\\.") | ||
hunter_generate_qt_5_6_info( | ||
"${component_name}" | ||
toskip | ||
depends_on | ||
"${is_android}" | ||
"${is_win32}" | ||
) | ||
else() | ||
hunter_user_error("Unexpected Qt version") | ||
endif() | ||
|
||
set( | ||
nobuild | ||
"qtwebkit" | ||
"qtwebengine" | ||
"qtwebview" | ||
"qtwinextras" | ||
"qtx11extras" | ||
) | ||
|
||
set("${skip_components_varname}" "${toskip}" PARENT_SCOPE) | ||
set("${component_depends_on_varname}" "${depends_on}" PARENT_SCOPE) | ||
set("${nobuild_varname}" "${nobuild}" PARENT_SCOPE) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# Copyright (c) 2015, Ruslan Baratov | ||
# All rights reserved. | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
|
||
include("../../examples/common.cmake") | ||
project(TestModuleHunterGenerateQtInfo) | ||
|
||
include(hunter_generate_qt_info) | ||
|
||
set( | ||
all_components | ||
qt3d | ||
qtactiveqt | ||
qtandroidextras | ||
qtbase | ||
qtcanvas3d | ||
qtconnectivity | ||
qtdeclarative | ||
qtdoc | ||
qtenginio | ||
qtgraphicaleffects | ||
qtimageformats | ||
qtlocation | ||
qtmacextras | ||
qtmultimedia | ||
qtquick1 | ||
qtquickcontrols | ||
qtscript | ||
qtsensors | ||
qtserialport | ||
qtsvg | ||
qttools | ||
qttranslations | ||
qtwayland | ||
qtwebchannel | ||
qtwebengine | ||
qtwebkit | ||
qtwebkit-examples | ||
qtwebsockets | ||
qtwinextras | ||
qtx11extras | ||
qtxmlpatterns | ||
) | ||
|
||
### Test qtbase | ||
hunter_generate_qt_info("qtbase" toskip depends_on nobuild "5.5.0" "NO" "NO") | ||
|
||
list(APPEND toskip qtbase) | ||
list(SORT toskip) | ||
string(COMPARE EQUAL "${toskip}" "${all_components}" is_good) | ||
if(NOT is_good) | ||
message(FATAL_ERROR "qtbase should skip all components: ${toskip}") | ||
endif() | ||
|
||
string(COMPARE EQUAL "${depends_on}" "" is_good) | ||
if(NOT is_good) | ||
message(FATAL_ERROR "qtbase should not depends on anything: ${depends_on}") | ||
endif() | ||
|
||
### Test android component | ||
hunter_generate_qt_info("qtconnectivity" toskip depends_on nobuild "5.5.0" "YES" "NO") | ||
list(FIND depends_on "qtandroidextras" found) | ||
if(found EQUAL -1) | ||
message(FATAL_ERROR "qtandroidextras component not found") | ||
endif() | ||
|
||
### Test no android component | ||
hunter_generate_qt_info("qtconnectivity" toskip depends_on nobuild "5.5.0" "0" "NO") | ||
list(FIND depends_on "qtandroidextras" found) | ||
if(NOT found EQUAL -1) | ||
message(FATAL_ERROR "qtandroidextras component found") | ||
endif() | ||
|
||
### | ||
hunter_generate_qt_info("qtsvg" toskip depends_on nobuild "5.5.0" "NO" "NO") | ||
string(COMPARE EQUAL "qtbase" "${depends_on}" is_good) | ||
if(NOT is_good) | ||
message(FATAL_ERROR "qtsvg depends only on qtbase: ${depends_on}") | ||
endif() | ||
|
||
### Test qtdeclarative | ||
hunter_generate_qt_info("qtdeclarative" toskip depends_on nobuild "5.5.0" "NO" "NO") | ||
string(COMPARE EQUAL "${depends_on}" "qtbase;qtsvg;qtxmlpatterns" is_good) | ||
if(NOT is_good) | ||
message(FATAL_ERROR "Not good") | ||
endif() | ||
|
||
### Test | ||
hunter_generate_qt_info("qtenginio" toskip depends_on nobuild "5.5.0" "NO" "") # empty string should work fine too | ||
string(COMPARE EQUAL "${depends_on}" "qtbase;qtdeclarative;qtsvg;qtxmlpatterns" is_good) | ||
if(NOT is_good) | ||
message(FATAL_ERROR "Not good") | ||
endif() | ||
|
||
### Test | ||
hunter_generate_qt_info("qtwebchannel" toskip depends_on nobuild "5.5.0" "NO" "NO") | ||
string(COMPARE EQUAL "${depends_on}" "qtbase;qtdeclarative;qtsvg;qtwebsockets;qtxmlpatterns" is_good) | ||
if(NOT is_good) | ||
message(FATAL_ERROR "Not good") | ||
endif() | ||
|
||
### Test | ||
hunter_generate_qt_info("qtwebkit" toskip depends_on nobuild "5.5.0" "NO" "NO") | ||
string( | ||
COMPARE | ||
EQUAL | ||
"${depends_on}" | ||
"qtbase;qtdeclarative;qtlocation;qtmultimedia;qtsensors;qtsvg;qtwebchannel;qtwebsockets;qtxmlpatterns" | ||
is_good | ||
) | ||
if(NOT is_good) | ||
message(FATAL_ERROR "Not good: ${depends_on}") | ||
endif() | ||
|
||
### Test | ||
hunter_generate_qt_info("qtwebengine" toskip depends_on nobuild "5.5.0" "NO" "NO") | ||
string( | ||
COMPARE | ||
EQUAL | ||
"${depends_on}" | ||
"qtbase;qtdeclarative;qtgraphicaleffects;qtlocation;qtmultimedia;qtquickcontrols;qtsensors;qtsvg;qtwebchannel;qtwebkit;qtwebsockets;qtxmlpatterns" | ||
is_good | ||
) | ||
if(NOT is_good) | ||
message(FATAL_ERROR "Not good: ${depends_on}") | ||
endif() | ||
|
||
message("PASSED") |