diff --git a/src/ADC/CMakeLists.txt b/src/ADC/CMakeLists.txt index 3b39d8c..afdf472 100644 --- a/src/ADC/CMakeLists.txt +++ b/src/ADC/CMakeLists.txt @@ -1,17 +1,33 @@ +# File: srcs/ADC/CMakeLists.txt add_library(ADC STATIC ADC.c ) -target_include_directories(ADC PUBLIC - ${CMAKE_CURRENT_LIST_DIR} -) -if(UNIT_TESTING) +if(NOT UNIT_TESTING) + target_include_directories(ADC PUBLIC + ${CMAKE_CURRENT_LIST_DIR} + ${CMAKE_SOURCE_DIR}/inc/ + ) + target_link_libraries(ADC + RegEdit + ) +else() + target_include_directories(ADC PUBLIC + ${CMAKE_CURRENT_LIST_DIR} + #First we include any module specific test dependencies. + ${CMAKE_SOURCE_DIR}/tests/ADC/mocks/ + ${CMAKE_SOURCE_DIR}/tests/ADC/fakes/ + ${CMAKE_SOURCE_DIR}/tests/ADC/stubs/ + #Next comes the shared and non-module specific test depencencies. + ${CMAKE_SOURCE_DIR}/tests/shared/mocks/ + ${CMAKE_SOURCE_DIR}/tests/shared/fakes/ + ${CMAKE_SOURCE_DIR}/tests/shared/stubs/ + #Finally we include the local stuff, which has likely been overridden. + ${CMAKE_CURRENT_SOURCE_DIR} + ) + #Place Mocked/Regular dependencies here for unit testing. target_link_libraries(ADC MockRegEdit ) - -else() - target_link_libraries(ADC - RegEdit - ) endif() + diff --git a/src/RegEdit/CMakeLists.txt b/src/RegEdit/CMakeLists.txt index 8baf7a3..c4e0e50 100644 --- a/src/RegEdit/CMakeLists.txt +++ b/src/RegEdit/CMakeLists.txt @@ -5,3 +5,32 @@ add_library(RegEdit STATIC target_include_directories(RegEdit PUBLIC ${CMAKE_CURRENT_LIST_DIR} ) + + +if(NOT UNIT_TESTING) + target_include_directories(RegEdit PUBLIC + ${CMAKE_CURRENT_LIST_DIR} + ${CMAKE_SOURCE_DIR}/inc/ + ) + #target_link_libraries(RegEdit + # + #) +else() + target_include_directories(RegEdit PUBLIC + ${CMAKE_CURRENT_LIST_DIR} + #First we include any module specific test dependencies. + ${CMAKE_SOURCE_DIR}/tests/RegEdit/mocks/ + ${CMAKE_SOURCE_DIR}/tests/RegEdit/fakes/ + ${CMAKE_SOURCE_DIR}/tests/RegEdit/stubs/ + #Next comes the shared and non-module specific test depencencies. + ${CMAKE_SOURCE_DIR}/tests/shared/mocks/ + ${CMAKE_SOURCE_DIR}/tests/shared/fakes/ + ${CMAKE_SOURCE_DIR}/tests/shared/stubs/ + #Finally we include the local stuff, which has likely been overridden. + ${CMAKE_CURRENT_SOURCE_DIR} + ) + #Place Mocked/Regular dependencies here for unit testing. + #target_link_libraries(RegEdit + # + #) +endif()