Skip to content

Commit 6bad719

Browse files
Improve build system and the CppSafeIO library's version
1 parent f840e29 commit 6bad719

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
cmake_minimum_required(VERSION 3.14)
2+
if(NOT DEFINED CPP_MENU)
3+
set(CPP_MENU "CppMenu" CACHE STRING "Name for the CppMenu library")
4+
endif()
5+
6+
project(CPP_MENU)
27

38
set(CMAKE_CXX_STANDARD 11)
49
set(CMAKE_CXX_STANDARD_REQUIRED ON)
10+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
511

12+
enable_testing()
613
include(FetchContent)
714

815
message(STATUS "Fetching the CppSafeIO library...")
916

1017
FetchContent_Declare( cppsafeio
1118
GIT_REPOSITORY https://github.com/DanielRamirez404/CppSafeIO.git
12-
GIT_TAG v2.0.0
19+
GIT_TAG v2.1.0
1320
GIT_SHALLOW TRUE
1421
)
1522

1623
FetchContent_MakeAvailable(cppsafeio)
1724

18-
if(NOT DEFINED CPP_MENU)
19-
set(CPP_MENU "CppMenu" CACHE STRING "Name for the CppMenu library")
20-
endif()
21-
2225
add_subdirectory(src)
23-
target_link_libraries(${CPP_MENU} PUBLIC ${CPP_SAFE_IO})

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
add_library(${CPP_MENU} STATIC cppmenu.cpp)
22
target_include_directories(${CPP_MENU} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
3+
target_link_libraries(${CPP_MENU} PUBLIC ${CPP_SAFE_IO})

0 commit comments

Comments
 (0)