2
0

CMakeLists.txt 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at https://curl.se/docs/copyright.html.
  13. #
  14. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. # copies of the Software, and permit persons to whom the Software is
  16. # furnished to do so, under the terms of the COPYING file.
  17. #
  18. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. # KIND, either express or implied.
  20. #
  21. # SPDX-License-Identifier: curl
  22. #
  23. ###########################################################################
  24. # TODO build a special libcurlu library for unittests.
  25. return()
  26. set(UT_SRC
  27. unit1300.c
  28. unit1301.c
  29. unit1302.c
  30. unit1303.c
  31. unit1304.c
  32. unit1305.c
  33. unit1307.c
  34. unit1308.c
  35. unit1309.c
  36. unit1330.c
  37. # Broken link on Linux
  38. # unit1394.c
  39. unit1395.c
  40. unit1396.c
  41. unit1397.c
  42. unit1398.c
  43. unit1600.c
  44. unit1601.c
  45. unit1603.c
  46. # Broken link on Linux
  47. # unit1604.c
  48. unit1620.c
  49. unit1655.c
  50. )
  51. set(UT_COMMON_FILES ../libtest/first.c ../libtest/test.h curlcheck.h)
  52. include_directories(
  53. ${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h"
  54. ${CURL_SOURCE_DIR}/tests/libtest
  55. ${CURL_SOURCE_DIR}/src
  56. ${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h"
  57. ${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h"
  58. )
  59. foreach(_testfile ${UT_SRC})
  60. get_filename_component(_testname ${_testfile} NAME_WE)
  61. add_executable(${_testname} EXCLUDE_FROM_ALL ${_testfile} ${UT_COMMON_FILES})
  62. #add_dependencies(testdeps ${_testname})
  63. target_link_libraries(${_testname} libcurl ${CURL_LIBS})
  64. set_target_properties(${_testname}
  65. PROPERTIES COMPILE_DEFINITIONS "UNITTESTS")
  66. endforeach()