diff options
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/extra/net-snmp/CMakeLists.txt | 33 | ||||
-rw-r--r-- | accel-pppd/logs/CMakeLists.txt | 10 |
2 files changed, 35 insertions, 8 deletions
diff --git a/accel-pppd/extra/net-snmp/CMakeLists.txt b/accel-pppd/extra/net-snmp/CMakeLists.txt index 5571849f..5feaec6f 100644 --- a/accel-pppd/extra/net-snmp/CMakeLists.txt +++ b/accel-pppd/extra/net-snmp/CMakeLists.txt @@ -16,14 +16,33 @@ SET(sources exec_cli.c ) -ADD_LIBRARY(net-snmp SHARED ${sources}) -TARGET_LINK_LIBRARIES(net-snmp netsnmpagent netsnmphelpers netsnmpmibs -netsnmp) +find_library(SNMP_LIBRARY netsnmp + HINTS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib + PATHS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib +) + +find_library(SNMPAGENT_LIBRARY netsnmpagent + HINTS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib + PATHS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib +) + +find_library(SNMPHELPERS_LIBRARY netsnmphelpers + HINTS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib + PATHS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib +) + +find_library(SNMPMIBS_LIBRARY netsnmpmibs + HINTS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib + PATHS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib +) -IF (NETSNMP_PREFIX) - SET_PROPERTY(TARGET net-snmp PROPERTY COMPILE_FLAGS "-I${NETSNMP_PREFIX}/include") - SET_PROPERTY(TARGET net-snmp PROPERTY LINK_FLAGS "-L${NETSNMP_PREFIX}/lib") -ENDIF (NETSNMP_PREFIX) +IF(NOT SNMP_LIBRARY) + message(FATAL_ERROR "${Esc}[31mRequired snmp libraries not found.\n Install libsnmp-dev and run cmake again${Esc}[m") +ENDIF(NOT SNMP_LIBRARY) + + +ADD_LIBRARY(net-snmp SHARED ${sources}) +TARGET_LINK_LIBRARIES(net-snmp ${SNMP_LIBRARY} ${SNMPAGENT_LIBRARY} ${SNMPHELPERS_LIBRARY} ${SNMPMIBS_LIBRARY}) INSTALL(TARGETS net-snmp LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp diff --git a/accel-pppd/logs/CMakeLists.txt b/accel-pppd/logs/CMakeLists.txt index b25cbe26..4d8a631a 100644 --- a/accel-pppd/logs/CMakeLists.txt +++ b/accel-pppd/logs/CMakeLists.txt @@ -34,8 +34,16 @@ IF(LOG_SYSLOG) ENDIF(LOG_SYSLOG) IF(LOG_PGSQL) + find_library(PGSQL_LIBRARY pq + HINTS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib + PATHS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib + ) + IF(NOT PGSQL_LIBRARY) + message(FATAL_ERROR "${Esc}[31mRequired libpq not found.\n Install libpq-dev and run cmake again${Esc}[m") + ENDIF(NOT PGSQL_LIBRARY) + ADD_LIBRARY(log_pgsql SHARED log_pgsql.c) - TARGET_LINK_LIBRARIES(log_pgsql pq) + TARGET_LINK_LIBRARIES(log_pgsql ${PGSQL_LIBRARY}) INSTALL(TARGETS log_pgsql LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) |