CMakeLists.txt 2.2 KB

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