-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (26 loc) · 1.03 KB
/
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
# Specify the minimum version of CMake
cmake_minimum_required(VERSION 3.16)
# Define your project name
project(minesweeper VERSION 1.0 LANGUAGES CXX)
# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Check for wxWidgets
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/external/wxWidgets")
message(FATAL_ERROR "wxWidgets submodule is not initialized. Run 'git submodule update --init --recursive'.")
endif()
# Add the wxWidgets submodule as a subdirectory
add_subdirectory(external/wxWidgets)
# Add your application executable
add_executable(minesweeper minesweeper.cpp field.cpp)
# Link your application with wxWidgets libraries
target_link_libraries(minesweeper PRIVATE wx::net wx::core wx::base)
# Include directories for your source files
target_include_directories(minesweeper PRIVATE ${CMAKE_SOURCE_DIR}/src)
include(CTest)
add_test(
NAME Minesweeper_Run_Test
COMMAND $<TARGET_FILE:minesweeper>
)
set_tests_properties(Minesweeper_Run_Test PROPERTIES PASS_REGULAR_EXPRESSION ".*")