Can I and should I use CMake for my setup
The projects I'm working on are organized into root folders (VOBS) as follows:
|--BUILD_FOLDER
| |-- BUILD_SCRIPTS
| |-- SOME_MORE_CODE
|
|--COMPONENT_A
|--COMPONENT_B
Since they are ClearCase VOBS, there is no higher root folder to host CMakeLists.txt. This setting doesn't seem to fit the CMake pattern ...
- Is this a show stopper for using CMake?
- CMake seems to require everything to be hierarchical as it goes down from one point. ...
- Is CMake the right tool for non Windows / Linux targets?
- Projects use custom c compilers and call third-party tools to create application files in multiple formats.
+2
source to share
1 answer
Your components must not be subdirectories of the directory where the CMakeLists.txt file is located. Put it in a folder with the same rank as for components and just use relative paths in your command ADD_SUBDIRECTORY
:
ADD_SUBDIRECTORY(../componentA) ADD_SUBDIRECTORY(../componentB)
How I suggest you organize your folders
|--BUILD_FOLDER <-- this directory is created by "make" (???)
| |-- BUILD_SCRIPTS
| |-- SOME_MORE_CODE
|
|--META_FOLDER <--- place CMakeLists.txt here
|--COMPONENT_A
|--COMPONENT_B
A similar directory layout was used to build OpenJDK 6 (but regular make was used instead of CMake these days).
0
source to share