diff --git a/md5/CMakeLists.txt b/md5/CMakeLists.txt index c6dfee75..25ef760a 100644 --- a/md5/CMakeLists.txt +++ b/md5/CMakeLists.txt @@ -5,3 +5,7 @@ set(CPPS set(PLATFORMCPPS) add_library(md5 STATIC ${HEADERS} ${CPPS} ${PLATFORMCPPS}) + +if(BUILD_TESTING) + add_subdirectory(tests) +endif() diff --git a/md5/tests/CMakeLists.txt b/md5/tests/CMakeLists.txt new file mode 100644 index 00000000..bf2241d3 --- /dev/null +++ b/md5/tests/CMakeLists.txt @@ -0,0 +1,12 @@ +add_executable( + md5_tests + ../md5.cpp + md5_tests.cpp +) +target_link_libraries( + md5_tests + GTest::gtest_main +) +target_include_directories(md5_tests PRIVATE ${PROJECT_SOURCE_DIR}/md5 ${PROJECT_SOURCE_DIR}/lib) + +gtest_discover_tests(md5_tests) diff --git a/tests/md5_tests.cpp b/md5/tests/md5_tests.cpp similarity index 100% rename from tests/md5_tests.cpp rename to md5/tests/md5_tests.cpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5ac595f1..5c2c08aa 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,16 +9,3 @@ target_link_libraries( target_include_directories(byteswap_tests PRIVATE ${PROJECT_SOURCE_DIR}/lib) gtest_discover_tests(byteswap_tests) - -add_executable( - md5_tests - ../md5/md5.cpp - md5_tests.cpp -) -target_link_libraries( - md5_tests - GTest::gtest_main -) -target_include_directories(md5_tests PRIVATE ${PROJECT_SOURCE_DIR}/md5 ${PROJECT_SOURCE_DIR}/lib) - -gtest_discover_tests(md5_tests)