forked from woboq/verdigris
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/qt65' into develop
- Loading branch information
Showing
67 changed files
with
3,238 additions
and
163 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
* text=auto | ||
*.sh text eol=lf | ||
*.yml text eol=lf | ||
*.json text eol=lf | ||
Makefile text eol=lf | ||
Vagrantfile text eol=lf |
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
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,6 @@ | ||
/cmake-build-*/ | ||
/build*/ | ||
/.idea/ | ||
/.vscode/ | ||
/*.user | ||
/*.autosave |
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 @@ | ||
cmake_minimum_required(VERSION 3.25) | ||
|
||
project(Verdigris | ||
VERSION 2.0 | ||
DESCRIPTION "Replace Qt moc with native C++" | ||
HOMEPAGE_URL "https://github.com/woboq/verdigris" | ||
LANGUAGES CXX | ||
) | ||
|
||
enable_testing() | ||
|
||
find_package(Qt6 "6.2...<6.6" COMPONENTS Core Test REQUIRED) | ||
|
||
add_subdirectory("src") | ||
add_subdirectory("tools") | ||
add_subdirectory("tutorial") | ||
add_subdirectory("tests") | ||
add_subdirectory("benchmarks") | ||
|
||
set_source_files_properties( | ||
"src/wobjectcpp.h" | ||
"src/wobjectdefs.h" | ||
"src/wobjectimpl.h" | ||
"src/wqmlelement.h" | ||
DIRECTORY | ||
"benchmarks/qobject/" | ||
PROPERTIES | ||
SKIP_AUTOMOC ON | ||
) | ||
|
||
add_library(verdigris::verdigris ALIAS verdigris) | ||
include(CMakePackageConfigHelpers) | ||
configure_package_config_file("cmake/verdigrisConfig.cmake.in" | ||
"verdigrisConfig.cmake" | ||
INSTALL_DESTINATION verdigris/cmake | ||
) | ||
write_basic_package_version_file("verdigrisConfigVersion.cmake" | ||
VERSION ${PROJECT_VERSION} | ||
COMPATIBILITY SameMajorVersion | ||
ARCH_INDEPENDENT | ||
) | ||
include(GNUInstallDirs) | ||
install(TARGETS verdigris | ||
EXPORT verdigris_Targets | ||
FILE_SET HEADERS | ||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/verdigris" | ||
) | ||
install(FILES | ||
"${PROJECT_BINARY_DIR}/verdigrisConfig.cmake" | ||
"${PROJECT_BINARY_DIR}/verdigrisConfigVersion.cmake" | ||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/verdigris/cmake) | ||
install(EXPORT verdigris_Targets | ||
FILE "verdigrisTargets.cmake" | ||
NAMESPACE verdigris:: | ||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/verdigris/cmake | ||
) | ||
|
||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.LGPLv3") | ||
include(CPack) |
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,38 @@ | ||
{ | ||
"version": 3, | ||
"configurePresets": [ | ||
{ | ||
"name": "base", | ||
"hidden": true, | ||
"description": "Base for concrete configure presets", | ||
"generator": "Ninja Multi-Config", | ||
"binaryDir": "${sourceDir}/build/${presetName}" | ||
}, | ||
{ | ||
"name": "msvc", | ||
"description": "Preferred settings for MSVC 2022", | ||
"cacheVariables": { | ||
"CMAKE_CXX_FLAGS": "/DWIN32 /D_WINDOWS /EHsc /permissive- /Zc:__cplusplus /Zc:externConstexpr /Zc:inline /Zc:preprocessor /Zc:throwingNew /diagnostics:caret" | ||
} | ||
}, | ||
{ | ||
"name": "clang", | ||
"cacheVariables": { | ||
"CMAKE_CXX_FLAGS": "--pedantic -Wall -Wextra -ftemplate-backtrace-limit=0 -Wno-gnu-zero-variadic-macro-arguments" | ||
} | ||
}, | ||
{ | ||
"name": "clang-libcpp", | ||
"cacheVariables": { | ||
"CMAKE_CXX_FLAGS": "--stdlib=libc++ --pedantic -Wall -Wextra -ftemplate-backtrace-limit=0 -Wno-gnu-zero-variadic-macro-arguments", | ||
"CMAKE_EXE_LINKER_FLAGS": "--stdlib=libc++" | ||
} | ||
}, | ||
{ | ||
"name": "gcc", | ||
"cacheVariables": { | ||
"CMAKE_CXX_FLAGS": "--pedantic -Wall -Wextra -Wno-noexcept-type -Wno-address -ftemplate-backtrace-limit=0" | ||
} | ||
} | ||
] | ||
} |
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,2 @@ | ||
|
||
add_subdirectory("qobject") |
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,11 @@ | ||
|
||
add_executable(qobject_bench | ||
"main.cpp" | ||
"object.cpp" | ||
"object.h" | ||
) | ||
target_link_libraries(qobject_bench PRIVATE | ||
verdigris | ||
Qt6::Test | ||
) | ||
set_target_properties(qobject_bench PROPERTIES AUTOMOC ON) |
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,4 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
check_required_components("@PROJECT_NAME@") |
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,26 @@ | ||
import qbs.File | ||
|
||
Module { | ||
Depends { name: "Qt.core" } | ||
|
||
Rule { | ||
name: "Qt MetaTypes" | ||
inputs: ["verdigris.metatypes"] | ||
inputsFromDependencies: ["verdigris.metatypes"] | ||
Artifact { | ||
filePath: input.fileName + ".json" | ||
fileTags: ["qt.core.metatypes"] | ||
qbs.install: product.Qt.core.metaTypesInstallDir | ||
qbs.installDir: product.Qt.core.metaTypesInstallDir | ||
} | ||
prepare: { | ||
var cmd = new JavaScriptCommand(); | ||
cmd.description = "generating " + output.fileName + " from " + input.fileName; | ||
cmd.highlight = "codegen"; | ||
cmd.sourceCode = function() { | ||
File.copy(input.filePath, output.filePath); | ||
} | ||
return [cmd]; | ||
} | ||
} | ||
} |
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,32 @@ | ||
|
||
Module { | ||
additionalProductTypes: ["obj", "verdigris.metatypes"] | ||
|
||
Depends { productTypes: ["metatypes-extractor"] } | ||
Depends { name: "Qt.core" } | ||
|
||
Rule { | ||
name: "Extract MetaTypes" | ||
multiplex: true | ||
inputs: ["obj"] | ||
Artifact { | ||
filePath: product.targetName.toLowerCase() + "_metatypes" | ||
fileTags: ["verdigris.metatypes"] | ||
} | ||
explicitlyDependsOnFromDependencies: ["metatypes-extractor"] | ||
prepare: { | ||
var inputFilePaths = inputs.obj.map(function(a) { | ||
return a.filePath; | ||
}); | ||
var toolPath = explicitlyDependsOn["metatypes-extractor"][0].filePath; | ||
var cmd = new Command(toolPath, | ||
["--out=" + output.filePath].concat(inputFilePaths)); | ||
cmd.environment = [ | ||
"PATH=" + product.Qt.core.libExecPath // ensure Qt libraries are available | ||
]; | ||
cmd.description = "generating " + output.fileName; | ||
cmd.highlight = "codegen"; | ||
return cmd; | ||
} | ||
} | ||
} |
Oops, something went wrong.