-
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.
Implement SUBDIR-= conversion in pro2cmake tool
CMake doesn't support removing subdirectories therefore one need to convert all removal to conditional adds. The resulting code doesn't win a beauty contest. That is because handle_subdir works on already processed strings which means it doesn't have access to the boolean operations. As such it can not minimize the expressions, but it works and in the most simple cases it is pretty good. The patch re-generates CMakeLists.txt under tests/auto/corelib/kernel excluding qcoreapplication, qmetatype, qmimedata, qobject, qtimer, which are suffering from unrelated problems, like for example Gui, pthread linkage issues. Change-Id: I18a02f6eda7a3b41b1313211c8bc9ce277bb67be Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <[email protected]>
- Loading branch information
Showing
28 changed files
with
566 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
# Generated from kernel.pro. | ||
|
||
# add_subdirectory(qcoreapplication) | ||
add_subdirectory(qdeadlinetimer) | ||
add_subdirectory(qelapsedtimer) | ||
add_subdirectory(qeventdispatcher) | ||
if(NOT ((NOT TARGET Qt::Network))) | ||
add_subdirectory(qeventloop) | ||
endif() | ||
add_subdirectory(qmath) | ||
add_subdirectory(qmetaenum) | ||
add_subdirectory(qmetamethod) | ||
add_subdirectory(qmetaobject) | ||
add_subdirectory(qmetaobjectbuilder) | ||
add_subdirectory(qmetamethod) | ||
add_subdirectory(qmetaproperty) | ||
# add_subdirectory(qmimedata) | ||
# add_subdirectory(qmetatype) | ||
add_subdirectory(qmetaenum) | ||
if(NOT ((NOT TARGET Qt::Gui))) | ||
# add_subdirectory(qmimedata) | ||
endif() | ||
if(NOT ((ANDROID OR APPLE_UIKIT) OR (NOT TARGET Qt::Network))) | ||
# add_subdirectory(qobject) | ||
endif() | ||
add_subdirectory(qpointer) | ||
if(NOT ((ANDROID OR APPLE_UIKIT) OR (NOT QT_FEATURE_private_tests))) | ||
add_subdirectory(qsharedmemory) | ||
endif() | ||
add_subdirectory(qsignalblocker) | ||
add_subdirectory(qsignalmapper) | ||
# add_subdirectory(qwineventnotifier) | ||
|
||
if(NOT ((NOT QT_FEATURE_private_tests) OR (NOT TARGET Qt::Network))) | ||
add_subdirectory(qsocketnotifier) | ||
endif() | ||
if(NOT ((ANDROID OR APPLE_UIKIT) OR (NOT QT_FEATURE_systemsemaphore))) | ||
add_subdirectory(qsystemsemaphore) | ||
endif() | ||
# add_subdirectory(qtimer) | ||
add_subdirectory(qtranslator) | ||
add_subdirectory(qvariant) | ||
if(NOT ((NOT win32_x_ OR WINRT))) | ||
add_subdirectory(qwineventnotifier) | ||
endif() |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
add_qt_test(tst_qdeadlinetimer SOURCES tst_qdeadlinetimer.cpp) | ||
# Generated from qdeadlinetimer.pro. | ||
|
||
##################################################################### | ||
## tst_qdeadlinetimer Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qdeadlinetimer | ||
SOURCES | ||
tst_qdeadlinetimer.cpp | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qdeadlinetimer.pro:<TRUE>: | ||
# CONFIG = "testcase" |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
add_qt_test(tst_qelapsedtimer SOURCES tst_qelapsedtimer.cpp) | ||
# Generated from qelapsedtimer.pro. | ||
|
||
##################################################################### | ||
## tst_qelapsedtimer Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qelapsedtimer | ||
SOURCES | ||
tst_qelapsedtimer.cpp | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qelapsedtimer.pro:<TRUE>: | ||
# CONFIG = "testcase" |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
add_qt_test(tst_qeventdispatcher SOURCES tst_qeventdispatcher.cpp) | ||
# Generated from qeventdispatcher.pro. | ||
|
||
##################################################################### | ||
## tst_qeventdispatcher Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qeventdispatcher | ||
SOURCES | ||
tst_qeventdispatcher.cpp | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qeventdispatcher.pro:<TRUE>: | ||
# CONFIG = "testcase" |
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,30 @@ | ||
# Generated from qeventloop.pro. | ||
|
||
##################################################################### | ||
## tst_qeventloop Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qeventloop | ||
SOURCES | ||
tst_qeventloop.cpp | ||
LIBRARIES | ||
Qt::CorePrivate | ||
PUBLIC_LIBRARIES | ||
Qt::Network | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qeventloop.pro:<TRUE>: | ||
# CONFIG = "testcase" | ||
|
||
## Scopes: | ||
##################################################################### | ||
|
||
extend_target(tst_qeventloop CONDITION WIN32 AND NOT WINRT | ||
PUBLIC_LIBRARIES | ||
user32 | ||
) | ||
|
||
extend_target(tst_qeventloop CONDITION QT_FEATURE_glib | ||
DEFINES | ||
HAVE_GLIB | ||
) |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
add_qt_test(tst_qmath SOURCES tst_qmath.cpp) | ||
# Generated from qmath.pro. | ||
|
||
##################################################################### | ||
## tst_qmath Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qmath | ||
SOURCES | ||
tst_qmath.cpp | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qmath.pro:<TRUE>: | ||
# CONFIG = "testcase" |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
add_qt_test(tst_qmetaenum SOURCES tst_qmetaenum.cpp) | ||
# Generated from qmetaenum.pro. | ||
|
||
##################################################################### | ||
## tst_qmetaenum Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qmetaenum | ||
SOURCES | ||
tst_qmetaenum.cpp | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qmetaenum.pro:<TRUE>: | ||
# CONFIG = "testcase" |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
add_qt_test(tst_qmetamethod SOURCES tst_qmetamethod.cpp) | ||
# Generated from qmetamethod.pro. | ||
|
||
##################################################################### | ||
## tst_qmetamethod Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qmetamethod | ||
SOURCES | ||
tst_qmetamethod.cpp | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qmetamethod.pro:<TRUE>: | ||
# CONFIG = "testcase" |
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 |
---|---|---|
@@ -1 +1,21 @@ | ||
add_qt_test(tst_qmetaobject SOURCES tst_qmetaobject.cpp LIBRARIES Qt::CorePrivate) | ||
# Generated from qmetaobject.pro. | ||
|
||
##################################################################### | ||
## tst_qmetaobject Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qmetaobject | ||
SOURCES | ||
tst_qmetaobject.cpp | ||
LIBRARIES | ||
Qt::CorePrivate | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qmetaobject.pro:<TRUE>: | ||
# CONFIG = "testcase" | ||
|
||
## Scopes: | ||
##################################################################### | ||
|
||
#### Keys ignored in scope 2:.:.:qmetaobject.pro:qtConfig(c++14): | ||
# CONFIG = "c++14" |
16 changes: 15 additions & 1 deletion
16
tests/auto/corelib/kernel/qmetaobjectbuilder/CMakeLists.txt
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 |
---|---|---|
@@ -1 +1,15 @@ | ||
add_qt_test(tst_qmetaobjectbuilder SOURCES tst_qmetaobjectbuilder.cpp LIBRARIES Qt::CorePrivate) | ||
# Generated from qmetaobjectbuilder.pro. | ||
|
||
##################################################################### | ||
## tst_qmetaobjectbuilder Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qmetaobjectbuilder | ||
SOURCES | ||
tst_qmetaobjectbuilder.cpp | ||
LIBRARIES | ||
Qt::CorePrivate | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qmetaobjectbuilder.pro:<TRUE>: | ||
# CONFIG = "testcase" |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
add_qt_test(tst_qmetaproperty SOURCES tst_qmetaproperty.cpp) | ||
# Generated from qmetaproperty.pro. | ||
|
||
##################################################################### | ||
## tst_qmetaproperty Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qmetaproperty | ||
SOURCES | ||
tst_qmetaproperty.cpp | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qmetaproperty.pro:<TRUE>: | ||
# CONFIG = "testcase" |
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,41 @@ | ||
# Generated from qmetatype.pro. | ||
|
||
##################################################################### | ||
## tst_qmetatype Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qmetatype | ||
SOURCES | ||
tst_qmetatype.cpp | ||
DEFINES | ||
QT_DISABLE_DEPRECATED_BEFORE=0 | ||
INCLUDE_DIRECTORIES | ||
../../../other/qvariant_common | ||
LIBRARIES | ||
Qt::CorePrivate | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qmetatype.pro:<TRUE>: | ||
# CONFIG = "testcase" | ||
# TESTDATA = "./typeFlags.bin" | ||
|
||
## Scopes: | ||
##################################################################### | ||
|
||
extend_target(tst_qmetatype CONDITION MSVC OR WINRT | ||
COMPILE_OPTIONS | ||
/bigobj | ||
) | ||
|
||
#### Keys ignored in scope 3:.:.:qmetatype.pro:WINRT: | ||
# QMAKE_CFLAGS_RELEASE = "--O2" | ||
# QMAKE_CXXFLAGS_RELEASE = "--O2" | ||
|
||
#### Keys ignored in scope 4:.:.:qmetatype.pro:CLANG: | ||
# QMAKE_CFLAGS_RELEASE = "--O2" "--g" | ||
# QMAKE_CXXFLAGS_RELEASE = "--O2" "--g" | ||
|
||
extend_target(tst_qmetatype CONDITION CLANG AND (TEST_architecture_arch STREQUAL "arm") | ||
DEFINES | ||
TST_QMETATYPE_BROKEN_COMPILER | ||
) |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
add_qt_test(tst_qmimedata SOURCES tst_qmimedata.cpp) | ||
# Generated from qmimedata.pro. | ||
|
||
##################################################################### | ||
## tst_qmimedata Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qmimedata | ||
SOURCES | ||
tst_qmimedata.cpp | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qmimedata.pro:<TRUE>: | ||
# CONFIG = "testcase" |
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,29 @@ | ||
# Generated from qobject.pro. | ||
|
||
##################################################################### | ||
## tst_qobject Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qobject | ||
SOURCES | ||
tst_qobject.cpp | ||
DEFINES | ||
QT_DISABLE_DEPRECATED_BEFORE=0 | ||
LIBRARIES | ||
Qt::CorePrivate | ||
PUBLIC_LIBRARIES | ||
Qt::Network | ||
) | ||
|
||
#### Keys ignored in scope 3:.:.:test.pro:<TRUE>: | ||
# CONFIG = "testcase" "console" | ||
|
||
## Scopes: | ||
##################################################################### | ||
|
||
#### Keys ignored in scope 4:.:.:test.pro:QT_CONFIG___contains___c++1z: | ||
# CONFIG = "c++1z" | ||
|
||
if(NOT WINRT) | ||
add_subdirectory(signalbug) | ||
endif() |
14 changes: 14 additions & 0 deletions
14
tests/auto/corelib/kernel/qobject/signalbug/CMakeLists.txt
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,14 @@ | ||
# Generated from signalbug.pro. | ||
|
||
##################################################################### | ||
## signalbug Binary: | ||
##################################################################### | ||
|
||
add_qt_executable(signalbug | ||
GUI | ||
SOURCES | ||
signalbug.cpp signalbug.h | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:signalbug.pro:<TRUE>: | ||
# _LOADED = "qt_test_helper" |
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,21 @@ | ||
# Generated from qpointer.pro. | ||
|
||
##################################################################### | ||
## tst_qpointer Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qpointer | ||
SOURCES | ||
tst_qpointer.cpp | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:qpointer.pro:<TRUE>: | ||
# CONFIG = "testcase" | ||
|
||
## Scopes: | ||
##################################################################### | ||
|
||
extend_target(tst_qpointer CONDITION TARGET Qt::Widgets | ||
PUBLIC_LIBRARIES | ||
Qt::Widgets | ||
) |
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,30 @@ | ||
# Generated from qsharedmemory.pro. | ||
|
||
|
||
if(QT_FEATURE_sharedmemory) | ||
##################################################################### | ||
## tst_qsharedmemory Test: | ||
##################################################################### | ||
|
||
add_qt_test(tst_qsharedmemory | ||
SOURCES | ||
tst_qsharedmemory.cpp | ||
LIBRARIES | ||
Qt::CorePrivate | ||
) | ||
|
||
#### Keys ignored in scope 4:.:.:test.pro:<TRUE>: | ||
# CONFIG = "testcase" | ||
|
||
## Scopes: | ||
##################################################################### | ||
|
||
extend_target(tst_qsharedmemory CONDITION LINUX | ||
PUBLIC_LIBRARIES | ||
rt | ||
) | ||
|
||
if(NOT WINRT) | ||
add_subdirectory(producerconsumer) | ||
endif() | ||
endif() |
16 changes: 16 additions & 0 deletions
16
tests/auto/corelib/kernel/qsharedmemory/producerconsumer/CMakeLists.txt
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,16 @@ | ||
# Generated from producerconsumer.pro. | ||
|
||
##################################################################### | ||
## producerconsumer Binary: | ||
##################################################################### | ||
|
||
add_qt_executable(producerconsumer | ||
GUI | ||
SOURCES | ||
main.cpp | ||
PUBLIC_LIBRARIES | ||
Qt::Test | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:producerconsumer.pro:<TRUE>: | ||
# _LOADED = "qt_test_helper" |
Oops, something went wrong.