Skip to content

Commit

Permalink
Support for WIN and LINUX mosquitto libs
Browse files Browse the repository at this point in the history
  • Loading branch information
JGMonroy committed Apr 1, 2016
1 parent 6457b07 commit 2ea70ff
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions MQTTMosquitto/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
PROJECT(MQTTMosquitto)

# Use MRPT:
FIND_PACKAGE( MRPT REQUIRED slam gui hwdrivers)
FIND_PACKAGE( MRPT REQUIRED slam gui hwdrivers)

# Get MOOS
INCLUDE_DIRECTORIES( ${MOOS_INCLUDE_DIRS} )
LINK_DIRECTORIES( ${MOOS_LIBRARY_DIRS} )


#Use Mosquitto libraries
find_path(MQTTmosquitto_LIB NAMES mosquitto.lib mosquittopp.lib DOC "Path to the folder containing the MQTTmosquitto mosquitto.lib and mosquittopp.lib libraries")
if (${MQTTmosquitto_LIB} STREQUAL "MQTTmosquitto_LIB-NOTFOUND")
message ("MQTTmosquitto 'mosquitto.lib' or 'mosquittopp.lib' not Found!. \nPlease, provide the path to the MQTTmosquitto libraries.")
endif (${MQTTmosquitto_LIB} STREQUAL "MQTTmosquitto_LIB-NOTFOUND")
IF(WIN32)
find_path(MQTTmosquitto_LIB NAMES mosquitto.lib mosquittopp.lib DOC "Path to the folder containing the MQTTmosquitto mosquitto.lib and mosquittopp.lib libraries")
ENDIF(WIN32)
IF(UNIX)
find_path(MQTTmosquitto_LIB NAMES libmosquitto libmosquittopp DOC "Path to the folder containing the libmosquitto.so and libmosquittopp.so libraries")
ENDIF(UNIX)

IF (${MQTTmosquitto_LIB} STREQUAL "MQTTmosquitto_LIB-NOTFOUND")
message ("MQTTmosquitto 'mosquitto' or 'mosquittopp' libs not Found!. \nPlease, provide the path to the MQTTmosquitto libraries.")
ENDIF (${MQTTmosquitto_LIB} STREQUAL "MQTTmosquitto_LIB-NOTFOUND")

INCLUDE_DIRECTORIES(${MQTTmosquitto_LIB})


# Add executable
ADD_EXECUTABLE( ${PROJECT_NAME}
main.cpp
Expand All @@ -23,4 +30,9 @@ ADD_EXECUTABLE( ${PROJECT_NAME}
)

# Link the executable
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${MOOS_LIBRARIES} ${MRPT_LIBS} "${MQTTmosquitto_LIB}/mosquitto.lib" "${MQTTmosquitto_LIB}/mosquittopp.lib" )
IF(WIN32)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${MOOS_LIBRARIES} ${MRPT_LIBS} "${MQTTmosquitto_LIB}/mosquitto.lib" "${MQTTmosquitto_LIB}/mosquittopp.lib" )
ENDIF(WIN32)
IF(UNIX)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${MOOS_LIBRARIES} ${MRPT_LIBS} "${MQTTmosquitto_LIB}/libmosquitto.so" "${MQTTmosquitto_LIB}/libmosquittopp.so" )
ENDIF(UNIX)

0 comments on commit 2ea70ff

Please sign in to comment.