Skip to content

Instantly share code, notes, and snippets.

@cyrusbehr
Created October 9, 2020 23:19
Show Gist options
  • Select an option

  • Save cyrusbehr/2c25015c194d11686f230a5af4e0d574 to your computer and use it in GitHub Desktop.

Select an option

Save cyrusbehr/2c25015c194d11686f230a5af4e0d574 to your computer and use it in GitHub Desktop.
Unit testing CMake
# Unit test
add_executable(run_tests tests/test.cpp)
target_link_libraries(run_tests ${CMAKE_CURRENT_BINARY_DIR}/libmy_sdk.a)
target_include_directories(run_tests PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include)
target_include_directories(run_tests PRIVATE ${CMAKE_CURRENT_LIST_DIR}/3rdparty/catch2)
add_dependencies(run_tests my_sdk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment