How to create CMakeLists.txt file for a project so that its target compile type is shared library and not executable. Any reference article or direction can be helpful here. In Optix sample, all projects are executable, hence I don’t have a sample to create shared library output project.
I’m interested to expose some methods out of this shared library with syntax as below.
extern “C” attribute((dllexport)) void doSomething(…) {…}
Hi @aman_sharma,
That’s a good question. I haven’t tried starting from the OptiX cmake files and building a shared library. We’re not cmake experts, so I’d probably recommend checking the cmake support resources or other places for that kind of info. Here are a couple of things I found searching that I hope might help:
https://cgold.readthedocs.io/en/latest/tutorials/libraries/static-shared.html
–
David.
Thanks dhart. On Windows, I’ll run CMake and then change the project type in Visual Studio project properties. On Linux, I want to solve this before CMake itself.
I’ll try to find the solution and share if succeeded.