Hi, I have a particular situation that I would like you to analyze to help me find the best solution possible.
I have a project "A", a project "B" and an external dependency called "C". The project "B" depends directly on "C". The project "A" needs the projects "B" to build but does not want to know about its dependencies ("C"). So, "A"-->"B"-->"C" and "A" doesn't know anything about "C". Of what I tought, there are two solution approaches to this problem: 1. The project "A" and "B" cmake script are completly independant; "B" is able to build itself alone and "A" simply include "B"'s script that contains the link to the dependency "C". 2. There is a master script that knows every dependencies (in our case, "C") and which build "A" and "B" calling the "subdir" command to execute their proper scripts. "A" and "B" script knows nothing about "C" in their proper scripts. I did some tests and the second solution is working fine with CMake. Every depencies are propagated in the three like a charm. However, I have problem with the first one and I would like if it would be possible to acheive. The problem is when I include the "B" script, the CMake engine is searching for the "B" files in the "A" paths. Example: "A" source directory is: src/file1.cpp "B" source directory is: src/file2.cpp file2.cpp is searched in the src/ directory of project "A". Of course, the file isn't found and CMake is generating an error. Here's come the questions: 1. What solution do you think is the best: "A main master script" that knows every dependencies of every projects VS "Completly indenpendant build script" that we could simply include if we need them and their dependencies ? Please justify. 2. How can I achieve the first solution with CMake ? (Is it possible ?) 3: Is there any better solution that I don't see ? I would really like to know what you think about this problematic. Regard, Félix C. Morency
_______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake