Skip to content

Commit

Permalink
CMake: Add argp library
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhard Dutka committed Mar 30, 2022
1 parent 486d021 commit 9c6f6ca
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ endif()

set(TARGET_GROUP production CACHE STRING "Group to build")

find_library(ARGP_LIB argp)
find_library(PHEV_LIB phev)
find_library(MSG_CORE_LIB msg_core)
find_library(CJSON_LIB cjson)
Expand All @@ -20,17 +21,14 @@ if(MQTT_PAHO)
find_library(PAHO_LIB paho-mqtt3c-static REQUIRED)
set(CMAKE_C_FLAGS "-DMQTT_PAHO=true")
endif()

if(TARGET_GROUP STREQUAL production)


add_executable(phevctl main.c
src/phevargs.c
)
add_executable(decode decode.c)
target_include_directories(phevctl PUBLIC include)
target_include_directories(decode PUBLIC include)
target_link_libraries(phevctl "${PHEV_LIB}" "${MSG_CORE_LIB}" "${CJSON_LIB}" "${PAHO_LIB}" pthread)
target_include_directories(phevctl PUBLIC include ${ARGP} /usr/local/include)
target_include_directories(decode PUBLIC include /usr/local/include)
target_link_libraries(phevctl "${PHEV_LIB}" "${MSG_CORE_LIB}" "${CJSON_LIB}" "${PAHO_LIB}" pthread "${ARGP_LIB}")
target_link_libraries(decode "${PHEV_LIB}" "${MSG_CORE_LIB}" "${CJSON_LIB}" )
elseif(TARGET_GROUP STREQUAL test)
add_subdirectory(test)
Expand Down

0 comments on commit 9c6f6ca

Please sign in to comment.