linking against crypt
This commit is contained in:
@@ -110,14 +110,17 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/include)
|
|||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/${LIB_DIR})
|
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/${LIB_DIR})
|
||||||
|
|
||||||
##################### WIRING_PI ##########################
|
##################### WIRING_PI ##########################
|
||||||
find_library(WIRING_PI NAMES libwiringPi.so.2.44 HINTS ${CMAKE_SOURCE_DIR}/lib)
|
find_library(wiringPi_LIB wiringPi)
|
||||||
|
if(NOT wiringPi_LIB)
|
||||||
if(NOT WIRING_PI)
|
|
||||||
message(FATAL_ERROR "Could not find wiringPi library")
|
message(FATAL_ERROR "Could not find wiringPi library")
|
||||||
endif()
|
endif()
|
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC ${wiringPi_LIB})
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC ${WIRING_PI})
|
find_library(crypt_LIB crypt)
|
||||||
|
if(NOT crypt_LIB)
|
||||||
|
message(FATAL_ERROR "Could not find crypt library")
|
||||||
|
endif()
|
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC ${crypt_LIB})
|
||||||
## EASYLOGGING
|
## EASYLOGGING
|
||||||
set(EASYLOGGING_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/${LIB_DIR}/easylogging)
|
set(EASYLOGGING_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/${LIB_DIR}/easylogging)
|
||||||
add_library(Easylogging STATIC ${EASYLOGGING_INCLUDE_DIR}/easylogging++.cc)
|
add_library(Easylogging STATIC ${EASYLOGGING_INCLUDE_DIR}/easylogging++.cc)
|
||||||
@@ -132,6 +135,9 @@ target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
|
|||||||
|
|
||||||
## THREAD
|
## THREAD
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
if(NOT CMAKE_THREAD_LIBS_INIT)
|
||||||
|
message(FATAL_ERROR, "Could not find libthread")
|
||||||
|
endif()
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${Threads_LIBRARIES})
|
target_link_libraries(${PROJECT_NAME} PRIVATE ${Threads_LIBRARIES})
|
||||||
|
|
||||||
if(ENABLE_TESTING)
|
if(ENABLE_TESTING)
|
||||||
|
|||||||
Binary file not shown.
@@ -7,17 +7,17 @@
|
|||||||
|
|
||||||
#include "GPIOInterface.h"
|
#include "GPIOInterface.h"
|
||||||
|
|
||||||
//#include "lib/wiringPi/wiringPi.h"
|
#include "wiringPi/wiringPi.h"
|
||||||
#include "json/json.hpp"
|
#include "json/json.hpp"
|
||||||
|
|
||||||
|
|
||||||
void GPIOInterface::write_pin(char address, char data)
|
void GPIOInterface::write_pin(char address, char data)
|
||||||
{
|
{
|
||||||
//digitalWrite(address, data);
|
digitalWrite(address, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GPIOInterface::read_pin(char address)
|
bool GPIOInterface::read_pin(char address)
|
||||||
{
|
{
|
||||||
//return digitalRead(address);
|
return digitalRead(address);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user