Page 1 of 1

Migrating VTK

Posted: Wed Jul 03 2024 7:01 pm
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);
}
}ï¼›

Re: Migrating VTK

Posted: Wed Jul 03 2024 7:26 pm
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.

Re: Migrating VTK

Posted: Sat Jul 06 2024 5:36 am
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

Re: Migrating VTK

Posted: Sat Jul 06 2024 5:28 pm
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