Commit 04702460 authored by Johan Ström's avatar Johan Ström

Fix cmake variable names to conform to package names, silences developer warnings

parent 6eb61d39
......@@ -183,21 +183,21 @@ pkg_search_module(LUA lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1 lua)
log_pkg_found(lua "${LUA_FOUND}" "${LUA_VERSION}" WARNING ", parts of core will not be built")
find_package(CppDb)
log_pkg_found(cppdb "${CPPDB_FOUND}" "" WARNING ", parts of core will not be built")
log_pkg_found(cppdb "${CppDb_FOUND}" "" WARNING ", parts of core will not be built")
pkg_search_module(LIBRRD librrd)
log_pkg_found(librrd "${LIBRRD_FOUND}" "${LIBRRD_VERSION}" WARNING ", parts of core will not be built")
find_package(Qpid)
log_pkg_found(qpid "${QPID_FOUND}" "${QPID_VERSION}" STATUS ", QPID communication support will not be built")
set(WITH_QPID ${QPID_FOUND})
log_pkg_found(qpid "${Qpid_FOUND}" "${Qpid_VERSION}" STATUS ", legacy Qpid communication support will not be built")
set(WITH_QPID ${Qpid_FOUND})
find_package(Mosquittopp)
log_pkg_found(mosquittopp "${MOSQUITTOPP_FOUND}" "${MOSQUITTOPP_VERSION}" WARNING ", MQTT communication support will not be built")
set(WITH_MQTT ${MOSQUITTOPP_FOUND})
log_pkg_found(Mosquittopp "${Mosquittopp_FOUND}" "${Mosquittopp_VERSION}" WARNING ", MQTT communication support will not be built")
set(WITH_MQTT ${Mosquittopp_FOUND})
if(NOT ${MOSQUITTOPP_FOUND} AND NOT ${QPID_FOUND})
message(FATAL_ERROR "Neither mosquittopp nor qpid found. One or both is required")
if(NOT ${Mosquittopp_FOUND} AND NOT ${Qpid_FOUND})
message(FATAL_ERROR "Neither Mosquittopp nor qpid found. One or both is required, mosquittopp is recommended")
endif()
if(OS_LINUX)
......
# Find the CppDb includes and library
#
# This module defines
# CPPDB_INCLUDE_DIRS, where to find frontend.h, etc.
# CPPDB_LIBRARIES, the libraries to link against to use CppUnit.
# CPPDB_FOUND, If false, do not try to use CppUnit.
# CppDb_INCLUDE_DIRS, where to find frontend.h, etc.
# CppDb_LIBRARIES, the libraries to link against to use CppUnit.
# CppDb_FOUND, If false, do not try to use CppUnit.
FIND_PATH(CPPDB_INCLUDE_DIRS cppdb/frontend.h
FIND_PATH(CppDb_INCLUDE_DIRS cppdb/frontend.h
/usr/local/include
/usr/include
)
FIND_LIBRARY(CPPDB_LIBRARIES cppdb
${CPPDB_INCLUDE_DIRS}/../lib
FIND_LIBRARY(CppDb_LIBRARIES cppdb
${CppDb_INCLUDE_DIRS}/../lib
/usr/local/lib
/usr/lib)
if(CPPDB_INCLUDE_DIRS)
IF(CPPDB_LIBRARIES)
SET(CPPDB_FOUND "YES")
SET(CPPDB_LIBRARIES ${CPPDB_LIBRARIES} ${CMAKE_DL_LIBS})
if(CppDb_INCLUDE_DIRS)
IF(CppDb_LIBRARIES)
SET(CppDb_FOUND "YES")
SET(CppDb_LIBRARIES ${CppDb_LIBRARIES} ${CMAKE_DL_LIBS})
endif()
endif()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPDB DEFAULT_MSG CPPDB_LIBRARIES CPPDB_INCLUDE_DIRS)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CppDb DEFAULT_MSG CppDb_LIBRARIES CppDb_INCLUDE_DIRS)
......@@ -3,26 +3,26 @@
# Find the CppUnit includes and library
#
# This module defines
# CPPUNIT_INCLUDE_DIRS, where to find tiff.h, etc.
# CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
# CPPUNIT_FOUND, If false, do not try to use CppUnit.
# CppUnit_INCLUDE_DIRS, where to find tiff.h, etc.
# CppUnit_LIBRARIES, the libraries to link against to use CppUnit.
# CppUnit_FOUND, If false, do not try to use CppUnit.
FIND_PATH(CPPUNIT_INCLUDE_DIRS cppunit/TestCase.h
FIND_PATH(CppUnit_INCLUDE_DIRS cppunit/TestCase.h
/usr/local/include
/usr/include
)
FIND_LIBRARY(CPPUNIT_LIBRARIES cppunit
${CPPUNIT_INCLUDE_DIRS}/../lib
FIND_LIBRARY(CppUnit_LIBRARIES cppunit
${CppUnit_INCLUDE_DIRS}/../lib
/usr/local/lib
/usr/lib)
if(CPPUNIT_INCLUDE_DIRS)
IF(CPPUNIT_LIBRARIES)
SET(CPPUNIT_FOUND "YES")
SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARIES} ${CMAKE_DL_LIBS})
if(CppUnit_INCLUDE_DIRS)
IF(CppUnit_LIBRARIES)
SET(CppUnit_FOUND "YES")
SET(CppUnit_LIBRARIES ${CppUnit_LIBRARIES} ${CMAKE_DL_LIBS})
endif()
endif()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CppUnit DEFAULT_MSG CppUnit_LIBRARIES CppUnit_INCLUDE_DIRS)
......@@ -3,29 +3,29 @@
# - Find libmosquitto
# Find the native libmosquitto includes and libraries
#
# MOSQUITTOPP_INCLUDE_DIR - where to find mosquitto.h, etc.
# MOSQUITTOPP_LIBRARIES - List of libraries when using libmosquitto.
# MOSQUITTOPP_FOUND - True if libmosquitto found.
# Mosquittopp_INCLUDE_DIR - where to find mosquitto.h, etc.
# Mosquittopp_LIBRARIES - List of libraries when using libmosquitto.
# Mosquittopp_FOUND - True if libmosquitto found.
if(MOSQUITTOPP_INCLUDE_DIR)
if(Mosquittopp_INCLUDE_DIR)
# Already in cache, be silent
set(MOSQUITTOPP_FIND_QUIETLY TRUE)
endif(MOSQUITTOPP_INCLUDE_DIR)
set(Mosquittopp_FIND_QUIETLY TRUE)
endif(Mosquittopp_INCLUDE_DIR)
find_path(MOSQUITTOPP_INCLUDE_DIR mosquitto.h)
find_path(Mosquittopp_INCLUDE_DIR mosquitto.h)
find_library(MOSQUITTOPP_LIBRARY NAMES libmosquittopp mosquittopp)
find_library(MOSQUITTO_LIBRARY NAMES libmosquitto mosquitto)
find_library(Mosquittopp_LIBRARY NAMES libmosquittopp mosquittopp)
find_library(Mosquitto_LIBRARY NAMES libmosquitto mosquitto)
# Handle the QUIETLY and REQUIRED arguments and set MOSQUITTO_FOUND to TRUE if
# Handle the QUIETLY and REQUIRED arguments and set Mosquittopp_FOUND to TRUE if
# all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MOSQUITTOPP DEFAULT_MSG MOSQUITTOPP_LIBRARY MOSQUITTOPP_INCLUDE_DIR)
find_package_handle_standard_args(Mosquittopp DEFAULT_MSG Mosquittopp_LIBRARY Mosquittopp_INCLUDE_DIR)
if(MOSQUITTOPP_FOUND)
set(MOSQUITTOPP_LIBRARIES ${MOSQUITTOPP_LIBRARY} ${MOSQUITTO_LIBRARY})
else(MOSQUITTOPP_FOUND)
set(MOSQUITTOPP_LIBRARIES)
endif(MOSQUITTOPP_FOUND)
if(Mosquittopp_FOUND)
set(Mosquittopp_LIBRARIES ${Mosquittopp_LIBRARY} ${Mosquitto_LIBRARY})
else(Mosquittopp_FOUND)
set(Mosquittopp_LIBRARIES)
endif(Mosquittopp_FOUND)
mark_as_advanced(MOSQUITTOPP_INCLUDE_DIR MOSQUITTOPP_LIBRARY)
mark_as_advanced(Mosquittopp_INCLUDE_DIR Mosquittopp_LIBRARY)
......@@ -103,4 +103,4 @@ if(OpenZWave_INCLUDE_BASE_DIR)
endif()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENZWAVE DEFAULT_MSG OpenZWave_LIBRARIES OpenZWave_INCLUDE_DIRS)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenZWave DEFAULT_MSG OpenZWave_LIBRARIES OpenZWave_INCLUDE_DIRS)
# Find qpid libraries and headers
#
# QPID_INCLUDE_DIR - where to find qpid/messaging/*.h, etc.
# QPID_LIBRARIES - List of libraries when using qpid.
# QPID_FOUND - True if qpid found.
# Qpid_INCLUDE_DIR - where to find qpid/messaging/*.h, etc.
# Qpid_LIBRARIES - List of libraries when using qpid.
# Qpid_FOUND - True if qpid found.
if(QPID_INCLUDE_DIR)
if(Qpid_INCLUDE_DIR)
# Already in cache, be silent
set(QPID_FIND_QUIETLY TRUE)
endif(QPID_INCLUDE_DIR)
set(Qpid_FIND_QUIETLY TRUE)
endif(Qpid_INCLUDE_DIR)
find_path(QPID_INCLUDE_DIR qpid/messaging/Connection.h)
find_path(Qpid_INCLUDE_DIR qpid/messaging/Connection.h)
find_library(QPID_MESSAGING_LIBRARY NAMES qpidmessaging)
find_library(QPID_TYPES_LIBRARY NAMES qpidtypes)
find_library(Qpid_MESSAGING_LIBRARY NAMES qpidmessaging)
find_library(Qpid_TYPES_LIBRARY NAMES qpidtypes)
# Handle the QUIETLY and REQUIRED arguments and set QPID_FOUND to TRUE if
# Handle the QUIETLY and REQUIRED arguments and set Qpid_FOUND to TRUE if
# all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QPID DEFAULT_MSG QPID_MESSAGING_LIBRARY QPID_INCLUDE_DIR)
find_package_handle_standard_args(Qpid DEFAULT_MSG Qpid_MESSAGING_LIBRARY Qpid_INCLUDE_DIR)
if(QPID_FOUND)
set(QPID_LIBRARIES ${QPID_MESSAGING_LIBRARY} ${QPID_TYPES_LIBRARY})
else(QPID_FOUND)
set(QPID_LIBRARIES)
endif(QPID_FOUND)
if(Qpid_FOUND)
set(Qpid_LIBRARIES ${Qpid_MESSAGING_LIBRARY} ${Qpid_TYPES_LIBRARY})
else(Qpid_FOUND)
set(Qpid_LIBRARIES)
endif(Qpid_FOUND)
mark_as_advanced(QPID_INCLUDE_DIR QPID_LIBRARY)
mark_as_advanced(Qpid_INCLUDE_DIR Qpid_LIBRARY)
......@@ -54,7 +54,7 @@ if (BUILD_CORE_event)
endif()
OPTION(BUILD_CORE_datalogger "Build agodatalogger" ON)
if (BUILD_CORE_datalogger AND LIBRRD_FOUND AND CPPDB_FOUND)
if (BUILD_CORE_datalogger AND LIBRRD_FOUND AND CppDb_FOUND)
add_subdirectory (datalogger)
endif()
......
......@@ -6,10 +6,10 @@ set (DATALOGGER_LIBRARIES
sqlite3
${Boost_PROGRAM_DATE_TIME_LIBRARY}
${LIBRRD_LIBRARIES}
${CPPDB_LIBRARIES}
${CppDb_LIBRARIES}
)
include_directories(${CPPDB_INCLUDE_DIRS})
include_directories(${CppDb_INCLUDE_DIRS})
# add the executable
add_executable (agodatalogger ${AGODATALOGGER_SOURCE_FILES})
......
......@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.0)
set (DRAIN_LIBRARIES
agoclient
${QPID_LIBRARIES}
${Qpid_LIBRARIES}
)
# add the executable
......
......@@ -73,14 +73,14 @@ set(AGOLIBS agoclient agocore)
if(WITH_MQTT)
add_library (agotransport-mqtt SHARED agotransport-mqtt.cpp)
set_target_properties (agotransport-mqtt PROPERTIES VERSION 1 SOVERSION 1)
target_link_libraries(agotransport-mqtt agocore ${MOSQUITTOPP_LIBRARIES} ${Boost_THREAD_LIBRARY} ${Boost_LOG_LIBRARY})
target_link_libraries(agotransport-mqtt agocore ${Mosquittopp_LIBRARIES} ${Boost_THREAD_LIBRARY} ${Boost_LOG_LIBRARY})
list(APPEND AGOLIBS agotransport-mqtt)
endif()
if(WITH_QPID)
add_library (agotransport-qpid SHARED agotransport-qpid.cpp agojson-qpid.cpp)
set_target_properties (agotransport-qpid PROPERTIES VERSION 1 SOVERSION 1)
target_link_libraries(agotransport-qpid agocore ${QPID_LIBRARIES} ${Boost_LOG_LIBRARY})
target_link_libraries(agotransport-qpid agocore ${Qpid_LIBRARIES} ${Boost_LOG_LIBRARY})
list(APPEND AGOLIBS agotransport-qpid)
endif()
......
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