mirror of
https://github.com/curl/curl.git
synced 2024-12-21 06:50:10 +08:00
4a5aa6682d
This reverts renaming and usage of lib/*.h header files done
28-12-2012, reverting 2 commits:
f871de0... build: make use of 76 lib/*.h renamed files
ffd8e12... build: rename 76 lib/*.h files
This also reverts removal of redundant include guard (redundant thanks
to changes in above commits) done 2-12-2013, reverting 1 commit:
c087374... curl_setup.h: remove redundant include guard
This also reverts renaming and usage of lib/*.c source files done
3-12-2013, reverting 3 commits:
13606bb... build: make use of 93 lib/*.c renamed files
5b6e792... build: rename 93 lib/*.c files
7d83dff... build: commit 13606bbfde
follow-up 1
Start of related discussion thread:
http://curl.haxx.se/mail/lib-2013-01/0012.html
Asking for confirmation on pushing this revertion commit:
http://curl.haxx.se/mail/lib-2013-01/0048.html
Confirmation summary:
http://curl.haxx.se/mail/lib-2013-01/0079.html
NOTICE: The list of 2 files that have been modified by other
intermixed commits, while renamed, and also by at least one
of the 6 commits this one reverts follows below. These 2 files
will exhibit a hole in history unless git's '--follow' option
is used when viewing logs.
lib/curl_imap.h
lib/curl_smtp.h
127 lines
3.1 KiB
CMake
127 lines
3.1 KiB
CMake
set(LIB_NAME libcurl)
|
|
|
|
configure_file(${CURL_SOURCE_DIR}/include/curl/curlbuild.h.cmake
|
|
${CURL_BINARY_DIR}/include/curl/curlbuild.h)
|
|
configure_file(curl_config.h.cmake
|
|
${CMAKE_CURRENT_BINARY_DIR}/curl_config.h)
|
|
|
|
transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
|
include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake)
|
|
|
|
list(APPEND HHEADERS
|
|
${CMAKE_CURRENT_BINARY_DIR}/curl_config.h
|
|
${CURL_BINARY_DIR}/include/curl/curlbuild.h
|
|
)
|
|
|
|
if(MSVC)
|
|
list(APPEND CSOURCES libcurl.rc)
|
|
endif()
|
|
|
|
# SET(CSOURCES
|
|
# # memdebug.c -not used
|
|
# # nwlib.c - Not used
|
|
# # strtok.c - specify later
|
|
# # strtoofft.c - specify later
|
|
# )
|
|
|
|
# # if we have Kerberos 4, right now this is never on
|
|
# #OPTION(CURL_KRB4 "Use Kerberos 4" OFF)
|
|
# IF(CURL_KRB4)
|
|
# SET(CSOURCES ${CSOURCES}
|
|
# krb4.c
|
|
# security.c
|
|
# )
|
|
# ENDIF(CURL_KRB4)
|
|
|
|
# #OPTION(CURL_MALLOC_DEBUG "Debug mallocs in Curl" OFF)
|
|
# MARK_AS_ADVANCED(CURL_MALLOC_DEBUG)
|
|
# IF(CURL_MALLOC_DEBUG)
|
|
# SET(CSOURCES ${CSOURCES}
|
|
# memdebug.c
|
|
# )
|
|
# ENDIF(CURL_MALLOC_DEBUG)
|
|
|
|
# # only build compat strtoofft if we need to
|
|
# IF(NOT HAVE_STRTOLL AND NOT HAVE__STRTOI64)
|
|
# SET(CSOURCES ${CSOURCES}
|
|
# strtoofft.c
|
|
# )
|
|
# ENDIF(NOT HAVE_STRTOLL AND NOT HAVE__STRTOI64)
|
|
|
|
if(HAVE_FEATURES_H)
|
|
set_source_files_properties(
|
|
cookie.c
|
|
easy.c
|
|
formdata.c
|
|
getenv.c
|
|
nonblock.c
|
|
hash.c
|
|
http.c
|
|
if2ip.c
|
|
mprintf.c
|
|
multi.c
|
|
sendf.c
|
|
telnet.c
|
|
transfer.c
|
|
url.c
|
|
COMPILE_FLAGS -D_BSD_SOURCE)
|
|
endif(HAVE_FEATURES_H)
|
|
|
|
|
|
# The rest of the build
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../include)
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
if(CURL_USE_ARES)
|
|
include_directories(${CARES_INCLUDE_DIR})
|
|
endif()
|
|
|
|
if(CURL_STATICLIB)
|
|
# Static lib
|
|
set(CURL_USER_DEFINED_DYNAMIC_OR_STATIC STATIC)
|
|
else()
|
|
# DLL / so dynamic lib
|
|
set(CURL_USER_DEFINED_DYNAMIC_OR_STATIC SHARED)
|
|
endif()
|
|
|
|
add_library(
|
|
${LIB_NAME}
|
|
${CURL_USER_DEFINED_DYNAMIC_OR_STATIC}
|
|
${HHEADERS} ${CSOURCES}
|
|
)
|
|
|
|
target_link_libraries(${LIB_NAME} ${CURL_LIBS})
|
|
|
|
if(WIN32)
|
|
add_definitions( -D_USRDLL )
|
|
endif()
|
|
|
|
set_target_properties(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL)
|
|
|
|
setup_curl_dependencies(${LIB_NAME})
|
|
|
|
# Remove the "lib" prefix since the library is already named "libcurl".
|
|
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "")
|
|
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "")
|
|
|
|
if(MSVC)
|
|
if(NOT BUILD_RELEASE_DEBUG_DIRS)
|
|
# Ugly workaround to remove the "/debug" or "/release" in each output
|
|
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "../")
|
|
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
|
|
endif()
|
|
endif()
|
|
|
|
if(WIN32)
|
|
if(NOT CURL_STATICLIB)
|
|
# Add "_imp" as a suffix before the extension to avoid conflicting with the statically linked "libcurl.lib"
|
|
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib")
|
|
endif()
|
|
endif()
|
|
|
|
install(TARGETS ${LIB_NAME} DESTINATION lib)
|