-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
37 lines (27 loc) · 954 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
cmake_minimum_required(VERSION 3.10)
# Project name
project(rHashGen)
# Set the C++ standard to use
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Include the src directory
include_directories(${PROJECT_SOURCE_DIR}/src/include)
# Add subdirectories
add_subdirectory(src)
# Google Test
add_subdirectory(external/googletest)
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
# Find all main files in the app directory
file(GLOB APP_SOURCES ${PROJECT_SOURCE_DIR}/app/*.cpp)
# For each main file, create an executable
foreach(APP_SOURCE ${APP_SOURCES})
# Get the file name without the extension
get_filename_component(APP_NAME ${APP_SOURCE} NAME_WE)
# Add the executable
add_executable(${APP_NAME} ${APP_SOURCE})
# Link the necessary libraries
target_link_libraries(${APP_NAME} PRIVATE rHashGenLib)
endforeach()
# Add the test directory
enable_testing()
add_subdirectory(test)