Skip to content

Commit b7604a7

Browse files
committed
better cmake patch
1 parent acabd70 commit b7604a7

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

CMakeLists.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,6 @@ if(NOT SQLITE3_LIBRARY)
109109
message(SEND_ERROR "Failed to find the sqlite3 library")
110110
endif()
111111

112-
find_path(OPENSSL_INCLUDE_DIR openssl/ssl.h)
113-
find_library(OPENSSL_LIBRARY ssl)
114-
if(NOT OPENSSL_INCLUDE_DIR)
115-
message(SEND_ERROR "Failed to find openssl include files (ssl.h)")
116-
endif()
117-
if(NOT OPENSSL_LIBRARY)
118-
message(SEND_ERROR "Failed to find the openssl library")
119-
else()
120-
add_definitions(-DNS_ENABLE_SSL)
121-
endif()
122-
123112
FIND_PROGRAM(SVN_EXECUTABLE svn
124113
DOC "subversion command line client")
125114

@@ -304,6 +293,18 @@ else()
304293
MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
305294
ENDIF(LIBUSB_FOUND)
306295

296+
find_path(OPENSSL_INCLUDE_DIR openssl/ssl.h)
297+
find_library(OPENSSL_LIBRARY ssl)
298+
if(NOT OPENSSL_INCLUDE_DIR)
299+
message(SEND_ERROR "Failed to find openssl include files (ssl.h), no HTTPS support")
300+
endif()
301+
if(NOT OPENSSL_LIBRARY)
302+
message(SEND_ERROR "Failed to find the openssl library, no HTTPS support")
303+
else()
304+
add_definitions(-DNS_ENABLE_SSL)
305+
target_link_libraries(domoticz ${OPENSSL_LIBRARY})
306+
endif()
307+
307308
## support lua popen on Linux platforms
308309
#IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
309310
# SET(OperatingSystem "Linux")
@@ -364,7 +365,7 @@ else()
364365
message(STATUS "Not building on Raspberry Pi. GPIO support disabled.")
365366
ENDIF(RaspberryPi)
366367

367-
target_link_libraries(domoticz ${Boost_LIBRARIES} ${SQLITE3_LIBRARY} ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} pthread lua ${CMAKE_DL_LIBS} ${OPENSSL_LIBRARY})
368+
target_link_libraries(domoticz ${Boost_LIBRARIES} ${SQLITE3_LIBRARY} ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} pthread lua ${CMAKE_DL_LIBS})
368369

369370
ADD_PRECOMPILED_HEADER(domoticz "main/stdafx.h")
370371

0 commit comments

Comments
 (0)