Skip to content

Commit

Permalink
cmake:migrate apps CMakeLists for canutils
Browse files Browse the repository at this point in the history
Signed-off-by: xuxin19 <[email protected]>
  • Loading branch information
xuxin930 authored and xiaoxiang781216 committed Aug 9, 2023
1 parent 6cd890e commit 24319be
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 0 deletions.
2 changes: 2 additions & 0 deletions canutils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
#
# ##############################################################################

nuttx_add_subdirectory()

nuttx_generate_kconfig(MENUDESC "CAN Utilities")
37 changes: 37 additions & 0 deletions canutils/candump/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ##############################################################################
# apps/canutils/candump/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_CANUTILS_CANDUMP)

set(LIBCANUTILS_DIR ${NUTTX_APPS_DIR}/canutils/libcanutils)

nuttx_add_application(
NAME
candump
STACKSIZE
${CONFIG_CANUTILS_CANDUMP_STACKSIZE}
MODULE
${CONFIG_CANUTILS_CANDUMP}
SRCS
candump.c
INCLUDE_DIRECTORIES
${LIBCANUTILS_DIR})

endif()
26 changes: 26 additions & 0 deletions canutils/canlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ##############################################################################
# apps/canutils/canlib/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
if(CONFIG_CANUTILS_CANLIB)

target_sources(
apps PRIVATE canlib_getbaud.c canlib_setbaud.c canlib_getloopback.c
canlib_setloopback.c canlib_getsilent.c canlib_setsilent.c)

endif()
37 changes: 37 additions & 0 deletions canutils/cansend/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ##############################################################################
# apps/canutils/cansend/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_CANUTILS_CANSEND)

set(LIBCANUTILS_DIR ${NUTTX_APPS_DIR}/canutils/libcanutils)

nuttx_add_application(
NAME
cansend
STACKSIZE
${CONFIG_CANUTILS_CANSEND_STACKSIZE}
MODULE
${CONFIG_CANUTILS_CANSEND}
SRCS
cansend.c
INCLUDE_DIRECTORIES
${LIBCANUTILS_DIR})

endif()
25 changes: 25 additions & 0 deletions canutils/libcanutils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ##############################################################################
# apps/canutils/libcanutils/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_CANUTILS_LIBCANUTILS)

target_sources(apps PRIVATE lib.c)

endif()
26 changes: 26 additions & 0 deletions canutils/libobd2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ##############################################################################
# apps/canutils/libobd2/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_CANUTILS_LIBOBD2)

target_sources(apps PRIVATE obd2.c obd_sendrequest.c obd_waitresponse.c
obd_decodepid.c)

endif()
33 changes: 33 additions & 0 deletions canutils/slcan/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ##############################################################################
# apps/canutils/slcan/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_CANUTILS_SLCAN)

nuttx_add_application(
NAME
slcan
STACKSIZE
${CONFIG_CANUTILS_SLCAN_STACKSIZE}
MODULE
${CONFIG_CANUTILS_SLCAN}
SRCS
slcan.c)

endif()

0 comments on commit 24319be

Please sign in to comment.