1 set(TARGET_LABEL_PREFIX "Test server ")
3 function(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
4 add_executable( ${TEST_NAME} ${ARGN} )
5 string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
8 ${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h"
9 ${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h"
10 ${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h"
13 include_directories(${CARES_INCLUDE_DIR})
15 # resolve test needs this
16 setup_curl_dependencies(${TEST_NAME})
17 #TARGET_LINK_LIBRARIES( ${TEST_NAME} libcurl )
19 # Test servers simply are standalone programs that do not use libcurl
20 # library. For convinience and to ease portability of these servers,
21 # some source code files from the libcurl subdirectory are also used
22 # to build the servers. In order to achieve proper linkage of these
23 # files on Win32 targets it is necessary to build the test servers
24 # with CURL_STATICLIB defined, independently of how libcurl is built.
25 if(NOT CURL_STATICLIB)
26 set_target_properties(${TEST_NAME} PROPERTIES
27 COMPILE_DEFINITIONS CURL_STATICLIB) # ${UPPER_TEST_NAME}
29 set_target_properties(${TEST_NAME} PROPERTIES
30 PROJECT_LABEL "${TARGET_LABEL_PREFIX}${TEST_NAME}")
32 # Add the postfix to the executable since it is not added
33 # automatically as for modules and shared libraries
34 set_target_properties(${TEST_NAME} PROPERTIES
35 DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
38 if(NOT BUILD_RELEASE_DEBUG_DIRS)
39 # Ugly workaround to remove the "/debug" or "/release" in each output
40 set_target_properties(${TEST_NAME} PROPERTIES PREFIX "../")
41 set_target_properties(${TEST_NAME} PROPERTIES IMPORT_PREFIX "../")
48 transform_makefile_inc("Makefile.inc"
49 "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
50 include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake)
52 foreach(EXECUTABLE_NAME ${noinst_PROGRAMS})
53 setup_executable(${EXECUTABLE_NAME} ${${EXECUTABLE_NAME}_SOURCES})
59 # ${CURL_SOURCE_DIR}/lib/strequal.c
60 # ${CURL_SOURCE_DIR}/lib/base64.c
61 # ${CURL_SOURCE_DIR}/lib/mprintf.c
62 # ${CURL_SOURCE_DIR}/lib/memdebug.c
63 # ${CURL_SOURCE_DIR}/lib/timeval.c
66 # SETUP_EXECUTABLE(sws sws.c util.c util.h ${useful})
67 # SETUP_EXECUTABLE(resolve resolve.c util.c util.h ${useful})
68 # SETUP_EXECUTABLE(sockfilt sockfilt.c util.c util.h ${useful} ${CURL_SOURCE_DIR}/lib/inet_pton.c)
69 # SETUP_EXECUTABLE(getpart testpart.c ${useful})
70 # SETUP_EXECUTABLE(tftpd tftpd.c util.c util.h ${useful} tftp.h)