[CMake] Newie's question: Multiple applications with one common kernel

Matthias Moeller matthias.moeller at math.tu-dortmund.de
Mon Dec 7 11:53:37 EST 2009


I am new to Cmake and I am looking for some ideas (what to read, where
to search) on how to solve the following problem.


Our project has the following structure:

root/applications (Applications by different users)
     applications/app1
     applications/app2
     applications/...

root/kernel (common kernel source files)

root/libraries (external libraries)


Each application has some source files and uses the common source files
from the kernel directory which is *not* a subdirectory. In a first
attempt, I wrote one CMakeLists.txt file on the kernel directory which
has a list of all kernel source files. Each application/appX directory
has its own CMakeLists.txt file which includes the kernel sources via:

ADD_SUBDIRECTORY (${APPX_SOURCE_DIR}/../..
${CMAKE_CURRENT_BINARY_DIR}/kernel)

Unfortunately, the variables defined in the kernel's CMakeLists.txt file
are not available from within the application's CMakeLists.txt file.


Any help on this problem will be appreciated.

Best regards,
Matthias Moeller



More information about the CMake mailing list