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

cmake SOURCE_DIR issues noted when using as a submodule #329

Open
tom-seddon opened this issue Jan 31, 2025 · 0 comments
Open

cmake SOURCE_DIR issues noted when using as a submodule #329

tom-seddon opened this issue Jan 31, 2025 · 0 comments

Comments

@tom-seddon
Copy link

I'm using PDCursesMod as a submodule of my project, building it from source as part of the build process and linking with the built copy. (This is my own workaround for the lack of a standard package manager on Windows or macOS...)

I encountered some issues attempting this with PDCursesMod on Windows with cmake. There's a couple of places where CMAKE_SOURCE_DIR (folder specified on the command line, containing the root CMakeLists.txt specified) is used, that should be CMAKE_CURRENT_SOURCE_DIR (folder specified with add_subdirectory, containing some subproject).

And, similarly, a couple of places where I had to replace CMAKE_SOURCE_DIR with CMAKE_CURRENT_LIST_DIR (folder containing current cmake code included using include).

Symptoms of these were the build process trying to find pdcurses stuff from the root folder of my own project.

Diffs here: tom-seddon@838d11c - but this only fixes my immediate issue, and some of the other CMAKE_SOURCE_DIR uses might need fixing up if doing this properly. So no PR, just an issue. But I thought it could be worth noting.

Thanks,

--Tom

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

1 participant