Skip to content

Commit 15b0a41

Browse files
committed
for god knows when i last updated this, pls help-
1 parent e7df765 commit 15b0a41

38 files changed

+754
-351
lines changed

CMakeLists.txt

+14-33
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.20)
22
project(ansible2cxx VERSION 1.0 LANGUAGES CXX)
33

44
set(CMAKE_CXX_STANDARD 17)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
7+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
58

69
# available toolchains out of the box (see "toolchains" directory):
710
# Linux_amd64 = x86_64 / AMD64 / x64 Architectures
@@ -40,46 +43,24 @@ file(GLOB LOCAL_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/include/*")
4043
include_directories(${LOCAL_INCLUDE_DIRS})
4144
include_directories(external/yaml-cpp/include)
4245

43-
file(GLOB_RECURSE UTIL_SOURCES "${CMAKE_SOURCE_DIR}/src/Utils/**.cpp" "${CMAKE_SOURCE_DIR}/src/Utils/**/*.cpp")
44-
file(GLOB_RECURSE APP_SOURCES "${CMAKE_SOURCE_DIR}/src/Application/**.cpp" "${CMAKE_SOURCE_DIR}/src/Application/**/*.cpp")
46+
file(GLOB_RECURSE Ansible2Cxx_UTIL_SOURCES "${CMAKE_SOURCE_DIR}/src/Utils/**.cpp" "${CMAKE_SOURCE_DIR}/src/Utils/**/*.cpp")
47+
file(GLOB_RECURSE Ansible2Cxx_APP_SOURCES "${CMAKE_SOURCE_DIR}/src/Application/**.cpp" "${CMAKE_SOURCE_DIR}/src/Application/**/*.cpp" "${CMAKE_SOURCE_DIR}/src/Application/**/*.h" "${CMAKE_SOURCE_DIR}/src/Application/**/*.hpp")
48+
49+
add_library(ansible2cxx-utils STATIC "${Ansible2Cxx_UTIL_SOURCES}")
4550

46-
add_library(ansible2cxx-utils STATIC "${UTIL_SOURCES}")
51+
file(GLOB_RECURSE Ansible2Cxx_PkgAPI_SOURCES "${CMAKE_SOURCE_DIR}/src/PkgAPI/**.cpp")
52+
add_library(ansible2cxx-pkg_api STATIC "${Ansible2Cxx_PkgAPI_SOURCES}")
53+
target_link_libraries(ansible2cxx-pkg_api PRIVATE ansible2cxx-utils)
4754

4855
file(GLOB_RECURSE Ansible2Cxx_API_SOURCES "${CMAKE_SOURCE_DIR}/src/API/**.cpp")
4956
add_library(ansible2cxx-api STATIC "${Ansible2Cxx_API_SOURCES}")
50-
target_link_libraries(ansible2cxx-api PRIVATE ansible2cxx-utils)
51-
52-
add_executable(ansible2cxx "${APP_SOURCES}")
53-
target_link_libraries(ansible2cxx PRIVATE ansible2cxx-utils yaml-cpp)
54-
55-
if (${APP_SYSTEM_ARCH} STREQUAL "x86_64")
56-
if (${APP_SYSTEM_TARGET} STREQUAL "Linux")
57-
find_package(Qt6 REQUIRED COMPONENTS Widgets Core)
58-
include_directories(${Qt6Widgets_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS})
59-
endif ()
60-
61-
file(GLOB_RECURSE APP_GUI_WIN64_SOURCES "${CMAKE_SOURCE_DIR}/src/ApplicationGUI/Win64/**.cpp" "${CMAKE_SOURCE_DIR}/src/ApplicationGUI/Win64/**/*.cpp")
62-
file(GLOB_RECURSE APP_GUI_LINUX_SOURCES "${CMAKE_SOURCE_DIR}/src/ApplicationGUI/Qt/**.cpp" "${CMAKE_SOURCE_DIR}/src/ApplicationGUI/Qt/**/*.cpp")
63-
file(GLOB APP_GUI_GLOB_SOURCES "${CMAKE_SOURCE_DIR}/src/ApplicationGUI/**.cpp" "${CMAKE_SOURCE_DIR}/src/ApplicationGUI/**.h")
57+
target_link_libraries(ansible2cxx-api PRIVATE ansible2cxx-utils ansible2cxx-pkg_api)
6458

65-
set(APP_GUI_SOURCES ${APP_GUI_GLOB_SOURCES})
66-
67-
if ("${APP_SYSTEM_TARGET}" STREQUAL "Linux")
68-
list(APPEND APP_GUI_SOURCES ${APP_GUI_LINUX_SOURCES})
69-
elseif ("${APP_SYSTEM_TARGET}" STREQUAL "Win64")
70-
list(APPEND APP_GUI_SOURCES ${APP_GUI_WIN64_SOURCES})
71-
endif ()
72-
73-
add_executable(ansible2cxx-gui "${APP_GUI_SOURCES}")
74-
target_link_libraries(ansible2cxx-gui PRIVATE ansible2cxx-utils yaml-cpp)
75-
76-
if (${APP_SYSTEM_TARGET} STREQUAL "Linux")
77-
target_link_libraries(ansible2cxx-gui PRIVATE Qt6::Widgets Qt6::Core)
78-
endif ()
79-
endif ()
59+
add_executable(ansible2cxx "${Ansible2Cxx_APP_SOURCES}")
60+
target_link_libraries(ansible2cxx PRIVATE ansible2cxx-pkg_api ansible2cxx-api ansible2cxx-utils yaml-cpp)
8061

8162
if (EXISTS "${CMAKE_SOURCE_DIR}/src/TestCode.cpp")
82-
message("$ Found TestCode.cpp")
63+
message(STATUS "Found TestCode.cpp")
8364
add_executable(ansible2cxx-test "src/TestCode.cpp")
8465
target_link_libraries(ansible2cxx-test PRIVATE ansible2cxx-utils yaml-cpp)
8566
endif ()

TestScript.yml

+15-28
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
1-
# yes, I've been working with Raspberry Pi's in the last months.
2-
# If you have been looking through my profile and stuff, you'll
3-
# know that I am a trainee, and I was playing (working) with
4-
# Raspberry Pi's, especially with building a custom RPI kernel and
5-
# other stuff.
1+
- name: Service Setup
2+
hosts: localhost
3+
become: yes
64

7-
- name: Network Configuration
8-
hosts: raspberrypi
9-
user: root
5+
vars:
6+
path_root_services: "/usr/lib/systemd"
7+
path_root_enabled_services: "/etc/systemd/system"
108

119
tasks:
12-
- name: write dhcpcd configuration
10+
- name: Systemd Service Copy
1311
copy:
14-
backup: true
15-
src: raspberrypi-dhcpcd.conf
16-
dest: /etc/dhcpcd.conf
17-
owner: root
18-
group: netdev
19-
mode: 0664
20-
- name: write network configuration
21-
copy:
22-
backup: true
23-
src: GuestWifi.nmconnection
24-
dest: /etc/NetworkManager/system-connections/example_net_file.nmconnection
12+
src: simple-ansible2cxx.service
13+
dest: "{{ path_root_services }}/system/simple-ansible2cxx.service"
2514
owner: root
2615
group: root
27-
mode: 0600
28-
notify: guest network refresh
29-
30-
handlers:
31-
- name: guest network refresh
32-
service:
33-
name: NetworkManager
34-
state: reloaded
16+
mode: 0644
17+
- name: Manually enabling Systemd Service
18+
file:
19+
src: "{{ path_root_services }}/system/simple-ansible2cxx.service"
20+
dest: "{{ path_root_enabled_services }}/multi-user.target.wants/simple-ansible2cxx.service"
21+
state: link

include/ansible2cxx-api/ansible2cxx/api/API.h

-121
This file was deleted.

0 commit comments

Comments
 (0)