# TODO:
# The output .so file lacks the soname number which we currently have within the lib/Makefile.am file
+# Fix the Win32 "_beginthreadex" warning (According to Tetetest: The proto of this function is in process.h file, so first of all make sure that HAVE_PROCESS_H is defined. Second, this function is only available in multithread builds (_MT is defined, /MD or /MT compiler switch supplied). CMake does supply /MD switch to compiler (I have just checked this), so the reason must be the absense of HAVE_PROCESS_H.)
# Add full (4 or 5 libs) SSL support
# Add INSTALL target (EXTRA_DIST variables in Makefile.am may be moved to Makefile.inc so that CMake/CPack is aware of what's to include).
# Add CTests(?)
OPTION(BUILD_CURL_EXE "Set to ON to build cURL executable." ON)
OPTION(BUILD_CURL_TESTS "Set to ON to build cURL tests." ON)
OPTION(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF)
+
+OPTION(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of cURL builds here http://www.cdash.org/CDashPublic/index.php?project=CURL" OFF)
+IF(BUILD_DASHBOARD_REPORTS)
+ #INCLUDE(Dart)
+ INCLUDE(CTest)
+ENDIF(BUILD_DASHBOARD_REPORTS)
+
IF(MSVC)
OPTION(BUILD_RELEASE_DEBUG_DIRS "Set OFF to build each configuration to a separate directory" OFF)
MARK_AS_ADVANCED(BUILD_RELEASE_DEBUG_DIRS)
ADD_SUBDIRECTORY(tests)
ENDIF()
-OPTION(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of cURL builds here http://www.cdash.org/CDashPublic/index.php?project=CURL" OFF)
-IF(BUILD_DASHBOARD_REPORTS)
- INCLUDE(Dart)
- #INCLUDE(CTest)
-ENDIF(BUILD_DASHBOARD_REPORTS)
-
# This needs to be run very last so other parts of the scripts can take advantage of this.
IF(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
SET(CURL_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
ADD_DEFINITIONS( -D_USRDLL )
ENDIF()
-ADD_DEFINITIONS(
- -DBUILDING_LIBCURL
-)
+SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL)
SETUP_CURL_DEPENDENCIES(${LIB_NAME})
-MACRO(SETUP_TEST TEST_NAME) # ARGN are the files in the test
+FUNCTION(SETUP_TEST TEST_NAME) # ARGN are the files in the test
ADD_EXECUTABLE( ${TEST_NAME} ${ARGN} )
- STRING(TOUPPER TEST_NAME UPPER_TEST_NAME)
+ STRING(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
INCLUDE_DIRECTORIES(
${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h"
SETUP_CURL_DEPENDENCIES(${TEST_NAME})
TARGET_LINK_LIBRARIES( ${TEST_NAME} libcurl )
- ADD_DEFINITIONS( "-D${UPPER_TEST_NAME}" )
-
+ SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES COMPILE_DEFINITIONS ${UPPER_TEST_NAME})
+
# Add the postfix to the executable since it is not added automatically as for modules and shared libraries
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
IF(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES PREFIX "../")
+ SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES IMPORT_PREFIX "../")
ENDIF()
ENDIF()
-ENDMACRO()
+ENDFUNCTION()
TRANSFORM_MAKEFILE_INC("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
-MACRO(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
+FUNCTION(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
ADD_EXECUTABLE( ${TEST_NAME} ${ARGN} )
- STRING(TOUPPER TEST_NAME UPPER_TEST_NAME)
+ STRING(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
INCLUDE_DIRECTORIES(
${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h"
SETUP_CURL_DEPENDENCIES(${TEST_NAME})
#TARGET_LINK_LIBRARIES( ${TEST_NAME} libcurl )
- ADD_DEFINITIONS( "-D${UPPER_TEST_NAME}" )
-
+ #SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES COMPILE_DEFINITIONS ${UPPER_TEST_NAME})
+
# Add the postfix to the executable since it is not added automatically as for modules and shared libraries
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
IF(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES PREFIX "../")
+ SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES IMPORT_PREFIX "../")
ENDIF()
ENDIF()
-ENDMACRO()
+ENDFUNCTION()
TRANSFORM_MAKEFILE_INC("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")