-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
* add qt cmake macros fixes #4574 * compatibility with conan < 1.33 * setup self.cpp_info.builddirs and remove unused cmake files
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -652,7 +652,8 @@ def package(self): | |
if not self.options.get_safe(module): | ||
tools.rmdir(os.path.join(self.package_folder, "licenses", module)) | ||
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) | ||
tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) | ||
for mask in ["Find*.cmake", "*Config.cmake", "*-config.cmake"]: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ericLemanissier
Author
Contributor
|
||
tools.remove_files_by_mask(self.package_folder, mask) | ||
tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la*") | ||
tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb*") | ||
tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") | ||
|
@@ -695,6 +696,20 @@ def package_info(self): | |
self.cpp_info.frameworks.extend(["Cocoa"]) # "libQt5Core.a" require "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework | ||
self.cpp_info.frameworks.extend(["Security"]) # "libQt5Core.a" require "_SecRequirementCreateWithString" and more, which are in "Security" framework | ||
|
||
tools.save(os.path.join("lib", "cmake", "Qt5Core", "extras.cmake"), | ||
"set(Qt5Core_QMAKE_EXECUTABLE ${CMAKE_CURRENT_LIST_DIR}/../../../bin/qmake)\n" | ||
"set(Qt5Core_MOC_EXECUTABLE ${CMAKE_CURRENT_LIST_DIR}/../../../bin/moc)\n" | ||
"set(Qt5Core_RCC_EXECUTABLE ${CMAKE_CURRENT_LIST_DIR}/../../../bin/rcc)\n" | ||
"set(Qt5Core_UIC_EXECUTABLE ${CMAKE_CURRENT_LIST_DIR}/../../../bin/uic)") | ||
for m in os.listdir(os.path.join("lib", "cmake")): | ||
module = os.path.join("lib", "cmake", m, "%sMacros.cmake" % m) | ||
if os.path.isfile(module): | ||
self.cpp_info.build_modules.append(module) | ||
self.cpp_info.builddirs.append(os.path.join("lib", "cmake", m)) | ||
else: | ||
tools.rmdir(os.path.join("lib", "cmake", m)) | ||
self.cpp_info.build_modules.append(os.path.join("lib", "cmake", "Qt5Core", "extras.cmake")) | ||
|
||
|
||
@staticmethod | ||
def _remove_duplicate(l): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource> | ||
<file>resource.txt</file> | ||
</qresource> | ||
</RCC> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
project('test_package', 'cpp') | ||
qt5 = import('qt5') | ||
qt5_dep = dependency('qt5', modules: ['Core']) | ||
moc_files = qt5.preprocess(moc_headers : 'greeter.h') | ||
moc_files = qt5.preprocess(moc_headers : 'greeter.h', qresources : 'example.qrc') | ||
executable('test_package', 'test_package.cpp', moc_files, | ||
dependencies : qt5_dep) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello World From Resource |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ SOURCES += test_package.cpp | |
|
||
HEADERS += greeter.h | ||
|
||
RESOURCES = example.qrc | ||
|
||
QT -= gui | ||
|
||
CONFIG += console |
@ericLemanissier Hey, this change basically killed this Conan package to be consumed in any sensible way using ordinary CMake (e.g.
find_package()
). What is the reason that Qt5Config.cmake etc. got removed during the packaging step?