diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ddd9b0e..c638980 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,19 @@ + +message ("GTEST_LIBRARIES: ${GTEST_LIBRARIES}") +message ("GTest_LIBRARIES: ${GTest_LIBRARIES}") + +message ("GTEST_INCLUDE_DIRS: ${GTEST_INCLUDE_DIRS}") +message ("GTest_INCLUDE_DIRS: ${GTest_INCLUDE_DIRS}") + +if (NOT GTEST_LIBRARIES) + set (GTEST_LIBRARIES ${GTest_LIBRARIES}) +endif() + +if (NOT GTEST_INCLUDE_DIRS) + set (GTEST_INCLUDE_DIRS ${GTest_INCLUDE_DIRS}) +endif() + + ####### unit_tests add_executable(unit_tests @@ -13,12 +29,13 @@ add_dependencies(unit_tests target_include_directories(unit_tests PRIVATE - $ - $ - $ + ${CMAKE_CURRENT_SOURCE_DIR} + ${MYSQLPOOL_ROOT}/include + ${MYSQLPOOL_ROOT}/src/lib + ${CMAKE_BINARY_DIR}/generated-include> + ${CMAKE_BINARY_DIR}/external-projects/installed/include> + ${CMAKE_CURRENT_BINARY_DIR} + ${GTEST_INCLUDE_DIRS} ) target_link_libraries(unit_tests @@ -33,8 +50,6 @@ target_link_libraries(unit_tests add_test(NAME unit_tests COMMAND unit_tests) -message("GTEST_LIBRARIES: ${GTEST_LIBRARIES}") - ####### integration_tests if (MYSQLPOOL_WITH_INTGRATION_TESTS) @@ -51,12 +66,13 @@ add_dependencies(integration_tests target_include_directories(integration_tests PRIVATE - $ - $ - $ + ${CMAKE_CURRENT_SOURCE_DIR} + ${MYSQLPOOL_ROOT}/include + ${MYSQLPOOL_ROOT}/src/lib + ${CMAKE_BINARY_DIR}/generated-include> + ${CMAKE_BINARY_DIR}/external-projects/installed/include> + ${CMAKE_CURRENT_BINARY_DIR} + ${GTEST_INCLUDE_DIRS} ) target_link_libraries(integration_tests