Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eclipse
paho.mqtt.c
Commits
eb294bd1
Commit
eb294bd1
authored
Jan 16, 2017
by
Otavio Rodolfo Piske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use CMake features to search for OpenSSL libraries
Signed-off-by:
Otavio Rodolfo Piske
<
opiske@redhat.com
>
parent
83cc318c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
15 deletions
+26
-15
CMakeLists.txt
src/CMakeLists.txt
+26
-15
No files found.
src/CMakeLists.txt
View file @
eb294bd1
#*******************************************************************************
#*******************************************************************************
# Copyright (c) 2015 logi.cals GmbH
# Copyright (c) 2015 logi.cals GmbH
#
#
# All rights reserved. This program and the accompanying materials
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
#
# The Eclipse Public License is available at
# The Eclipse Public License is available at
# http://www.eclipse.org/legal/epl-v10.html
# http://www.eclipse.org/legal/epl-v10.html
# and the Eclipse Distribution License is available at
# and the Eclipse Distribution License is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
# http://www.eclipse.org/org/documents/edl-v10.php.
#
#
# Contributors:
# Contributors:
# Rainer Poisel - initial version
# Rainer Poisel - initial version
#*******************************************************************************/
#*******************************************************************************/
...
@@ -56,7 +56,7 @@ ENDIF()
...
@@ -56,7 +56,7 @@ ENDIF()
ADD_EXECUTABLE
(
MQTTVersion MQTTVersion.c
)
ADD_EXECUTABLE
(
MQTTVersion MQTTVersion.c
)
ADD_LIBRARY
(
paho-mqtt3c SHARED
${
common_src
}
MQTTClient.c
)
ADD_LIBRARY
(
paho-mqtt3c SHARED
${
common_src
}
MQTTClient.c
)
ADD_LIBRARY
(
paho-mqtt3a SHARED
${
common_src
}
MQTTAsync.c
)
ADD_LIBRARY
(
paho-mqtt3a SHARED
${
common_src
}
MQTTAsync.c
)
TARGET_LINK_LIBRARIES
(
paho-mqtt3c pthread
${
LIBS_SYSTEM
}
)
TARGET_LINK_LIBRARIES
(
paho-mqtt3c pthread
${
LIBS_SYSTEM
}
)
TARGET_LINK_LIBRARIES
(
paho-mqtt3a pthread
${
LIBS_SYSTEM
}
)
TARGET_LINK_LIBRARIES
(
paho-mqtt3a pthread
${
LIBS_SYSTEM
}
)
TARGET_LINK_LIBRARIES
(
MQTTVersion paho-mqtt3a paho-mqtt3c
${
LIBS_SYSTEM
}
)
TARGET_LINK_LIBRARIES
(
MQTTVersion paho-mqtt3a paho-mqtt3c
${
LIBS_SYSTEM
}
)
SET_TARGET_PROPERTIES
(
SET_TARGET_PROPERTIES
(
...
@@ -70,19 +70,30 @@ INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h
...
@@ -70,19 +70,30 @@ INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h
DESTINATION include
)
DESTINATION include
)
IF
(
PAHO_WITH_SSL
)
IF
(
PAHO_WITH_SSL
)
SET
(
OPENSSL_LIB_SEARCH_PATH
""
CACHE PATH
"Directory containing OpenSSL libraries"
)
SET
(
OPENSSL_LIB_SEARCH_PATH
""
CACHE PATH
"Directory containing OpenSSL libraries"
)
SET
(
OPENSSL_INC_SEARCH_PATH
""
CACHE PATH
"Directory containing OpenSSL includes"
)
SET
(
OPENSSL_INC_SEARCH_PATH
""
CACHE PATH
"Directory containing OpenSSL includes"
)
SET
(
OPENSSL_LIBRARIES ssl crypto
)
SET
(
OPENSSL_LIBRARIES ssl crypto
)
LINK_DIRECTORIES
(
${
OPENSSL_LIB_SEARCH_PATH
}
find_path
(
OPENSSL_INCLUDE_DIR openssl/ssl.h
)
HINTS
${
OPENSSL_INC_SEARCH_PATH
}
/include
)
find_library
(
OPENSSL_LIB NAMES ssl libssl
HINTS
${
OPENSSL_DIR
}
/lib
${
OPENSSL_DIR
}
/lib64
)
find_library
(
OPENSSLCRYPTO_LIB NAMES ssl libssl
HINTS
${
OPENSSL_DIR
}
/lib
${
OPENSSL_DIR
}
/lib64
)
message
(
STATUS
"OpenSSL hint
${
PENSSL_INC_SEARCH_PATH
}
(includes) / "
)
message
(
STATUS
"OpenSSL headers found at
${
OPENSSL_INCLUDE_DIR
}
"
)
message
(
STATUS
"OpenSSL library found at
${
OPENSSL_LIB
}
"
)
message
(
STATUS
"OpenSSL Crypto library found at
${
OPENSSLCRYPTO_LIB
}
"
)
INCLUDE_DIRECTORIES
(
INCLUDE_DIRECTORIES
(
${
OPENSSL_INC
_SEARCH_PATH
}
${
OPENSSL_INC
LUDE_DIR
}
)
)
ADD_LIBRARY
(
paho-mqtt3cs SHARED
${
common_src
}
MQTTClient.c SSLSocket.c
)
ADD_LIBRARY
(
paho-mqtt3cs SHARED
${
common_src
}
MQTTClient.c SSLSocket.c
)
ADD_LIBRARY
(
paho-mqtt3as SHARED
${
common_src
}
MQTTAsync.c SSLSocket.c
)
ADD_LIBRARY
(
paho-mqtt3as SHARED
${
common_src
}
MQTTAsync.c SSLSocket.c
)
TARGET_LINK_LIBRARIES
(
paho-mqtt3cs pthread
${
OPENSSL_LIBRARIES
}
${
LIBS_SYSTEM
}
)
TARGET_LINK_LIBRARIES
(
paho-mqtt3as pthread
${
OPENSSL_LIBRARIES
}
${
LIBS_SYSTEM
}
)
TARGET_LINK_LIBRARIES
(
paho-mqtt3cs pthread
${
OPENSSL_LIB
}
${
OPENSSLCRYPTO_LIB
}
${
LIBS_SYSTEM
}
)
TARGET_LINK_LIBRARIES
(
paho-mqtt3as pthread
${
OPENSSL_LIB
}
${
OPENSSLCRYPTO_LIB
}
${
LIBS_SYSTEM
}
)
SET_TARGET_PROPERTIES
(
SET_TARGET_PROPERTIES
(
paho-mqtt3cs paho-mqtt3as PROPERTIES
paho-mqtt3cs paho-mqtt3as PROPERTIES
VERSION
${
CLIENT_VERSION
}
VERSION
${
CLIENT_VERSION
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment