@@ -11,53 +11,55 @@ endif()
11
11
# Libuv
12
12
#------------------------
13
13
14
- # Setup the paths and hints for libuv
15
- if (NOT LIBUV_ROOT_DIR)
16
- if (EXISTS "${PROJECT_SOURCE_DIR} /lib/libuv/" )
17
- set (LIBUV_ROOT_DIR "${PROJECT_SOURCE_DIR} /lib/libuv/" )
18
- elseif (EXISTS "${PROJECT_SOURCE_DIR} /build/libs/libuv/" )
19
- set (LIBUV_ROOT_DIR "${PROJECT_SOURCE_DIR} /build/libs/libuv/" )
14
+ if (CASS_USE_LIBUV)
15
+ # Setup the paths and hints for libuv
16
+ if (NOT LIBUV_ROOT_DIR)
17
+ if (EXISTS "${PROJECT_SOURCE_DIR} /lib/libuv/" )
18
+ set (LIBUV_ROOT_DIR "${PROJECT_SOURCE_DIR} /lib/libuv/" )
19
+ elseif (EXISTS "${PROJECT_SOURCE_DIR} /build/libs/libuv/" )
20
+ set (LIBUV_ROOT_DIR "${PROJECT_SOURCE_DIR} /build/libs/libuv/" )
21
+ endif ()
20
22
endif ()
21
- endif ()
22
23
23
- # Ensure libuv was found
24
- find_package (Libuv "1.0.0" )
25
- if (WIN32 AND NOT LIBUV_FOUND)
26
- message (STATUS "Unable to Locate libuv: Third party build step will be performed" )
27
- include (ExternalProject-libuv)
28
- elseif (NOT LIBUV_FOUND)
29
- message (FATAL_ERROR "Unable to Locate libuv: libuv v1.0.0+ is required" )
30
- endif ()
24
+ # Ensure libuv was found
25
+ find_package (Libuv "1.0.0" )
26
+ if (WIN32 AND NOT LIBUV_FOUND)
27
+ message (STATUS "Unable to Locate libuv: Third party build step will be performed" )
28
+ include (ExternalProject-libuv)
29
+ elseif (NOT LIBUV_FOUND)
30
+ message (FATAL_ERROR "Unable to Locate libuv: libuv v1.0.0+ is required" )
31
+ endif ()
31
32
32
- if (LIBUV_VERSION VERSION_LESS "1.0" )
33
- message (FATAL_ERROR "Libuv version ${LIBUV_VERSION} is not "
34
- " supported. Please updgrade to libuv version 1.0 or greater in order to "
35
- "utilize the driver." )
36
- endif ()
33
+ if (LIBUV_VERSION VERSION_LESS "1.0" )
34
+ message (FATAL_ERROR "Libuv version ${LIBUV_VERSION} is not "
35
+ " supported. Please updgrade to libuv version 1.0 or greater in order to "
36
+ "utilize the driver." )
37
+ endif ()
37
38
38
- if (LIBUV_VERSION VERSION_LESS "1.6" )
39
- message (WARNING "Libuv version ${LIBUV_VERSION} does not support custom "
40
- "memory allocators (version 1.6 or greater required)" )
41
- endif ()
39
+ if (LIBUV_VERSION VERSION_LESS "1.6" )
40
+ message (WARNING "Libuv version ${LIBUV_VERSION} does not support custom "
41
+ "memory allocators (version 1.6 or greater required)" )
42
+ endif ()
42
43
43
- # Assign libuv include and libraries
44
- set (CASS_INCLUDES ${CASS_INCLUDES} ${LIBUV_INCLUDE_DIRS} )
45
- set (CASS_LIBS ${CASS_LIBS} ${LIBUV_LIBRARIES} )
44
+ # Assign libuv include and libraries
45
+ set (CASS_INCLUDES ${CASS_INCLUDES} ${LIBUV_INCLUDE_DIRS} )
46
+ set (CASS_LIBS ${CASS_LIBS} ${LIBUV_LIBRARIES} )
46
47
47
- # libuv and gtests require thread library
48
- if (NOT WIN32 )
49
- set (CMAKE_THREAD_PREFER_PTHREAD 1)
50
- set (THREADS_PREFER_PTHREAD_FLAG 1)
51
- endif ()
48
+ # libuv and gtests require thread library
49
+ if (NOT WIN32 )
50
+ set (CMAKE_THREAD_PREFER_PTHREAD 1)
51
+ set (THREADS_PREFER_PTHREAD_FLAG 1)
52
+ endif ()
52
53
53
- find_package (Threads REQUIRED)
54
+ find_package (Threads REQUIRED)
54
55
55
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_THREAD_LIBS_INIT} " )
56
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_THREAD_LIBS_INIT} " )
57
- if (NOT WIN32 AND ${CMAKE_VERSION} VERSION_LESS "3.1.0" )
58
- # FindThreads in CMake versions < v3.1.0 do not have the THREADS_PREFER_PTHREAD_FLAG to prefer -pthread
59
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
60
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread" )
56
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_THREAD_LIBS_INIT} " )
57
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_THREAD_LIBS_INIT} " )
58
+ if (NOT WIN32 AND ${CMAKE_VERSION} VERSION_LESS "3.1.0" )
59
+ # FindThreads in CMake versions < v3.1.0 do not have the THREADS_PREFER_PTHREAD_FLAG to prefer -pthread
60
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
61
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread" )
62
+ endif ()
61
63
endif ()
62
64
63
65
#------------------------
0 commit comments