CMakeLists.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. cmake_minimum_required(VERSION 3.15)
  2. project(scattnlay_tests C CXX)
  3. # -- Dependency (Google Test)
  4. find_package(GTest REQUIRED)
  5. include_directories(${GTEST_INCLUDE_DIRS})
  6. set(LIBS ${LIBS} ${GTEST_LIBRARIES})
  7. set(LIBS ${LIBS} pthread)
  8. add_compile_options(-D_GLIBCXX_DEBUG)
  9. # -- Output tests in directory
  10. add_executable("test_near_field"
  11. test_near_field.cc)
  12. target_link_libraries("test_near_field" ${LIBS})
  13. add_test(NAME "test_near_field"
  14. COMMAND "test_near_field")
  15. # In included file test_spec_functions_data.hpp there are results of multiple
  16. # precision computation that may overflow double precision at compile time.
  17. set_source_files_properties(test_Riccati_Bessel_logarithmic_derivative.cc
  18. PROPERTIES COMPILE_FLAGS -Wno-overflow)
  19. add_executable("test_Riccati_Bessel_logarithmic_derivative"
  20. test_Riccati_Bessel_logarithmic_derivative.cc)
  21. target_link_libraries("test_Riccati_Bessel_logarithmic_derivative" ${LIBS})
  22. add_test(NAME "test_Riccati_Bessel_logarithmic_derivative"
  23. COMMAND "test_Riccati_Bessel_logarithmic_derivative")
  24. add_executable("test_bulk_sphere" test_bulk_sphere.cc)
  25. target_link_libraries("test_bulk_sphere" ${LIBS})
  26. add_test(NAME "test_bulk_sphere"
  27. COMMAND "test_bulk_sphere")
  28. add_executable("test_bulk_sphere_multi_precision" test_bulk_sphere.cc)
  29. target_compile_options("test_bulk_sphere_multi_precision"
  30. PRIVATE -DMULTI_PRECISION=100)
  31. target_link_libraries("test_bulk_sphere_multi_precision" ${LIBS})
  32. add_test(NAME "test_bulk_sphere_multi_precision"
  33. COMMAND "test_bulk_sphere_multi_precision")
  34. add_executable("test_near_field_multi_precision"
  35. test_near_field.cc)
  36. target_compile_options("test_near_field_multi_precision"
  37. PRIVATE -DMULTI_PRECISION=100)
  38. target_link_libraries("test_near_field_multi_precision" ${LIBS})
  39. add_test(NAME "test_near_field_multi_precision"
  40. COMMAND "test_near_field_multi_precision")