Skip to content

Commit

Permalink
bin folder
Browse files Browse the repository at this point in the history
  • Loading branch information
SermetPekin committed Nov 5, 2024
1 parent b0daa52 commit 16f3086
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
cmake_minimum_required(VERSION 3.20)
project(evdscpp LANGUAGES CXX)


# Top-level CMakeLists.txt

# Set output directories for executables and libraries
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)



# Enable testing
enable_testing()

Expand All @@ -17,3 +27,43 @@ find_package(CURL REQUIRED)
add_subdirectory(src)

add_subdirectory(tests)




#=======================================================================================================================
# 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


0 comments on commit 16f3086

Please sign in to comment.