CMakeLists.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. )
  24. set(UT_COMMON_FILES ../libtest/first.c ../libtest/test.h curlcheck.h)
  25. include_directories(
  26. ${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h"
  27. ${CURL_SOURCE_DIR}/tests/libtest
  28. ${CURL_SOURCE_DIR}/src
  29. ${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h"
  30. ${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h"
  31. )
  32. foreach(_testfile ${UT_SRC})
  33. get_filename_component(_testname ${_testfile} NAME_WE)
  34. add_executable(${_testname} ${_testfile} ${UT_COMMON_FILES})
  35. target_link_libraries(${_testname} libcurl ${CURL_LIBS})
  36. set_target_properties(${_testname}
  37. PROPERTIES COMPILE_DEFINITIONS "UNITTESTS")
  38. if(HIDES_CURL_PRIVATE_SYMBOLS)
  39. set_target_properties(${_testname}
  40. PROPERTIES
  41. EXCLUDE_FROM_ALL TRUE
  42. EXCLUDE_FROM_DEFAULT_BUILD TRUE
  43. )
  44. else()
  45. add_test(NAME ${_testname}
  46. COMMAND ${_testname} "http://www.google.com"
  47. )
  48. endif()
  49. endforeach()