mirror of
https://github.com/curl/curl.git
synced 2026-08-25 15:13:41 +03:00
cmake: tidy-ups
- tidy-up comments. - use lowercase, underscore prefixed names for internal variables. - use `IN LISTS` and `IN ITEMS` in `foreach()` loops. - rename variable name `OUTPUT` to a more distinctive one. - tidy-up `STREQUAL` syntax. - delete commented code. - indent/whitespace. Closes #14197
This commit is contained in:
parent
b64d9d7d81
commit
acbc6b703f
26 changed files with 401 additions and 487 deletions
|
|
@ -27,55 +27,39 @@ if(MSVC)
|
|||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4306")
|
||||
endif()
|
||||
|
||||
function(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
|
||||
add_executable(${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN})
|
||||
add_dependencies(testdeps ${TEST_NAME})
|
||||
function(setup_executable test_name) # ARGN are the files in the test
|
||||
add_executable(${test_name} EXCLUDE_FROM_ALL ${ARGN})
|
||||
add_dependencies(testdeps ${test_name})
|
||||
|
||||
include_directories(
|
||||
${CURL_SOURCE_DIR}/lib # for "curl_setup_once.h"
|
||||
${CURL_BINARY_DIR}/lib # for "curl_config.h"
|
||||
${CURL_BINARY_DIR}/include # for "curl/curl.h"
|
||||
${CURL_SOURCE_DIR}/src # for "tool_xattr.h"
|
||||
)
|
||||
)
|
||||
if(USE_ARES)
|
||||
include_directories(${CARES_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${TEST_NAME} ${CURL_LIBS})
|
||||
target_link_libraries(${test_name} ${CURL_LIBS})
|
||||
|
||||
# Test servers simply are standalone programs that do not use libcurl
|
||||
# library. For convenience and to ease portability of these servers,
|
||||
# some source code files from the libcurl subdirectory are also used
|
||||
# to build the servers. In order to achieve proper linkage of these
|
||||
# files on Win32 targets it is necessary to build the test servers
|
||||
# files on Windows targets it is necessary to build the test servers
|
||||
# with CURL_STATICLIB defined, independently of how libcurl is built.
|
||||
set_target_properties(${TEST_NAME} PROPERTIES
|
||||
set_target_properties(${test_name} PROPERTIES
|
||||
COMPILE_DEFINITIONS CURL_STATICLIB)
|
||||
set_target_properties(${TEST_NAME} PROPERTIES
|
||||
PROJECT_LABEL "${TARGET_LABEL_PREFIX}${TEST_NAME}")
|
||||
set_target_properties(${test_name} PROPERTIES
|
||||
PROJECT_LABEL "${TARGET_LABEL_PREFIX}${test_name}")
|
||||
endfunction()
|
||||
|
||||
|
||||
# Get 'noinst_PROGRAMS', '<target>_SOURCES' variables
|
||||
transform_makefile_inc("Makefile.inc"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake)
|
||||
|
||||
foreach(EXECUTABLE_NAME ${noinst_PROGRAMS})
|
||||
setup_executable(${EXECUTABLE_NAME} ${${EXECUTABLE_NAME}_SOURCES})
|
||||
foreach(_executable_name IN LISTS noinst_PROGRAMS)
|
||||
setup_executable(${_executable_name} ${${_executable_name}_SOURCES})
|
||||
endforeach()
|
||||
|
||||
|
||||
# set(useful
|
||||
# getpart.c getpart.h
|
||||
# ${CURL_SOURCE_DIR}/lib/strequal.c
|
||||
# ${CURL_SOURCE_DIR}/lib/base64.c
|
||||
# ${CURL_SOURCE_DIR}/lib/mprintf.c
|
||||
# ${CURL_SOURCE_DIR}/lib/memdebug.c
|
||||
# ${CURL_SOURCE_DIR}/lib/timeval.c
|
||||
# )
|
||||
|
||||
# setup_executable(sws sws.c util.c util.h ${useful})
|
||||
# setup_executable(resolve resolve.c util.c util.h ${useful})
|
||||
# setup_executable(sockfilt sockfilt.c util.c util.h ${useful} ${CURL_SOURCE_DIR}/lib/inet_pton.c)
|
||||
# setup_executable(getpart testpart.c ${useful})
|
||||
# setup_executable(tftpd tftpd.c util.c util.h ${useful} tftp.h)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue