Imported Upstream version 7.59.0
[platform/upstream/curl.git] / tests / libtest / CMakeLists.txt
index a7449c3..4d42aa5 100644 (file)
@@ -7,7 +7,8 @@ function(SETUP_TEST TEST_NAME)          # ARGN are the files in the test
   include_directories(
     ${CURL_SOURCE_DIR}/lib          # To be able to reach "curl_setup_once.h"
     ${CURL_BINARY_DIR}/lib          # To be able to reach "curl_config.h"
-    ${CURL_BINARY_DIR}/include      # To be able to reach "curl/curlbuild.h"
+    ${CURL_BINARY_DIR}/include      # To be able to reach "curl/curl.h"
+    ${CURL_SOURCE_DIR}/tests/libtest # To be able to build generated tests
     )
   if(USE_ARES)
     include_directories(${CARES_INCLUDE_DIR})
@@ -49,7 +50,15 @@ if(NOT WIN32)
   endif()
 endif()
 
-# # files used only in some libcurl test programs
+add_custom_command(
+  OUTPUT lib1521.c
+  COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl < ${CMAKE_SOURCE_DIR}/include/curl/curl.h > lib1521.c
+  DEPENDS
+    "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl"
+    "${CMAKE_SOURCE_DIR}/include/curl/curl.h"
+  VERBATIM)
+
+  # # files used only in some libcurl test programs
 # SET(TESTUTIL testutil.c testutil.h)
 
 # # these files are used in every single test program below