Skip to content

Commit 9157aa3

Browse files
committed
chore: Convert to CMake
Fixes #360
1 parent da9ee1c commit 9157aa3

22 files changed

+89
-122
lines changed

.qmake.conf

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ script:
2020
- source /opt/qt54/bin/qt54-env.sh
2121
- qmake
2222
- make check
23-
- ./lint.sh
24-
- ./build_docs.sh
23+
- ./scripts/lint.sh
24+
- ./scripts/build_docs.sh
2525

2626
after_success:
27-
- ./deploy.sh
27+
- ./scripts/deploy.sh
2828

2929
notifications:
3030
slack: papyros:Z7PeY2Y4mh0GWPoypZZNLd3D
@@ -36,4 +36,4 @@ env:
3636
- ENCRYPTION_LABEL="a0d7d9cd7ef9"
3737
- GIT_NAME="Travis CI"
3838
- GIT_EMAIL="[email protected]"
39-
- SOURCE_BRANCH="develop"
39+
- SOURCE_BRANCH="develop"

CMakeLists.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
project(io.papyros.Material)
2+
3+
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
4+
5+
# Find includes in corresponding build directories
6+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
7+
8+
# Instruct CMake to run moc and rrc automatically when needed
9+
set(CMAKE_AUTOMOC ON)
10+
set(CMAKE_AUTORCC ON)
11+
12+
# Extra CMake files
13+
find_package(ECM 0.0.11 REQUIRED NO_MODULE)
14+
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
15+
16+
include(KDEInstallDirs)
17+
include(KDECMakeSettings)
18+
include(KDECompilerSettings)
19+
include(FeatureSummary)
20+
21+
# Build flags
22+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -Werror -Wall -Wextra -Wno-unused-parameter -pedantic -std=c++11")
23+
24+
# Disable debug output for release builds
25+
if(CMAKE_BUILD_TYPE MATCHES "^[Rr]elease$")
26+
add_definitions(-DQT_NO_DEBUG_OUTPUT)
27+
endif()
28+
29+
# Minimum version requirements
30+
set(QT_MIN_VERSION "5.4.0")
31+
32+
# Find Qt5
33+
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
34+
Core
35+
Qml
36+
Quick
37+
Test
38+
QuickTest)
39+
40+
add_subdirectory(modules)
41+
# add_subdirectory(documentation)
42+
add_subdirectory(tests)
43+
44+
# Display feature summary
45+
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

modules/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
add_subdirectory(Material)
2+
add_subdirectory(QtQuick/Controls/Styles/Material)

modules/Material/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
file(GLOB QML_FILES *.qml)
2+
file(GLOB JS_FILES *.js)
3+
4+
install(FILES ${QML_FILES} ${JS_FILES} qmldir
5+
DESTINATION ${QML_INSTALL_DIR}/Material)
6+
install(DIRECTORY fonts icons
7+
DESTINATION ${QML_INSTALL_DIR}/Material/Extras)
8+
9+
add_subdirectory(Extras)
10+
add_subdirectory(ListItems)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
file(GLOB QML_FILES *.qml)
2+
3+
install(FILES ${QML_FILES} qmldir
4+
DESTINATION ${QML_INSTALL_DIR}/Material/Extras)
5+
install(DIRECTORY js images
6+
DESTINATION ${QML_INSTALL_DIR}/Material/Extras)

modules/Material/Extras/Extras.pro

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
file(GLOB QML_FILES *.qml)
2+
3+
install(FILES ${QML_FILES} qmldir
4+
DESTINATION ${QML_INSTALL_DIR}/Material/ListItems)

modules/Material/Material.pro

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
file(GLOB QML_FILES *.qml)
2+
3+
install(FILES ${QML_FILES} qmldir
4+
DESTINATION ${QML_INSTALL_DIR}/QtQuick/Controls/Styles/Material)

modules/QtQuick/Controls/Styles/Material/Material.pro

Lines changed: 0 additions & 9 deletions
This file was deleted.

qml-material.pro

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

lint.sh renamed to scripts/lint.sh

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
include(ECMMarkAsTest)
2+
3+
set(SOURCES tests.cpp)
4+
5+
set(CMAKE_MACOSX_BUNDLE FALSE)
6+
7+
add_definitions(-DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
8+
9+
add_executable(materialtests ${SOURCES})
10+
target_link_libraries(materialtests Qt5::Core Qt5::Qml Qt5::Quick Qt5::Test Qt5::QuickTest)
11+
12+
add_test(NAME material COMMAND materialtests -import ${CMAKE_SOURCE_DIR}/modules)
13+
ecm_mark_as_test(materialtests)

tests/qml-materials.qml

Lines changed: 0 additions & 67 deletions
This file was deleted.

tests/tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
*/
1818

1919
#include <QtQuickTest/QtQuickTest>
20-
QUICK_TEST_MAIN(materials)
20+
QUICK_TEST_MAIN(material)

tests/tests.pro

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)