[CMake] How to make a hierarchical application using CMake?

David Aldrich david.aldrich.ntml at gmail.com
Mon Oct 14 09:13:19 EDT 2019


Hi



I am trying to convert a large software project from makefiles to CMake.
The project is organised as a set of shared ‘star’ libraries, linked to a
static ‘kernel’ library. The current directory arrangement is:



|--stars

|     |-- star1_lib

|              |-- source files

|              |-- makefile

|     |-- star2_lib

|              |-- source files

|              |-- makefile

|     |-- solibs

|              |-- Release

|                     |-- <star>.so files

|

|--kernel

|     |-- source files

|     |-- makefile

|     |-- Release

|              |-- kernel.a

|

|--application

      |-- makefile

      |-- Release

               |-- myapp.exe



In high-level terms, how could I implement this using CMake, such that
invoking ‘make’ in directory ‘application’ invokes a make of each shared
and static library, and links them to form ‘myapp.exe’?



(I understand the basics of CMake, the issue here is how to handle the make
of source code and libraries spread across a directory hierarchy).



Best regards



David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20191014/08ed549a/attachment-0001.html>


More information about the CMake mailing list