Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ben Boeckel
QtTesting
Commits
e16e3c0c
Commit
e16e3c0c
authored
May 04, 2016
by
Utkarsh Ayachit
⛰
Browse files
Cleanup to use imported targets.
Also updates CMake minimum version to 2.8.12.
parent
706d5cd1
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
e16e3c0c
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
)
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
.12
)
PROJECT
(
QtTesting
)
...
...
@@ -12,16 +12,13 @@ IF(NOT (QtTesting_QT_VERSION VERSION_EQUAL "4" OR
message
(
FATAL_ERROR
"Expected value for QtTesting_QT_VERSION is either '4' or '5'"
)
ENDIF
()
set
(
qt_imported_targets
)
IF
(
QtTesting_QT_VERSION VERSION_GREATER
"4"
)
FIND_PACKAGE
(
Qt5Widgets REQUIRED
)
ADD_DEFINITIONS
(
${
Qt5Widgets_DEFINITIONS
}
)
INCLUDE_DIRECTORIES
(
${
Qt5Widgets_INCLUDE_DIRS
}
)
SET
(
QT_LIBRARIES
${
Qt5Widgets_LIBRARIES
}
)
FIND_PACKAGE
(
Qt5 REQUIRED COMPONENTS Core Widgets
)
SET
(
qt_imported_targets Qt5::Core Qt5::Widgets
)
ELSE
()
IF
(
NOT QT4_FOUND
)
FIND_PACKAGE
(
Qt4 REQUIRED
)
INCLUDE
(
${
QT_USE_FILE
}
)
ENDIF
()
FIND_PACKAGE
(
Qt4 REQUIRED COMPONENTS QtGui
)
SET
(
qt_imported_targets Qt4::QtCore Qt4::QtGui
)
ENDIF
()
IF
(
NOT DEFINED QT_TESTING_WITH_PYTHON
)
...
...
@@ -306,7 +303,7 @@ SOURCE_GROUP("Generated" FILES
)
TARGET_LINK_LIBRARIES
(
QtTesting
${
QT_LIBRARIES
}
${
qt_imported_targets
}
)
IF
(
QT_TESTING_WITH_PYTHON
)
...
...
Testing/Cpp/CMakeLists.txt
View file @
e16e3c0c
include
(
../CMake/qtTestingMacroGenerateMocs.cmake
)
IF
(
QtTesting_QT_VERSION VERSION_GREATER
"4"
)
FIND_PACKAGE
(
Qt5Test REQUIRED
)
ADD_DEFINITIONS
(
${
Qt5Test_DEFINITIONS
}
)
INCLUDE_DIRECTORIES
(
${
Qt5Test_INCLUDE_DIRS
}
)
SET
(
TEST_LIBRARIES
${
Qt5Test_LIBRARIES
}
)
FIND_PACKAGE
(
Qt5 REQUIRED QUIET COMPONENTS Test
)
SET
(
TEST_LIBRARIES Qt5::Test
)
ELSE
()
SET
(
TEST_LIBRARIES
${
QT_QTTEST_LIBRARY
}
)
FIND_PACKAGE
(
Qt4 REQUIRED QUIET COMPONENTS QtTest
)
SET
(
TEST_LIBRARIES Qt4::QtTest
)
ENDIF
()
set
(
KIT
${
PROJECT_NAME
}
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment