Migrating VTK

Discuss anything related to product development
Post Reply
regon
Posts: 6
Joined: Wed Apr 03 2024 4:49 pm

Migrating VTK

Post by regon »

[ Moved from another Post ]

I'm trying to make the vtk library depend on copperspice instead of qt. I'm running into the following issues:
1. I selected vulkan when compiling copperspice from source, and when I tried to link with vtk, an error occurred. So I unselected vulkan, will this have any effect? ​​Or, how should I fix this error?

cmake error message
/*
CMake Error at F:/CopperSpice/bin/cmake/CopperSpice/CopperSpiceLibraryTargets.cmake:130 (set_target_properties):
The link interface of target "CopperSpice::CsVulkan" contains:

Vulkan::Vulkan

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
*/

2. qMove is not defined.

template <typename T>
class QScopedValueRollback
{
public:
explicit QScopedValueRollback(T &var, T value)
: varRef(var), oldValue(var)
{
varRef = qMove(value);
}
};
ansel
Posts: 154
Joined: Fri Apr 10 2015 8:23 am

Re: Migrating VTK

Post by ansel »

Thanks for your questions and we are happy to support you in this migration project.

1) This error message indicates CMake was able to find the CopperSpice::CsVulkan library, but it has not been able to locate the LunarG Vulkan SDK. As the message mentions, you will need to add "find_package(Vulkan)" to your CMake project. You may also need to adjust your CMAKE_PREFIX_PATH so CMake can find the Vulkan SDK.

2) Thank you, we have now changed the qMove to call std::move.
Ansel Sermersheim
CopperSpice Cofounder
regon
Posts: 6
Joined: Wed Apr 03 2024 4:49 pm

Re: Migrating VTK

Post by regon »

Thank you very much for helping me solve the problem.

I encountered a new problem, Q_DECLARE_FLAGS macro is not defined.

Code: Select all


Define	               Sample	Description
Q_DECLARE_FLAGS	  —	        Unchanged in CS

https://www.copperspice.com/docs/cs_overview/m_macros_metaobj.html
barbara
Posts: 461
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Migrating VTK

Post by barbara »

This macro was removed in favor of a using declaration.

Code: Select all

   // Q_DECLARE_FLAGS(enumName, flagName)
   using flagName = QFlags<enumName>;
 
   // Q_DECLARE_FLAGS(Option, OptionFlags)
   using OptionFlags = QFlags<Option>;
Thanks for letting us know about the documentation issue and please continue to tell us about anything which is missing or unclear. New CS Overview docs will be uploaded next week.

Barbara
Post Reply