asmodehn / wkcmake

Workshop CMake - For quick and easy CMake setup of project, based on simple folder and file naming conventions
BSD 2-Clause "Simplified" License
5 stars 2 forks source link

WkAddSubdirectory #15

Closed asmodehn closed 10 years ago

asmodehn commented 11 years ago

We need a WkAddSubdirectory() At the moment, when using Add subdirectory, if both project are using WkCMake, the top project WkCMake parameters ( directories, etc.) are erased by the dependent WkCMake parameters. We need a WkAddSubdirectory which will maintain a stack of wkcmake setup in memory, and can support either normal cmake project, or WkCMake projects. This seems the best way to be able to include WKCMake project into another one ( and have multiple project in one solution in VS - more convenient for VS devs )

asmodehn commented 11 years ago

This is actually true only for directories (bin, source, etc.) It is not true for machine configuration ( astyle, cppcheck, etc. ) It would probably make more sense if the folders were project specific (using PROJECT_NAME). CMake will take care of that variable and normal add_subdirectory could be used...

asmodehn commented 11 years ago

At rev.197 directories were made part of projects, so we can have different structure between projects in subdiretories. This needs to be tested ( ProjectB has a dependency called projectCsub now ). Then more work needs to be done to ensure we can use add_subdirectory properly. or if we need a special WkAddSubdirectory...

asmodehn commented 11 years ago

I just made safe WkCMake.cmake scripts for add_subdirectory. The top WkCMake overrides all others in cmake configuration tree. Last step todo : set up subProject_DIR variable, so that a WkDepends automatically knows where to find the dependency.

asmodehn commented 10 years ago

WkDepends has been done. If the depends is a subdirectory, add_subdirectory is used and working as expected ( including subdir project into current project as source dependency to be compiled )