-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d41cef1
commit b0daa52
Showing
21 changed files
with
139 additions
and
266 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# CMake version requirement | ||
cmake_minimum_required(VERSION 3.20 FATAL_ERROR) | ||
|
||
project(evdscpp LANGUAGES CXX) | ||
|
||
#======================================================================================================================= | ||
# Set C++ compiler version | ||
#======================================================================================================================= | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
#======================================================================================================================= | ||
# Define the source files | ||
#======================================================================================================================= | ||
set(source_files src/main.cpp) # Assuming main.cpp is in the src/ directory | ||
|
||
#======================================================================================================================= | ||
# Add the executable target | ||
#======================================================================================================================= | ||
add_executable(evdscpp ${source_files}) | ||
|
||
#======================================================================================================================= | ||
# Dependencies | ||
#======================================================================================================================= | ||
|
||
include_directories("extern/dotenv") | ||
|
||
|
||
# ----------> curl | ||
find_package(CURL REQUIRED) | ||
target_link_libraries(evdscpp PRIVATE CURL::libcurl) | ||
|
||
# ----------> nlohmann-json | ||
include_directories("extern/nlohmann") | ||
|
||
|
||
|
||
#======================================================================================================================= | ||
# Output directories for different types of build outputs | ||
#======================================================================================================================= | ||
include(GNUInstallDirs) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) | ||
|
||
#======================================================================================================================= | ||
# Enable testing | ||
#======================================================================================================================= | ||
enable_testing() | ||
|
||
#======================================================================================================================= | ||
# Test target | ||
#======================================================================================================================= | ||
add_executable(test_dataframe tests/test_dataframe.cpp) | ||
|
||
# Link the test executable to the same libraries as the main executable | ||
target_include_directories(test_dataframe PRIVATE extern/nlohmann) | ||
|
||
#======================================================================================================================= | ||
# Valgrind check target | ||
#======================================================================================================================= | ||
find_program(VALGRIND "valgrind") | ||
|
||
if (VALGRIND) | ||
add_custom_target(valgrind_check | ||
COMMAND ${VALGRIND} --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose | ||
$<TARGET_FILE:evdscpp> | ||
COMMENT "Running Valgrind memory check on evdscpp" | ||
DEPENDS evdscpp | ||
) | ||
else() | ||
message(WARNING "Valgrind not found. 'valgrind_check' target will not be available.") | ||
endif() | ||
|
||
|
||
|
||
# Enable AddressSanitizer for memory error detection | ||
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -g") | ||
|
||
|
||
#======================================================================================================================= | ||
# Build instructions | ||
#======================================================================================================================= | ||
# To build and run the project: | ||
# mkdir build | ||
# cd build | ||
# cmake .. | ||
# make | ||
# ./evdscpp | ||
# | ||
# To run Valgrind check: | ||
# make valgrind_check | ||
|
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,94 +1,19 @@ | ||
# CMake version requirement | ||
cmake_minimum_required(VERSION 3.20 FATAL_ERROR) | ||
|
||
cmake_minimum_required(VERSION 3.20) | ||
project(evdscpp LANGUAGES CXX) | ||
|
||
#======================================================================================================================= | ||
# Set C++ compiler version | ||
#======================================================================================================================= | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
#======================================================================================================================= | ||
# Define the source files | ||
#======================================================================================================================= | ||
set(source_files src/main.cpp) # Assuming main.cpp is in the src/ directory | ||
|
||
#======================================================================================================================= | ||
# Add the executable target | ||
#======================================================================================================================= | ||
add_executable(evdscpp ${source_files}) | ||
|
||
#======================================================================================================================= | ||
# Dependencies | ||
#======================================================================================================================= | ||
|
||
include_directories("extern/dotenv") | ||
|
||
|
||
# ----------> curl | ||
find_package(CURL REQUIRED) | ||
target_link_libraries(evdscpp PRIVATE CURL::libcurl) | ||
|
||
# ----------> nlohmann-json | ||
include_directories("extern/nlohmann") | ||
|
||
|
||
|
||
#======================================================================================================================= | ||
# Output directories for different types of build outputs | ||
#======================================================================================================================= | ||
include(GNUInstallDirs) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) | ||
|
||
#======================================================================================================================= | ||
# Enable testing | ||
#======================================================================================================================= | ||
enable_testing() | ||
|
||
#======================================================================================================================= | ||
# Test target | ||
#======================================================================================================================= | ||
add_executable(test_dataframe tests/test_dataframe.cpp) | ||
|
||
# Link the test executable to the same libraries as the main executable | ||
target_include_directories(test_dataframe PRIVATE extern/nlohmann) | ||
|
||
#======================================================================================================================= | ||
# Valgrind check target | ||
#======================================================================================================================= | ||
find_program(VALGRIND "valgrind") | ||
|
||
if (VALGRIND) | ||
add_custom_target(valgrind_check | ||
COMMAND ${VALGRIND} --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose | ||
$<TARGET_FILE:evdscpp> | ||
COMMENT "Running Valgrind memory check on evdscpp" | ||
DEPENDS evdscpp | ||
) | ||
else() | ||
message(WARNING "Valgrind not found. 'valgrind_check' target will not be available.") | ||
endif() | ||
|
||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
# Enable AddressSanitizer for memory error detection | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -g") | ||
include_directories(include) | ||
include_directories(extern/nlohmann) # External dependencies | ||
include_directories(extern/dotenv) # External dependencies | ||
|
||
find_package(CURL REQUIRED) | ||
|
||
#======================================================================================================================= | ||
# Build instructions | ||
#======================================================================================================================= | ||
# To build and run the project: | ||
# mkdir build | ||
# cd build | ||
# cmake .. | ||
# make | ||
# ./evdscpp | ||
# | ||
# To run Valgrind check: | ||
# make valgrind_check | ||
add_subdirectory(src) | ||
|
||
add_subdirectory(tests) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,14 @@ | ||
|
||
set(SOURCES | ||
|
||
main.cpp | ||
main.cpp | ||
|
||
) | ||
|
||
add_library(evdscpp_lib ${SOURCES}) | ||
|
||
target_link_libraries(evdscpp_lib PRIVATE CURL::libcurl) | ||
|
||
add_executable(evdscpp main.cpp) | ||
target_link_libraries(evdscpp PRIVATE evdscpp_lib) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.