-
Notifications
You must be signed in to change notification settings - Fork 10
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
Unable to call Subproject from toplevel project #628
Comments
I apologize for the very very late response! Though I assume this answer may be too late, here some information as future reference for others. I suggest a look at my other project called MIRTK that uses BASIS with submodules. You could add |
I had followed exactly the way it is done in MIRTK, but I still get the error CMake Error at CMake/Basis/ProjectTools.cmake:358 (message): The subprojects are only treated as modules of the top level project and they are not treated as a subproject. |
Thanks for following up. In that case, I would say the error message is probably quite specific and may not actually be relating to the fact that your top-level project has modules. Rather, do you have an entry Otherwise, please post the content of the top-level |
I have removed the DEFAULT_MODULES option in the BasisProject.cmake file. Now the configuration is done. When I build it Ninja gives the message "No work to do". As I understand SUBPROJECTS can have modules under them. I have all the sources as a module of the subproject. Since I have removed the DEFAULT_MODULES option no module under the subproject is included/built. |
Can you list the default subproject modules with |
Thanks. I was able to get the configuration done, but I felt that it is counter intuitive. One of my team member works on the sub-project with all the modules. So by default all the modules are on. Finally during the integration I will have to remove all the DEFAULT_MODULES option from all the sub-project and also add the sub-project and all the modules under the sub-project in the toplevel project once again. If I have many modules and many sub-projects this becomes very difficult. Further I am also having some issues in getting the dependency between sub-projects. |
I am trying to create a project following the structure shown below
MyWorkspace
|
|
|____ MyFramework1
| |
| |__Module1
| |
| |Module2
|
| MyFramework2
|
|___Module1
|
|___Module2
I have created the following equivalent BasisProject structure
TopLevelProject
|
|
|____ Subproject1
| |
| |Module1
| | | BasisProject.cmake
| |
| |Module2
| | | BasisProject.cmake
|
| Subproject2
| |
| |__Module1
| | | BasisProject.cmake
| |
| |__Module2
| | BasisProject.cmake
|
|___________BasisProject.cmake
|
|___________CMakeLists.txt
But there is no way the subproject is called from the toplevel project.
I tried adding basis_add_subdirectory(Subproject1) in the CMakeLists.txt of the toplevelproject. I get the error " Module Subproject1 specified DEFAULT_MODULES, but a module cannot have itself modules."
I tried adding add_subdirectory(Subproject1) in the CMakeLists.txt of the toplevelproject. I get the error
"CMake Error at config/basis-modules/InstallationTools.cmake:456 (add_custom_target): add_custom_target cannot create target "uninstall" because another target with the same name already exists. The existing target is a custom target"
What is the right way to call the subproject from the toplevel project?
The text was updated successfully, but these errors were encountered: