Use more modern CMake syntax.

This commit is contained in:
Nicholas J. Kain
2018-10-26 13:07:05 -04:00
parent 56b6ae2cd3
commit c5a1edd5f6
2 changed files with 32 additions and 16 deletions

View File

@@ -1,8 +1,4 @@
project (ndhc)
cmake_minimum_required (VERSION 2.6)
include_directories("${PROJECT_SOURCE_DIR}")
project (ndhc DESCRIPTION "dhcp4 client" LANGUAGES C)
set(RAGEL_IFCHD_PARSE ${CMAKE_CURRENT_BINARY_DIR}/ifchd-parse.c)
set(RAGEL_CFG_PARSE ${CMAKE_CURRENT_BINARY_DIR}/cfg.c)
@@ -25,7 +21,26 @@ add_custom_command(
VERBATIM
)
file(GLOB NDHC_SRCS "*.c")
add_executable(ndhc ${RAGEL_CFG_PARSE} ${RAGEL_IFCHD_PARSE} ${NDHC_SRCS})
target_link_libraries(ndhc ncmlib)
add_executable(ndhc ${RAGEL_CFG_PARSE} ${RAGEL_IFCHD_PARSE})
target_sources(ndhc PRIVATE
"arp.c"
"ifchd.c"
"netlink.c"
"sockd.c"
"dhcp.c"
"ifset.c"
"nl.c"
"state.c"
"duiaid.c"
"leasefile.c"
"options.c"
"sys.c"
"ifchange.c"
"ndhc.c"
"rfkill.c"
)
target_include_directories(ndhc PRIVATE
"${PROJECT_SOURCE_DIR}"
"${PROJECT_SOURCE_DIR}/../ncmlib"
)
target_link_libraries(ndhc PUBLIC ncmlib)