CMakeLists.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. set(UT_SRC
  2. unit1300.c
  3. unit1301.c
  4. unit1302.c
  5. unit1303.c
  6. unit1304.c
  7. unit1305.c
  8. unit1307.c
  9. unit1308.c
  10. unit1309.c
  11. unit1330.c
  12. # Broken link on Linux
  13. # unit1394.c
  14. unit1395.c
  15. unit1396.c
  16. unit1397.c
  17. unit1398.c
  18. unit1600.c
  19. unit1601.c
  20. unit1603.c
  21. # Broken link on Linux
  22. # unit1604.c
  23. unit1620.c
  24. )
  25. set(UT_COMMON_FILES ../libtest/first.c ../libtest/test.h curlcheck.h)
  26. include_directories(
  27. ${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h"
  28. ${CURL_SOURCE_DIR}/tests/libtest
  29. ${CURL_SOURCE_DIR}/src
  30. ${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h"
  31. ${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h"
  32. )
  33. foreach(_testfile ${UT_SRC})
  34. get_filename_component(_testname ${_testfile} NAME_WE)
  35. add_executable(${_testname} ${_testfile} ${UT_COMMON_FILES})
  36. target_link_libraries(${_testname} libcurl ${CURL_LIBS})
  37. set_target_properties(${_testname}
  38. PROPERTIES COMPILE_DEFINITIONS "UNITTESTS")
  39. if(HIDES_CURL_PRIVATE_SYMBOLS)
  40. set_target_properties(${_testname}
  41. PROPERTIES
  42. EXCLUDE_FROM_ALL TRUE
  43. EXCLUDE_FROM_DEFAULT_BUILD TRUE
  44. )
  45. else()
  46. add_test(NAME ${_testname}
  47. COMMAND ${_testname} "http://www.google.com"
  48. )
  49. endif()
  50. endforeach()