Commit d729fc30 authored by Otavio Rodolfo Piske's avatar Otavio Rodolfo Piske

Fix the library directory name for RHEL and Fedora

Signed-off-by: 's avatarOtavio Rodolfo Piske <opiske@redhat.com>
parent 61e56ecc
#*******************************************************************************
# Copyright (c) 2015 logi.cals GmbH
#
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
# 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.
#
#
# Contributors:
# Rainer Poisel - initial version
#*******************************************************************************/
......@@ -28,6 +28,16 @@ SET(CLIENT_VERSION ${PAHO_VERSION_MAJOR}.${PAHO_VERSION_MINOR}.${PAHO_VERSION_PA
EXECUTE_PROCESS(COMMAND date -u OUTPUT_VARIABLE BUILD_TIMESTAMP)
STRING(STRIP ${BUILD_TIMESTAMP} BUILD_TIMESTAMP)
# Uses the correct directory for libraries on Red Hat-based distributions.
SET(PAHO_LIBRARY_DIR_NAME "lib")
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
IF(EXISTS "/etc/redhat-release")
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(PAHO_LIBRARY_DIR_NAME "lib64")
ENDIF()
ENDIF()
ENDIF()
## build options
SET(PAHO_WITH_SSL FALSE CACHE BOOL "Flag that defines whether to build ssl-enabled binaries too. ")
SET(PAHO_BUILD_DOCUMENTATION FALSE CACHE BOOL "Create and install the HTML based API documentation (requires Doxygen)")
......
......@@ -53,6 +53,8 @@ ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(LIBS_SYSTEM dl)
ENDIF()
ADD_EXECUTABLE(MQTTVersion MQTTVersion.c)
ADD_LIBRARY(paho-mqtt3c SHARED ${common_src} MQTTClient.c)
ADD_LIBRARY(paho-mqtt3a SHARED ${common_src} MQTTAsync.c)
......@@ -65,7 +67,7 @@ SET_TARGET_PROPERTIES(
SOVERSION ${PAHO_VERSION_MAJOR})
INSTALL(TARGETS paho-mqtt3c paho-mqtt3a MQTTVersion
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
LIBRARY DESTINATION ${PAHO_LIBRARY_DIR_NAME})
INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h
DESTINATION include)
......@@ -103,8 +105,8 @@ SET(OPENSSL_LIB_SEARCH_PATH "" CACHE PATH "Directory containing OpenSSL librarie
SOVERSION ${PAHO_VERSION_MAJOR})
INSTALL(TARGETS paho-mqtt3cs
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
LIBRARY DESTINATION ${PAHO_LIBRARY_DIR_NAME})
INSTALL(TARGETS paho-mqtt3as
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
LIBRARY DESTINATION ${PAHO_LIBRARY_DIR_NAME})
ENDIF()
#*******************************************************************************
# Copyright (c) 2015, 2016 logi.cals GmbH
#
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
# 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.
#
#
# Contributors:
# Rainer Poisel - initial version
# Ian Craggs - update sample names
......@@ -57,5 +57,4 @@ INSTALL(TARGETS paho_c_sub
MQTTClient_publish
MQTTClient_publish_async
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
LIBRARY DESTINATION ${PAHO_LIBRARY_DIR_NAME})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment