CMakeLists.txt: clean up a bit

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
pull/105/head
Marc Kleine-Budde 2018-09-27 13:14:27 +02:00
parent a6954bdaae
commit 572a66fb94
1 changed files with 38 additions and 14 deletions

View File

@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.3)
project(can-utils LANGUAGES C) project(can-utils LANGUAGES C)
include (GNUInstallDirs)
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)
endif() endif()
@ -20,20 +22,42 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DN_SLCAN=17")
include_directories (.) include_directories (.)
include_directories (./include) include_directories (./include)
set(PROGRAMS_ISOTP isotpdump isotprecv isotpsend isotpsniffer set(PROGRAMS_CANLIB
isotptun isotpserver isotpperf) asc2log
set(PROGRAMS_CANGW cangw) canbusload
set(PROGRAMS_SLCAN slcan_attach slcand) candump
set(PROGRAMS_J1939 jacd jspy jsr testj1939) cangen
set(PROGRAMS_CANLIB cansend cangen candump canplayer canlogserver canlogserver
canbusload log2long log2asc asc2log) canplayer
cansend
log2asc
log2long
)
set(PROGRAMS can-calc-bit-timing cansniffer bcmserver set(PROGRAMS_J1939
jacd
jspy
jsr
testj1939
)
set(PROGRAMS
${PROGRAMS_CANLIB} ${PROGRAMS_CANLIB}
${PROGRAMS_ISOTP} bcmserver
${PROGRAMS_CANGW} can-calc-bit-timing
${PROGRAMS_SLCAN} canfdtest
slcanpty canfdtest cangw
cansniffer
isotpdump
isotpperf
isotprecv
isotpsend
isotpserver
isotpsniffer
isotptun
slcan_attach
slcand
slcanpty
) )
if(NOT ANDROID) if(NOT ANDROID)
@ -51,7 +75,7 @@ foreach(name ${PROGRAMS})
endif() endif()
add_executable(${name} ${name}.c ${SRC_DEPS}) add_executable(${name} ${name}.c ${SRC_DEPS})
install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach() endforeach()