diff --git a/CMakeLists.txt b/CMakeLists.txt index 5299db65aee7bf9177e3ec13fa6d41edc9e8c60f..8098dc1c6896db669b7b31edfd2717f703442fcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,45 +112,42 @@ project(stereo-evs) set_property(GLOBAL PROPERTY USE_FOLDERS ON) # make Visual Studio projects look nicer include(CTest) -include_directories( - lib_com - lib_debug - lib_dec - lib_enc - lib_rend - lib_util -) - file(GLOB libComSrcs "lib_com/*.c") file(GLOB libComHeaders "lib_com/*.h") add_library(lib_com ${libComSrcs} ${libComHeaders}) if(UNIX) target_link_libraries(lib_com m) endif() +target_include_directories(lib_com PUBLIC lib_com PRIVATE lib_enc lib_dec lib_rend lib_debug) file(GLOB libDebugSrcs "lib_debug/*.c") file(GLOB libDebugHeaders "lib_debug/*.h") add_library(lib_debug ${libDebugSrcs} ${libDebugHeaders}) target_link_libraries(lib_debug lib_com) +target_include_directories(lib_debug PUBLIC lib_debug PRIVATE lib_enc lib_dec lib_rend) file(GLOB libEncSrcs "lib_enc/*.c") file(GLOB libEncHeaders "lib_enc/*.h") add_library(lib_enc ${libEncSrcs} ${libEncHeaders}) target_link_libraries(lib_enc lib_com lib_debug) +target_include_directories(lib_enc PUBLIC lib_enc PRIVATE lib_dec lib_rend) file(GLOB libRendSrcs "lib_rend/*.c") file(GLOB libRendHeaders "lib_rend/*.h") add_library(lib_rend ${libRendSrcs} ${libRendHeaders}) target_link_libraries(lib_rend lib_dec lib_com lib_debug) # Todo refactor: This dependency on lib_dec should be removed. +target_include_directories(lib_rend PUBLIC lib_rend PRIVATE lib_enc) file(GLOB libDecSrcs "lib_dec/*.c") file(GLOB libDecHeaders "lib_dec/*.h") add_library(lib_dec ${libDecSrcs} ${libDecHeaders}) target_link_libraries(lib_dec lib_com lib_rend lib_debug) +target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_enc) file(GLOB libUtilSrcs "lib_util/*.c") file(GLOB libUtilHeaders "lib_util/*.h") add_library(lib_util ${libUtilSrcs} ${libUtilHeaders}) +target_include_directories(lib_util PUBLIC lib_util PRIVATE lib_com lib_enc lib_dec lib_rend lib_debug) add_executable(IVAS_cod apps/encoder.c) target_link_libraries(IVAS_cod lib_enc lib_util) @@ -166,6 +163,7 @@ endif() add_executable(IVAS_rend apps/renderer.c) target_link_libraries(IVAS_rend lib_rend lib_util) +target_include_directories(IVAS_rend PRIVATE lib_enc) if(COPY_EXECUTABLES_FROM_BUILD_DIR) # Optionally copy executables to the same place where Make puts them (useful for tests that expect executables in specific places)