-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
36 lines (26 loc) · 1021 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
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(wx_cmake_fetchcontent_template LANGUAGES CXX)
include(FetchContent)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(wxBUILD_SHARED OFF)
message(STATUS "Fetching wxWidgets...")
FetchContent_Declare(
wxWidgets
GIT_REPOSITORY https://github.com/wxWidgets/wxWidgets.git
GIT_SHALLOW ON
)
FetchContent_MakeAvailable(wxWidgets)
set(SRCS main.cpp)
if(APPLE)
# create bundle on apple compiles
add_executable(main MACOSX_BUNDLE ${SRCS})
# Set a custom plist file for the app bundle - needed for Mac OS Retina display
set_target_properties(main PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
else()
# the WIN32 is needed for Windows in order for it to look for WinMain
# instead of the main function. This is ignored on other systems,
# so it works on all platforms
add_executable(main WIN32 ${SRCS} main.exe.manifest)
endif()
target_link_libraries(main PRIVATE wxcore wxnet)