I have the following structure:
${root}
project_a
main.c
CMakeLists.txt
project_b
lib.c
target.cmake
CMakeList.txt
include(${ROOT}/project_b/target.cmake)
add_executable(${PROJECT_NAME} main.c)
add_dependencies (${PROJECT_NAME} app_cmake_b)
target_link_libraries (${PROJECT_NAME} app_cmake_b)
target.cmake
add_library(project_b STATIC ${ROOT}/lib.c)
Is using include the only way to import other cmake projects?
I do not like that I need absolute paths in my included target.cmake
What is the best pratice to solve my usecase with CMake?