Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datoviz expects to be top level CMake project #49

Open
wolro opened this issue May 1, 2023 · 2 comments
Open

Datoviz expects to be top level CMake project #49

wolro opened this issue May 1, 2023 · 2 comments

Comments

@wolro
Copy link

wolro commented May 1, 2023

Hello Cyril,

First: as a VisPy user looking to include a performant visualization library into a non-Python project, Datoviz looks like an absolute godsend!

Note that I am using MinGW on a Windows 10 system.

Trying various ways to include Datoviz as a dependency into another (CMake) project, I ran into the issue that the CMakeLists.txt file uses the "${CMAKE_SOURCE_DIR}" / "${CMAKE_BINARY_DIR}" variables. While this is no issue when precompiling and adding Datoviz as a shared library, it prevents smooth adding of the library via e.g.:

add_subdirectory(libs/datoviz)

Trying this, one currently has to add the "cmake", "data" and "external" folders as well as "include/datoviz" to the top-level folder referenced by ${CMAKE_SOURCE_DIR}. Upon quick testing, simply replacing the two variables by ${PROJECT_SOURCE_DIR}" and ${PROJECT_BINARY_DIR} resolved this, and a test project adding Datoviz via "add_subdirectory" worked just fine.

I suspect that with this change, also simply pulling in Datoviz via "FetchContent_Declare / FetchContent_MakeAvailable" might just work; trying this, currently one runs into similar issues as with "add_subdirectory" which can also be resolved by adding the respective folders to top level, but then I ran into ODR violation issues with ImGui involving standard and GLFW headers.

In any case thank you for the great work, and kind regards!
Wolfgang

@rossant
Copy link
Contributor

rossant commented May 2, 2023

Hi Wolfgang, thank you for raising this issue. Would you consider submitting a pull request to fix this? I'll quickly test it and merge if it works for me!

@wolro
Copy link
Author

wolro commented May 2, 2023

Hi Cyril, sure! Submitted the pull request. Hope it doesn't break anything on other platforms than Windows / MinGW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants