Hello, list!<br /><br />A bit of background: I am currently working inside a large perforce repository, containing source code for several programs. Some functionality has been separated out into separate directories, e.g., some linear algebra operations, file I/O, etc. Currently, all programs (save for one, which I've CMakeified) build by Makefiles, which basically list all source files, residing in all sorts of directories scattered around the repository. An abbreviated example file structure could be<br /> -- root<br />    |-- category-1<br />    |   |-- somelib<br />    |   |   `-- foo.f<br />    |   `-- someprogram<br />    |       |-- main.f<br />    |       `-- Makefile<br />    `-- category-2<br />        |-- otherlib<br />        |   `-- bar.f<br />        `-- otherprogram<br />            |-- main.f<br />            `-- Makefile<br /><br />Every Makefile can, conceivably, shop any number of files from any "library" directory, using the "add_executable (target file1 file2 ...)" type of logic.<br /><br />I've managed to CMakeify one of these programs, basically, by listing all the source files and having CMake link them together. I would, however, prefer to create modules/libraries in some sense. My initial idea is that "otherlib" and "somelib" could be built into static libraries "on the fly", but by a CMakeLists.txt in each directory. The "add_subdirectory" command comes to mind, but it does not work for directories that are not actual subdirectories in the filesystem. I've been playing with the idea of using Externalproject_add commands or custom find_package, but these seem to be geared towards globally installed libraries, which I do not want (yet, at least). The reasons for the project organization is of cource "history" and "legacy" much more than anything else, and with several applications and "libraries" mixed together, it's a challenge to refactor both build systems and code into a more sensible architecture.<br /><br />What do you recommend in this case?<br /><br />I would highly prefer not creating static libraries outside the build system, since in this case, the combinatorics make for a lot of pre-built libraries - one per 32/64 bit, operating system, and across 3-4 compilers...<br /><br />-----------<br />Paul Anton Letnes<br />