Skip to content

Commit 54e5d46

Browse files
committed
update code to align with github.com/khumnath/nepdate
1 parent 9afc5f2 commit 54e5d46

File tree

7 files changed

+557
-545
lines changed

7 files changed

+557
-545
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
cd build
2727
cmake ..
2828
make
29+
echo "Build completed successfully."
30+
echo "testing build output"
31+
make run
2932
3033
- name: Build Debian Package
3134
run: |

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ jobs:
2727
cd build
2828
cmake ..
2929
make
30+
echo "Build completed successfully."
31+
echo "Testing build output"
32+
make run

CMakeLists.txt

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
1-
# Minimum CMake version required
2-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.10)
32

4-
# Set the project name
5-
project(nepdate-cli)
3+
project(nepdate-cli VERSION 2.0.0)
4+
5+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
6+
7+
add_executable(nepdate-cli src/main.cpp)
8+
9+
# Allow user to override this on cmake command line
10+
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
11+
set(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "Install path prefix")
12+
endif()
13+
14+
install(TARGETS nepdate-cli
15+
RUNTIME DESTINATION bin
16+
)
17+
18+
configure_file(
19+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
20+
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
21+
IMMEDIATE @ONLY
22+
)
23+
24+
add_custom_target(uninstall
25+
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
26+
)
27+
28+
add_custom_target(run
29+
COMMAND $<TARGET_FILE:nepdate-cli>
30+
DEPENDS nepdate-cli
31+
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
32+
)
633

7-
# Add the src subdirectory
8-
add_subdirectory(src)

cmake_uninstall.cmake.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(INSTALL_MANIFEST_FILE "@CMAKE_BINARY_DIR@/install_manifest.txt")
2+
3+
if(NOT EXISTS "${INSTALL_MANIFEST_FILE}")
4+
message(FATAL_ERROR "Cannot find install manifest: ${INSTALL_MANIFEST_FILE}")
5+
endif()
6+
7+
file(READ "${INSTALL_MANIFEST_FILE}" files)
8+
string(REPLACE "\n" ";" files "${files}")
9+
10+
foreach(file ${files})
11+
message(STATUS "Removing ${file}")
12+
execute_process(COMMAND ${CMAKE_COMMAND} -E remove "${file}")
13+
endforeach()
14+
15+
file(REMOVE "${INSTALL_MANIFEST_FILE}")

src/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)