trolando / sylvan

Implementation of multi-core (binary) decision diagrams
Apache License 2.0
67 stars 29 forks source link

Fix Sylvan Cannot be Compiled as a Submodule #48

Closed SSoelvsten closed 7 months ago

SSoelvsten commented 9 months ago

Note that CMAKE_SOURCE_DIR and PROJECT_SOURCE_DIR are two different variables. The former is the root of the entire tree (possibly a dependent project) whereas the latter is the latest call to project() (which is the Sylvan root folder in this case).

jacopol commented 9 months ago

Could this be related to / would this also fix https://github.com/trolando/sylvan/issues/47 ?

SSoelvsten commented 9 months ago

This would not fix #47, no. I do not exactly know why ccmake did not change the value correctly, but you can alternatively provide the prefix at the terminal with cmake.

trolando commented 7 months ago

I'll pull it in, but I recall that there was a better way to detect if a project is the root project or a subproject.

SSoelvsten commented 7 months ago

Thanks!

You can use the PROJECT_IS_TOP_LEVEL Cmake variable to check if something is the root project, if that is the you are thinking of. But, I'm not sure I yet see how it can improve code quality.