diff --git a/CMakeLists.txt b/CMakeLists.txt index 43c5e82..31efebe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,16 @@ cmake_minimum_required(VERSION 3.5) project(wxMinesweeper LANGUAGES CXX) -add_subdirectory(libs/wxWidgets-3.2.4) -add_executable(wxMinesweeper field.cpp field.h minesweeper.cpp minesweeper.h) -target_link_libraries(wxMinesweeper wx::net wx::core wx::base) \ No newline at end of file +include(ExternalProject) +ExternalProject_Add(wxwidgets + GIT_REPOSITORY https://github.com/wxwidge + GIT_TAG origin/release/v3.2.4 + STEP_TARGETS build +) +aux_source_directory(. SRC_LIST) +find_package(wxWidgets REQUIRED COMPONENTS net core base) +if(wxWidgets_USE_FILE) # not defined in CONFIG mode + include(${wxWidgets_USE_FILE}) +endif() +add_executable(${PROJECT_NAME} ${SRC_LIST}) +target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES}) \ No newline at end of file