45 lines
939 B
CMake
45 lines
939 B
CMake
cmake_minimum_required(VERSION 3.15)
|
|
project(wxwidgets_demo)
|
|
|
|
# Set C++ standard
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# Add For Windows, specify Unicode
|
|
if(WIN32)
|
|
add_definitions(-DUNICODE -D_UNICODE)
|
|
endif()
|
|
|
|
# Add wxWidgets as a subdirectory
|
|
add_subdirectory(external/wxWidgets)
|
|
|
|
# Define your source files
|
|
set(SRC_DIR ${CMAKE_SOURCE_DIR}/src)
|
|
file(GLOB SRC_FILES ${SRC_DIR}/*.cpp)
|
|
|
|
# Include directories
|
|
include_directories(${CMAKE_SOURCE_DIR}/external/wxWidgets/include)
|
|
|
|
add_definitions(-D__WXUNIVERSAL__)
|
|
|
|
# Link additional libraries
|
|
set(WX_LIB
|
|
wx::core
|
|
wx::base
|
|
wx::net
|
|
wx::aui
|
|
wx::propgrid
|
|
)
|
|
|
|
# Create the executable
|
|
add_executable(${PROJECT_NAME} ${SRC_FILES})
|
|
|
|
# Link wxWidgets libraries
|
|
target_link_libraries(${PROJECT_NAME} ${WX_LIB})
|
|
|
|
# Set the C++ standard for your target
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
CXX_STANDARD 17
|
|
CXX_STANDARD_REQUIRED YES
|
|
)
|