-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix build error * Upgrade conan * Fix build * Check versions * Fix case * Use conan to install --------- Co-authored-by: rawia.moalla <rawia.moalla}technica-engineering.de>
- Loading branch information
Showing
4 changed files
with
67 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
cmake_minimum_required(VERSION 3.9) | ||
|
||
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/conan.cmake") | ||
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/conan.cmake") | ||
endif() | ||
|
||
include(${CMAKE_CURRENT_BINARY_DIR}/conan.cmake) | ||
|
||
conan_cmake_run( | ||
REQUIRES pcapplusplus/22.05 | ||
GENERATORS CMakeDeps | ||
BUILD missing | ||
) | ||
cmake_minimum_required(VERSION 3.17) | ||
|
||
add_executable(tecmp_app "app.cpp") | ||
find_package(pcapplusplus REQUIRED CONFIG) | ||
find_package(PcapPlusPlus REQUIRED) | ||
|
||
target_link_libraries(tecmp_app PRIVATE tecmp_library pcapplusplus::pcapplusplus) | ||
target_compile_features(tecmp_app PRIVATE cxx_std_17) | ||
target_link_libraries(tecmp_app PUBLIC tecmp_library PcapPlusPlus::PcapPlusPlus) | ||
target_compile_features(tecmp_app PUBLIC cxx_std_17) | ||
|
||
add_test( | ||
NAME "tecmp_app.test" | ||
COMMAND tecmp_app | ||
"${CMAKE_CURRENT_LIST_DIR}/../traces/input_eth.pcap" | ||
"${CMAKE_CURRENT_LIST_DIR}/../traces/output_eth.pcap" | ||
) | ||
|
||
install( | ||
TARGETS tecmp_app DESTINATION "." | ||
RUNTIME DESTINATION bin | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from conan import ConanFile | ||
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps | ||
|
||
|
||
class TecmpAppRecipe(ConanFile): | ||
name = "tecmp_app" | ||
version = "0.1" | ||
package_type = "application" | ||
|
||
# Optional metadata | ||
license = "<Put the package license here>" | ||
author = "<Put your name here> <And your email here>" | ||
url = "<Package recipe repository url here, for issues about the package>" | ||
description = "<Description of tecmp_app package here>" | ||
topics = ("<Put some tag here>", "<here>", "<and here>") | ||
|
||
# Binary configuration | ||
settings = "os", "compiler", "build_type", "arch" | ||
|
||
# Sources are located in the same place as this recipe, copy them to the recipe | ||
exports_sources = "CMakeLists.txt", "src/*" | ||
|
||
package_folder = "../dist" | ||
|
||
def requirements(self): | ||
self.requires("pcapplusplus/23.09") | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def generate(self): | ||
deps = CMakeDeps(self) | ||
deps.generate() | ||
tc = CMakeToolchain(self) | ||
tc.generate() | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
cmake.install() | ||
|
||
def package(self): | ||
cmake = CMake(self) | ||
cmake.install() | ||
|