I want to use my headers and libs as common libraries for app1 and app2. My project tree are below. image/ and math/ are library directories used by app1 and app2. In this case, should I set same settings to both CmakeLists.txt under app1 and app2? Of course I know it works, but are there any smarter ways to set common libraries?
|-- CMakeLists.txt |-- app1 | |-- CMakeLists.txt | `-- main.cc |-- app2 | |-- CMakeLists.txt | `-- main.cc |-- image | |-- CMakeLists.txt | |-- include | | `-- image_func.h | `-- src | `-- image_func.cc `-- math |-- CMakeLists.txt |-- include | `-- math_util.h `-- src `-- math_util.cc Roots CMakelists.txt is below. Is it possible to set math and image parameters for app1 and app2? My actual project has many applications which uses multiple libraries.
cmake_minimum_required(VERSION 2.8) add_subdirectory("./image") add_subdirectory("./math") add_subdirectory("./app1") add_subdirectory("./app2")