# # This file models a directory hierarchy: # # libfoo/ # core/ # rpc/ # client/ # server/ # # I want to link the whole thing together into a single libfoo.so. At each # directory in the hierarchy, I want to use $ to # bundle together objects from child directories. # # Currently, CMake only allows the $ mechanism to work over # one level; I need to use some other mechanism to bundle up the objects from # rpc/client and rpc/server into the rpc OBJECT library. # # What I want to be able to do (and what my patch allows) is: # ## libfoo/CMakeLists.txt cmake_minimum_required(VERSION 2.8) #add_subdirectory(core) #add_subdirectory(rpc) file(WRITE top.c "void top_level_function() {}") add_library(foo SHARED top.c $ $) ## libfoo/core/CMakeLists.txt file(WRITE some_application_logic.c "void application_logic() {}") add_library(core SHARED OBJECT some_application_logic.c) ## libfoo/rpc/CMakeLists.txt #add_subdirectory(client) #add_subdirectory(server) file(WRITE rpc.c "void common_rpc_code() {}") add_library(rpc SHARED OBJECT rpc.c $ $ ) ## libfoo/rpc/client file(WRITE client_stubs.c "void client_stub() {}") add_library(client SHARED OBJECT client_stubs.c) ## libfoo/rpc/server file(WRITE server_stubs.c "void server_stub() {}") add_library(server SHARED OBJECT server_stubs.c)