CMakeLists.txt 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #TODO remove -Wno
  25. set_source_files_properties(test_bulk_sphere.cc
  26. PROPERTIES COMPILE_FLAGS "-Wno-overflow -Wno-unused-parameter")
  27. add_executable("test_bulk_sphere" test_bulk_sphere.cc)
  28. target_link_libraries("test_bulk_sphere" ${LIBS})
  29. add_test(NAME "test_bulk_sphere"
  30. COMMAND "test_bulk_sphere")
  31. add_executable("test_bulk_sphere_multi_precision" test_bulk_sphere.cc)
  32. target_compile_options("test_bulk_sphere_multi_precision"
  33. PRIVATE -DMULTI_PRECISION=100)
  34. target_link_libraries("test_bulk_sphere_multi_precision" ${LIBS})
  35. add_test(NAME "test_bulk_sphere_multi_precision"
  36. COMMAND "test_bulk_sphere_multi_precision")
  37. add_executable("test_near_field_multi_precision"
  38. test_near_field.cc)
  39. target_compile_options("test_near_field_multi_precision"
  40. PRIVATE -DMULTI_PRECISION=100)
  41. target_link_libraries("test_near_field_multi_precision" ${LIBS})
  42. add_test(NAME "test_near_field_multi_precision"
  43. COMMAND "test_near_field_multi_precision")