Skip to content

Commit 409df33

Browse files
maxDcbkali
authored andcommitted
Embed transport dependencies and adjust includes
1 parent 993e4d7 commit 409df33

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,18 @@ FetchContent_Declare(
3636
GIT_TAG master
3737
)
3838
FetchContent_MakeAvailable(Dnscommunication)
39+
set_target_properties(Dnscommunication PROPERTIES
40+
INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${dnscommunication_SOURCE_DIR}/src>;$<INSTALL_INTERFACE:include>")
3941

4042
FetchContent_Declare(
4143
SocketHandler
4244
GIT_REPOSITORY https://github.com/maxDcb/libSocketHandler.git
4345
GIT_TAG master
4446
)
4547
FetchContent_MakeAvailable(SocketHandler)
48+
set_target_properties(SocketHandler PROPERTIES
49+
INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${sockethandler_SOURCE_DIR}/src>;$<INSTALL_INTERFACE:include>")
50+
4651

4752
# PipeHandler and MemoryModule have platform-specific sources
4853
if(WIN32)
@@ -73,13 +78,26 @@ endif()
7378

7479
FetchContent_MakeAvailable(PipeHandler)
7580
FetchContent_MakeAvailable(MemoryModule)
81+
if(WIN32)
82+
set(_pipe_inc ${pipehandler_SOURCE_DIR}/src)
83+
set(_mm_inc ${memorymodule_SOURCE_DIR}/src)
84+
else()
85+
set(_pipe_inc ${pipehandler_SOURCE_DIR}/libs/libPipeHandlerDumy/src)
86+
set(_mm_inc ${memorymodule_SOURCE_DIR}/libs/libMemoryModuleDumy/src)
87+
endif()
88+
set_target_properties(PipeHandler PROPERTIES
89+
INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${_pipe_inc}>;$<INSTALL_INTERFACE:include>")
90+
set_target_properties(MemoryModule PROPERTIES
91+
INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${_mm_inc}>;$<INSTALL_INTERFACE:include>")
7692

7793
FetchContent_Declare(
7894
SocksServer
7995
GIT_REPOSITORY https://github.com/maxDcb/libSocks5.git
8096
GIT_TAG master
8197
)
8298
FetchContent_MakeAvailable(SocksServer)
99+
set_target_properties(SocksServer PROPERTIES
100+
INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${socksserver_SOURCE_DIR}/src>;$<INSTALL_INTERFACE:include>")
83101

84102
if(WIN32)
85103
FetchContent_Declare(
@@ -159,6 +177,11 @@ add_subdirectory(modules)
159177

160178
install(
161179
DIRECTORY beacon/ listener/ modules/
180+
${sockethandler_SOURCE_DIR}/src/
181+
${pipehandler_SOURCE_DIR}/src/
182+
${memorymodule_SOURCE_DIR}/src/
183+
${socksserver_SOURCE_DIR}/src/
184+
${dnscommunication_SOURCE_DIR}/src/
162185
DESTINATION include
163186
FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h"
164187
)

beacon/Beacon.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3-
#include <ListenerTcp.hpp>
4-
#include <ListenerSmb.hpp>
3+
#include <listener/ListenerTcp.hpp>
4+
#include <listener/ListenerSmb.hpp>
55
#include "SocksTunnelClient.hpp"
66

77
#include <queue>

beacon/tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
include_directories(..)
2+
include_directories(../..)
23
include_directories(../../modules/ModuleCmd)
34

45
# Unit tests using Catch2

cmake/C2CoreConfig.cmake.in

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
@PACKAGE_INIT@
22

33
include(CMakeFindDependencyMacro)
4-
find_dependency(SocketHandler)
5-
find_dependency(PipeHandler)
6-
find_dependency(MemoryModule)
7-
find_dependency(SocksServer)
8-
find_dependency(Dnscommunication)
94
find_dependency(OpenSSL)
5+
find_dependency(Threads)
106

117
include("${CMAKE_CURRENT_LIST_DIR}/C2CoreTargets.cmake")
128

0 commit comments

Comments
 (0)