pabloariasal / modern-cmake-sample

Example library that shows best practices and proper usage of CMake by using targets
MIT License
667 stars 70 forks source link

Adding tests for file_utils.h #9

Closed Dzordzu closed 2 years ago

Dzordzu commented 5 years ago

As a beginner in cmake I'd like to see how to implement tests for private sources of the target (here it would be file_utils.h) Now I do something like

target_include_directories(tests
        PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/../src
        )

in test directory. Is it correct?