cleanup in cmake file (added libraries)
code reformats
This commit is contained in:
parent
c5b5029cb1
commit
904cd2e96a
@ -1,30 +1,38 @@
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
project(iprefresher)
|
||||
project(iprefresher VERSION 1.0.1 DESCRIPTION "mylib description")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
find_package(CURL REQUIRED)
|
||||
include_directories(${CURL_INCLUDE_DIR})
|
||||
|
||||
|
||||
set(SOURCE
|
||||
src/main.cpp
|
||||
|
||||
add_library(api
|
||||
src/api/API.h
|
||||
src/api/API.cpp
|
||||
|
||||
src/api/Hashmap.h
|
||||
|
||||
src/Logger.cpp
|
||||
src/Logger.h
|
||||
|
||||
src/api/TelegramAPI.cpp
|
||||
src/api/TelegramAPI.h
|
||||
|
||||
src/api/DynuAPI.cpp
|
||||
src/api/DynuAPI.h src/api/IPAPI.cpp src/api/IPAPI.h)
|
||||
src/api/DynuAPI.h
|
||||
|
||||
src/api/IPAPI.cpp
|
||||
src/api/IPAPI.h
|
||||
)
|
||||
|
||||
add_library(logger
|
||||
src/Logger.cpp
|
||||
src/Logger.h
|
||||
)
|
||||
|
||||
|
||||
set(SOURCE
|
||||
src/main.cpp
|
||||
)
|
||||
|
||||
add_executable(iprefresher ${SOURCE})
|
||||
target_link_libraries(iprefresher ${CURL_LIBRARIES})
|
||||
target_link_libraries(iprefresher api logger ${CURL_LIBRARIES} )
|
||||
|
||||
install (TARGETS iprefresher DESTINATION bin)
|
||||
|
@ -26,7 +26,7 @@ API::request(std::string myurl, bool post, Hashmap<std::string, std::string> &ma
|
||||
|
||||
struct curl_slist *list = nullptr;
|
||||
for (int j = 0; j < headers.size(); ++j) {
|
||||
list = curl_slist_append(list, headers.at((unsigned long)(j)).c_str());
|
||||
list = curl_slist_append(list, headers.at((unsigned long) (j)).c_str());
|
||||
}
|
||||
|
||||
std::string readString;
|
||||
|
@ -43,7 +43,7 @@ valuetype Hashmap<keytype, valuetype>::getValue(int position) {
|
||||
|
||||
template<class keytype, class valuetype>
|
||||
int Hashmap<keytype, valuetype>::size() {
|
||||
return (int)(keys.size());
|
||||
return (int) (keys.size());
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,10 +43,10 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
DynuAPI dynu;
|
||||
|
||||
if(dynu.refreshIp(ip)){
|
||||
if (dynu.refreshIp(ip)) {
|
||||
TelegramAPI tele;
|
||||
tele.sendMessage(oldip + " moved to " + ip);
|
||||
} else{
|
||||
} else {
|
||||
//error
|
||||
logger.logToLogfile(" [ERROR] failed to write ip to dynu api!");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user