Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
CMake scripts - handle errors
Browse files Browse the repository at this point in the history
Also run cmake in proper directory - no need to change directory.
  • Loading branch information
RoEdAl committed Jul 21, 2023
1 parent 9412fc9 commit a3fad9d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,10 @@ jobs:
path: asterisk-modules/asterisk-chan-quectel

- name: Configure project
working-directory: asterisk-modules/asterisk-chan-quectel
run: cmake -P make-build-dir.cmake
run: cmake -P asterisk-modules/asterisk-chan-quectel/make-build-dir.cmake

- name: Generate OpenWRT Makefile
working-directory: asterisk-modules/asterisk-chan-quectel
run: cmake -P install-openwrt-makefile.cmake
run: cmake -P asterisk-modules/asterisk-chan-quectel/install-openwrt-makefile.cmake

- name: Check OpenWRT SDK config file
id: check-owrt-cfg
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# asterisk-chan-quectel
#

CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
CMAKE_MINIMUM_REQUIRED(VERSION 3.19)

FUNCTION(SetProjectVersion cmajor cminor cpatch ctweak cstatus)
MATH(EXPR MMAJOR "${cmajor}")
Expand Down
7 changes: 5 additions & 2 deletions install-chan-quectel.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/cmake -P

SET(ENV{DESTDIR} ${CMAKE_SOURCE_DIR}/install/chan-quectel)
CMAKE_PATH(GET CMAKE_SCRIPT_MODE_FILE PARENT_PATH SCRIPT_DIR)

SET(ENV{DESTDIR} ${SCRIPT_DIR}/install/chan-quectel)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} --install build --component chan-quectel --prefix=/usr
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${SCRIPT_DIR}
COMMAND_ERROR_IS_FATAL ANY
)
7 changes: 5 additions & 2 deletions install-openwrt-makefile.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/cmake -P

SET(ENV{DESTDIR} ${CMAKE_SOURCE_DIR}/install)
CMAKE_PATH(GET CMAKE_SCRIPT_MODE_FILE PARENT_PATH SCRIPT_DIR)

SET(ENV{DESTDIR} ${SCRIPT_DIR}/install)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} --install build --component openwrt --prefix=/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${SCRIPT_DIR}
COMMAND_ERROR_IS_FATAL ANY
)
5 changes: 4 additions & 1 deletion make-build-dir.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/cmake -P

CMAKE_PATH(GET CMAKE_SCRIPT_MODE_FILE PARENT_PATH SCRIPT_DIR)

EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} --preset default
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${SCRIPT_DIR}
COMMAND_ERROR_IS_FATAL ANY
)
5 changes: 4 additions & 1 deletion make-package.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/cmake -P

CMAKE_PATH(GET CMAKE_SCRIPT_MODE_FILE PARENT_PATH SCRIPT_DIR)

EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} --build --preset package
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${SCRIPT_DIR}
COMMAND_ERROR_IS_FATAL ANY
)

0 comments on commit a3fad9d

Please sign in to comment.