initial commit

Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
2025-10-31 23:37:30 +01:00
commit bf6b52fd94
9654 changed files with 4035664 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
This directory contains [CMake][1] files needed to build
native build files for wxWidgets.
For building wxWidgets or using wxWidgets in your CMake project please see
the [CMake overview](../../docs/doxygen/overviews/cmake.md) in the wxWidgets
documentation.
CMake files organization
========================
All CMake files are located in _$(wx)/build/cmake_ additionally there is a
_CMakeLists.txt_ in the root directory.
Files
-----
* $(wx)/CMakeLists.txt
* This should only contain commands and definitions which need to be
contained in the top level and includes _main.cmake_
* config.cmake
* Generates config files used to find wxWidgets by other build systems
* Creates wx-config
* files.cmake
* List of source files generated by _$(wx)build/upmake_ from _$(wx)build/files_
* This file should usually **never** be edited manually
* However if a new group of files is added it needs to be edited manually
* functions.cmake
* contains various wxWidgets specific functions and macros used throughout
the CMake files
* Every function should contain a short description of its parameters as
a comment before the function/macro
* install.cmake
* Handles definitions for the `install` and `uninstall` target
* init.cmake
* Initializes various variables used during the build process and for
generation of setup.h and configuration files
* main.cmake
* Includes all other cmake files
* options.cmake
* All user selectable build options should be defined in this file via
calls to `wx_option()`
* policies.cmake
* [CMake policies][2] for wxWidgets should be defined in this file
* setup.cmake
* Handles all tests required to create the _setup.h_ header based
platform and user settings
* setup.h.in
* Template for _setup.h_ updated automatically by _$(wx)/build/update-setup-h_
* source_groups.cmake
* Define source groups used in supported IDEs
* toolkit.cmake
* Define toolkit specific options and detection to this file
* uninstall.cmake.in
* Used by _install.cmake_ when creating the `uninstall` target
Sub directories
---------------
Each sub directory contains a _CMakeLists.txt_ and might contain various other
_.cmake_ files.
* demos
* Defines build targets for demos via `wx_add_demo()`
* lib
* Defines build targets for all libraries and bundle third party libraries
* Each library is contained in a separate directory and uses
`wx_add_library()` to define the library target
* Bundled third party library without upstream CMake support are defined in
a _.cmake_ file using `wx_add_builtin_library()` to define static library
targets
* modules
* Includes CMake modules used to find third party packages via [find_package()][3]
* Includes the [cotire module][4] used to for precompiled header generation
* samples
* Defines build targets for all samples via `wx_add_sample()`
* Definitions for trivial samples are included in _CMakeLists.txt_ more
complex samples might have a separate .cmake file
* tests
* Defines build targets for all tests
* utils
* Defines build targets for all utilities
[1]: https://cmake.org
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html
[3]: https://cmake.org/cmake/help/latest/command/find_package.html
[4]: https://github.com/sakra/cotire/

View File

@@ -0,0 +1,12 @@
#############################################################################
# Name: build/cmake/benchmarks/CMakeLists.txt
# Purpose: CMake file for benchmarks
# Author: Maarten Bent
# Created: 2021-02-07
# Copyright: (c) 2021 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
add_subdirectory(bench)
add_subdirectory(bench_graphics)
add_subdirectory(bench_gui)

View File

@@ -0,0 +1,34 @@
#############################################################################
# Name: build/cmake/benchmarks/bench/CMakeLists.txt
# Purpose: CMake file for benchmarks
# Author: Maarten Bent
# Created: 2021-02-07
# Copyright: (c) 2021 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(BENCH_SRC
bench.cpp
bench.h
datetime.cpp
htmlparser/htmlpars.cpp
htmlparser/htmlpars.h
htmlparser/htmltag.cpp
htmlparser/htmltag.h
ipcclient.cpp
log.cpp
mbconv.cpp
printfbench.cpp
strings.cpp
tls.cpp
)
set(BENCH_DATA
htmltest.html
)
wx_add_benchmark(bench CONSOLE ${BENCH_SRC} DATA ${BENCH_DATA})
if(wxUSE_SOCKETS)
wx_exe_link_libraries(bench wxnet)
endif()

View File

@@ -0,0 +1,18 @@
#############################################################################
# Name: build/cmake/benchmarks/bench_graphics/CMakeLists.txt
# Purpose: CMake file for benchmarks
# Author: Maarten Bent
# Created: 2021-02-07
# Copyright: (c) 2021 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(BENCH_GRAPGICS_SRC
graphics.cpp
)
wx_add_benchmark(bench_graphics CONSOLE_GUI ${BENCH_GRAPGICS_SRC})
if(wxUSE_OPENGL)
wx_exe_link_libraries(bench_graphics wxgl)
endif()

View File

@@ -0,0 +1,24 @@
#############################################################################
# Name: build/cmake/benchmarks/bench_gui/CMakeLists.txt
# Purpose: CMake file for benchmarks
# Author: Maarten Bent
# Created: 2021-02-07
# Copyright: (c) 2021 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(BENCH_GUI_SRC
bench.cpp
bench.h
display.cpp
image.cpp
)
set(IMAGE_DATA
../../samples/image/horse.bmp:horse.bmp
../../samples/image/horse.jpg:horse.jpg
../../samples/image/horse.png:horse.png
../../samples/image/horse.tif:horse.tif
)
wx_add_benchmark(bench_gui CONSOLE_GUI ${BENCH_GUI_SRC} DATA ${IMAGE_DATA})

View File

@@ -0,0 +1,39 @@
WXVER_MAJOR=@wxMAJOR_VERSION@
WXVER_MINOR=@wxMINOR_VERSION@
WXVER_RELEASE=@wxRELEASE_NUMBER@
BUILD=@wxBUILD@
MONOLITHIC=@wxBUILD_MONOLITHIC_bf@
SHARED=@wxBUILD_SHARED_bf@
UNICODE=1
TOOLKIT=@wxBUILD_TOOLKIT_UPPER@
TOOLKIT_VERSION=@wxTOOLKIT_VERSION@
WXUNIV=@wxUNIV@
CFG=@wxCFG@
VENDOR=@wxBUILD_VENDOR@
OFFICIAL_BUILD=@wxOFFICIAL_BUILD@
DEBUG_FLAG=@wxDEBUG_FLAG@
DEBUG_INFO=@wxDEBUG_INFO@
RUNTIME_LIBS=@wxRUNTIME_LIBS@
USE_EXCEPTIONS=@wxUSE_EXCEPTIONS_bf@
USE_RTTI=@wxUSE_RTTI@
USE_THREADS=@wxUSE_THREADS_bf@
USE_AUI=@wxUSE_AUI_bf@
USE_GUI=@wxUSE_GUI_bf@
USE_HTML=@wxUSE_HTML_bf@
USE_MEDIA=@wxUSE_MEDIA_bf@
USE_OPENGL=@wxUSE_OPENGL_bf@
USE_QA=@wxUSE_DEBUGREPORT_bf@
USE_PROPGRID=@wxUSE_PROPGRID_bf@
USE_RIBBON=@wxUSE_RIBBON_bf@
USE_RICHTEXT=@wxUSE_RICHTEXT_bf@
USE_STC=@wxUSE_STC_bf@
USE_WEBVIEW=@wxUSE_WEBVIEW_bf@
USE_XRC=@wxUSE_XRC_bf@
COMPILER=@wxCOMPILER_PREFIX@
COMPILER_VERSION=@wxCOMPILER_VERSION@
CC=@wxCC@
CXX=@wxCXX@
CFLAGS=@wxCFLAGS@
CPPFLAGS=@wxCPPFLAGS@
CXXFLAGS=@wxCXXFLAGS@
LDFLAGS=@wxLDFLAGS@

View File

@@ -0,0 +1,70 @@
#############################################################################
# Name: build/cmake/build_cfg.cmake
# Purpose: Create and configure build.cfg
# Author: Maarten Bent
# Created: 2021-06-17
# Copyright: (c) 2021 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
macro(wx_buildfile_var var)
# convert TRUE/FALSE to 1/0, add _bf suffix for use in build.cfg
if(${var})
set(${var}_bf 1)
else()
set(${var}_bf 0)
endif()
endmacro()
wx_buildfile_var(wxBUILD_MONOLITHIC)
wx_buildfile_var(wxBUILD_SHARED)
wx_buildfile_var(wxUSE_EXCEPTIONS)
wx_buildfile_var(wxUSE_THREADS)
wx_buildfile_var(wxUSE_AUI)
wx_buildfile_var(wxUSE_GUI)
wx_buildfile_var(wxUSE_HTML)
wx_buildfile_var(wxUSE_MEDIACTRL)
wx_buildfile_var(wxUSE_OPENGL)
wx_buildfile_var(wxUSE_DEBUGREPORT)
wx_buildfile_var(wxUSE_PROPGRID)
wx_buildfile_var(wxUSE_RIBBON)
wx_buildfile_var(wxUSE_RICHTEXT)
wx_buildfile_var(wxUSE_STC)
wx_buildfile_var(wxUSE_WEBVIEW)
wx_buildfile_var(wxUSE_XRC)
if(wxUSE_NO_RTTI)
set(wxUSE_RTTI 0)
else()
set(wxUSE_RTTI 1)
endif()
if(wxBUILD_STRIPPED_RELEASE)
set(wxDEBUG_INFO 0)
else()
set(wxDEBUG_INFO 1)
endif()
if(wxBUILD_USE_STATIC_RUNTIME)
set(wxRUNTIME_LIBS "static")
else()
set(wxRUNTIME_LIBS "dynamic")
endif()
set(wxDEBUG_FLAG ${wxBUILD_DEBUG_LEVEL})
get_filename_component(wxCC ${CMAKE_C_COMPILER} NAME_WE)
get_filename_component(wxCXX ${CMAKE_CXX_COMPILER} NAME_WE)
set(wxCFLAGS ${CMAKE_C_FLAGS})
set(wxCPPFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}")
set(wxCXXFLAGS ${CMAKE_CXX_FLAGS})
set(wxLDFLAGS ${CMAKE_EXE_LINKER_FLAGS})
# These are currently not used by CMake
set(wxCFG "")
set(wxUNIV 0)
set(wxOFFICIAL_BUILD 0)
set(wxCOMPILER_VERSION "")
set(wxBUILD "release")
configure_file(build/cmake/build.cfg.in ${wxBUILD_FILE})
set(wxBUILD "debug")
configure_file(build/cmake/build.cfg.in ${wxBUILD_FILE_DEBUG})

View File

@@ -0,0 +1,209 @@
#############################################################################
# Name: build/cmake/config.cmake
# Purpose: Build wx-config script in build folder
# Author: Tobias Taschner
# Created: 2016-10-13
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(wxCONFIG_DIR ${wxOUTPUT_DIR}/wx/config)
file(MAKE_DIRECTORY ${wxCONFIG_DIR})
set(TOOLCHAIN_FULLNAME ${wxBUILD_FILE_ID})
macro(wx_configure_script input output)
# variables used in wx-config-inplace.in
set(abs_top_srcdir ${wxSOURCE_DIR})
set(abs_top_builddir ${wxBINARY_DIR})
configure_file(
${wxSOURCE_DIR}/${input}
${wxBINARY_DIR}${CMAKE_FILES_DIRECTORY}/${output}
ESCAPE_QUOTES @ONLY NEWLINE_STYLE UNIX)
file(COPY
${wxBINARY_DIR}${CMAKE_FILES_DIRECTORY}/${output}
DESTINATION ${wxCONFIG_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endmacro()
macro(wx_get_dependencies var lib)
set(${var})
if(TARGET wx${lib})
get_target_property(deps wx${lib} LINK_LIBRARIES)
foreach(dep IN LISTS deps)
if(TARGET ${dep})
get_target_property(dep_type ${dep} TYPE)
if (dep_type STREQUAL "INTERFACE_LIBRARY")
get_target_property(dep_name ${dep} INTERFACE_OUTPUT_NAME)
else()
get_target_property(dep_name ${dep} OUTPUT_NAME)
endif()
# imported target
if(CMAKE_VERSION VERSION_GREATER "3.18")
# CMake <= 3.18 only allows a few properties to be checked, not LOCATION, see
# https://cmake.org/cmake/help/v3.18/manual/cmake-buildsystem.7.html#interface-libraries
set(prop_suffix)
if (CMAKE_BUILD_TYPE)
string(TOUPPER "${CMAKE_BUILD_TYPE}" prop_suffix)
set(prop_suffix "_${prop_suffix}")
endif()
if(NOT dep_name AND prop_suffix)
get_target_property(dep_name ${dep} LOCATION${prop_suffix})
endif()
if(NOT dep_name)
get_target_property(dep_name ${dep} LOCATION)
endif()
endif()
if(NOT dep_name)
get_target_property(dep_name ${dep} IMPORTED_LIBNAME)
endif()
else()
# For the value like $<$<CONFIG:DEBUG>:LIB_PATH>
# Or $<$<NOT:$<CONFIG:DEBUG>>:LIB_PATH>
string(REGEX REPLACE "^.+>:(.+)>$" "\\1" dep_name ${dep})
if (NOT dep_name)
set(dep_name ${dep})
endif()
endif()
if(dep_name STREQUAL "libc.so")
# don't include this library
elseif(dep_name MATCHES "^-(.*)$") # -l, -framework, -weak_framework
wx_string_append(${var} "${dep_name} ")
elseif(dep_name MATCHES "^lib(.*)(.so|.dylib|.tbd|.a)$")
wx_string_append(${var} "-l${CMAKE_MATCH_1} ")
elseif(dep_name)
get_filename_component(abs_path ${dep_name} PATH)
if (abs_path) # value contains path
wx_string_append(${var} "${dep_name} ")
else()
wx_string_append(${var} "-l${dep_name} ")
endif()
endif()
endforeach()
string(STRIP ${${var}} ${var})
endif()
endmacro()
function(wx_write_config_inplace)
wx_configure_script(
"wx-config-inplace.in"
"inplace-${TOOLCHAIN_FULLNAME}"
)
if(WIN32_MSVC_NAMING)
set(COPY_CMD copy)
else()
set(COPY_CMD create_symlink)
endif()
execute_process(
COMMAND
"${CMAKE_COMMAND}" -E ${COPY_CMD}
"${wxBINARY_DIR}/lib/wx/config/inplace-${TOOLCHAIN_FULLNAME}"
"${wxBINARY_DIR}/wx-config"
)
endfunction()
function(wx_write_config)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(includedir "\${prefix}/include")
set(libdir "\${exec_prefix}/lib")
set(bindir "\${exec_prefix}/bin")
if(wxBUILD_MONOLITHIC)
set(MONOLITHIC 1)
else()
set(MONOLITHIC 0)
endif()
if(wxBUILD_SHARED)
set(SHARED 1)
else()
set(SHARED 0)
endif()
set(lib_unicode_suffix u)
if(CMAKE_CROSSCOMPILING)
set(cross_compiling yes)
set(host_alias ${CMAKE_SYSTEM_NAME})
else()
set(cross_compiling no)
endif()
set(BUILT_WX_LIBS)
set(STD_BASE_LIBS)
set(STD_GUI_LIBS)
set(STD_BASE_LIBS_ALL xml net base)
set(STD_GUI_LIBS_ALL xrc html qa adv core)
foreach(lib IN ITEMS xrc webview stc richtext ribbon propgrid aui gl media html qa adv core xml net base)
if (wx${lib} IN_LIST wxLIB_TARGETS)
wx_string_append(BUILT_WX_LIBS "${lib} ")
if (${lib} IN_LIST STD_BASE_LIBS_ALL)
wx_string_append(STD_BASE_LIBS "${lib} ")
endif()
if (${lib} IN_LIST STD_GUI_LIBS_ALL)
wx_string_append(STD_GUI_LIBS "${lib} ")
endif()
endif()
endforeach()
string(STRIP "${BUILT_WX_LIBS}" BUILT_WX_LIBS)
string(STRIP "${STD_BASE_LIBS}" STD_BASE_LIBS)
string(STRIP "${STD_GUI_LIBS}" STD_GUI_LIBS)
set(WX_RELEASE ${wxMAJOR_VERSION}.${wxMINOR_VERSION})
set(WX_VERSION ${wxVERSION})
set(WX_SUBVERSION ${wxVERSION}.0)
wx_get_flavour(WX_FLAVOUR "-")
wx_get_flavour(lib_flavour "_")
set(TOOLKIT_DIR ${wxBUILD_TOOLKIT})
set(TOOLKIT_VERSION)
set(WIDGET_SET ${wxBUILD_WIDGETSET})
set(TOOLCHAIN_NAME "${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}-${WX_RELEASE}")
set(WX_LIBRARY_BASENAME_GUI "wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_flavour}")
set(WX_LIBRARY_BASENAME_NOGUI "wx_base${lib_unicode_suffix}${lib_flavour}")
wx_get_dependencies(WXCONFIG_LIBS base)
wx_get_dependencies(EXTRALIBS_GUI core)
set(EXTRALIBS_SDL) # included in core libs when SDL is enabled
wx_get_dependencies(EXTRALIBS_HTML html)
wx_get_dependencies(EXTRALIBS_STC stc)
wx_get_dependencies(EXTRALIBS_WEBVIEW webview)
wx_get_dependencies(EXTRALIBS_XML xml)
wx_get_dependencies(EXTRALIBS_MEDIA media)
wx_get_dependencies(OPENGL_LIBS gl)
set(DMALLOC_LIBS)
if(wxBUILD_MONOLITHIC)
wx_get_dependencies(WXCONFIG_LIBS mono)
endif()
set(CC ${CMAKE_C_COMPILER})
set(CXX ${CMAKE_CXX_COMPILER})
set(WXCONFIG_CFLAGS ${CMAKE_THREAD_LIBS_INIT})
set(WXCONFIG_LDFLAGS ${CMAKE_THREAD_LIBS_INIT})
set(WXCONFIG_CPPFLAGS)
if(wxBUILD_SHARED)
wx_string_append(WXCONFIG_CPPFLAGS " -DWXUSINGDLL")
endif()
foreach(flag IN LISTS wxTOOLKIT_DEFINITIONS)
wx_string_append(WXCONFIG_CPPFLAGS " -D${flag}")
endforeach()
if(wxBUILD_LARGEFILE_SUPPORT)
wx_string_append(WXCONFIG_CPPFLAGS " -D_FILE_OFFSET_BITS=64")
endif()
string(STRIP "${WXCONFIG_CPPFLAGS}" WXCONFIG_CPPFLAGS)
set(WXCONFIG_CXXFLAGS ${WXCONFIG_CFLAGS})
set(WXCONFIG_LDFLAGS_GUI)
set(WXCONFIG_RESFLAGS)
set(WXCONFIG_RPATH "-Wl,-rpath,\$libdir")
set(LDFLAGS_GL)
set(RESCOMP)
wx_configure_script(
"wx-config.in"
"${TOOLCHAIN_FULLNAME}"
)
endfunction()
wx_write_config_inplace()
wx_write_config()

View File

@@ -0,0 +1,67 @@
#############################################################################
# Name: build/cmake/demos/CMakeLists.txt
# Purpose: CMake script for demos
# Author: Tobias Taschner
# Created: 2016-10-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_add_demo(bombs
bombs.cpp
bombs.h
bombs1.cpp
game.cpp
game.h
)
wx_add_demo(forty
canvas.cpp
canvas.h
card.cpp
card.h
forty.cpp
forty.h
game.cpp
game.h
pile.cpp
pile.h
playerdg.cpp
playerdg.h
scoredg.cpp
scoredg.h
scorefil.cpp
scorefil.h
DATA
about.htm
LIBRARIES
wxhtml wxxml
)
wx_add_demo(fractal
fractal.cpp
)
wx_add_demo(life
dialogs.cpp
dialogs.h
game.cpp
game.h
life.cpp
life.h
reader.cpp
reader.h
DATA
breeder.lif
)
wx_add_demo(poem
wxpoem.cpp
wxpoem.h
DATA
wxpoem.txt wxpoem.dat wxpoem.idx
LIBRARIES
wxhtml
NAME
wxpoem
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,793 @@
#############################################################################
# Name: build/cmake/init.cmake
# Purpose: Initialize variables based on user selection and system
# information before creating build targets
# Author: Tobias Taschner
# Created: 2016-09-24
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
function(checkCompilerDefaults)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <vector>
int main() {
std::vector<int> v{1,2,3};
for (auto& n : v)
--n;
return v[0];
}"
wxHAVE_CXX11)
check_cxx_source_compiles("
#if defined(_MSVC_LANG)
#if _MSVC_LANG < 201703L
#error C++17 support is required
#endif
#elif __cplusplus < 201703L
#error C++17 support is required
#endif
int main() {
[[maybe_unused]] auto unused = 17;
}"
wxHAVE_CXX17)
endfunction()
if(DEFINED CMAKE_CXX_STANDARD)
# User has explicitly set a CMAKE_CXX_STANDARD.
elseif(DEFINED wxBUILD_CXX_STANDARD AND NOT wxBUILD_CXX_STANDARD STREQUAL COMPILER_DEFAULT)
# Standard is set using wxBUILD_CXX_STANDARD.
set(CMAKE_CXX_STANDARD ${wxBUILD_CXX_STANDARD})
set(CMAKE_CXX_STANDARD_REQUIRED ON)
else()
# CMAKE_CXX_STANDARD not defined.
checkCompilerDefaults()
if(NOT wxHAVE_CXX11)
# If the standard is not set explicitly, and the default compiler settings
# do not support c++11, request it explicitly.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
endif()
if(MSVC)
if(CMAKE_VERSION VERSION_LESS "3.15")
# CMake 3.15 and later use MSVC_RUNTIME_LIBRARY property, see functions.cmake
# Determine MSVC runtime library flag
set(MSVC_LIB_USE "/MD")
set(MSVC_LIB_REPLACE "/MT")
if(wxBUILD_USE_STATIC_RUNTIME)
set(MSVC_LIB_USE "/MT")
set(MSVC_LIB_REPLACE "/MD")
endif()
# Set MSVC runtime flags for all configurations
foreach(cfg "" ${CMAKE_CONFIGURATION_TYPES})
set(c_flag_var CMAKE_C_FLAGS)
set(cxx_flag_var CMAKE_CXX_FLAGS)
if(cfg)
string(TOUPPER ${cfg} cfg_upper)
wx_string_append(c_flag_var "_${cfg_upper}")
wx_string_append(cxx_flag_var "_${cfg_upper}")
endif()
if(${c_flag_var} MATCHES ${MSVC_LIB_REPLACE})
string(REPLACE ${MSVC_LIB_REPLACE} ${MSVC_LIB_USE} ${c_flag_var} "${${c_flag_var}}")
set(${c_flag_var} ${${c_flag_var}} CACHE STRING
"Flags used by the C compiler during ${cfg_upper} builds." FORCE)
endif()
if(${cxx_flag_var} MATCHES ${MSVC_LIB_REPLACE})
string(REPLACE ${MSVC_LIB_REPLACE} ${MSVC_LIB_USE} ${cxx_flag_var} "${${cxx_flag_var}}")
set(${cxx_flag_var} ${${cxx_flag_var}} CACHE STRING
"Flags used by the CXX compiler during ${cfg_upper} builds." FORCE)
endif()
endforeach()
endif()
if(wxBUILD_SHARED AND wxBUILD_USE_STATIC_RUNTIME AND wxUSE_STD_IOSTREAM)
# Objects like std::cout are defined as extern in <iostream> and implemented in libcpmt.
# This is statically linked into wxbase (stdstream.cpp).
# When building an application with both wxbase and libcpmt,
# the linker gives 'multiply defined symbols' error.
message(WARNING "wxUSE_STD_IOSTREAM combined with wxBUILD_USE_STATIC_RUNTIME will fail to link when using std::cout or similar functions")
endif()
if(wxBUILD_OPTIMISE)
set(MSVC_LINKER_RELEASE_FLAGS " /LTCG /OPT:REF /OPT:ICF")
wx_string_append(CMAKE_EXE_LINKER_FLAGS_RELEASE "${MSVC_LINKER_RELEASE_FLAGS}")
wx_string_append(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${MSVC_LINKER_RELEASE_FLAGS}")
wx_string_append(CMAKE_STATIC_LINKER_FLAGS_RELEASE " /LTCG")
set(MSVC_COMPILER_RELEASE_FLAGS " /Ox /Oi /Ot /Oy /GS- /Gy /GL /Gw")
wx_string_append(CMAKE_CXX_FLAGS_RELEASE "${MSVC_COMPILER_RELEASE_FLAGS}")
wx_string_append(CMAKE_C_FLAGS_RELEASE "${MSVC_COMPILER_RELEASE_FLAGS}")
endif()
if(NOT wxBUILD_STRIPPED_RELEASE)
set(MSVC_PDB_FLAG " /DEBUG")
endif()
wx_string_append(CMAKE_EXE_LINKER_FLAGS_RELEASE "${MSVC_PDB_FLAG}")
wx_string_append(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${MSVC_PDB_FLAG}")
if(wxBUILD_MSVC_MULTIPROC)
wx_string_append(CMAKE_C_FLAGS " /MP")
wx_string_append(CMAKE_CXX_FLAGS " /MP")
endif()
if(NOT POLICY CMP0092)
string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
elseif(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
if(wxBUILD_OPTIMISE)
set(GCC_PREFERRED_RELEASE_FLAGS " -O2 -fomit-frame-pointer")
wx_string_append(CMAKE_CXX_FLAGS_RELEASE "${GCC_PREFERRED_RELEASE_FLAGS}")
wx_string_append(CMAKE_C_FLAGS_RELEASE "${GCC_PREFERRED_RELEASE_FLAGS}")
endif()
if(wxBUILD_STRIPPED_RELEASE)
set(LD_STRIPPING_FLAG " -s")
wx_string_append(CMAKE_EXE_LINKER_FLAGS_RELEASE "${LD_STRIPPING_FLAG}")
wx_string_append(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${LD_STRIPPING_FLAG}")
else()
set(COMPILER_DBGSYM_FLAG " -g")
wx_string_append(CMAKE_CXX_FLAGS_RELEASE "${COMPILER_DBGSYM_FLAG}")
wx_string_append(CMAKE_C_FLAGS_RELEASE "${COMPILER_DBGSYM_FLAG}")
endif()
if(wxBUILD_USE_STATIC_RUNTIME AND NOT APPLE)
if(MINGW)
set(STATIC_LINKER_FLAGS " -static")
else()
set(STATIC_LINKER_FLAGS " -static-libgcc -static-libstdc++")
endif()
wx_string_append(CMAKE_EXE_LINKER_FLAGS "${STATIC_LINKER_FLAGS}")
wx_string_append(CMAKE_SHARED_LINKER_FLAGS "${STATIC_LINKER_FLAGS}")
endif()
endif()
if(NOT wxBUILD_COMPATIBILITY STREQUAL "NONE")
set(WXWIN_COMPATIBILITY_3_2 ON)
if(wxBUILD_COMPATIBILITY VERSION_LESS 3.2)
set(WXWIN_COMPATIBILITY_3_0 ON)
endif()
endif()
# Build wxBUILD_FILE_ID used for config and setup path
#TODO: build different id for WIN32
set(wxBUILD_FILE_ID "${wxBUILD_TOOLKIT}${wxBUILD_WIDGETSET}-")
wx_string_append(wxBUILD_FILE_ID "unicode")
if(NOT wxBUILD_SHARED)
wx_string_append(wxBUILD_FILE_ID "-static")
endif()
wx_string_append(wxBUILD_FILE_ID "-${wxMAJOR_VERSION}.${wxMINOR_VERSION}")
wx_get_flavour(lib_flavour "-")
wx_string_append(wxBUILD_FILE_ID "${lib_flavour}")
set(wxPLATFORM_ARCH)
if(CMAKE_GENERATOR_PLATFORM)
if(NOT CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
string(TOLOWER ${CMAKE_GENERATOR_PLATFORM} wxPLATFORM_ARCH)
endif()
elseif(CMAKE_VS_PLATFORM_NAME)
if(NOT CMAKE_VS_PLATFORM_NAME STREQUAL "Win32")
string(TOLOWER ${CMAKE_VS_PLATFORM_NAME} wxPLATFORM_ARCH)
endif()
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(wxPLATFORM_ARCH "x64")
endif()
endif()
set(wxARCH_SUFFIX)
set(wxCOMPILER_PREFIX)
set(wxPLATFORM_LIB_DIR)
if(WIN32)
# TODO: include compiler version in wxCOMPILER_PREFIX for official builds
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(wxCOMPILER_PREFIX "vc")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(wxCOMPILER_PREFIX "gcc")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(wxCOMPILER_PREFIX "clang")
else()
message(FATAL_ERROR "Unknown WIN32 compiler type")
endif()
if(wxPLATFORM_ARCH)
set(wxARCH_SUFFIX "_${wxPLATFORM_ARCH}")
endif()
endif()
if(WIN32_MSVC_NAMING)
if(wxBUILD_SHARED)
set(lib_suffix "_dll")
else()
set(lib_suffix "_lib")
endif()
set(wxPLATFORM_LIB_DIR "${wxCOMPILER_PREFIX}${wxARCH_SUFFIX}${lib_suffix}")
# Generator expression to not create different Debug and Release directories
set(GEN_EXPR_DIR "$<1:/>")
set(wxINSTALL_INCLUDE_DIR "include")
else()
set(GEN_EXPR_DIR "/")
wx_get_flavour(lib_flavour "-")
set(wxINSTALL_INCLUDE_DIR "include/wx-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${lib_flavour}")
endif()
if(wxBUILD_CUSTOM_SETUP_HEADER_PATH)
if(NOT EXISTS "${wxBUILD_CUSTOM_SETUP_HEADER_PATH}/wx/setup.h")
message(FATAL_ERROR "wxBUILD_CUSTOM_SETUP_HEADER_PATH needs to contain a wx/setup.h file")
endif()
set(wxSETUP_HEADER_PATH ${wxBUILD_CUSTOM_SETUP_HEADER_PATH})
else()
# Set path where setup.h will be created
if(WIN32_MSVC_NAMING)
set(lib_unicode u)
set(wxSETUP_HEADER_PATH
${wxOUTPUT_DIR}/${wxPLATFORM_LIB_DIR}/${wxBUILD_TOOLKIT}${lib_unicode})
file(MAKE_DIRECTORY ${wxSETUP_HEADER_PATH}/wx)
file(MAKE_DIRECTORY ${wxSETUP_HEADER_PATH}d/wx)
set(wxSETUP_HEADER_FILE_DEBUG ${wxSETUP_HEADER_PATH}d/wx/setup.h)
else()
set(wxSETUP_HEADER_PATH
${wxOUTPUT_DIR}/wx/include/${wxBUILD_FILE_ID})
file(MAKE_DIRECTORY ${wxSETUP_HEADER_PATH}/wx)
endif()
endif()
set(wxSETUP_HEADER_FILE ${wxSETUP_HEADER_PATH}/wx/setup.h)
set(wxBUILD_FILE ${wxSETUP_HEADER_PATH}/build.cfg)
set(wxBUILD_FILE_DEBUG ${wxSETUP_HEADER_PATH}d/build.cfg)
if(DEFINED wxSETUP_HEADER_FILE_DEBUG)
# Append configuration specific suffix to setup header path
wx_string_append(wxSETUP_HEADER_PATH "$<$<CONFIG:Debug>:d>")
endif()
if(NOT wxBUILD_DEBUG_LEVEL STREQUAL "Default")
add_compile_options("-DwxDEBUG_LEVEL=${wxBUILD_DEBUG_LEVEL}")
endif()
# Constants for setup.h creation
if(NOT wxUSE_EXPAT)
set(wxUSE_XRC OFF)
endif()
set(wxUSE_XML ${wxUSE_XRC})
if(DEFINED wxUSE_OLE AND wxUSE_OLE)
set(wxUSE_OLE_AUTOMATION ON)
endif()
if(wxUSE_ACTIVEX AND DEFINED wxUSE_OLE AND NOT wxUSE_OLE)
message(WARNING "wxActiveXContainer requires wxUSE_OLE... disabled")
wx_option_force_value(wxUSE_ACTIVEX OFF)
endif()
if(wxUSE_DRAG_AND_DROP AND DEFINED wxUSE_OLE AND NOT wxUSE_OLE)
message(WARNING "wxUSE_DRAG_AND_DROP requires wxUSE_OLE... disabled")
wx_option_force_value(wxUSE_DRAG_AND_DROP OFF)
endif()
if(wxUSE_ACCESSIBILITY AND DEFINED wxUSE_OLE AND NOT wxUSE_OLE)
message(WARNING "wxUSE_ACCESSIBILITY requires wxUSE_OLE... disabled")
wx_option_force_value(wxUSE_ACCESSIBILITY OFF)
endif()
if(wxUSE_MEDIACTRL AND DEFINED wxUSE_ACTIVEX AND NOT wxUSE_ACTIVEX)
message(WARNING "wxMediaCtl requires wxActiveXContainer... disabled")
wx_option_force_value(wxUSE_MEDIACTRL OFF)
endif()
if(wxUSE_WEBVIEW AND wxUSE_WEBVIEW_IE AND DEFINED wxUSE_ACTIVEX AND NOT wxUSE_ACTIVEX)
message(WARNING "wxWebViewIE requires wxActiveXContainer... disabled")
wx_option_force_value(wxUSE_WEBVIEW_IE OFF)
endif()
if(wxUSE_OPENGL)
set(wxUSE_GLCANVAS ON)
endif()
if(wxUSE_ARCHIVE_STREAMS AND NOT wxUSE_STREAMS)
message(WARNING "wxArchive requires wxStreams... disabled")
wx_option_force_value(wxUSE_ARCHIVE_STREAMS OFF)
endif()
if(wxUSE_ZIPSTREAM AND (NOT wxUSE_ARCHIVE_STREAMS OR NOT wxUSE_ZLIB))
message(WARNING "wxZip requires wxArchive or wxZlib... disabled")
wx_option_force_value(wxUSE_ZIPSTREAM OFF)
endif()
if(wxUSE_TARSTREAM AND NOT wxUSE_ARCHIVE_STREAMS)
message(WARNING "wxTar requires wxArchive... disabled")
wx_option_force_value(wxUSE_TARSTREAM OFF)
endif()
if(wxUSE_FILESYSTEM AND (NOT wxUSE_STREAMS OR (NOT wxUSE_FILE AND NOT wxUSE_FFILE)))
message(WARNING "wxFileSystem requires wxStreams and wxFile or wxFFile... disabled")
wx_option_force_value(wxUSE_FILESYSTEM OFF)
endif()
if(wxUSE_FS_ARCHIVE AND (NOT wxUSE_FILESYSTEM OR NOT wxUSE_ARCHIVE_STREAMS))
message(WARNING "wxArchiveFSHandler requires wxArchive and wxFileSystem... disabled")
wx_option_force_value(wxUSE_FS_ARCHIVE OFF)
endif()
if(wxUSE_FS_ARCHIVE AND (NOT wxUSE_FILESYSTEM OR NOT wxUSE_ARCHIVE_STREAMS))
message(WARNING "wxArchiveFSHandler requires wxArchive and wxFileSystem... disabled")
wx_option_force_value(wxUSE_FS_ARCHIVE OFF)
endif()
if(wxUSE_FS_ZIP AND NOT wxUSE_FS_ARCHIVE)
message(WARNING "wxZipFSHandler requires wxArchiveFSHandler... disabled")
wx_option_force_value(wxUSE_FS_ZIP OFF)
endif()
if(wxUSE_TEXTFILE AND (NOT wxUSE_FILE OR NOT wxUSE_TEXTBUFFER))
message(WARNING "wxTextFile requires wxFile and wxTextBuffer... disabled")
wx_option_force_value(wxUSE_TEXTFILE OFF)
endif()
if(wxUSE_MIMETYPE AND NOT wxUSE_TEXTFILE)
message(WARNING "wxUSE_MIMETYPE requires wxTextFile... disabled")
wx_option_force_value(wxUSE_MIMETYPE OFF)
endif()
if(wxUSE_CONFIG)
if(NOT wxUSE_TEXTFILE)
message(WARNING "wxConfig requires wxTextFile... disabled")
wx_option_force_value(wxUSE_CONFIG OFF)
else()
set(wxUSE_CONFIG_NATIVE ON)
endif()
endif()
if(wxUSE_INTL AND NOT wxUSE_FILE)
message(WARNING "I18n code requires wxFile... disabled")
wx_option_force_value(wxUSE_INTL OFF)
endif()
if(wxUSE_THREADS)
if(ANDROID)
# Android has pthreads but FindThreads fails due to missing pthread_cancel
set(CMAKE_USE_PTHREADS_INIT 1)
set(CMAKE_THREAD_LIBS_INIT "")
set(Threads_FOUND TRUE)
else()
find_package(Threads REQUIRED)
endif()
endif()
if(wxUSE_LIBLZMA)
find_package(LibLZMA)
if(NOT LIBLZMA_FOUND)
message(WARNING "libLZMA not found, LZMA compression won't be available")
wx_option_force_value(wxUSE_LIBLZMA OFF)
endif()
endif()
if (wxUSE_WEBREQUEST)
if(wxUSE_WEBREQUEST_CURL)
find_package(CURL)
if(NOT CURL_FOUND)
message(WARNING "CURL not found, wxWebSessionBackendCURL won't be available")
wx_option_force_value(wxUSE_WEBREQUEST_CURL OFF)
endif()
endif()
include(CheckCSourceCompiles)
if(wxUSE_WEBREQUEST_WINHTTP)
check_c_source_compiles("#include <windows.h>
#include <winhttp.h>
int main(){return 0;}"
HAVE_WINHTTP_H)
if(NOT HAVE_WINHTTP_H)
message(WARNING "winhttp.h not found, wxWebSessionBackendWinHTTP won't be available")
wx_option_force_value(wxUSE_WEBREQUEST_WINHTTP OFF)
endif()
endif()
if (NOT(wxUSE_WEBREQUEST_WINHTTP OR wxUSE_WEBREQUEST_URLSESSION OR wxUSE_WEBREQUEST_CURL))
message(WARNING "wxUSE_WEBREQUEST requires at least one backend, it won't be available")
wx_option_force_value(wxUSE_WEBREQUEST OFF)
endif()
endif()
if(UNIX)
if(wxUSE_SECRETSTORE AND NOT APPLE)
# The required APIs are always available under MSW and OS X but we must
# have GNOME libsecret under Unix to be able to compile this class.
find_package(LIBSECRET)
if(NOT LIBSECRET_FOUND)
message(WARNING "libsecret not found, wxSecretStore won't be available")
wx_option_force_value(wxUSE_SECRETSTORE OFF)
endif()
endif()
if(wxUSE_LIBICONV)
find_package(ICONV)
if(NOT ICONV_FOUND)
message(WARNING "iconv not found")
wx_option_force_value(wxUSE_LIBICONV OFF)
endif()
endif()
if(wxBUILD_LARGEFILE_SUPPORT)
set(HAVE_LARGEFILE_SUPPORT ON)
endif()
endif(UNIX)
if(wxUSE_GUI)
if(WXMSW AND wxUSE_METAFILE)
# this one should probably be made separately configurable
set(wxUSE_ENH_METAFILE ON)
endif()
# Direct2D check
if(WIN32 AND wxUSE_GRAPHICS_DIRECT2D)
check_include_file(d2d1.h HAVE_D2D1_H)
if (NOT HAVE_D2D1_H)
wx_option_force_value(wxUSE_GRAPHICS_DIRECT2D OFF)
endif()
endif()
if(MSVC) # match setup.h
wx_option_force_value(wxUSE_GRAPHICS_DIRECT2D ${wxUSE_GRAPHICS_CONTEXT})
endif()
# WXQT checks
if(WXQT)
wx_option_force_value(wxUSE_WEBVIEW OFF)
wx_option_force_value(wxUSE_METAFILE OFF)
if(WIN32)
wx_option_force_value(wxUSE_ACCESSIBILITY OFF)
wx_option_force_value(wxUSE_OWNER_DRAWN OFF)
endif()
endif()
# WXGTK checks, match include/wx/gtk/chkconf.h
if(WXGTK)
wx_option_force_value(wxUSE_METAFILE OFF)
if(WIN32)
wx_option_force_value(wxUSE_CAIRO ON)
wx_option_force_value(wxUSE_ACCESSIBILITY OFF)
wx_option_force_value(wxUSE_OWNER_DRAWN OFF)
endif()
if(NOT UNIX)
wx_option_force_value(wxUSE_WEBVIEW OFF)
wx_option_force_value(wxUSE_MEDIACTRL OFF)
wx_option_force_value(wxUSE_UIACTIONSIMULATOR OFF)
wx_option_force_value(wxUSE_OPENGL OFF)
set(wxUSE_GLCANVAS OFF)
endif()
endif()
# extra dependencies
if(wxUSE_OPENGL)
if(WXOSX_IPHONE)
set(OPENGL_FOUND TRUE)
set(OPENGL_INCLUDE_DIR "")
set(OPENGL_LIBRARIES "-framework OpenGLES" "-framework QuartzCore" "-framework GLKit")
else()
find_package(OpenGL)
if(OPENGL_FOUND)
foreach(gltarget OpenGL::GL OpenGL::OpenGL)
if(TARGET ${gltarget})
set(OPENGL_LIBRARIES ${gltarget} ${OPENGL_LIBRARIES})
endif()
endforeach()
endif()
if(WXGTK3 AND OpenGL_EGL_FOUND AND wxUSE_GLCANVAS_EGL)
if(TARGET OpenGL::EGL)
set(OPENGL_LIBRARIES OpenGL::EGL ${OPENGL_LIBRARIES})
else()
# It's possible for OpenGL::EGL not to be set even when EGL
# is found, at least under Cygwin (see #23673), so use the
# library directly like this to avoid link problems.
set(OPENGL_LIBRARIES ${OPENGL_egl_LIBRARY} ${OPENGL_LIBRARIES})
endif()
set(OPENGL_INCLUDE_DIR ${OPENGL_INCLUDE_DIR} ${OPENGL_EGL_INCLUDE_DIRS})
find_package(WAYLANDEGL)
if(WAYLANDEGL_FOUND AND wxHAVE_GDK_WAYLAND)
list(APPEND OPENGL_LIBRARIES ${WAYLANDEGL_LIBRARIES})
endif()
endif()
endif()
if(NOT OPENGL_FOUND)
message(WARNING "opengl not found, wxGLCanvas won't be available")
wx_option_force_value(wxUSE_OPENGL OFF)
endif()
if(UNIX AND (NOT WXGTK3 OR NOT OpenGL_EGL_FOUND))
wx_option_force_value(wxUSE_GLCANVAS_EGL OFF)
endif()
endif()
if(wxUSE_WEBVIEW)
if(WXGTK)
if(wxUSE_WEBVIEW_WEBKIT)
set(WEBKIT_LIBSOUP_VERSION 2.4)
if(WXGTK2)
find_package(WEBKIT 1.0)
elseif(WXGTK3)
find_package(WEBKIT2 4.1 QUIET)
if(WEBKIT2_FOUND)
set(WEBKIT_LIBSOUP_VERSION 3.0)
else()
find_package(WEBKIT2 4.0)
endif()
if(NOT WEBKIT2_FOUND)
find_package(WEBKIT 3.0)
endif()
endif()
find_package(LIBSOUP ${WEBKIT_LIBSOUP_VERSION})
endif()
set(wxUSE_WEBVIEW_WEBKIT OFF)
set(wxUSE_WEBVIEW_WEBKIT2 OFF)
if(WEBKIT_FOUND AND LIBSOUP_FOUND)
set(wxUSE_WEBVIEW_WEBKIT ON)
elseif(WEBKIT2_FOUND AND LIBSOUP_FOUND)
set(wxUSE_WEBVIEW_WEBKIT2 ON)
elseif(NOT wxUSE_WEBVIEW_CHROMIUM)
message(WARNING "webkit or chromium not found or enabled, wxWebview won't be available")
wx_option_force_value(wxUSE_WEBVIEW OFF)
endif()
elseif(APPLE)
if(NOT wxUSE_WEBVIEW_WEBKIT AND NOT wxUSE_WEBVIEW_CHROMIUM)
message(WARNING "webkit and chromium not found or enabled, wxWebview won't be available")
wx_option_force_value(wxUSE_WEBVIEW OFF)
endif()
else()
set(wxUSE_WEBVIEW_WEBKIT OFF)
endif()
if(WXMSW AND NOT wxUSE_WEBVIEW_IE AND NOT wxUSE_WEBVIEW_EDGE AND NOT wxUSE_WEBVIEW_CHROMIUM)
message(WARNING "WebviewIE and WebviewEdge and WebviewChromium not found or enabled, wxWebview won't be available")
wx_option_force_value(wxUSE_WEBVIEW OFF)
endif()
if(wxUSE_WEBVIEW_CHROMIUM AND WIN32 AND NOT MSVC)
message(FATAL_ERROR "WebviewChromium libcef_dll_wrapper can only be built with MSVC")
endif()
if(wxUSE_WEBVIEW_CHROMIUM)
# CEF requires C++17: we trust CMAKE_CXX_STANDARD if it is defined,
# or the previously tested wxHAVE_CXX17 if the compiler supports C++17 anyway.
if(NOT (CMAKE_CXX_STANDARD GREATER_EQUAL 17 OR wxHAVE_CXX17))
# We shouldn't disable this option as it's disabled by default and
# if it is on, it means that CEF is meant to be used, but we can't
# continue either as libcef_dll_wrapper will fail to build
# (actually it may still succeed with CEF v116 which provided
# its own stand-in for std::in_place used in CEF headers, but
# not with the later versions, so just fail instead of trying
# to detect CEF version here, as even v116 officially only
# supports C++17 anyhow).
if (DEFINED CMAKE_CXX_STANDARD)
set(cxx17_error_details "configured to use C++${CMAKE_CXX_STANDARD}")
else()
set(cxx17_error_details "the compiler doesn't support C++17 by default and CMAKE_CXX_STANDARD is not set")
endif()
message(FATAL_ERROR "WebviewChromium requires at least C++17 but ${cxx17_error_details}")
endif()
endif()
endif()
set(wxWebviewInfo "enable wxWebview")
if(wxUSE_WEBVIEW)
if(wxUSE_WEBVIEW_WEBKIT)
list(APPEND webviewBackends "WebKit")
endif()
if(wxUSE_WEBVIEW_WEBKIT2)
list(APPEND webviewBackends "WebKit2")
endif()
if(wxUSE_WEBVIEW_EDGE)
if(wxUSE_WEBVIEW_EDGE_STATIC)
list(APPEND webviewBackends "Edge (static)")
else()
list(APPEND webviewBackends "Edge")
endif()
endif()
if(wxUSE_WEBVIEW_IE)
list(APPEND webviewBackends "IE")
endif()
if(wxUSE_WEBVIEW_CHROMIUM)
list(APPEND webviewBackends "Chromium")
endif()
string(REPLACE ";" ", " webviewBackends "${webviewBackends}")
set(wxWebviewInfo "${wxWebviewInfo} with ${webviewBackends}")
endif()
set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_WEBVIEW ${wxWebviewInfo})
if(wxUSE_PRIVATE_FONTS AND WXGTK)
find_package(FONTCONFIG)
find_package(PANGOFT2)
if(NOT FONTCONFIG_FOUND OR NOT PANGOFT2_FOUND)
message(WARNING "Fontconfig or PangoFT2 not found, Private fonts won't be available")
wx_option_force_value(wxUSE_PRIVATE_FONTS OFF)
endif()
endif()
if(wxUSE_MEDIACTRL AND WXGTK AND NOT APPLE AND NOT WIN32)
find_package(GSTREAMER 1.0 COMPONENTS video)
if(NOT GSTREAMER_FOUND)
find_package(GSTREAMER 0.10 COMPONENTS interfaces)
endif()
set(wxUSE_GSTREAMER ${GSTREAMER_FOUND})
set(wxUSE_GSTREAMER_PLAYER OFF)
if(GSTREAMER_PLAYER_INCLUDE_DIRS)
set(wxUSE_GSTREAMER_PLAYER ON)
endif()
if(NOT GSTREAMER_FOUND)
message(WARNING "GStreamer not found, wxMediaCtrl won't be available")
wx_option_force_value(wxUSE_MEDIACTRL OFF)
endif()
else()
set(wxUSE_GSTREAMER OFF)
set(wxUSE_GSTREAMER_PLAYER OFF)
endif()
if(wxUSE_SOUND AND wxUSE_LIBSDL AND UNIX AND NOT APPLE)
find_package(SDL2)
if(NOT SDL2_FOUND)
find_package(SDL)
endif()
if(NOT SDL2_FOUND AND NOT SDL_FOUND)
message(WARNING "SDL not found, SDL Audio back-end won't be available")
wx_option_force_value(wxUSE_LIBSDL OFF)
endif()
else()
set(wxUSE_LIBSDL OFF)
endif()
if(wxUSE_NOTIFICATION_MESSAGE AND UNIX AND WXGTK AND wxUSE_LIBNOTIFY)
find_package(LIBNOTIFY)
if(NOT LIBNOTIFY_FOUND)
message(WARNING "Libnotify not found, it won't be used for notifications")
wx_option_force_value(wxUSE_LIBNOTIFY OFF)
else()
if(NOT LIBNOTIFY_VERSION VERSION_LESS 0.7)
set(wxUSE_LIBNOTIFY_0_7 ON)
endif()
list(APPEND wxTOOLKIT_EXTRA "libnotify")
endif()
else()
set(wxUSE_LIBNOTIFY OFF)
endif()
if(wxUSE_UIACTIONSIMULATOR AND UNIX AND WXGTK)
if(wxUSE_XTEST)
find_package(XTEST)
if(XTEST_FOUND)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${XTEST_INCLUDE_DIRS})
list(APPEND wxTOOLKIT_LIBRARIES ${XTEST_LIBRARIES})
else()
if(WXGTK3)
# This class can't work without XTest with GTK+ 3
# which uses XInput2 and so ignores XSendEvent().
message(STATUS "XTest not found, wxUIActionSimulator won't be available")
wx_option_force_value(wxUSE_UIACTIONSIMULATOR OFF)
endif()
# The other ports can use XSendEvent(), so don't warn
wx_option_force_value(wxUSE_XTEST OFF)
endif()
else(WXGTK3)
# As per above, wxUIActionSimulator can't be used in this case,
# but there is no need to warn, presumably the user knows what
# he's doing if wxUSE_XTEST was explicitly disabled.
wx_option_force_value(wxUSE_UIACTIONSIMULATOR OFF)
endif()
endif()
if(wxUSE_HTML AND UNIX AND wxUSE_LIBMSPACK)
find_package(MSPACK)
if(NOT MSPACK_FOUND)
message(STATUS "libmspack not found")
wx_option_force_value(wxUSE_LIBMSPACK OFF)
endif()
else()
set(wxUSE_LIBMSPACK OFF)
endif()
if(WXGTK AND wxUSE_PRINTING_ARCHITECTURE AND wxUSE_GTKPRINT)
find_package(GTKPRINT ${wxTOOLKIT_VERSION})
if(GTKPRINT_FOUND)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${GTKPRINT_INCLUDE_DIRS})
list(APPEND wxTOOLKIT_EXTRA "GTK+ printing")
else()
message(STATUS "GTK printing support not found (GTK+ >= 2.10), library will use GNOME printing support or standard PostScript printing")
wx_option_force_value(wxUSE_GTKPRINT OFF)
endif()
else()
set(wxUSE_GTKPRINT OFF)
endif()
if(WXGTK AND wxUSE_MIMETYPE AND wxUSE_LIBGNOMEVFS)
find_package(GNOMEVFS2)
if(GNOMEVFS2_FOUND)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${GNOMEVFS2_INCLUDE_DIRS})
list(APPEND wxTOOLKIT_LIBRARIES ${GNOMEVFS2_LIBRARIES})
list(APPEND wxTOOLKIT_EXTRA "gnomevfs")
else()
message(STATUS "libgnomevfs not found, library won't be used to associate MIME type")
wx_option_force_value(wxUSE_LIBGNOMEVFS OFF)
endif()
else()
set(wxUSE_LIBGNOMEVFS OFF)
endif()
if(WXGTK3 AND wxUSE_SPELLCHECK)
find_package(GSPELL)
if(GSPELL_FOUND)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${GSPELL_INCLUDE_DIRS})
list(APPEND wxTOOLKIT_LIBRARIES ${GSPELL_LIBRARIES})
else()
message(STATUS "gspell-1 not found, spell checking in wxTextCtrl won't be available")
wx_option_force_value(wxUSE_SPELLCHECK OFF)
endif()
endif()
if(wxUSE_CAIRO AND NOT WXGTK)
find_package(Cairo)
if(NOT CAIRO_FOUND)
message(WARNING "Cairo not found, Cairo renderer won't be available")
wx_option_force_value(wxUSE_CAIRO OFF)
endif()
endif()
if(WXGTK AND NOT APPLE AND NOT WIN32)
find_package(XKBCommon)
if(XKBCOMMON_FOUND)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIRS})
list(APPEND wxTOOLKIT_LIBRARIES ${XKBCOMMON_LIBRARIES})
set(HAVE_XKBCOMMON ON)
else()
message(STATUS "libxkbcommon not found, key codes in key events may be incorrect")
endif()
endif()
endif(wxUSE_GUI)
# test if precompiled headers are supported using the cotire test project
if(DEFINED wxBUILD_PRECOMP_PREV AND NOT wxBUILD_PRECOMP STREQUAL wxBUILD_PRECOMP_PREV)
set(CLEAN_PRECOMP_TEST TRUE)
endif()
set(wxBUILD_PRECOMP_PREV ${wxBUILD_PRECOMP} CACHE INTERNAL "")
if((wxBUILD_PRECOMP STREQUAL "ON" AND CMAKE_VERSION VERSION_LESS "3.16") OR (wxBUILD_PRECOMP STREQUAL "COTIRE"))
if(DEFINED CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED)
set(try_flags "-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=${CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED}")
endif()
if (CLEAN_PRECOMP_TEST)
try_compile(RESULT_VAR_CLEAN
"${wxBINARY_DIR}/CMakeFiles/cotire_test"
"${wxSOURCE_DIR}/build/cmake/modules/cotire_test"
CotireExample clean_cotire
CMAKE_FLAGS ${try_flags}
)
endif()
try_compile(RESULT_VAR
"${wxBINARY_DIR}/CMakeFiles/cotire_test"
"${wxSOURCE_DIR}/build/cmake/modules/cotire_test"
CotireExample
CMAKE_FLAGS ${try_flags}
OUTPUT_VARIABLE OUTPUT_VAR
)
# check if output has precompiled header warnings. The build can still succeed, so check the output
# likely caused by gcc hardening: https://bugzilla.redhat.com/show_bug.cgi?id=1721553
# cc1plus: warning /path/to/project/cotire/name_CXX_prefix.hxx.gch: had text segment at different address
string(FIND "${OUTPUT_VAR}" "had text segment at different address" HAS_MESSAGE)
if(${HAS_MESSAGE} GREATER -1)
set(RESULT_VAR FALSE)
endif()
if(NOT RESULT_VAR)
message(WARNING "precompiled header (PCH) test failed, it will be turned off")
wx_option_force_value(wxBUILD_PRECOMP OFF)
else()
set(USE_COTIRE ON)
endif()
endif()

View File

@@ -0,0 +1,138 @@
#############################################################################
# Name: build/cmake/install.cmake
# Purpose: Install target CMake file
# Author: Tobias Taschner
# Created: 2016-10-17
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(NOT wxBUILD_INSTALL)
return()
endif()
install(CODE "message(STATUS \"Installing: Headers...\")")
foreach(header ${wxINSTALL_HEADERS})
get_filename_component(path "${header}" PATH)
install(
FILES "${wxSOURCE_DIR}/include/${header}"
DESTINATION "${wxINSTALL_INCLUDE_DIR}/${path}"
)
endforeach()
if(MSVC)
install(
DIRECTORY "${wxSOURCE_DIR}/include/msvc"
DESTINATION "${wxINSTALL_INCLUDE_DIR}"
)
install(
FILES "${wxSOURCE_DIR}/wxwidgets.props"
DESTINATION "."
)
install(
FILES "${wxSOURCE_DIR}/build/msw/wx_setup.props"
DESTINATION "build/msw"
)
endif()
# setup header and wx-config
if(WIN32_MSVC_NAMING)
# create both Debug and Release directories, so CMake doesn't complain about
# non-existent path when only Release or Debug build has been installed
set(lib_unicode "u")
install(DIRECTORY
DESTINATION "lib/${wxPLATFORM_LIB_DIR}/${wxBUILD_TOOLKIT}${lib_unicode}")
install(DIRECTORY
DESTINATION "lib/${wxPLATFORM_LIB_DIR}/${wxBUILD_TOOLKIT}${lib_unicode}d")
install(
DIRECTORY "${wxSETUP_HEADER_PATH}"
DESTINATION "lib/${wxPLATFORM_LIB_DIR}")
else()
install(
DIRECTORY "${wxSETUP_HEADER_PATH}"
DESTINATION "lib/wx/include")
install(
FILES "${wxOUTPUT_DIR}/wx/config/${wxBUILD_FILE_ID}"
DESTINATION "lib/wx/config"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
)
install(DIRECTORY DESTINATION "bin")
install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
\"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/wx/config/${wxBUILD_FILE_ID}\" \
\"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wx-config\" \
)"
)
endif()
install(EXPORT wxWidgetsTargets NAMESPACE wx:: DESTINATION "lib/cmake/wxWidgets/${wxPLATFORM_LIB_DIR}")
# find_package config file
include(CMakePackageConfigHelpers)
set(versionConfig "${wxOUTPUT_DIR}/wxWidgetsConfigVersion.cmake")
set(projectConfig "${wxOUTPUT_DIR}/wxWidgetsConfig.cmake")
if(CMAKE_VERSION VERSION_LESS "3.11")
set(versionCompat SameMajorVersion)
else()
set(versionCompat SameMinorVersion)
endif()
if(WIN32_MSVC_NAMING AND NOT CMAKE_VERSION VERSION_LESS "3.14")
set(archCompat ARCH_INDEPENDENT)
endif()
write_basic_package_version_file(
"${versionConfig}"
COMPATIBILITY ${versionCompat}
${archCompat}
)
configure_package_config_file(
"${wxSOURCE_DIR}/build/cmake/wxWidgetsConfig.cmake.in"
"${projectConfig}"
INSTALL_DESTINATION "lib/cmake/wxWidgets"
)
install(
FILES "${projectConfig}" "${versionConfig}"
DESTINATION "lib/cmake/wxWidgets"
)
# uninstall target
if(MSVC_IDE)
set(UNINST_NAME UNINSTALL)
else()
set(UNINST_NAME uninstall)
endif()
if(NOT TARGET ${UNINST_NAME})
# these symlinks are not included in the install manifest
set(WX_EXTRA_UNINSTALL_FILES)
if(NOT WIN32_MSVC_NAMING)
if(IPHONE)
set(EXE_SUFFIX ".app")
else()
set(EXE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX})
endif()
set(WX_EXTRA_UNINSTALL_FILES
"${CMAKE_INSTALL_PREFIX}/bin/wx-config"
"${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX}"
)
endif()
configure_file(
"${wxSOURCE_DIR}/build/cmake/uninstall.cmake.in"
"${wxBINARY_DIR}/uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(${UNINST_NAME}
COMMAND ${CMAKE_COMMAND} -P ${wxBINARY_DIR}/uninstall.cmake)
get_property(PREDEF_FOLDER GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER)
if(NOT PREDEF_FOLDER)
set(PREDEF_FOLDER "CMakePredefinedTargets")
endif()
set_target_properties(${UNINST_NAME} PROPERTIES FOLDER "${PREDEF_FOLDER}")
endif()

View File

@@ -0,0 +1,118 @@
#############################################################################
# Name: build/cmake/lib/CMakeLists.txt
# Purpose: Main lib CMake file
# Author: Tobias Taschner
# Created: 2016-10-14
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxBUILD_MONOLITHIC)
# Initialize variables for monolithic build
set(wxMONO_SRC_FILES)
set(wxMONO_LIBS_PRIVATE)
set(wxMONO_LIBS_PUBLIC)
set(wxMONO_DIRS_PRIVATE)
set(wxMONO_DIRS_PUBLIC)
set(wxMONO_INCLUDE_DIRS)
set(wxMONO_DEFINITIONS)
set(wxMONO_NONCOMPILED_CPP_FILES)
set(wxMONO_DEPENDENCIES)
endif()
# Define third party libraries
set(LIBS_THIRDPARTY regex zlib expat)
if(wxUSE_GUI)
list(APPEND LIBS_THIRDPARTY jpeg png tiff nanosvg webp)
endif()
foreach(LIB IN LISTS LIBS_THIRDPARTY)
include(${LIB}.cmake)
endforeach()
# add_opt_lib()
# Add library which may have been disabled by wxUSE_...
macro(add_opt_lib name)
set(add_lib ON)
foreach(var_name ${ARGN})
if(NOT ${var_name})
set(add_lib OFF)
endif()
endforeach()
if(add_lib)
list(APPEND LIBS ${name})
endif()
endmacro()
# Define base libraries
set(LIBS base)
add_opt_lib(net wxUSE_SOCKETS)
# Define UI libraries
if(wxUSE_GUI)
list(APPEND LIBS core adv)
foreach(lib
aui
html
propgrid
ribbon
richtext
webview
stc
xrc
)
string(TOUPPER ${lib} _name_upper)
add_opt_lib(${lib} wxUSE_${_name_upper})
endforeach()
add_opt_lib(media wxUSE_MEDIACTRL)
add_opt_lib(gl wxUSE_OPENGL)
add_opt_lib(qa wxUSE_DEBUGREPORT)
add_opt_lib(webview_chromium wxUSE_WEBVIEW wxUSE_WEBVIEW_CHROMIUM)
endif() # wxUSE_GUI
# Include XML library last
# In the monolithic build, where all target properties (include dirs) from different targets are concatenated,
# wxml might include system expat, which might use Mono, which has it's own copy of png.
# Thus to ensure wx's core library includes the right png class, core must be processed first before xml
add_opt_lib(xml wxUSE_XML)
# Include cmake file for every library
foreach(LIB ${LIBS})
add_subdirectory(${LIB})
endforeach()
if(wxBUILD_MONOLITHIC)
# Create monolithic library target
wx_add_library(wxmono IS_MONO ${wxMONO_SRC_FILES})
foreach(vis PRIVATE PUBLIC)
if(wxMONO_LIBS_${vis})
# Remove libs included in mono from list
foreach(lib IN LISTS LIBS)
list(REMOVE_ITEM wxMONO_LIBS_${vis} wx${lib})
endforeach()
target_link_libraries(wxmono ${vis} ${wxMONO_LIBS_${vis}})
endif()
if(wxMONO_DIRS_${vis})
target_link_directories(wxmono ${vis} ${wxMONO_DIRS_${vis}})
endif()
endforeach()
if(wxMONO_INCLUDE_DIRS)
target_include_directories(wxmono BEFORE PRIVATE ${wxMONO_INCLUDE_DIRS})
endif()
if(wxMONO_DEFINITIONS)
target_compile_definitions(wxmono PRIVATE ${wxMONO_DEFINITIONS})
endif()
foreach(file ${wxMONO_NONCOMPILED_CPP_FILES})
set_source_files_properties(${file} PROPERTIES HEADER_FILE_ONLY TRUE)
endforeach()
foreach(dep ${wxMONO_DEPENDENCIES})
add_dependencies(wxmono ${dep})
endforeach()
if(wxUSE_WEBVIEW)
wx_webview_copy_webview2_loader(wxmono)
endif()
endif()
# Propagate variable(s) to parent scope
set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE)
set(wxINSTALL_HEADERS ${wxINSTALL_HEADERS} PARENT_SCOPE)

View File

@@ -0,0 +1,10 @@
#############################################################################
# Name: build/cmake/lib/adv/CMakeLists.txt
# Purpose: CMake file for adv library
# Author: Tobias Taschner
# Created: 2016-10-03
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_add_library(wxadv "${wxSOURCE_DIR}/src/common/dummy.cpp")

View File

@@ -0,0 +1,18 @@
#############################################################################
# Name: build/cmake/lib/aui/CMakeLists.txt
# Purpose: CMake file for aui library
# Author: Tobias Taschner
# Created: 2016-10-04
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(AUI_FILES AUI_CMN)
if(WXMSW)
wx_append_sources(AUI_FILES AUI_MSW)
elseif(WXGTK2)
wx_append_sources(AUI_FILES AUI_GTK)
endif()
wx_add_library(wxaui ${AUI_FILES})

View File

@@ -0,0 +1,74 @@
#############################################################################
# Name: build/cmake/lib/base/CMakeLists.txt
# Purpose: CMake file for base library
# Author: Tobias Taschner
# Created: 2016-09-20
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(BASE_FILES BASE_CMN)
wx_append_sources(BASE_FILES BASE_AND_GUI_CMN)
if(WIN32)
wx_append_sources(BASE_FILES BASE_WIN32)
wx_append_sources(BASE_FILES BASE_AND_GUI_WIN32)
elseif(APPLE)
if(WXOSX_COCOA OR WXOSX_IPHONE)
wx_append_sources(BASE_FILES BASE_OSX_SHARED)
if(WXOSX_COCOA)
wx_append_sources(BASE_FILES BASE_AND_GUI_OSX_COCOA)
endif()
else()
wx_append_sources(BASE_FILES BASE_OSX_NOTWXMAC)
endif()
elseif(UNIX)
wx_append_sources(BASE_FILES BASE_UNIX)
endif()
wx_add_library(wxbase IS_BASE ${BASE_FILES})
if(wxUSE_ZLIB)
wx_lib_include_directories(wxbase ${ZLIB_INCLUDE_DIRS})
wx_lib_link_libraries(wxbase PRIVATE ${ZLIB_LIBRARIES})
endif()
if(wxUSE_REGEX)
wx_lib_include_directories(wxbase ${REGEX_INCLUDE_DIRS})
wx_lib_link_libraries(wxbase PRIVATE ${REGEX_LIBRARIES})
endif()
if(wxUSE_LIBLZMA)
wx_lib_include_directories(wxbase ${LIBLZMA_INCLUDE_DIRS})
wx_lib_link_libraries(wxbase PRIVATE ${LIBLZMA_LIBRARIES})
endif()
if(UNIX AND wxUSE_SECRETSTORE)
wx_lib_include_directories(wxbase ${LIBSECRET_INCLUDE_DIRS})
# Avoid linking with libsecret-1.so directly, we load this
# library dynamically in wxSecretStoreLibSecretImpl to avoid
# requiring it being installed on the target system.
list(REMOVE_ITEM LIBSECRET_LIBRARIES secret-1)
wx_lib_link_libraries(wxbase PRIVATE ${LIBSECRET_LIBRARIES})
endif()
if(wxUSE_LIBICONV)
wx_lib_include_directories(wxbase ${ICONV_INCLUDE_DIR})
wx_lib_link_libraries(wxbase PRIVATE ${ICONV_LIBRARIES})
endif()
if(APPLE)
wx_lib_link_libraries(wxbase
PUBLIC
"-framework CoreFoundation"
)
if(WXOSX_COCOA)
wx_lib_link_libraries(wxbase
PRIVATE
"-framework Security"
PUBLIC
"-framework Carbon"
"-framework Cocoa"
"-framework IOKit"
"-framework QuartzCore"
)
endif()
elseif(UNIX)
wx_lib_link_libraries(wxbase PRIVATE ${CMAKE_DL_LIBS})
endif()

View File

@@ -0,0 +1,115 @@
#############################################################################
# Name: build/cmake/lib/core/CMakeLists.txt
# Purpose: CMake file for core library
# Author: Tobias Taschner
# Created: 2016-10-01
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(CORE_SRC GUI_CMN)
wx_append_sources(CORE_SRC BASE_AND_GUI_CMN)
if(WIN32)
wx_append_sources(CORE_SRC BASE_AND_GUI_WIN32)
elseif(UNIX)
wx_append_sources(CORE_SRC UNIX)
if(wxUSE_LIBSDL)
wx_append_sources(CORE_SRC UNIX_SOUND_SDL)
endif()
endif()
if(WXMSW)
wx_append_sources(CORE_SRC MSW_LOWLEVEL)
wx_append_sources(CORE_SRC MSW)
if(NOT wxUSE_OLE)
wx_list_add_prefix(CORE_SRC "${wxSOURCE_DIR}/" "src/generic/dirdlgg.cpp")
endif()
elseif(WXGTK)
if(WXGTK2)
set(GTK2_LOWLEVEL_HDR ${GTK_LOWLEVEL_HDR})
wx_append_sources(CORE_SRC GTK2_LOWLEVEL)
wx_append_sources(CORE_SRC GTK2)
else()
wx_append_sources(CORE_SRC GTK_LOWLEVEL)
wx_append_sources(CORE_SRC GTK)
endif()
if(UNIX)
wx_append_sources(CORE_SRC XWIN_LOWLEVEL)
elseif(WIN32)
wx_append_sources(CORE_SRC GTK_WIN32)
endif()
elseif(WXOSX_COCOA)
wx_append_sources(CORE_SRC BASE_AND_GUI_OSX_COCOA)
wx_append_sources(CORE_SRC OSX_LOWLEVEL)
wx_append_sources(CORE_SRC OSX_SHARED)
wx_append_sources(CORE_SRC OSX_COCOA)
elseif(WXOSX_IPHONE)
wx_append_sources(CORE_SRC OSX_LOWLEVEL)
wx_append_sources(CORE_SRC OSX_SHARED)
wx_append_sources(CORE_SRC OSX_IPHONE)
elseif(WXQT)
wx_append_sources(CORE_SRC QT)
if(UNIX)
wx_append_sources(CORE_SRC QT_UNIX)
elseif(WIN32)
wx_append_sources(CORE_SRC QT_WIN32)
endif()
elseif(WXX11)
wx_append_sources(CORE_SRC X11_LOWLEVEL)
endif()
wx_add_library(wxcore ${CORE_SRC})
foreach(lib JPEG PNG TIFF NANOSVG WebP)
if(${lib}_LIBRARIES)
wx_lib_link_libraries(wxcore PRIVATE ${${lib}_LIBRARIES})
endif()
if(${lib}_INCLUDE_DIRS)
wx_lib_include_directories(wxcore ${${lib}_INCLUDE_DIRS})
elseif(${lib}_INCLUDE_DIR)
wx_lib_include_directories(wxcore ${${lib}_INCLUDE_DIR})
endif()
endforeach()
if(wxUSE_NANOSVG STREQUAL "sys" AND wxUSE_NANOSVG_EXTERNAL_ENABLE_IMPL)
wx_lib_compile_definitions(wxcore wxUSE_NANOSVG_EXTERNAL_ENABLE_IMPL)
endif()
if(WIN32)
wx_lib_link_libraries(wxcore PRIVATE winmm)
endif()
if(WXOSX_COCOA)
wx_lib_link_libraries(wxcore PUBLIC "-framework AudioToolbox")
if(wxUSE_WEBVIEW)
wx_lib_link_libraries(wxcore PUBLIC "-framework WebKit")
endif()
endif()
if(WXOSX_IPHONE)
wx_lib_link_libraries(wxcore
PUBLIC
"-framework AudioToolbox"
"-framework CoreGraphics"
"-framework CoreText"
"-framework UIKit"
)
endif()
if(WXGTK AND wxUSE_PRIVATE_FONTS)
wx_lib_include_directories(wxcore ${FONTCONFIG_INCLUDE_DIRS} ${PANGOFT2_INCLUDE_DIRS})
wx_lib_link_libraries(wxcore PUBLIC ${FONTCONFIG_LIBRARIES} ${PANGOFT2_LIBRARIES})
endif()
if(wxUSE_LIBSDL)
if(SDL2_FOUND)
wx_lib_include_directories(wxcore ${SDL2_INCLUDE_DIR})
wx_lib_link_libraries(wxcore PUBLIC ${SDL2_LIBRARY})
elseif(SDL_FOUND)
wx_lib_include_directories(wxcore ${SDL_INCLUDE_DIR})
wx_lib_link_libraries(wxcore PUBLIC ${SDL_LIBRARY})
endif()
endif()
if(wxUSE_LIBNOTIFY)
wx_lib_include_directories(wxcore ${LIBNOTIFY_INCLUDE_DIRS})
wx_lib_link_libraries(wxcore PUBLIC ${LIBNOTIFY_LIBRARIES})
endif()
if(wxUSE_CAIRO AND NOT WXGTK)
wx_lib_include_directories(wxcore ${CAIRO_INCLUDE_DIRS})
# no libs, cairo is loaded dynamically
endif()

View File

@@ -0,0 +1,22 @@
#############################################################################
# Name: build/cmake/lib/expat.cmake
# Purpose: Use external or internal expat lib
# Author: Tobias Taschner
# Created: 2016-09-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_EXPAT STREQUAL "builtin")
# TODO: implement building expat via its CMake file, using
# add_subdirectory or ExternalProject_Add
wx_add_builtin_library(wxexpat
src/expat/expat/lib/xmlparse.c
src/expat/expat/lib/xmlrole.c
src/expat/expat/lib/xmltok.c
)
set(EXPAT_LIBRARIES wxexpat)
set(EXPAT_INCLUDE_DIRS ${wxSOURCE_DIR}/src/expat/expat/lib)
elseif(wxUSE_EXPAT)
find_package(EXPAT REQUIRED)
endif()

View File

@@ -0,0 +1,28 @@
#############################################################################
# Name: build/cmake/lib/gl/CMakeLists.txt
# Purpose: CMake file for gl library
# Author: Tobias Taschner
# Created: 2016-10-03
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(GL_FILES OPENGL_CMN)
if(WXMSW)
wx_append_sources(GL_FILES OPENGL_MSW)
elseif(WXGTK)
wx_append_sources(GL_FILES OPENGL_GTK)
elseif(WXOSX_COCOA)
wx_append_sources(GL_FILES OPENGL_OSX_COCOA)
elseif(WXOSX_IPHONE)
wx_append_sources(GL_FILES OPENGL_OSX_IPHONE)
elseif(WXQT)
wx_append_sources(GL_FILES OPENGL_QT)
elseif(WXX11)
wx_append_sources(GL_FILES OPENGL_X11)
endif()
wx_add_library(wxgl ${GL_FILES})
wx_lib_include_directories(wxgl ${OPENGL_INCLUDE_DIR})
wx_lib_link_libraries(wxgl PUBLIC ${OPENGL_LIBRARIES})

View File

@@ -0,0 +1,21 @@
#############################################################################
# Name: build/cmake/lib/html/CMakeLists.txt
# Purpose: CMake file for html library
# Author: Tobias Taschner
# Created: 2016-10-03
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(HTML_FILES HTML_CMN)
if(WXMSW)
wx_append_sources(HTML_FILES HTML_MSW)
endif()
wx_add_library(wxhtml ${HTML_FILES})
if(wxUSE_LIBMSPACK)
wx_lib_include_directories(wxhtml ${MSPACK_INCLUDE_DIRS})
wx_lib_link_libraries(wxhtml PRIVATE ${MSPACK_LIBRARIES})
endif()

View File

@@ -0,0 +1,67 @@
#############################################################################
# Name: build/cmake/lib/jpeg.cmake
# Purpose: Use external or internal libjpeg
# Author: Tobias Taschner
# Created: 2016-09-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_LIBJPEG STREQUAL "builtin")
wx_add_builtin_library(wxjpeg
src/jpeg/jaricom.c
src/jpeg/jcapimin.c
src/jpeg/jcapistd.c
src/jpeg/jcarith.c
src/jpeg/jccoefct.c
src/jpeg/jccolor.c
src/jpeg/jcdctmgr.c
src/jpeg/jchuff.c
src/jpeg/jcinit.c
src/jpeg/jcmainct.c
src/jpeg/jcmarker.c
src/jpeg/jcmaster.c
src/jpeg/jcomapi.c
src/jpeg/jcparam.c
src/jpeg/jcprepct.c
src/jpeg/jcsample.c
src/jpeg/jctrans.c
src/jpeg/jdapimin.c
src/jpeg/jdapistd.c
src/jpeg/jdarith.c
src/jpeg/jdatadst.c
src/jpeg/jdatasrc.c
src/jpeg/jdcoefct.c
src/jpeg/jdcolor.c
src/jpeg/jddctmgr.c
src/jpeg/jdhuff.c
src/jpeg/jdinput.c
src/jpeg/jdmainct.c
src/jpeg/jdmarker.c
src/jpeg/jdmaster.c
src/jpeg/jdmerge.c
src/jpeg/jdpostct.c
src/jpeg/jdsample.c
src/jpeg/jdtrans.c
src/jpeg/jerror.c
src/jpeg/jfdctflt.c
src/jpeg/jfdctfst.c
src/jpeg/jfdctint.c
src/jpeg/jidctflt.c
src/jpeg/jidctfst.c
src/jpeg/jidctint.c
src/jpeg/jmemmgr.c
src/jpeg/jmemnobs.c
src/jpeg/jquant1.c
src/jpeg/jquant2.c
src/jpeg/jutils.c
)
target_include_directories(wxjpeg
BEFORE PRIVATE
${wxSETUP_HEADER_PATH}
)
set(JPEG_LIBRARIES wxjpeg)
set(JPEG_INCLUDE_DIR ${wxSOURCE_DIR}/src/jpeg)
elseif(wxUSE_LIBJPEG)
find_package(JPEG REQUIRED)
endif()

View File

@@ -0,0 +1,56 @@
#############################################################################
# Name: build/cmake/lib/media/CMakeLists.txt
# Purpose: CMake file for media library
# Author: Tobias Taschner
# Created: 2016-10-03
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(MEDIA_FILES MEDIA_CMN)
if(WXMSW)
wx_append_sources(MEDIA_FILES MEDIA_MSW)
elseif(WXOSX_COCOA)
wx_append_sources(MEDIA_FILES MEDIA_OSX_COCOA)
elseif(WXOSX_IPHONE)
wx_append_sources(MEDIA_FILES MEDIA_OSX_IPHONE)
elseif(WXGTK)
wx_append_sources(MEDIA_FILES MEDIA_UNIX)
wx_append_sources(MEDIA_FILES MEDIA_GTK)
elseif(WXQT)
wx_append_sources(MEDIA_FILES MEDIA_QT)
elseif(WXX11)
wx_append_sources(MEDIA_FILES MEDIA_UNIX)
endif()
wx_add_library(wxmedia ${MEDIA_FILES})
if(WXOSX)
wx_lib_link_libraries(wxmedia PUBLIC
"-framework AVFoundation"
"-framework CoreMedia"
"-weak_framework AVKit"
)
elseif(WXGTK)
wx_lib_include_directories(wxmedia ${GSTREAMER_INCLUDE_DIRS})
if(GSTREAMER_INTERFACES_INCLUDE_DIRS)
wx_lib_include_directories(wxmedia ${GSTREAMER_INTERFACES_INCLUDE_DIRS})
endif()
if(GSTREAMER_VIDEO_INCLUDE_DIRS)
wx_lib_include_directories(wxmedia ${GSTREAMER_VIDEO_INCLUDE_DIRS})
endif()
if(GSTREAMER_PLAYER_INCLUDE_DIRS)
wx_lib_include_directories(wxmedia ${GSTREAMER_PLAYER_INCLUDE_DIRS})
endif()
wx_lib_link_libraries(wxmedia PUBLIC ${GSTREAMER_LIBRARIES})
if(GSTREAMER_INTERFACES_LIBRARIES)
wx_lib_link_libraries(wxmedia PUBLIC ${GSTREAMER_INTERFACES_LIBRARIES})
endif()
if(GSTREAMER_VIDEO_LIBRARIES)
wx_lib_link_libraries(wxmedia PUBLIC ${GSTREAMER_VIDEO_LIBRARIES})
endif()
if(GSTREAMER_PLAYER_LIBRARIES)
wx_lib_link_libraries(wxmedia PUBLIC ${GSTREAMER_PLAYER_LIBRARIES})
endif()
endif()

View File

@@ -0,0 +1,39 @@
#############################################################################
# Name: build/cmake/lib/nanosvg.cmake
# Purpose: Use external or internal nanosvg lib
# Author: Tamas Meszaros, Maarten Bent
# Created: 2022-05-05
# Copyright: (c) 2022 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_NANOSVG STREQUAL "builtin")
set(wxUSE_NANOSVG_EXTERNAL 0 PARENT_SCOPE)
elseif(wxUSE_NANOSVG)
set(wxUSE_NANOSVG_EXTERNAL 1 PARENT_SCOPE)
set(NANOSVG_LIBRARIES )
set(NANOSVG_INCLUDE_DIRS )
set(wxUSE_NANOSVG_EXTERNAL_ENABLE_IMPL TRUE)
find_package(NanoSVG REQUIRED)
foreach(TARGETNAME NanoSVG::nanosvg NanoSVG::nanosvgrast unofficial::nanosvg)
if(NOT TARGET ${TARGETNAME})
continue()
endif()
list(APPEND NANOSVG_LIBRARIES ${TARGETNAME})
get_target_property(svg_incl_dir ${TARGETNAME} INTERFACE_INCLUDE_DIRECTORIES)
if(svg_incl_dir)
list(APPEND NANOSVG_INCLUDE_DIRS ${svg_incl_dir})
endif()
get_target_property(svg_lib_d ${TARGETNAME} IMPORTED_LOCATION_DEBUG)
get_target_property(svg_lib_r ${TARGETNAME} IMPORTED_LOCATION_RELEASE)
get_target_property(svg_lib ${TARGETNAME} IMPORTED_LOCATION)
if(svg_lib_d OR svg_lib_r OR svg_lib)
set(wxUSE_NANOSVG_EXTERNAL_ENABLE_IMPL FALSE)
endif()
endforeach()
endif()

View File

@@ -0,0 +1,35 @@
#############################################################################
# Name: build/cmake/lib/net/CMakeLists.txt
# Purpose: CMake file for net library
# Author: Tobias Taschner
# Created: 2016-09-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(NET_FILES NET_CMN)
if(WIN32)
wx_append_sources(NET_FILES NET_WIN32)
elseif(APPLE)
wx_append_sources(NET_FILES NET_OSX)
endif()
if(UNIX AND NOT WIN32)
wx_append_sources(NET_FILES NET_UNIX)
endif()
wx_add_library(wxnet IS_BASE ${NET_FILES})
if(WIN32)
wx_lib_link_libraries(wxnet PRIVATE ws2_32)
if(wxUSE_WEBREQUEST_WINHTTP)
wx_lib_link_libraries(wxnet PRIVATE winhttp)
endif()
endif()
if (wxUSE_WEBREQUEST_CURL)
wx_lib_include_directories(wxnet ${CURL_INCLUDE_DIRS})
wx_lib_link_libraries(wxnet PUBLIC ${CURL_LIBRARIES})
endif()

View File

@@ -0,0 +1,58 @@
#############################################################################
# Name: build/cmake/lib/png.cmake
# Purpose: Use external or internal libpng
# Author: Tobias Taschner
# Created: 2016-09-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_LIBPNG STREQUAL "builtin")
# TODO: implement building libpng via its CMake file, using
# add_subdirectory or ExternalProject_Add
if(NOT MSVC)
set(PNG_EXTRA_SOURCES
src/png/mips/filter_msa_intrinsics.c
src/png/mips/mips_init.c
src/png/powerpc/filter_vsx_intrinsics.c
src/png/powerpc/powerpc_init.c
)
endif()
wx_add_builtin_library(wxpng
src/png/png.c
src/png/pngerror.c
src/png/pngget.c
src/png/pngmem.c
src/png/pngpread.c
src/png/pngread.c
src/png/pngrio.c
src/png/pngrtran.c
src/png/pngrutil.c
src/png/pngset.c
src/png/pngtrans.c
src/png/pngwio.c
src/png/pngwrite.c
src/png/pngwtran.c
src/png/pngwutil.c
src/png/arm/arm_init.c
src/png/arm/filter_neon_intrinsics.c
src/png/arm/palette_neon_intrinsics.c
src/png/intel/intel_init.c
src/png/intel/filter_sse2_intrinsics.c
${PNG_EXTRA_SOURCES}
)
if(WIN32)
# define this to get rid of a warning about using POSIX lfind():
# confusingly enough, we do define lfind as _lfind for MSVC but
# doing this results in a just more confusing warning, see:
# http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101278
target_compile_definitions(wxpng PRIVATE _CRT_NONSTDC_NO_WARNINGS)
endif()
target_compile_definitions(wxpng PRIVATE PNG_INTEL_SSE)
target_include_directories(wxpng PRIVATE ${ZLIB_INCLUDE_DIRS})
target_link_libraries(wxpng PRIVATE ${ZLIB_LIBRARIES})
set(PNG_LIBRARIES wxpng)
set(PNG_INCLUDE_DIRS ${wxSOURCE_DIR}/src/png)
elseif(wxUSE_LIBPNG)
find_package(PNG REQUIRED)
endif()

View File

@@ -0,0 +1,12 @@
#############################################################################
# Name: build/cmake/lib/propgrid/CMakeLists.txt
# Purpose: CMake file for propgrid library
# Author: Tobias Taschner
# Created: 2016-10-04
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(PROPGRID_FILES PROPGRID)
wx_add_library(wxpropgrid ${PROPGRID_FILES})

View File

@@ -0,0 +1,13 @@
#############################################################################
# Name: build/cmake/lib/qa/CMakeLists.txt
# Purpose: CMake file for qa library
# Author: Tobias Taschner
# Created: 2016-10-03
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(QA_FILES QA)
wx_add_library(wxqa ${QA_FILES})
wx_lib_link_libraries(wxqa PUBLIC wxxml)

View File

@@ -0,0 +1,52 @@
#############################################################################
# Name: build/cmake/lib/regex.cmake
# Purpose: Use external or internal regex lib
# Author: Tobias Taschner
# Created: 2016-09-25
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_REGEX STREQUAL "builtin")
# TODO: implement building PCRE2 via its CMake file, using
# add_subdirectory or ExternalProject_Add
wx_add_builtin_library(wxregex
3rdparty/pcre/src/pcre2_auto_possess.c
3rdparty/pcre/src/pcre2_chkdint.c
3rdparty/pcre/src/pcre2_compile.c
3rdparty/pcre/src/pcre2_compile_class.c
3rdparty/pcre/src/pcre2_config.c
3rdparty/pcre/src/pcre2_context.c
3rdparty/pcre/src/pcre2_convert.c
3rdparty/pcre/src/pcre2_dfa_match.c
3rdparty/pcre/src/pcre2_error.c
3rdparty/pcre/src/pcre2_extuni.c
3rdparty/pcre/src/pcre2_find_bracket.c
3rdparty/pcre/src/pcre2_jit_compile.c
3rdparty/pcre/src/pcre2_maketables.c
3rdparty/pcre/src/pcre2_match.c
3rdparty/pcre/src/pcre2_match_data.c
3rdparty/pcre/src/pcre2_newline.c
3rdparty/pcre/src/pcre2_ord2utf.c
3rdparty/pcre/src/pcre2_pattern_info.c
3rdparty/pcre/src/pcre2_script_run.c
3rdparty/pcre/src/pcre2_serialize.c
3rdparty/pcre/src/pcre2_string_utils.c
3rdparty/pcre/src/pcre2_study.c
3rdparty/pcre/src/pcre2_substitute.c
3rdparty/pcre/src/pcre2_substring.c
3rdparty/pcre/src/pcre2_tables.c
3rdparty/pcre/src/pcre2_ucd.c
3rdparty/pcre/src/pcre2_valid_utf.c
3rdparty/pcre/src/pcre2_xclass.c
3rdparty/pcre/src/pcre2_chartables.c
)
set(REGEX_LIBRARIES wxregex)
set(REGEX_INCLUDE_DIRS ${wxSOURCE_DIR}/3rdparty/pcre/src/wx)
target_compile_definitions(wxregex PRIVATE __WX__ HAVE_CONFIG_H)
target_include_directories(wxregex PRIVATE ${wxSETUP_HEADER_PATH} ${wxSOURCE_DIR}/include ${REGEX_INCLUDE_DIRS})
elseif(wxUSE_REGEX)
find_package(PCRE2 REQUIRED)
set(REGEX_LIBRARIES ${PCRE2_LIBRARIES})
set(REGEX_INCLUDE_DIRS ${PCRE2_INCLUDE_DIRS})
endif()

View File

@@ -0,0 +1,12 @@
#############################################################################
# Name: build/cmake/lib/ribbon/CMakeLists.txt
# Purpose: CMake file for ribbon library
# Author: Tobias Taschner
# Created: 2016-10-04
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(RIBBON_FILES RIBBON)
wx_add_library(wxribbon ${RIBBON_FILES})

View File

@@ -0,0 +1,13 @@
#############################################################################
# Name: build/cmake/lib/richtext/CMakeLists.txt
# Purpose: CMake file for richtext library
# Author: Tobias Taschner
# Created: 2016-10-04
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(RICHTEXT_FILES RICHTEXT)
wx_add_library(wxrichtext ${RICHTEXT_FILES})
wx_lib_link_libraries(wxrichtext PRIVATE wxhtml wxxml)

View File

@@ -0,0 +1,31 @@
#############################################################################
# Name: build/cmake/lib/stc/CMakeLists.txt
# Purpose: CMake file for stc library
# Author: Tobias Taschner
# Created: 2016-10-04
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
include(scintilla.cmake)
include(lexilla.cmake)
wx_append_sources(STC_FILES STC_CMN)
if(WXOSX_COCOA)
wx_append_sources(STC_FILES STC_OSX_COCOA)
endif()
wx_add_library(wxstc ${STC_FILES})
get_target_property(SCINTILLA_INCLUDE wxscintilla INCLUDE_DIRECTORIES)
get_target_property(LEXILLA_INCLUDE wxlexilla INCLUDE_DIRECTORIES)
wx_lib_include_directories(wxstc PRIVATE ${SCINTILLA_INCLUDE} ${LEXILLA_INCLUDE})
get_target_property(SCINTILLA_DEFINITIONS wxscintilla COMPILE_DEFINITIONS)
get_target_property(LEXILLA_DEFINITIONS wxlexilla COMPILE_DEFINITIONS)
wx_lib_compile_definitions(wxstc PRIVATE ${SCINTILLA_DEFINITIONS} ${LEXILLA_DEFINITIONS})
wx_lib_link_libraries(wxstc PRIVATE wxscintilla wxlexilla)
if(WXMSW)
wx_lib_link_libraries(wxstc PRIVATE imm32)
endif()

View File

@@ -0,0 +1,187 @@
#############################################################################
# Name: build/cmake/lib/stc/lexilla.cmake
# Purpose: CMake file for Lexilla library
# Author: Maarten Bent
# Created: 2022-12-28
# Copyright: (c) 2022 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
include(../../source_groups.cmake)
set(LEXILLA_SRC_DIR src/stc/lexilla)
wx_add_builtin_library(wxlexilla
${LEXILLA_SRC_DIR}/access/LexillaAccess.cxx
${LEXILLA_SRC_DIR}/access/LexillaAccess.h
${LEXILLA_SRC_DIR}/include/Lexilla.h
${LEXILLA_SRC_DIR}/include/LexillaCompat.h
${LEXILLA_SRC_DIR}/include/SciLexer.h
${LEXILLA_SRC_DIR}/lexers/LexA68k.cxx
${LEXILLA_SRC_DIR}/lexers/LexAPDL.cxx
${LEXILLA_SRC_DIR}/lexers/LexASY.cxx
${LEXILLA_SRC_DIR}/lexers/LexAU3.cxx
${LEXILLA_SRC_DIR}/lexers/LexAVE.cxx
${LEXILLA_SRC_DIR}/lexers/LexAVS.cxx
${LEXILLA_SRC_DIR}/lexers/LexAbaqus.cxx
${LEXILLA_SRC_DIR}/lexers/LexAda.cxx
${LEXILLA_SRC_DIR}/lexers/LexAsciidoc.cxx
${LEXILLA_SRC_DIR}/lexers/LexAsm.cxx
${LEXILLA_SRC_DIR}/lexers/LexAsn1.cxx
${LEXILLA_SRC_DIR}/lexers/LexBaan.cxx
${LEXILLA_SRC_DIR}/lexers/LexBash.cxx
${LEXILLA_SRC_DIR}/lexers/LexBasic.cxx
${LEXILLA_SRC_DIR}/lexers/LexBatch.cxx
${LEXILLA_SRC_DIR}/lexers/LexBibTeX.cxx
${LEXILLA_SRC_DIR}/lexers/LexBullant.cxx
${LEXILLA_SRC_DIR}/lexers/LexCIL.cxx
${LEXILLA_SRC_DIR}/lexers/LexCLW.cxx
${LEXILLA_SRC_DIR}/lexers/LexCOBOL.cxx
${LEXILLA_SRC_DIR}/lexers/LexCPP.cxx
${LEXILLA_SRC_DIR}/lexers/LexCSS.cxx
${LEXILLA_SRC_DIR}/lexers/LexCaml.cxx
${LEXILLA_SRC_DIR}/lexers/LexCmake.cxx
${LEXILLA_SRC_DIR}/lexers/LexCoffeeScript.cxx
${LEXILLA_SRC_DIR}/lexers/LexConf.cxx
${LEXILLA_SRC_DIR}/lexers/LexCrontab.cxx
${LEXILLA_SRC_DIR}/lexers/LexCsound.cxx
${LEXILLA_SRC_DIR}/lexers/LexD.cxx
${LEXILLA_SRC_DIR}/lexers/LexDMAP.cxx
${LEXILLA_SRC_DIR}/lexers/LexDMIS.cxx
${LEXILLA_SRC_DIR}/lexers/LexDart.cxx
${LEXILLA_SRC_DIR}/lexers/LexDataflex.cxx
${LEXILLA_SRC_DIR}/lexers/LexDiff.cxx
${LEXILLA_SRC_DIR}/lexers/LexECL.cxx
${LEXILLA_SRC_DIR}/lexers/LexEDIFACT.cxx
${LEXILLA_SRC_DIR}/lexers/LexEScript.cxx
${LEXILLA_SRC_DIR}/lexers/LexEiffel.cxx
${LEXILLA_SRC_DIR}/lexers/LexErlang.cxx
${LEXILLA_SRC_DIR}/lexers/LexErrorList.cxx
${LEXILLA_SRC_DIR}/lexers/LexFSharp.cxx
${LEXILLA_SRC_DIR}/lexers/LexFlagship.cxx
${LEXILLA_SRC_DIR}/lexers/LexForth.cxx
${LEXILLA_SRC_DIR}/lexers/LexFortran.cxx
${LEXILLA_SRC_DIR}/lexers/LexGAP.cxx
${LEXILLA_SRC_DIR}/lexers/LexGDScript.cxx
${LEXILLA_SRC_DIR}/lexers/LexGui4Cli.cxx
${LEXILLA_SRC_DIR}/lexers/LexHTML.cxx
${LEXILLA_SRC_DIR}/lexers/LexHaskell.cxx
${LEXILLA_SRC_DIR}/lexers/LexHex.cxx
${LEXILLA_SRC_DIR}/lexers/LexHollywood.cxx
${LEXILLA_SRC_DIR}/lexers/LexIndent.cxx
${LEXILLA_SRC_DIR}/lexers/LexInno.cxx
${LEXILLA_SRC_DIR}/lexers/LexJSON.cxx
${LEXILLA_SRC_DIR}/lexers/LexJulia.cxx
${LEXILLA_SRC_DIR}/lexers/LexKVIrc.cxx
${LEXILLA_SRC_DIR}/lexers/LexKix.cxx
${LEXILLA_SRC_DIR}/lexers/LexLaTeX.cxx
${LEXILLA_SRC_DIR}/lexers/LexLisp.cxx
${LEXILLA_SRC_DIR}/lexers/LexLout.cxx
${LEXILLA_SRC_DIR}/lexers/LexLua.cxx
${LEXILLA_SRC_DIR}/lexers/LexMMIXAL.cxx
${LEXILLA_SRC_DIR}/lexers/LexMPT.cxx
${LEXILLA_SRC_DIR}/lexers/LexMSSQL.cxx
${LEXILLA_SRC_DIR}/lexers/LexMagik.cxx
${LEXILLA_SRC_DIR}/lexers/LexMake.cxx
${LEXILLA_SRC_DIR}/lexers/LexMarkdown.cxx
${LEXILLA_SRC_DIR}/lexers/LexMatlab.cxx
${LEXILLA_SRC_DIR}/lexers/LexMaxima.cxx
${LEXILLA_SRC_DIR}/lexers/LexMetapost.cxx
${LEXILLA_SRC_DIR}/lexers/LexModula.cxx
${LEXILLA_SRC_DIR}/lexers/LexMySQL.cxx
${LEXILLA_SRC_DIR}/lexers/LexNim.cxx
${LEXILLA_SRC_DIR}/lexers/LexNimrod.cxx
${LEXILLA_SRC_DIR}/lexers/LexNix.cxx
${LEXILLA_SRC_DIR}/lexers/LexNsis.cxx
${LEXILLA_SRC_DIR}/lexers/LexNull.cxx
${LEXILLA_SRC_DIR}/lexers/LexOScript.cxx
${LEXILLA_SRC_DIR}/lexers/LexOpal.cxx
${LEXILLA_SRC_DIR}/lexers/LexPB.cxx
${LEXILLA_SRC_DIR}/lexers/LexPLM.cxx
${LEXILLA_SRC_DIR}/lexers/LexPO.cxx
${LEXILLA_SRC_DIR}/lexers/LexPOV.cxx
${LEXILLA_SRC_DIR}/lexers/LexPS.cxx
${LEXILLA_SRC_DIR}/lexers/LexPascal.cxx
${LEXILLA_SRC_DIR}/lexers/LexPerl.cxx
${LEXILLA_SRC_DIR}/lexers/LexPowerPro.cxx
${LEXILLA_SRC_DIR}/lexers/LexPowerShell.cxx
${LEXILLA_SRC_DIR}/lexers/LexProgress.cxx
${LEXILLA_SRC_DIR}/lexers/LexProps.cxx
${LEXILLA_SRC_DIR}/lexers/LexPython.cxx
${LEXILLA_SRC_DIR}/lexers/LexR.cxx
${LEXILLA_SRC_DIR}/lexers/LexRaku.cxx
${LEXILLA_SRC_DIR}/lexers/LexRebol.cxx
${LEXILLA_SRC_DIR}/lexers/LexRegistry.cxx
${LEXILLA_SRC_DIR}/lexers/LexRuby.cxx
${LEXILLA_SRC_DIR}/lexers/LexRust.cxx
${LEXILLA_SRC_DIR}/lexers/LexSAS.cxx
${LEXILLA_SRC_DIR}/lexers/LexSML.cxx
${LEXILLA_SRC_DIR}/lexers/LexSQL.cxx
${LEXILLA_SRC_DIR}/lexers/LexSTTXT.cxx
${LEXILLA_SRC_DIR}/lexers/LexScriptol.cxx
${LEXILLA_SRC_DIR}/lexers/LexSmalltalk.cxx
${LEXILLA_SRC_DIR}/lexers/LexSorcus.cxx
${LEXILLA_SRC_DIR}/lexers/LexSpecman.cxx
${LEXILLA_SRC_DIR}/lexers/LexSpice.cxx
${LEXILLA_SRC_DIR}/lexers/LexStata.cxx
${LEXILLA_SRC_DIR}/lexers/LexTACL.cxx
${LEXILLA_SRC_DIR}/lexers/LexTADS3.cxx
${LEXILLA_SRC_DIR}/lexers/LexTAL.cxx
${LEXILLA_SRC_DIR}/lexers/LexTCL.cxx
${LEXILLA_SRC_DIR}/lexers/LexTCMD.cxx
${LEXILLA_SRC_DIR}/lexers/LexTOML.cxx
${LEXILLA_SRC_DIR}/lexers/LexTeX.cxx
${LEXILLA_SRC_DIR}/lexers/LexTroff.cxx
${LEXILLA_SRC_DIR}/lexers/LexTxt2tags.cxx
${LEXILLA_SRC_DIR}/lexers/LexVB.cxx
${LEXILLA_SRC_DIR}/lexers/LexVHDL.cxx
${LEXILLA_SRC_DIR}/lexers/LexVerilog.cxx
${LEXILLA_SRC_DIR}/lexers/LexVisualProlog.cxx
${LEXILLA_SRC_DIR}/lexers/LexX12.cxx
${LEXILLA_SRC_DIR}/lexers/LexYAML.cxx
${LEXILLA_SRC_DIR}/lexers/LexZig.cxx
${LEXILLA_SRC_DIR}/lexlib/Accessor.cxx
${LEXILLA_SRC_DIR}/lexlib/Accessor.h
${LEXILLA_SRC_DIR}/lexlib/CatalogueModules.h
${LEXILLA_SRC_DIR}/lexlib/DefaultLexer.cxx
${LEXILLA_SRC_DIR}/lexlib/DefaultLexer.h
${LEXILLA_SRC_DIR}/lexlib/InList.cxx
${LEXILLA_SRC_DIR}/lexlib/InList.h
${LEXILLA_SRC_DIR}/lexlib/LexAccessor.cxx
${LEXILLA_SRC_DIR}/lexlib/LexAccessor.h
${LEXILLA_SRC_DIR}/lexlib/LexCharacterCategory.cxx
${LEXILLA_SRC_DIR}/lexlib/LexCharacterCategory.h
${LEXILLA_SRC_DIR}/lexlib/LexCharacterSet.cxx
${LEXILLA_SRC_DIR}/lexlib/LexCharacterSet.h
${LEXILLA_SRC_DIR}/lexlib/LexerBase.cxx
${LEXILLA_SRC_DIR}/lexlib/LexerBase.h
${LEXILLA_SRC_DIR}/lexlib/LexerModule.cxx
${LEXILLA_SRC_DIR}/lexlib/LexerModule.h
${LEXILLA_SRC_DIR}/lexlib/LexerSimple.cxx
${LEXILLA_SRC_DIR}/lexlib/LexerSimple.h
${LEXILLA_SRC_DIR}/lexlib/OptionSet.h
${LEXILLA_SRC_DIR}/lexlib/PropSetSimple.cxx
${LEXILLA_SRC_DIR}/lexlib/PropSetSimple.h
${LEXILLA_SRC_DIR}/lexlib/SparseState.h
${LEXILLA_SRC_DIR}/lexlib/StringCopy.h
${LEXILLA_SRC_DIR}/lexlib/StyleContext.cxx
${LEXILLA_SRC_DIR}/lexlib/StyleContext.h
${LEXILLA_SRC_DIR}/lexlib/SubStyles.h
${LEXILLA_SRC_DIR}/lexlib/WordList.cxx
${LEXILLA_SRC_DIR}/lexlib/WordList.h
${LEXILLA_SRC_DIR}/src/Lexilla.cxx
)
get_target_property(SCINTILLA_INCLUDE wxscintilla INCLUDE_DIRECTORIES)
target_include_directories(wxlexilla PRIVATE
${wxSOURCE_DIR}/${LEXILLA_SRC_DIR}/access
${wxSOURCE_DIR}/${LEXILLA_SRC_DIR}/include
${wxSOURCE_DIR}/${LEXILLA_SRC_DIR}/lexlib
${SCINTILLA_INCLUDE}
)
wx_target_enable_precomp(wxlexilla
"${wxSOURCE_DIR}/${SCINTILLA_SRC_DIR}/include/Scintilla.h"
"${wxSOURCE_DIR}/${LEXILLA_SRC_DIR}/include/Lexilla.h"
)

View File

@@ -0,0 +1,101 @@
#############################################################################
# Name: build/cmake/lib/stc/scintilla.cmake
# Purpose: CMake file for Scintilla library
# Author: Maarten Bent
# Created: 2022-12-28
# Copyright: (c) 2022 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
include(../../source_groups.cmake)
set(SCINTILLA_SRC_DIR src/stc/scintilla)
wx_add_builtin_library(wxscintilla
${SCINTILLA_SRC_DIR}/include/Compat.h
${SCINTILLA_SRC_DIR}/include/ILexer.h
${SCINTILLA_SRC_DIR}/include/ILoader.h
${SCINTILLA_SRC_DIR}/include/Platform.h
${SCINTILLA_SRC_DIR}/include/Sci_Position.h
${SCINTILLA_SRC_DIR}/include/Scintilla.h
${SCINTILLA_SRC_DIR}/include/ScintillaWidget.h
${SCINTILLA_SRC_DIR}/src/AutoComplete.cxx
${SCINTILLA_SRC_DIR}/src/AutoComplete.h
${SCINTILLA_SRC_DIR}/src/CallTip.cxx
${SCINTILLA_SRC_DIR}/src/CallTip.h
${SCINTILLA_SRC_DIR}/src/CaseConvert.cxx
${SCINTILLA_SRC_DIR}/src/CaseConvert.h
${SCINTILLA_SRC_DIR}/src/CaseFolder.cxx
${SCINTILLA_SRC_DIR}/src/CaseFolder.h
${SCINTILLA_SRC_DIR}/src/CellBuffer.cxx
${SCINTILLA_SRC_DIR}/src/CellBuffer.h
${SCINTILLA_SRC_DIR}/src/CharClassify.cxx
${SCINTILLA_SRC_DIR}/src/CharClassify.h
${SCINTILLA_SRC_DIR}/src/CharacterCategory.cxx
${SCINTILLA_SRC_DIR}/src/CharacterCategory.h
${SCINTILLA_SRC_DIR}/src/CharacterSet.cxx
${SCINTILLA_SRC_DIR}/src/CharacterSet.h
${SCINTILLA_SRC_DIR}/src/ContractionState.cxx
${SCINTILLA_SRC_DIR}/src/ContractionState.h
${SCINTILLA_SRC_DIR}/src/DBCS.cxx
${SCINTILLA_SRC_DIR}/src/DBCS.h
${SCINTILLA_SRC_DIR}/src/Decoration.cxx
${SCINTILLA_SRC_DIR}/src/Decoration.h
${SCINTILLA_SRC_DIR}/src/Document.cxx
${SCINTILLA_SRC_DIR}/src/Document.h
${SCINTILLA_SRC_DIR}/src/EditModel.cxx
${SCINTILLA_SRC_DIR}/src/EditModel.h
${SCINTILLA_SRC_DIR}/src/EditView.cxx
${SCINTILLA_SRC_DIR}/src/EditView.h
${SCINTILLA_SRC_DIR}/src/Editor.cxx
${SCINTILLA_SRC_DIR}/src/Editor.h
${SCINTILLA_SRC_DIR}/src/ElapsedPeriod.h
${SCINTILLA_SRC_DIR}/src/FontQuality.h
${SCINTILLA_SRC_DIR}/src/Indicator.cxx
${SCINTILLA_SRC_DIR}/src/Indicator.h
${SCINTILLA_SRC_DIR}/src/IntegerRectangle.h
${SCINTILLA_SRC_DIR}/src/KeyMap.cxx
${SCINTILLA_SRC_DIR}/src/KeyMap.h
${SCINTILLA_SRC_DIR}/src/LineMarker.cxx
${SCINTILLA_SRC_DIR}/src/LineMarker.h
${SCINTILLA_SRC_DIR}/src/MarginView.cxx
${SCINTILLA_SRC_DIR}/src/MarginView.h
${SCINTILLA_SRC_DIR}/src/Partitioning.h
${SCINTILLA_SRC_DIR}/src/PerLine.cxx
${SCINTILLA_SRC_DIR}/src/PerLine.h
${SCINTILLA_SRC_DIR}/src/Position.h
${SCINTILLA_SRC_DIR}/src/PositionCache.cxx
${SCINTILLA_SRC_DIR}/src/PositionCache.h
${SCINTILLA_SRC_DIR}/src/RESearch.cxx
${SCINTILLA_SRC_DIR}/src/RESearch.h
${SCINTILLA_SRC_DIR}/src/RunStyles.cxx
${SCINTILLA_SRC_DIR}/src/RunStyles.h
${SCINTILLA_SRC_DIR}/src/ScintillaBase.cxx
${SCINTILLA_SRC_DIR}/src/ScintillaBase.h
${SCINTILLA_SRC_DIR}/src/Selection.cxx
${SCINTILLA_SRC_DIR}/src/Selection.h
${SCINTILLA_SRC_DIR}/src/SparseVector.h
${SCINTILLA_SRC_DIR}/src/SplitVector.h
${SCINTILLA_SRC_DIR}/src/Style.cxx
${SCINTILLA_SRC_DIR}/src/Style.h
${SCINTILLA_SRC_DIR}/src/UniConversion.cxx
${SCINTILLA_SRC_DIR}/src/UniConversion.h
${SCINTILLA_SRC_DIR}/src/UniqueString.cxx
${SCINTILLA_SRC_DIR}/src/UniqueString.h
${SCINTILLA_SRC_DIR}/src/ViewStyle.cxx
${SCINTILLA_SRC_DIR}/src/ViewStyle.h
${SCINTILLA_SRC_DIR}/src/XPM.cxx
${SCINTILLA_SRC_DIR}/src/XPM.h
)
target_include_directories(wxscintilla PRIVATE
${wxSOURCE_DIR}/${SCINTILLA_SRC_DIR}/include
${wxSOURCE_DIR}/${SCINTILLA_SRC_DIR}/src
)
target_compile_definitions(wxscintilla PUBLIC
__WX__
)
wx_target_enable_precomp(wxscintilla
"${wxSOURCE_DIR}/${SCINTILLA_SRC_DIR}/include/Scintilla.h"
)

View File

@@ -0,0 +1,81 @@
#############################################################################
# Name: build/cmake/lib/tiff.cmake
# Purpose: Use external or internal libtiff
# Author: Tobias Taschner
# Created: 2016-09-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_LIBTIFF STREQUAL "builtin")
# TODO: implement building libtiff via its CMake file, using
# add_subdirectory or ExternalProject_Add
if(WIN32)
set(TIFF_PLATFORM_SRC src/tiff/libtiff/tif_win32.c)
elseif(UNIX)
set(TIFF_PLATFORM_SRC src/tiff/libtiff/tif_unix.c)
endif()
wx_add_builtin_library(wxtiff
${TIFF_PLATFORM_SRC}
src/tiff/libtiff/tif_aux.c
src/tiff/libtiff/tif_close.c
src/tiff/libtiff/tif_codec.c
src/tiff/libtiff/tif_color.c
src/tiff/libtiff/tif_compress.c
src/tiff/libtiff/tif_dir.c
src/tiff/libtiff/tif_dirinfo.c
src/tiff/libtiff/tif_dirread.c
src/tiff/libtiff/tif_dirwrite.c
src/tiff/libtiff/tif_dumpmode.c
src/tiff/libtiff/tif_error.c
src/tiff/libtiff/tif_extension.c
src/tiff/libtiff/tif_fax3.c
src/tiff/libtiff/tif_fax3sm.c
src/tiff/libtiff/tif_flush.c
src/tiff/libtiff/tif_getimage.c
src/tiff/libtiff/tif_hash_set.c
src/tiff/libtiff/tif_jbig.c
src/tiff/libtiff/tif_jpeg.c
src/tiff/libtiff/tif_jpeg_12.c
src/tiff/libtiff/tif_lerc.c
src/tiff/libtiff/tif_luv.c
src/tiff/libtiff/tif_lzma.c
src/tiff/libtiff/tif_lzw.c
src/tiff/libtiff/tif_next.c
src/tiff/libtiff/tif_ojpeg.c
src/tiff/libtiff/tif_open.c
src/tiff/libtiff/tif_packbits.c
src/tiff/libtiff/tif_pixarlog.c
src/tiff/libtiff/tif_predict.c
src/tiff/libtiff/tif_print.c
src/tiff/libtiff/tif_read.c
src/tiff/libtiff/tif_strip.c
src/tiff/libtiff/tif_swab.c
src/tiff/libtiff/tif_thunder.c
src/tiff/libtiff/tif_tile.c
src/tiff/libtiff/tif_version.c
src/tiff/libtiff/tif_warning.c
src/tiff/libtiff/tif_webp.c
src/tiff/libtiff/tif_write.c
src/tiff/libtiff/tif_zip.c
src/tiff/libtiff/tif_zstd.c
)
if(WIN32)
# define this to get rid of a warning about using POSIX lfind():
# confusingly enough, we do define lfind as _lfind for MSVC but
# doing this results in a just more confusing warning, see:
# http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101278
target_compile_definitions(wxtiff PRIVATE _CRT_NONSTDC_NO_WARNINGS)
endif()
target_include_directories(wxtiff PRIVATE
${wxSOURCE_DIR}/src/tiff/libtiff
${ZLIB_INCLUDE_DIRS}
${JPEG_INCLUDE_DIR}
)
target_link_libraries(wxtiff PRIVATE ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES})
set(TIFF_LIBRARIES wxtiff)
set(TIFF_INCLUDE_DIRS ${wxSOURCE_DIR}/src/tiff/libtiff)
elseif(wxUSE_LIBTIFF)
find_package(TIFF REQUIRED)
endif()

View File

@@ -0,0 +1,64 @@
#############################################################################
# Name: build/cmake/lib/webp.cmake
# Purpose: Use external or internal libwebp
# Author:
# Created: 2025-01-31
# Copyright: (c) 2025 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_LIBWEBP STREQUAL "builtin")
set(WEBP_ROOT "${wxSOURCE_DIR}/3rdparty/libwebp")
set(WEBP_BUILD_ROOT "${CMAKE_CURRENT_BINARY_DIR}/webp-build")
# No flags to enable or disable SIMD
set(WEBP_CHECK_SIMD OFF CACHE BOOL "")
# static library
set(WEBP_LINK_STATIC ON)
# disable tools
set(WEBP_BUILD_ANIM_UTILS OFF)
set(WEBP_BUILD_CWEBP OFF)
set(WEBP_BUILD_DWEBP OFF)
set(WEBP_BUILD_GIF2WEBP OFF)
set(WEBP_BUILD_IMG2WEBP OFF)
set(WEBP_BUILD_VWEBP OFF)
set(WEBP_BUILD_WEBPINFO OFF)
set(WEBP_BUILD_WEBPMUX OFF)
set(WEBP_BUILD_EXTRAS OFF)
set(WEBP_BUILD_WEBP_JS OFF)
set(WEBP_BUILD_FUZZTEST OFF)
add_subdirectory("${WEBP_ROOT}" "${WEBP_BUILD_ROOT}" EXCLUDE_FROM_ALL)
mark_as_advanced(WEBP_CHECK_SIMD)
mark_as_advanced(WEBP_BITTRACE)
mark_as_advanced(WEBP_BUILD_LIBWEBPMUX)
mark_as_advanced(WEBP_ENABLE_SIMD)
mark_as_advanced(WEBP_ENABLE_SWAP_16BIT_CSP)
mark_as_advanced(WEBP_ENABLE_WUNUSED_RESULT)
mark_as_advanced(WEBP_LINK_STATIC)
mark_as_advanced(WEBP_NEAR_LOSSLESS)
mark_as_advanced(WEBP_UNICODE)
mark_as_advanced(WEBP_USE_THREAD)
get_property(webpTargets DIRECTORY "${WEBP_ROOT}" PROPERTY BUILDSYSTEM_TARGETS)
foreach(target_name IN LISTS webpTargets)
set_target_properties(${target_name} PROPERTIES
FOLDER "Third Party Libraries/WebP"
PREFIX ""
OUTPUT_NAME "wx${target_name}"
PUBLIC_HEADER ""
)
endforeach()
set(WebP_LIBRARIES webp webpdemux sharpyuv)
if(NOT wxBUILD_SHARED)
wx_install(TARGETS ${WebP_LIBRARIES}
EXPORT wxWidgetsTargets
ARCHIVE DESTINATION "lib${GEN_EXPR_DIR}${wxPLATFORM_LIB_DIR}"
)
endif()
elseif(wxUSE_LIBWEBP)
find_package(WebP REQUIRED)
endif()

View File

@@ -0,0 +1,159 @@
#############################################################################
# Name: build/cmake/lib/webview/CMakeLists.txt
# Purpose: CMake file for webview library
# Author: Tobias Taschner
# Created: 2016-10-03
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
macro(wx_set_webview2_arch)
if(wxPLATFORM_ARCH)
set(WEBVIEW2_ARCH ${wxPLATFORM_ARCH})
else()
set(WEBVIEW2_ARCH x86)
endif()
endmacro()
function(wx_webview_copy_webview2_loader target)
if(NOT WXMSW OR NOT wxUSE_WEBVIEW_EDGE OR NOT TARGET ${target})
return()
endif()
wx_set_webview2_arch()
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
"${WEBVIEW2_PACKAGE_DIR}/build/native/${WEBVIEW2_ARCH}/WebView2Loader.dll"
"$<TARGET_FILE_DIR:${target}>/WebView2Loader.dll")
endfunction()
wx_append_sources(WEBVIEW_FILES WEBVIEW_CMN)
if(WXMSW)
wx_append_sources(WEBVIEW_FILES WEBVIEW_MSW)
elseif(WXGTK)
wx_append_sources(WEBVIEW_FILES WEBVIEW_GTK)
elseif(APPLE)
wx_append_sources(WEBVIEW_FILES WEBVIEW_OSX_SHARED)
endif()
wx_add_library(wxwebview ${WEBVIEW_FILES})
if(APPLE)
wx_lib_link_libraries(wxwebview PUBLIC "-framework WebKit")
elseif(WXMSW)
if(wxUSE_WEBVIEW_EDGE)
# Update the following variables if updating WebView2 SDK
set(WEBVIEW2_VERSION "1.0.1722.45")
set(WEBVIEW2_URL "https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/${WEBVIEW2_VERSION}")
set(WEBVIEW2_SHA256 "10d78e9e11c7851f0a8bf0dd4c22bbf6383de45bd337e1be42240b103812947d")
set(WEBVIEW2_DEFAULT_PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/packages/Microsoft.Web.WebView2.${WEBVIEW2_VERSION}")
if(NOT EXISTS ${WEBVIEW2_PACKAGE_DIR})
unset(WEBVIEW2_PACKAGE_DIR CACHE)
endif()
find_path(WEBVIEW2_PACKAGE_DIR
NAMES build/native/include/WebView2.h
PATHS
"${PROJECT_SOURCE_DIR}/3rdparty/webview2"
${WEBVIEW2_DEFAULT_PACKAGE_DIR}
)
if (NOT WEBVIEW2_PACKAGE_DIR)
message(STATUS "WebView2 SDK not found locally, downloading...")
set(WEBVIEW2_PACKAGE_DIR ${WEBVIEW2_DEFAULT_PACKAGE_DIR} CACHE PATH "WebView2 SDK PATH" FORCE)
file(DOWNLOAD
${WEBVIEW2_URL}
${CMAKE_CURRENT_BINARY_DIR}/webview2.nuget
EXPECTED_HASH SHA256=${WEBVIEW2_SHA256}
STATUS DOWNLOAD_RESULT)
# Check that the download was successful.
list(GET DOWNLOAD_RESULT 0 DOWNLOAD_RESULT_NUM)
if(NOT ${DOWNLOAD_RESULT_NUM} EQUAL 0)
list(GET DOWNLOAD_RESULT 1 DOWNLOAD_RESULT_STR)
message(FATAL_ERROR "Error ${DOWNLOAD_RESULT_NUM} downloading WebView2 SDK: ${DOWNLOAD_RESULT_STR}.")
endif()
file(MAKE_DIRECTORY ${WEBVIEW2_PACKAGE_DIR})
execute_process(COMMAND
"${CMAKE_COMMAND}" -E tar x "${CMAKE_CURRENT_BINARY_DIR}/webview2.nuget"
WORKING_DIRECTORY "${WEBVIEW2_PACKAGE_DIR}"
)
endif()
set(WEBVIEW2_PACKAGE_DIR ${WEBVIEW2_PACKAGE_DIR} CACHE INTERNAL "" FORCE)
wx_lib_include_directories(wxwebview "${WEBVIEW2_PACKAGE_DIR}/build/native/include")
if(NOT MSVC)
wx_lib_include_directories(wxwebview "${wxSOURCE_DIR}/include/wx/msw/wrl")
if (NOT wxBUILD_MONOLITHIC)
target_compile_options(wxwebview PRIVATE -Wno-unknown-pragmas)
endif()
endif()
if (wxUSE_WEBVIEW_EDGE_STATIC)
wx_set_webview2_arch()
wx_lib_link_directories(wxwebview PUBLIC
$<BUILD_INTERFACE:${WEBVIEW2_PACKAGE_DIR}/build/native/${WEBVIEW2_ARCH}/>
)
else()
wx_webview_copy_webview2_loader(wxwebview)
endif()
endif()
elseif(WXGTK)
if(LIBSOUP_FOUND)
wx_lib_include_directories(wxwebview ${LIBSOUP_INCLUDE_DIRS})
wx_lib_link_libraries(wxwebview PUBLIC ${LIBSOUP_LIBRARIES})
endif()
if(wxUSE_WEBVIEW_WEBKIT2)
wx_lib_include_directories(wxwebview ${WEBKIT2_INCLUDE_DIR})
wx_lib_link_libraries(wxwebview PUBLIC ${WEBKIT2_LIBRARIES})
elseif(wxUSE_WEBVIEW_WEBKIT)
wx_lib_include_directories(wxwebview ${WEBKIT_INCLUDE_DIR})
wx_lib_link_libraries(wxwebview PUBLIC ${WEBKIT_LIBRARIES})
endif()
endif()
# webkit extension plugin
# we can't use (all of the) macros and functions because this library should
# always be build as a shared libary, and not included in the monolithic build.
if(WXGTK AND wxUSE_WEBVIEW_WEBKIT2)
wx_append_sources(WEBKIT2_EXT_FILES WEBVIEW_WEBKIT2_EXTENSION)
add_library(wxwebkit2_ext SHARED ${WEBKIT2_EXT_FILES})
wx_set_target_properties(wxwebkit2_ext IS_PLUGIN)
set_target_properties(wxwebkit2_ext PROPERTIES NO_SONAME 1)
# Change output name to match expected name in webview_webkit2.cpp: webkit2_ext*
set(lib_unicode "u")
set(lib_rls)
set(lib_dbg)
if(WIN32_MSVC_NAMING)
set(lib_dbg "d")
endif()
if(wxVERSION_IS_DEV)
set(WX_WEB_EXT_VERSION "${wxMAJOR_VERSION}.${wxMINOR_VERSION}.${wxRELEASE_NUMBER}")
else()
set(WX_WEB_EXT_VERSION "${wxMAJOR_VERSION}.${wxMINOR_VERSION}")
endif()
set_target_properties(wxwebkit2_ext PROPERTIES
OUTPUT_NAME "webkit2_ext${lib_unicode}${lib_rls}-${WX_WEB_EXT_VERSION}"
OUTPUT_NAME_DEBUG "webkit2_ext${lib_unicode}${lib_dbg}-${WX_WEB_EXT_VERSION}"
PREFIX ""
)
target_include_directories(wxwebkit2_ext PRIVATE
${LIBSOUP_INCLUDE_DIRS}
${WEBKIT2_INCLUDE_DIR}
)
target_link_libraries(wxwebkit2_ext PUBLIC
${LIBSOUP_LIBRARIES}
${WEBKIT2_LIBRARIES}
)
wx_install(TARGETS wxwebkit2_ext LIBRARY DESTINATION "lib/wx/${WX_WEB_EXT_VERSION}/web-extensions")
wx_add_dependencies(wxwebview wxwebkit2_ext)
endif()

View File

@@ -0,0 +1,331 @@
#############################################################################
# Name: build/cmake/lib/webview_chromium/CMakeLists.txt
# Purpose: CMake file for webview_chromium library
# Author: Tobias Taschner
# Created: 2018-02-03
# Copyright: (c) 2018 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
include(../../source_groups.cmake)
set(KNOWN_CONFIGS "Debug;Release;RelWithDebInfo;MinSizeRel")
if(CMAKE_CONFIGURATION_TYPES)
foreach(cfg ${CMAKE_CONFIGURATION_TYPES})
if (NOT cfg IN_LIST KNOWN_CONFIGS)
message(WARNING "Unknown build configuration '${cfg}', this might cause issues with libcef_dll_wrapper")
endif()
endforeach()
elseif(CMAKE_BUILD_TYPE)
if (NOT CMAKE_BUILD_TYPE IN_LIST KNOWN_CONFIGS)
message(WARNING "Unknown build configuration '${cfg}', this might cause issues with libcef_dll_wrapper")
endif()
endif()
find_path(CEF_ROOT
NAMES libcef_dll
HINTS
$ENV{CEF_ROOT}
${wxSOURCE_DIR}/3rdparty/cef
DOC "CEF Binary Root directory"
)
# We may need to create multiple arch-specific directories, so define the
# variables containing the common root for all of them.
set(CEF_DOWNLOAD_ROOT ${CMAKE_CURRENT_BINARY_DIR}/cef-download)
set(CEF_SOURCE_ROOT ${CMAKE_CURRENT_BINARY_DIR}/cef-source)
set(CEF_BUILD_ROOT ${CMAKE_CURRENT_BINARY_DIR}/cef-build)
# But when we don't need multiple directories, just use them directly.
set(CEF_DOWNLOAD_DIR ${CEF_DOWNLOAD_ROOT})
set(CEF_SOURCE_DIR ${CEF_SOURCE_ROOT})
set(CEF_BUILD_DIR ${CEF_BUILD_ROOT})
# This function downloads and builds CEF for the specified platform.
function(wx_download_cef CEF_PLATFORM)
message("Downloading CEF binary distribution for ${CEF_PLATFORM}...")
set(CEF_URL "${CEF_BASE_URL}${CEF_VERSION}_${CEF_PLATFORM}${CEF_DISTRIBUTION}${CEF_FILE_EXT}")
set(CEF_SHA1 "${CEF_SHA1_${CEF_PLATFORM}}")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cef_download.cmake.in
${CEF_DOWNLOAD_DIR}/CMakeLists.txt
)
execute_process(
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CEF_DOWNLOAD_DIR}
)
if(result)
message(FATAL_ERROR "CMake step for cef failed: ${result}")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CEF_DOWNLOAD_DIR}
)
if(result)
message(FATAL_ERROR "Build step for cef failed: ${result}")
endif()
endfunction()
if(NOT CEF_ROOT)
include(cef_version_info.cmake)
# Note that CMAKE_OSX_ARCHITECTURES is always defined under macOS, but is
# empty if not explicitly specified, so do _not_ use if(DEFINED ...) here.
if(CMAKE_OSX_ARCHITECTURES)
foreach(osx_arch IN LISTS CMAKE_OSX_ARCHITECTURES)
# Determine the matching CEF platform name.
if(${osx_arch} STREQUAL "arm64")
set(CEF_PLATFORM "macosarm64")
elseif(${osx_arch} STREQUAL "x86_64")
set(CEF_PLATFORM "macosx64")
else()
message(FATAL_ERROR "Building CEF for macOS architecture ${osx_arch} is not supported")
endif()
if(NOT first_cef_platform)
# Download/unpack CEF files in the root directory and remember
# that we did it by setting this variable.
set(first_cef_platform ${CEF_PLATFORM})
else()
list(APPEND other_cef_platforms ${CEF_PLATFORM})
# Use different subdirectories for the other architectures.
set(CEF_DOWNLOAD_DIR "${CEF_DOWNLOAD_ROOT}/${CEF_PLATFORM}")
set(CEF_SOURCE_DIR "${CEF_SOURCE_ROOT}/${CEF_PLATFORM}")
set(CEF_BUILD_DIR "${CEF_BUILD_ROOT}/${CEF_PLATFORM}")
endif()
wx_download_cef(${CEF_PLATFORM})
endforeach()
# Now lipo all the binaries together unless this is a degenerate case
# in which CMAKE_OSX_ARCHITECTURES contains only one element.
if(other_cef_platforms)
set(cef_binaries
"cef_sandbox.a"
"Chromium Embedded Framework.framework/Chromium Embedded Framework"
"Chromium Embedded Framework.framework/Libraries/libEGL.dylib"
"Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib"
"Chromium Embedded Framework.framework/Libraries/libvk_swiftshader.dylib"
)
foreach(cef_bin_file IN LISTS cef_binaries)
set(lipo_command
lipo -create "Release/${cef_bin_file}"
)
foreach(cef_platform IN LISTS other_cef_platforms)
list(APPEND lipo_command "${cef_platform}/Release/${cef_bin_file}")
endforeach()
list(APPEND lipo_command "-output")
list(APPEND lipo_command "Release/${cef_bin_file}.tmp")
execute_process(
COMMAND ${lipo_command}
RESULT_VARIABLE result
WORKING_DIRECTORY ${CEF_SOURCE_ROOT}
)
if(result)
message(FATAL_ERROR "Running \"${lipo_command}\" in ${CEF_SOURCE_ROOT} failed: ${result}")
endif()
file(RENAME
"${CEF_SOURCE_ROOT}/Release/${cef_bin_file}.tmp"
"${CEF_SOURCE_ROOT}/Release/${cef_bin_file}"
)
endforeach()
# Special case of arch-specific v8 snapshot file.
foreach(cef_platform IN LISTS other_cef_platforms)
# This one uses the standard arch name instead of CEF-specific
# name used elsewhere just to make our life a bit more interesting.
if(${cef_platform} STREQUAL "macosarm64")
set(cef_arch "arm64")
elseif(${cef_platform} STREQUAL "macosx64")
set(cef_arch "x86_64")
else()
message(FATAL_ERROR "Uknown v8 arch for CEF platform ${cef_platform}")
endif()
file(COPY_FILE
"${CEF_SOURCE_ROOT}/${cef_platform}/Release/Chromium Embedded Framework.framework/Resources/v8_context_snapshot.${cef_arch}.bin"
"${CEF_SOURCE_ROOT}/Release/Resources"
)
endforeach()
# This file differs between the architectures, but has a fixed name, so
# we can only remove it. FWIW it is not present in CEF included in
# /Application/Google Chrome.app, so it's probably the right thing to do.
file(REMOVE "${CEF_SOURCE_ROOT}/Release/Chrome Embedded Framework.framework/Resources/snapshot_blob.bin")
endif()
else()
# Auto detect CEF platform.
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(CMAKE_SIZEOF_VOID_P LESS 8)
message(FATAL_ERROR "Unsupported macOS system")
else()
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(CEF_PLATFORM "macosarm64")
else()
set(CEF_PLATFORM "macosx64")
endif()
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(CMAKE_SIZEOF_VOID_P LESS 8)
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm")
set(CEF_PLATFORM "linuxarm")
else()
message(FATAL_ERROR "Unsupported Linux system")
endif()
else()
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(CEF_PLATFORM "linuxarm64")
else()
set(CEF_PLATFORM "linux64")
endif()
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_SIZEOF_VOID_P LESS 8)
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm")
message(FATAL_ERROR "Unsupported Windows system")
else()
set(CEF_PLATFORM "windows32")
endif()
else()
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(CEF_PLATFORM "windowsarm64")
else()
set(CEF_PLATFORM "windows64")
endif()
endif()
else()
message(FATAL_ERROR "Unsupported CEF system")
endif()
wx_download_cef(${CEF_PLATFORM})
endif()
set(CEF_ROOT ${CEF_SOURCE_ROOT} CACHE PATH "CEF Binary Root directory" FORCE)
endif()
# CEF settings
set(USE_ATL OFF) # Disable usage of ATL in CEF
set(USE_SANDBOX OFF) # Disable usage of sandbox on windows
if(MSVC)
if(wxBUILD_USE_STATIC_RUNTIME)
set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "" FORCE)
else()
set(CEF_RUNTIME_LIBRARY_FLAG "/MD" CACHE STRING "" FORCE)
endif()
endif()
set(_saved_CMAKE_MESSAGE_LOG_LEVEL ${CMAKE_MESSAGE_LOG_LEVEL})
set(CEF_SHOW_RESULTS FALSE CACHE BOOL "Show CEF configuration results")
if(CEF_SHOW_RESULTS)
if(CMAKE_OSX_ARCHITECTURES)
# This is only used for the summary shown if CEF_SHOW_RESULTS is on.
set(PROJECT_ARCH ${CMAKE_OSX_ARCHITECTURES})
endif()
else()
set(CMAKE_MESSAGE_LOG_LEVEL ERROR)
endif()
# prevent libcef_dll_wrapper from creating only Release and Debug configs
# in multi-configuration generators
# variable_watch does not seem to be scoped, and we can't unset it, or replace it,
# and we don't care if it is changed later, so use enable_guard
# to stop the guard from working after libcef_dll_wrapper is added.
set(enable_guard 1)
macro(set_readonly VAR)
set(_${VAR}_ ${${VAR}})
variable_watch(${VAR} readonly_guard)
endmacro()
macro(readonly_guard VAR access value)
if (enable_guard AND "${access}" STREQUAL "MODIFIED_ACCESS" AND NOT "${value}" STREQUAL "${_${VAR}_}")
set(${VAR} ${_${VAR}_})
message(WARNING "Blocked changing variable '${VAR}' to '${value}', reset to '${${VAR}}'")
endif()
endmacro()
set_readonly(CMAKE_CONFIGURATION_TYPES)
# Prevent CEF from resetting CMAKE_OSX_ARCHITECTURES if it explicitly set, this
# is required in order to allow building universal binaries.
if(CMAKE_OSX_ARCHITECTURES)
set_readonly(CMAKE_OSX_ARCHITECTURES)
endif()
add_subdirectory(${CEF_ROOT} ${CEF_BUILD_ROOT} EXCLUDE_FROM_ALL)
set(enable_guard 0)
set(CMAKE_MESSAGE_LOG_LEVEL ${_saved_CMAKE_MESSAGE_LOG_LEVEL})
set_target_properties(libcef_dll_wrapper PROPERTIES
FOLDER "Third Party Libraries"
OUTPUT_NAME "libcef_dll_wrapper"
)
if(NOT MSVC)
target_compile_options(libcef_dll_wrapper PRIVATE "-Wno-extra")
endif()
# libcef_dll_wrapper only sets properties for Debug and Release.
# Extract the release options/flags and apply them to RelWithDebInfo and MinSizeRel.
macro(rls_flags property)
get_target_property(props libcef_dll_wrapper ${property})
string(FIND "${props}" "$<CONFIG:Release>:" index)
math(EXPR index "${index}+18")
string(SUBSTRING "${props}" ${index} -1 props)
string(FIND "${props}" ">" index)
string(SUBSTRING "${props}" 0 ${index} props)
if ("${property}" STREQUAL "COMPILE_DEFINITIONS")
target_compile_definitions(libcef_dll_wrapper PRIVATE
$<$<CONFIG:RelWithDebInfo>:${props}>
$<$<CONFIG:MinSizeRel>:${props}>
)
else()
target_compile_options(libcef_dll_wrapper PRIVATE
$<$<CONFIG:RelWithDebInfo>:${props}>
$<$<CONFIG:MinSizeRel>:${props}>
)
endif()
endmacro()
rls_flags(COMPILE_DEFINITIONS)
rls_flags(COMPILE_OPTIONS)
add_library(libcef SHARED IMPORTED GLOBAL)
if(APPLE)
set_target_properties(libcef PROPERTIES
IMPORTED_LOCATION "${CEF_ROOT}/Release/Chromium Embedded Framework.framework/Chromium Embedded Framework"
)
else()
set_target_properties(libcef PROPERTIES
IMPORTED_LOCATION "${CEF_ROOT}/Release/libcef${CMAKE_SHARED_LIBRARY_SUFFIX}"
IMPORTED_IMPLIB "${CEF_ROOT}/Release/libcef${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
endif()
wx_install(TARGETS libcef_dll_wrapper
EXPORT wxWidgetsTargets
ARCHIVE DESTINATION "lib${GEN_EXPR_DIR}${wxPLATFORM_LIB_DIR}"
)
wx_lib_include_directories(wxwebview PRIVATE ${CEF_ROOT})
wx_add_dependencies(wxwebview libcef_dll_wrapper)
wx_lib_link_libraries(wxwebview PUBLIC libcef libcef_dll_wrapper)
mark_as_advanced(USE_ATL)
mark_as_advanced(USE_SANDBOX)
mark_as_advanced(OPTION_USE_ARC)
mark_as_advanced(CEF_ROOT)
mark_as_advanced(CEF_SHOW_RESULTS)
mark_as_advanced(CEF_DEBUG_INFO_FLAG)
mark_as_advanced(CEF_RUNTIME_LIBRARY_FLAG)

View File

@@ -0,0 +1,28 @@
#############################################################################
# Name: build/cmake/lib/webview_chromium/cef_download.cmake.in
# Purpose: CMakeLists.txt template to download CEF
# Author: Tobias Taschner
# Created: 2018-02-19
# Copyright: (c) 2018 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
cmake_minimum_required(VERSION 3.5)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
project(cef-download NONE)
include(ExternalProject)
ExternalProject_Add(cef
URL ${CEF_URL}
URL_HASH SHA1=${CEF_SHA1}
SOURCE_DIR "${CEF_SOURCE_DIR}"
BINARY_DIR "${CEF_BUILD_DIR}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)

View File

@@ -0,0 +1,35 @@
#############################################################################
# Name: build/cmake/lib/webview_chromium/cef_update_version_info.cmake
# Purpose: Script to update
# Author: Tobias Taschner
# Created: 2018-02-03
# Copyright: (c) 2018 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
# Use this script to automatically update cef_version_info.cmake
#
# Run this script with cmake script mode
# cmake -D CEF_VERSION=x.y.z+b -P cef_update_version_info.cmake
if(NOT DEFINED CEF_VERSION)
message(FATAL_ERROR "CEF_VERSION not defined")
endif()
set(CEF_BASE_URL "https://cef-builds.spotifycdn.com/cef_binary_")
set(CEF_DISTRIBUTION "_minimal")
set(CEF_FILE_EXT ".tar.bz2")
set(sha_file ${CMAKE_BINARY_DIR}/__info_sha.txt)
foreach(platform windows64 windowsarm64 windows32 macosx64 macosarm64 linux64 linuxarm64 linuxarm)
file(DOWNLOAD "${CEF_BASE_URL}${CEF_VERSION}_${platform}${CEF_DISTRIBUTION}${CEF_FILE_EXT}.sha1" "${sha_file}")
file(READ "${sha_file}" CEF_SHA1_${platform})
endforeach()
file(REMOVE ${sha_file})
configure_file(
cef_version_info.cmake.in
cef_version_info.cmake
@ONLY NEWLINE_STYLE LF
)

View File

@@ -0,0 +1,27 @@
#############################################################################
# Name: build/cmake/lib/webview_chromium/cef_version_info.cmake
# Purpose: CMake file CEF version information
# Author: Tobias Taschner
# Created: 2018-02-03
# Copyright: (c) 2018 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
#
# DO NOT MODIFY MANUALLY
#
# To update this file, use cef_update_version_info.cmake
set(CEF_BASE_URL "https://cef-builds.spotifycdn.com/cef_binary_")
set(CEF_VERSION "122.1.10+gc902316+chromium-122.0.6261.112")
set(CEF_DISTRIBUTION "_minimal")
set(CEF_FILE_EXT ".tar.bz2")
set(CEF_SHA1_macosarm64 "d299d467508b970e7227c4d8171985a9942b08a7")
set(CEF_SHA1_macosx64 "a71cef7ec7d8230fcc24d97a09c023e77b2b8608")
set(CEF_SHA1_linuxarm "ba3bb572064da216d2a6e3aafbbcda5a96f6f204")
set(CEF_SHA1_linuxarm64 "700404f6972200eee834e1f94b42b4df4aefe266")
set(CEF_SHA1_linux64 "696f09deb86fd7a220004101521e07381b7dec4b")
set(CEF_SHA1_windows32 "850c8f5ff35ad36c447e2492292dc965d4f13ebc")
set(CEF_SHA1_windowsarm64 "a1e318fe1dc56d9e4014bf1e3b283a2ee70915d0")
set(CEF_SHA1_windows64 "93e6ccdd093da457ae98fdf63f84becc2388bdb8")

View File

@@ -0,0 +1,27 @@
#############################################################################
# Name: build/cmake/lib/webview_chromium/cef_version_info.cmake
# Purpose: CMake file CEF version information
# Author: Tobias Taschner
# Created: 2018-02-03
# Copyright: (c) 2018 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
#
# DO NOT MODIFY MANUALLY
#
# To update this file, use cef_update_version_info.cmake
set(CEF_BASE_URL "@CEF_BASE_URL@")
set(CEF_VERSION "@CEF_VERSION@")
set(CEF_DISTRIBUTION "@CEF_DISTRIBUTION@")
set(CEF_FILE_EXT "@CEF_FILE_EXT@")
set(CEF_SHA1_macosarm64 "@CEF_SHA1_macosarm64@")
set(CEF_SHA1_macosx64 "@CEF_SHA1_macosx64@")
set(CEF_SHA1_linuxarm "@CEF_SHA1_linuxarm@")
set(CEF_SHA1_linuxarm64 "@CEF_SHA1_linuxarm64@")
set(CEF_SHA1_linux64 "@CEF_SHA1_linux64@")
set(CEF_SHA1_windows32 "@CEF_SHA1_windows32@")
set(CEF_SHA1_windowsarm64 "@CEF_SHA1_windowsarm64@")
set(CEF_SHA1_windows64 "@CEF_SHA1_windows64@")

View File

@@ -0,0 +1,13 @@
#############################################################################
# Name: build/cmake/lib/xml/CMakeLists.txt
# Purpose: CMake file for xml library
# Author: Tobias Taschner
# Created: 2016-09-20
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(XML_FILES XML)
wx_add_library(wxxml IS_BASE ${XML_FILES})
wx_lib_link_libraries(wxxml PRIVATE ${EXPAT_LIBRARIES})
wx_lib_include_directories(wxxml ${EXPAT_INCLUDE_DIRS})

View File

@@ -0,0 +1,13 @@
#############################################################################
# Name: build/cmake/lib/xrc/CMakeLists.txt
# Purpose: CMake file for xrc library
# Author: Tobias Taschner
# Created: 2016-10-03
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_append_sources(XRC_FILES XRC)
wx_add_library(wxxrc ${XRC_FILES})
wx_lib_link_libraries(wxxrc PRIVATE wxhtml wxxml)

View File

@@ -0,0 +1,43 @@
#############################################################################
# Name: build/cmake/lib/zlib.cmake
# Purpose: Use external or internal zlib
# Author: Tobias Taschner
# Created: 2016-09-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_ZLIB STREQUAL "builtin")
# TODO: implement building zlib via its CMake file, using
# add_subdirectory or ExternalProject_Add
wx_add_builtin_library(wxzlib
src/zlib/adler32.c
src/zlib/compress.c
src/zlib/crc32.c
src/zlib/deflate.c
src/zlib/gzclose.c
src/zlib/gzlib.c
src/zlib/gzread.c
src/zlib/gzwrite.c
src/zlib/infback.c
src/zlib/inffast.c
src/zlib/inflate.c
src/zlib/inftrees.c
src/zlib/trees.c
src/zlib/uncompr.c
src/zlib/zutil.c
)
if(WIN32)
# Define this to get rid of many warnings about using open(),
# read() and other POSIX functions in zlib code. This is much
# more convenient than having to modify it to avoid them.
target_compile_definitions(wxzlib PRIVATE _CRT_NONSTDC_NO_WARNINGS)
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(wxzlib PRIVATE -Wno-deprecated-non-prototype)
endif()
set(ZLIB_LIBRARIES wxzlib)
set(ZLIB_INCLUDE_DIRS ${wxSOURCE_DIR}/src/zlib)
elseif(wxUSE_ZLIB)
find_package(ZLIB REQUIRED)
endif()

View File

@@ -0,0 +1,36 @@
if(wxBUILD_LOCALES STREQUAL "AUTO")
find_package(Gettext QUIET)
elseif(wxBUILD_LOCALES)
find_package(Gettext REQUIRED)
endif()
mark_as_advanced(GETTEXT_MSGMERGE_EXECUTABLE)
mark_as_advanced(GETTEXT_MSGFMT_EXECUTABLE)
if(NOT GETTEXT_FOUND OR wxBUILD_LOCALES STREQUAL "OFF")
return()
endif()
# list and process the po files
file(GLOB _po_files "${wxSOURCE_DIR}/locale/*.po")
foreach(_po_file ${_po_files})
get_filename_component(name "${_po_file}" NAME)
string(REGEX REPLACE "\\.[^.]*$" "" lang ${name})
gettext_process_po_files(${lang} ALL PO_FILES "${_po_file}")
wx_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo"
DESTINATION "share/locale/${lang}/LC_MESSAGES"
RENAME "wxstd-${wxMAJOR_VERSION}.${wxMINOR_VERSION}.mo"
)
endforeach()
# put all pofiles targets in a group to not clutter visual studio
set(base_name "pofiles")
set(target_index 0)
set(target_name ${base_name})
while(TARGET ${target_name})
set_target_properties(${target_name} PROPERTIES FOLDER "Locales")
math(EXPR target_index "${target_index}+1")
set(target_name "${base_name}_${target_index}")
endwhile()

View File

@@ -0,0 +1,87 @@
#############################################################################
# Name: build/cmake/main.cmake
# Purpose: Main CMake file
# Author: Tobias Taschner
# Created: 2016-09-20
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
list(APPEND CMAKE_MODULE_PATH "${wxSOURCE_DIR}/build/cmake/modules")
file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)
include(build/cmake/files.cmake) # Files list
include(build/cmake/source_groups.cmake) # Source group definitions
include(build/cmake/functions.cmake) # wxWidgets functions
include(build/cmake/toolkit.cmake) # Platform/toolkit settings
include(build/cmake/options.cmake) # User options
include(build/cmake/init.cmake) # Init various global build vars
include(build/cmake/pch.cmake) # Precompiled header support
add_subdirectory(build/cmake/locale locale)
add_subdirectory(build/cmake/lib libs)
add_subdirectory(build/cmake/utils utils)
if(wxBUILD_SAMPLES)
add_subdirectory(build/cmake/samples samples)
endif()
if(wxBUILD_TESTS)
enable_testing()
add_subdirectory(build/cmake/tests tests)
endif()
if(wxBUILD_DEMOS)
add_subdirectory(build/cmake/demos demos)
endif()
if(wxBUILD_BENCHMARKS)
add_subdirectory(build/cmake/benchmarks benchmarks)
endif()
if(NOT wxBUILD_CUSTOM_SETUP_HEADER_PATH)
# Write setup.h after all variables are available
include(build/cmake/setup.cmake)
endif()
if(WIN32_MSVC_NAMING)
include(build/cmake/build_cfg.cmake)
endif()
if(NOT MSVC)
# Write wx-config
include(build/cmake/config.cmake)
endif()
# Install target support
include(build/cmake/install.cmake)
# Determine minimum required OS at runtime
set(wxREQUIRED_OS_DESC "${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}")
if(MSVC OR MINGW OR CYGWIN)
set(wxREQUIRED_OS_DESC "Windows 7 / Windows Server 2008")
if(wxPLATFORM_ARCH)
wx_string_append(wxREQUIRED_OS_DESC " (${wxPLATFORM_ARCH} Edition)")
endif()
elseif(APPLE AND NOT IPHONE)
if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET)
set(wxREQUIRED_OS_DESC "macOS ${CMAKE_OSX_DEPLOYMENT_TARGET} ${CMAKE_SYSTEM_PROCESSOR}")
endif()
endif()
# Print configuration summary
wx_print_thirdparty_library_summary()
if(wxTOOLKIT_EXTRA)
string(REPLACE ";" ", " wxTOOLKIT_DESC "${wxTOOLKIT_EXTRA}")
set(wxTOOLKIT_DESC "with support for: ${wxTOOLKIT_DESC}")
endif()
message(STATUS "Configured wxWidgets ${wxVERSION} for ${CMAKE_SYSTEM_NAME}
Min OS Version required at runtime: ${wxREQUIRED_OS_DESC}
Which GUI toolkit should wxWidgets use? ${wxBUILD_TOOLKIT} ${wxTOOLKIT_VERSION} ${wxTOOLKIT_DESC}
Should wxWidgets be compiled into single library? ${wxBUILD_MONOLITHIC}
Should wxWidgets be linked as a shared library? ${wxBUILD_SHARED}
Which wxWidgets API compatibility should be used? ${wxBUILD_COMPATIBILITY}"
)

View File

@@ -0,0 +1,83 @@
# - Try to find Cairo
# Once done, this will define
#
# CAIRO_FOUND - system has Cairo
# CAIRO_INCLUDE_DIRS - the Cairo include directories
# CAIRO_LIBRARIES - link these to use Cairo
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_CAIRO QUIET cairo)
FIND_PATH(CAIRO_INCLUDE_DIRS
NAMES cairo.h
HINTS ${PC_CAIRO_INCLUDEDIR}
${PC_CAIRO_INCLUDE_DIRS}
PATH_SUFFIXES cairo
)
FIND_LIBRARY(CAIRO_LIBRARIES
NAMES cairo
HINTS ${PC_CAIRO_LIBDIR}
${PC_CAIRO_LIBRARY_DIRS}
)
IF (CAIRO_INCLUDE_DIRS)
IF (EXISTS "${CAIRO_INCLUDE_DIRS}/cairo-version.h")
FILE(READ "${CAIRO_INCLUDE_DIRS}/cairo-version.h" CAIRO_VERSION_CONTENT)
STRING(REGEX MATCH "#define +CAIRO_VERSION_MAJOR +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}")
SET(CAIRO_VERSION_MAJOR "${CMAKE_MATCH_1}")
STRING(REGEX MATCH "#define +CAIRO_VERSION_MINOR +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}")
SET(CAIRO_VERSION_MINOR "${CMAKE_MATCH_1}")
STRING(REGEX MATCH "#define +CAIRO_VERSION_MICRO +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}")
SET(CAIRO_VERSION_MICRO "${CMAKE_MATCH_1}")
SET(CAIRO_VERSION "${CAIRO_VERSION_MAJOR}.${CAIRO_VERSION_MINOR}.${CAIRO_VERSION_MICRO}")
ENDIF ()
ENDIF ()
# FIXME: Should not be needed anymore once we start depending on CMake 2.8.3
SET(VERSION_OK TRUE)
IF (Cairo_FIND_VERSION)
IF (Cairo_FIND_VERSION_EXACT)
IF ("${Cairo_FIND_VERSION}" VERSION_EQUAL "${CAIRO_VERSION}")
# FIXME: Use IF (NOT ...) with CMake 2.8.2+ to get rid of the ELSE block
ELSE ()
SET(VERSION_OK FALSE)
ENDIF ()
ELSE ()
IF ("${Cairo_FIND_VERSION}" VERSION_GREATER "${CAIRO_VERSION}")
SET(VERSION_OK FALSE)
ENDIF ()
ENDIF ()
ENDIF ()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cairo DEFAULT_MSG CAIRO_INCLUDE_DIRS CAIRO_LIBRARIES VERSION_OK)
mark_as_advanced(CAIRO_INCLUDE_DIRS CAIRO_LIBRARIES)

View File

@@ -0,0 +1,30 @@
# - Try to find Fontconfig
# Once done this will define
#
# FONTCONFIG_FOUND - system has Fontconfig
# FONTCONFIG_INCLUDE_DIRS - The include directory to use for the Fontconfig headers
# FONTCONFIG_LIBRARIES - Link these to use Fontconfig
find_package(PkgConfig)
pkg_check_modules(PC_FONTCONFIG QUIET fontconfig)
find_path(FONTCONFIG_INCLUDE_DIRS
NAMES fontconfig.h
HINTS ${PC_FONTCONFIG_INCLUDEDIR}
${PC_FONTCONFIG_INCLUDE_DIRS}
PATH_SUFFIXES fontconfig
)
find_library(FONTCONFIG_LIBRARIES
NAMES fontconfig
HINTS ${PC_FONTCONFIG_LIBDIR}
${PC_FONTCONFIG_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FONTCONFIG DEFAULT_MSG FONTCONFIG_INCLUDE_DIRS FONTCONFIG_LIBRARIES)
mark_as_advanced(
FONTCONFIG_INCLUDE_DIRS
FONTCONFIG_LIBRARIES
)

View File

@@ -0,0 +1,89 @@
# - Try to find GnomeVFS2
# Once done this will define
#
# GNOMEVFS2_FOUND - system has GnomeVFS2
# GNOMEVFS2_INCLUDE_DIRS - the GnomeVFS2 include directory
# GNOMEVFS2_LIBRARIES - Link these to use GnomeVFS2
# GNOMEVFS2_DEFINITIONS - Compiler switches required for using GnomeVFS2
#
# Copyright (c) 2008 Joshua L. Blocher <verbalshadow@gmail.com>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS)
# in cache already
set(GNOMEVFS2_FOUND TRUE)
else (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(gnome-vfs-2.0 _GNOMEVFS2_INCLUDEDIR _GNOMEVFS2_LIBDIR _GNOMEVFS2_LDFLAGS _GNOMEVFS2_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_GNOMEVFS2 gnome-vfs-2.0)
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_path(GNOMEVFS2_INCLUDE_DIR
NAMES
libgnomevfs/gnome-vfs.h
PATHS
${_GNOMEVFS2_INCLUDEDIR}
/usr/include
/usr/local/include
/opt/local/include
/sw/include
$ENV{DEVLIBS_PATH}//include//
PATH_SUFFIXES
gnome-vfs-2.0
)
find_library(GNOMEVFS-2_LIBRARY
NAMES
gnomevfs-2
PATHS
${_GNOMEVFS2_LIBDIR}
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
if (GNOMEVFS-2_LIBRARY)
set(GNOMEVFS-2_FOUND TRUE)
endif (GNOMEVFS-2_LIBRARY)
set(GNOMEVFS2_INCLUDE_DIRS
${GNOMEVFS2_INCLUDE_DIR}
)
if (GNOMEVFS-2_FOUND)
set(GNOMEVFS2_LIBRARIES
${GNOMEVFS2_LIBRARIES}
${GNOMEVFS-2_LIBRARY}
)
endif (GNOMEVFS-2_FOUND)
if (GNOMEVFS2_INCLUDE_DIRS AND GNOMEVFS2_LIBRARIES)
set(GNOMEVFS2_FOUND TRUE)
endif (GNOMEVFS2_INCLUDE_DIRS AND GNOMEVFS2_LIBRARIES)
if (GNOMEVFS2_FOUND)
if (NOT GNOMEVFS2_FIND_QUIETLY)
message(STATUS "Found GnomeVFS2: ${GNOMEVFS2_LIBRARIES}")
endif (NOT GNOMEVFS2_FIND_QUIETLY)
else (GNOMEVFS2_FOUND)
if (GNOMEVFS2_FIND_REQUIRED)
message(FATAL_ERROR "Could not find GnomeVFS2")
endif (GNOMEVFS2_FIND_REQUIRED)
endif (GNOMEVFS2_FOUND)
# show the GNOMEVFS2_INCLUDE_DIRS and GNOMEVFS2_LIBRARIES variables only in the advanced view
mark_as_advanced(GNOMEVFS2_INCLUDE_DIRS GNOMEVFS2_LIBRARIES GNOMEVFS2_INCLUDE_DIR GNOMEVFS-2_LIBRARY)
endif (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS)

View File

@@ -0,0 +1,42 @@
# - Try to find gspell
# Once done this will define
#
# GSPELL_FOUND - system has gspell
# GSPELL_INCLUDE_DIRS - The include directory to use for the gspell headers
# GSPELL_LIBRARIES - Link these to use gspell
find_package(PkgConfig)
pkg_check_modules(PC_GSPELL QUIET gspell-1)
find_path(GSPELL_INCLUDE_DIRS
NAMES gspell/gspell.h
HINTS ${PC_GSPELL_INCLUDEDIR}
${PC_GSPELL_INCLUDE_DIRS}
)
find_library(GSPELL_LIBRARIES
NAMES gspell-1
HINTS ${PC_GSPELL_LIBDIR}
${PC_GSPELL_LIBRARY_DIRS}
)
pkg_check_modules(PC_ENCHANT QUIET enchant-2 enchant)
find_path(ENCHANT_INCLUDE_DIRS
NAMES enchant.h
HINTS ${PC_ENCHANT_INCLUDEDIR}
${PC_ENCHANT_INCLUDE_DIRS}
PATH_SUFFIXES enchant-2 enchant
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSPELL DEFAULT_MSG GSPELL_INCLUDE_DIRS ENCHANT_INCLUDE_DIRS GSPELL_LIBRARIES)
if(GSPELL_FOUND)
set(GSPELL_INCLUDE_DIRS ${GSPELL_INCLUDE_DIRS} ${ENCHANT_INCLUDE_DIRS})
endif()
mark_as_advanced(
GSPELL_INCLUDE_DIRS
GSPELL_LIBRARIES
ENCHANT_INCLUDE_DIRS
)

View File

@@ -0,0 +1,131 @@
# - Try to find GStreamer and its plugins
# Once done, this will define
#
# GSTREAMER_FOUND - system has GStreamer
# GSTREAMER_INCLUDE_DIRS - the GStreamer include directories
# GSTREAMER_LIBRARIES - link these to use GStreamer
#
# Additionally, gstreamer-base is always looked for and required, and
# the following related variables are defined:
#
# GSTREAMER_BASE_INCLUDE_DIRS - gstreamer-base's include directory
# GSTREAMER_BASE_LIBRARIES - link to these to use gstreamer-base
#
# Optionally, the COMPONENTS keyword can be passed to find_package()
# and GStreamer plugins can be looked for. Currently, the following
# plugins can be searched, and they define the following variables if
# found:
#
# gstreamer-app: GSTREAMER_APP_INCLUDE_DIRS and GSTREAMER_APP_LIBRARIES
# gstreamer-audio: GSTREAMER_AUDIO_INCLUDE_DIRS and GSTREAMER_AUDIO_LIBRARIES
# gstreamer-fft: GSTREAMER_FFT_INCLUDE_DIRS and GSTREAMER_FFT_LIBRARIES
# gstreamer-interfaces: GSTREAMER_INTERFACES_INCLUDE_DIRS and GSTREAMER_INTERFACES_LIBRARIES
# gstreamer-pbutils: GSTREAMER_PBUTILS_INCLUDE_DIRS and GSTREAMER_PBUTILS_LIBRARIES
# gstreamer-video: GSTREAMER_VIDEO_INCLUDE_DIRS and GSTREAMER_VIDEO_LIBRARIES
# gstreamer-player: GSTREAMER_PLAYER_INCLUDE_DIRS and GSTREAMER_PLAYER_LIBRARIES
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_package(PkgConfig)
# Determine the version in the library name, default is 1.0
set(GST_LIB_VERSION 1.0)
if(DEFINED GSTREAMER_FIND_VERSION AND GSTREAMER_FIND_VERSION VERSION_LESS 1.0)
set(GST_LIB_VERSION 0.10)
endif()
# Helper macro to find a GStreamer plugin (or GStreamer itself)
# _component_prefix is prepended to the _INCLUDE_DIRS and _LIBRARIES variables (eg. "GSTREAMER_AUDIO")
# _pkgconfig_name is the component's pkg-config name (eg. "gstreamer", or "gstreamer-video").
# _header is the component's header, relative to the gstreamer-${GST_LIB_VERSION} directory (eg. "gst/gst.h").
# _library is the component's library name (eg. "gstreamer" or "gstvideo")
macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
pkg_check_modules(PC_${_component_prefix} QUIET ${_pkgconfig_name}-${GST_LIB_VERSION})
find_path(${_component_prefix}_INCLUDE_DIRS
NAMES ${_header}
HINTS ${PC_${_component_prefix}_INCLUDE_DIRS} ${PC_${_component_prefix}_INCLUDEDIR}
PATH_SUFFIXES gstreamer-${GST_LIB_VERSION}
)
find_library(${_component_prefix}_LIBRARIES
NAMES ${_library}-${GST_LIB_VERSION}
HINTS ${PC_${_component_prefix}_LIBRARY_DIRS} ${PC_${_component_prefix}_LIBDIR}
)
mark_as_advanced(${_component_prefix}_INCLUDE_DIRS ${_component_prefix}_LIBRARIES)
endmacro()
# ------------------------
# 1. Find GStreamer itself
# ------------------------
# 1.1. Find headers and libraries
FIND_GSTREAMER_COMPONENT(GSTREAMER gstreamer gst/gst.h gstreamer)
FIND_GSTREAMER_COMPONENT(GSTREAMER_BASE gstreamer-base gst/gst.h gstbase)
# 1.2. Check GStreamer version
if (GSTREAMER_INCLUDE_DIRS)
if (EXISTS "${GSTREAMER_INCLUDE_DIRS}/gst/gstversion.h")
file(READ "${GSTREAMER_INCLUDE_DIRS}/gst/gstversion.h" GSTREAMER_VERSION_CONTENTS)
string(REGEX MATCH "#define +GST_VERSION_MAJOR +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
set(GSTREAMER_VERSION_MAJOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define +GST_VERSION_MINOR +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
set(GSTREAMER_VERSION_MINOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define +GST_VERSION_MICRO +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
set(GSTREAMER_VERSION_MICRO "${CMAKE_MATCH_1}")
set(GSTREAMER_VERSION "${GSTREAMER_VERSION_MAJOR}.${GSTREAMER_VERSION_MINOR}.${GSTREAMER_VERSION_MICRO}")
endif ()
endif ()
# -------------------------
# 2. Find GStreamer plugins
# -------------------------
FIND_GSTREAMER_COMPONENT(GSTREAMER_APP gstreamer-app gst/app/gstappsink.h gstapp)
FIND_GSTREAMER_COMPONENT(GSTREAMER_AUDIO gstreamer-audio gst/audio/audio.h gstaudio)
FIND_GSTREAMER_COMPONENT(GSTREAMER_FFT gstreamer-fft gst/fft/gstfft.h gstfft)
FIND_GSTREAMER_COMPONENT(GSTREAMER_INTERFACES gstreamer-interfaces gst/interfaces/mixer.h gstinterfaces)
FIND_GSTREAMER_COMPONENT(GSTREAMER_PBUTILS gstreamer-pbutils gst/pbutils/pbutils.h gstpbutils)
FIND_GSTREAMER_COMPONENT(GSTREAMER_VIDEO gstreamer-video gst/video/video.h gstvideo)
FIND_GSTREAMER_COMPONENT(GSTREAMER_PLAYER gstreamer-player gst/player/player.h gstplayer)
# ------------------------------------------------
# 3. Process the COMPONENTS passed to FIND_PACKAGE
# ------------------------------------------------
set(_GSTREAMER_REQUIRED_VARS GSTREAMER_VERSION GSTREAMER_INCLUDE_DIRS GSTREAMER_LIBRARIES GSTREAMER_BASE_INCLUDE_DIRS GSTREAMER_BASE_LIBRARIES)
foreach (_component ${GSTREAMER_FIND_COMPONENTS})
set(_gst_component "GSTREAMER_${_component}")
string(TOUPPER ${_gst_component} _UPPER_NAME)
list(APPEND _GSTREAMER_REQUIRED_VARS ${_UPPER_NAME}_INCLUDE_DIRS ${_UPPER_NAME}_LIBRARIES)
endforeach ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSTREAMER DEFAULT_MSG ${_GSTREAMER_REQUIRED_VARS})

View File

@@ -0,0 +1,53 @@
# - Try to find GTK+ 3
# Once done, this will define
#
# GTK3_FOUND - system has GTK+ 3.
# GTK3_INCLUDE_DIRS - the GTK+ 3. include directories
# GTK3_LIBRARIES - link these to use GTK+ 3.
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
# Copyright (C) 2013 Igalia S.L.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_package(PkgConfig)
pkg_check_modules(GTK3 QUIET gtk+-3.0)
set(VERSION_OK TRUE)
if (GTK3_VERSION)
if (GTK3_FIND_VERSION_EXACT)
if (NOT("${GTK3_FIND_VERSION}" VERSION_EQUAL "${GTK3_VERSION}"))
set(VERSION_OK FALSE)
endif ()
else ()
if ("${GTK3_VERSION}" VERSION_LESS "${GTK3_FIND_VERSION}")
set(VERSION_OK FALSE)
endif ()
endif ()
endif ()
# Check for GDK Wayland support
include(CheckSymbolExists)
set(CMAKE_REQUIRED_INCLUDES ${GTK3_INCLUDE_DIRS})
check_symbol_exists(GDK_WINDOWING_WAYLAND "gdk/gdk.h" wxHAVE_GDK_WAYLAND)
check_symbol_exists(GDK_WINDOWING_X11 "gdk/gdk.h" wxHAVE_GDK_X11)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK3 DEFAULT_MSG GTK3_INCLUDE_DIRS GTK3_LIBRARIES VERSION_OK)
mark_as_advanced(GTK3_INCLUDE_DIRS GTK3_LIBRARIES)

View File

@@ -0,0 +1,48 @@
# - Try to find GTK+ 4
# Once done, this will define
#
# GTK4_FOUND - system has GTK+ 4.
# GTK4_INCLUDE_DIRS - the GTK+ 4. include directories
# GTK4_LIBRARIES - link these to use GTK+ 4.
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
# Copyright (C) 2013 Igalia S.L.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_package(PkgConfig)
pkg_check_modules(GTK4 QUIET gtk4)
set(VERSION_OK TRUE)
if (GTK4_VERSION)
if (GTK4_FIND_VERSION_EXACT)
if (NOT("${GTK4_FIND_VERSION}" VERSION_EQUAL "${GTK4_VERSION}"))
set(VERSION_OK FALSE)
endif ()
else ()
if ("${GTK4_VERSION}" VERSION_LESS "${GTK4_FIND_VERSION}")
set(VERSION_OK FALSE)
endif ()
endif ()
endif ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK4 DEFAULT_MSG GTK4_INCLUDE_DIRS GTK4_LIBRARIES VERSION_OK)
mark_as_advanced(GTK4_INCLUDE_DIRS GTK4_LIBRARIES)

View File

@@ -0,0 +1,33 @@
# - Try to find GTK Print
# Provide the GTK version as argument
# Once done this will define
#
# GTKPRINT_FOUND - system has GTK Print
# GTKPRINT_INCLUDE_DIRS - The include directory to use for the GTK Print headers
if(NOT GTKPRINT_FIND_VERSION EQUAL GTKPRINT_FIND_VERSION_USED)
unset(GTKPRINT_FOUND CACHE)
unset(GTKPRINT_INCLUDE_DIRS CACHE)
unset(GTKPRINT_FIND_VERSION_USED CACHE)
endif()
set(GTKPRINT_FIND_VERSION_USED "${GTKPRINT_FIND_VERSION}" CACHE INTERNAL "")
if(GTKPRINT_FIND_VERSION VERSION_LESS 3.0)
set(GTKPRINT_LIB_NAME "gtk+-unix-print-2.0")
else()
set(GTKPRINT_LIB_NAME "gtk+-unix-print-3.0")
endif()
find_package(PkgConfig)
pkg_check_modules(PC_GTKPRINT QUIET ${GTKPRINT_LIB_NAME})
find_path(GTKPRINT_INCLUDE_DIRS
NAMES gtk/gtkunixprint.h
HINTS ${PC_GTKPRINT_INCLUDEDIR}
${PC_GTKPRINT_INCLUDE_DIRS}
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTKPRINT DEFAULT_MSG GTKPRINT_INCLUDE_DIRS)
mark_as_advanced(GTKPRINT_INCLUDE_DIRS)

View File

@@ -0,0 +1,61 @@
# https://github.com/onyx-intl/cmake_modules/blob/master/FindIconv.cmake
#
# - Try to find Iconv
# Once done this will define
#
# ICONV_FOUND - system has Iconv
# ICONV_INCLUDE_DIR - the Iconv include directory
# ICONV_LIBRARIES - Link these to use Iconv
# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
#
include(CheckCXXSourceCompiles)
IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
# Already in cache, be silent
SET(ICONV_FIND_QUIETLY TRUE)
ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
SET(ICONV_FOUND TRUE)
ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
set(CMAKE_REQUIRED_QUIET ON)
IF(ICONV_FOUND)
check_cxx_source_compiles("
#include <iconv.h>
int main(){
iconv_t conv = 0;
const char* in = 0;
size_t ilen = 0;
char* out = 0;
size_t olen = 0;
iconv(conv, &in, &ilen, &out, &olen);
return 0;
}
" ICONV_SECOND_ARGUMENT_IS_CONST )
ENDIF(ICONV_FOUND)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
set(CMAKE_REQUIRED_QUIET)
IF(ICONV_FOUND)
IF(NOT ICONV_FIND_QUIETLY)
MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
ENDIF(NOT ICONV_FIND_QUIETLY)
ELSE(ICONV_FOUND)
IF(ICONV_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Iconv")
ENDIF(ICONV_FIND_REQUIRED)
ENDIF(ICONV_FOUND)
MARK_AS_ADVANCED(
ICONV_INCLUDE_DIR
ICONV_LIBRARIES
ICONV_SECOND_ARGUMENT_IS_CONST
)

View File

@@ -0,0 +1,55 @@
# - Try to find LibNotify
# This module defines the following variables:
#
# LIBNOTIFY_FOUND - LibNotify was found
# LIBNOTIFY_INCLUDE_DIRS - the LibNotify include directories
# LIBNOTIFY_LIBRARIES - link these to use LibNotify
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
# Copyright (C) 2014 Collabora Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_package(PkgConfig)
pkg_check_modules(LIBNOTIFY QUIET libnotify)
find_path(LIBNOTIFY_INCLUDE_DIRS
NAMES notify.h
HINTS ${LIBNOTIFY_INCLUDEDIR}
${LIBNOTIFY_INCLUDE_DIRS}
PATH_SUFFIXES libnotify
)
find_library(LIBNOTIFY_LIBRARIES
NAMES notify
HINTS ${LIBNOTIFY_LIBDIR}
${LIBNOTIFY_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBNOTIFY REQUIRED_VARS LIBNOTIFY_INCLUDE_DIRS LIBNOTIFY_LIBRARIES
VERSION_VAR LIBNOTIFY_VERSION)
mark_as_advanced(
LIBNOTIFY_INCLUDE_DIRS
LIBNOTIFY_LIBRARIES
)

View File

@@ -0,0 +1,51 @@
# - Try to find libsecret
# Once done, this will define
#
# LIBSECRET_FOUND - system has libsecret
# LIBSECRET_INCLUDE_DIRS - the libsecret include directories
# LIBSECRET_LIBRARIES - link these to use libsecret
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
# Copyright (C) 2014 Igalia S.L.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_package(PkgConfig)
pkg_check_modules(LIBSECRET QUIET libsecret-1)
set(VERSION_OK TRUE)
if (LIBSECRET_VERSION)
if (LIBSECRET_FIND_VERSION_EXACT)
if (NOT("${LIBSECRET_FIND_VERSION}" VERSION_EQUAL "${LIBSECRET_VERSION}"))
set(VERSION_OK FALSE)
endif ()
else ()
if ("${LIBSECRET_VERSION}" VERSION_LESS "${LIBSECRET_FIND_VERSION}")
set(VERSION_OK FALSE)
endif ()
endif ()
endif ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSECRET DEFAULT_MSG LIBSECRET_INCLUDE_DIRS LIBSECRET_LIBRARIES VERSION_OK)
mark_as_advanced(LIBSECRET_INCLUDE_DIRS LIBSECRET_LIBRARIES)

View File

@@ -0,0 +1,64 @@
# - Try to find LibSoup 2.4
# This module defines the following variables:
#
# LIBSOUP_FOUND - LibSoup 2.4 was found
# LIBSOUP_INCLUDE_DIRS - the LibSoup 2.4 include directories
# LIBSOUP_LIBRARIES - link these to use LibSoup 2.4
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# LibSoup does not provide an easy way to retrieve its version other than its
# .pc file, so we need to rely on PC_LIBSOUP_VERSION and REQUIRE the .pc file
# to be found.
SET(LIBSOUP_VERSION 2.4)
if(DEFINED LIBSOUP_FIND_VERSION)
SET(LIBSOUP_VERSION ${LIBSOUP_FIND_VERSION})
endif()
set(LIBSOUP_INCLUDE_DIRS LIBSOUP_INCLUDE_DIRS-NOTFOUND)
set(LIBSOUP_LIBRARIES LIBSOUP_LIBRARIES-NOTFOUND)
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_LIBSOUP QUIET libsoup-${LIBSOUP_VERSION})
if(PC_LIBSOUP_FOUND)
FIND_PATH(LIBSOUP_INCLUDE_DIRS
NAMES libsoup/soup.h
HINTS ${PC_LIBSOUP_INCLUDEDIR}
${PC_LIBSOUP_INCLUDE_DIRS}
PATH_SUFFIXES libsoup-${LIBSOUP_VERSION}
)
FIND_LIBRARY(LIBSOUP_LIBRARIES
NAMES soup-${LIBSOUP_VERSION}
HINTS ${PC_LIBSOUP_LIBDIR}
${PC_LIBSOUP_LIBRARY_DIRS}
)
endif()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSOUP REQUIRED_VARS LIBSOUP_INCLUDE_DIRS LIBSOUP_LIBRARIES
VERSION_VAR PC_LIBSOUP_VERSION)
mark_as_advanced(LIBSOUP_LIBRARIES LIBSOUP_INCLUDE_DIRS)

View File

@@ -0,0 +1,40 @@
## FindMSPACK.cmake
##
## Copyright (C) 2016 Christian Schenk
##
## This file is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation; either version 2, or (at your
## option) any later version.
##
## This file is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this file; if not, write to the Free Software
## Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
find_path(MSPACK_INCLUDE_DIR
NAMES
mspack.h
)
find_library(MSPACK_LIBRARY
NAMES
mspack
)
find_package_handle_standard_args(MSPACK DEFAULT_MSG MSPACK_LIBRARY MSPACK_INCLUDE_DIR)
if(MSPACK_FOUND)
set(MSPACK_INCLUDE_DIRS ${MSPACK_INCLUDE_DIR})
set(MSPACK_LIBRARIES ${MSPACK_LIBRARY})
else()
set(MSPACK_INCLUDE_DIRS)
set(MSPACK_LIBRARIES)
endif()
mark_as_advanced(MSPACK_LIBRARY MSPACK_INCLUDE_DIR)

View File

@@ -0,0 +1,30 @@
# - Try to find PangoFT2
# Once done this will define
#
# PANGOFT2_FOUND - system has PangoFT2
# PANGOFT2_INCLUDE_DIRS - The include directory to use for the PangoFT2 headers
# PANGOFT2_LIBRARIES - Link these to use PangoFT2
find_package(PkgConfig)
pkg_check_modules(PC_PANGOFT2 QUIET pangoft2)
find_path(PANGOFT2_INCLUDE_DIRS
NAMES pango-context.h
HINTS ${PC_PANGOFT2_INCLUDEDIR}
${PC_PANGOFT2_INCLUDE_DIRS}
PATH_SUFFIXES pango
)
find_library(PANGOFT2_LIBRARIES
NAMES pangoft2-1.0
HINTS ${PC_PANGOFT2_LIBDIR}
${PC_PANGOFT2_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PANGOFT2 REQUIRED_VARS PANGOFT2_INCLUDE_DIRS PANGOFT2_LIBRARIES)
mark_as_advanced(
PANGOFT2_INCLUDE_DIRS
PANGOFT2_LIBRARIES
)

View File

@@ -0,0 +1,43 @@
# Find the PCRE2 headers and libraries.
#
# Optionally define the following variables:
# PCRE2_CODE_UNIT_WIDTH - code unit width: 8 (default), 16 or 32 bit.
#
# This module defines the following variables:
# PCRE2_FOUND - true if PCRE2 is found.
# PCRE2_INCLUDE_DIRS - list of PCRE2 include directories.
# PCRE2_LIBRARIES - list of PCRE2 libraries.
if(NOT PCRE2_CODE_UNIT_WIDTH)
set(PCRE2_CODE_UNIT_WIDTH 8)
endif()
if(NOT PCRE2_CODE_UNIT_WIDTH EQUAL PCRE2_CODE_UNIT_WIDTH_USED)
unset(PCRE2_CODE_UNIT_WIDTH_USED CACHE)
unset(PCRE2_FOUND CACHE)
unset(PCRE2_INCLUDE_DIRS CACHE)
unset(PCRE2_LIBRARIES CACHE)
endif()
set(PCRE2_CODE_UNIT_WIDTH_USED "${PCRE2_CODE_UNIT_WIDTH}" CACHE INTERNAL "")
find_package(PkgConfig QUIET)
pkg_check_modules(PC_PCRE2 QUIET libpcre2-${PCRE2_CODE_UNIT_WIDTH})
find_path(PCRE2_INCLUDE_DIRS
NAMES pcre2.h
HINTS ${PC_PCRE2_INCLUDEDIR}
${PC_PCRE2_INCLUDE_DIRS}
)
find_library(PCRE2_LIBRARIES
NAMES pcre2-${PCRE2_CODE_UNIT_WIDTH}
HINTS ${PC_PCRE2_LIBDIR}
${PC_PCRE2_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE2 REQUIRED_VARS PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS VERSION_VAR PC_PCRE2_VERSION)
mark_as_advanced(PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS)

View File

@@ -0,0 +1,175 @@
# This module defines
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL2
# SDL2_INCLUDE_DIR, where to find SDL.h
#
# This module responds to the the flag:
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the the proper link flags
# as part of the returned SDL2_LIBRARY variable.
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDL2main which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL2_LIBRARY
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
#
#
# $SDL2DIR is an environment variable that would
# correspond to the ./configure --prefix=$SDL2DIR
# used in building SDL2.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDL2main which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL2/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL2/ (see FreeBSD).
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# message("<FindSDL2.cmake>")
SET(SDL2_SEARCH_PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
${SDL2_PATH}
)
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES include/SDL2 include
PATHS ${SDL2_SEARCH_PATHS}
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PATH_SUFFIXES lib64 lib/x64 lib)
else()
set(PATH_SUFFIXES lib/x86 lib)
endif()
FIND_LIBRARY(SDL2_LIBRARY_TEMP
NAMES SDL2
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES ${PATH_SUFFIXES}
PATHS ${SDL2_SEARCH_PATHS}
)
IF(NOT SDL2_BUILDING_LIBRARY)
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDL2main for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES ${PATH_SUFFIXES}
PATHS ${SDL2_SEARCH_PATHS}
)
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# SDL2 may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)
# MinGW needs an additional link flag, -mwindows
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -mwindows
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 "-mwindows" CACHE STRING "mwindows for MinGW")
ENDIF(MINGW)
IF(SDL2_LIBRARY_TEMP)
# For SDL2main
IF(NOT SDL2_BUILDING_LIBRARY)
IF(SDL2MAIN_LIBRARY)
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(SDL2MAIN_LIBRARY)
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
IF(APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
IF(NOT APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)
# For MinGW library
IF(MINGW)
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(MINGW)
# Set the final string here so the GUI reflects the final state.
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
ENDIF(SDL2_LIBRARY_TEMP)
# message("</FindSDL2.cmake>")
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
MARK_AS_ADVANCED(SDL2MAIN_LIBRARY SDL2_LIBRARY SDL2_INCLUDE_DIR)

View File

@@ -0,0 +1,20 @@
find_package(PkgConfig)
pkg_check_modules(WAYLANDEGL QUIET wayland-egl)
set(VERSION_OK TRUE)
if (WAYLANDEGL_VERSION)
if (WAYLANDEGL_FIND_VERSION_EXACT)
if (NOT("${WAYLANDEGL_FIND_VERSION}" VERSION_EQUAL "${WAYLANDEGL_VERSION}"))
set(VERSION_OK FALSE)
endif ()
else ()
if ("${WAYLANDEGL_VERSION}" VERSION_LESS "${WAYLANDEGL_FIND_VERSION}")
set(VERSION_OK FALSE)
endif ()
endif ()
endif ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLANDEGL DEFAULT_MSG WAYLANDEGL_LIBRARIES VERSION_OK)
mark_as_advanced(WAYLANDEGL_LIBRARIES)

View File

@@ -0,0 +1,40 @@
# - Find Webkit
# Find the Webkit includes and library
#
# WEBKIT_INCLUDE_DIR - Where to find webkit include sub-directory.
# WEBKIT_LIBRARIES - List of libraries when using Webkit.
# WEBKIT_FOUND - True if Webkit found.
SET(WEBKIT_VERSION 1.0)
if(DEFINED WEBKIT_FIND_VERSION)
SET(WEBKIT_VERSION ${WEBKIT_FIND_VERSION})
endif()
SET(WEBKIT_INCLUDE_DIR WEBKIT_INCLUDE_DIR-NOTFOUND)
SET(WEBKIT_LIBRARY WEBKIT_LIBRARY-NOTFOUND)
SET(WEBKIT_LIBRARIES WEBKIT_LIBRARIES-NOTFOUND)
FIND_PATH(WEBKIT_INCLUDE_DIR webkit/webkit.h
PATH_SUFFIXES "webkitgtk-${WEBKIT_VERSION}"
)
SET(WEBKIT_NAMES "webkitgtk-${WEBKIT_VERSION}")
FIND_LIBRARY(WEBKIT_LIBRARY
NAMES ${WEBKIT_NAMES}
)
# Handle the QUIETLY and REQUIRED arguments and set WEBKIT_FOUND to
# TRUE if all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
WEBKIT DEFAULT_MSG
WEBKIT_LIBRARY WEBKIT_INCLUDE_DIR
)
IF(WEBKIT_FOUND)
SET( WEBKIT_LIBRARIES ${WEBKIT_LIBRARY} )
ELSE(WEBKIT_FOUND)
SET( WEBKIT_LIBRARIES )
ENDIF(WEBKIT_FOUND)
MARK_AS_ADVANCED(WEBKIT_LIBRARY WEBKIT_LIBRARIES WEBKIT_INCLUDE_DIR)

View File

@@ -0,0 +1,50 @@
# - Find Webkit2
# Find the Webkit2 includes and library
#
# WEBKIT2_INCLUDE_DIR - Where to find Webkit2 include sub-directory.
# WEBKIT2_LIBRARIES - List of libraries when using Webkit2.
# WEBKIT2_FOUND - True if Webkit2 found.
SET(WEBKIT2_VERSION 4.0)
if(DEFINED WEBKIT2_FIND_VERSION)
SET(WEBKIT2_VERSION ${WEBKIT2_FIND_VERSION})
endif()
set(WEBKIT2_INCLUDE_DIR WEBKIT2_INCLUDE_DIR-NOTFOUND)
set(WEBKIT2_LIBRARY WEBKIT2_LIBRARY-NOTFOUND)
set(WEBKIT2_JS_LIBRARY WEBKIT2_JS_LIBRARY-NOTFOUND)
set(WEBKIT2_LIBRARIES WEBKIT2_LIBRARIES-NOTFOUND)
FIND_PATH(WEBKIT2_INCLUDE_DIR webkit2/webkit2.h
PATH_SUFFIXES "webkitgtk-${WEBKIT2_VERSION}"
)
SET(WEBKIT2_NAMES "webkit2gtk-${WEBKIT2_VERSION}")
FIND_LIBRARY(WEBKIT2_LIBRARY
NAMES ${WEBKIT2_NAMES}
)
SET(WEBKIT2_JS_NAMES "javascriptcoregtk-${WEBKIT2_VERSION}")
FIND_LIBRARY(WEBKIT2_JS_LIBRARY
NAMES ${WEBKIT2_JS_NAMES}
)
# Handle the QUIETLY and REQUIRED arguments and set WEBKIT2_FOUND to
# TRUE if all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
WEBKIT2 DEFAULT_MSG
WEBKIT2_LIBRARY WEBKIT2_INCLUDE_DIR
)
IF(WEBKIT2_FOUND)
SET( WEBKIT2_LIBRARIES ${WEBKIT2_LIBRARY} ${WEBKIT2_JS_LIBRARY} )
ELSE(WEBKIT2_FOUND)
SET( WEBKIT2_LIBRARIES )
ENDIF(WEBKIT2_FOUND)
MARK_AS_ADVANCED(WEBKIT2_LIBRARY
WEBKIT2_LIBRARIES
WEBKIT2_INCLUDE_DIR
WEBKIT2_JS_LIBRARY
)

View File

@@ -0,0 +1,28 @@
# FindXKBCommon
find_package(PkgConfig)
pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
find_path(XKBCOMMON_INCLUDE_DIRS
NAMES xkbcommon.h
HINTS ${PC_XKBCOMMON_INCLUDEDIR}
${PC_XKBCOMMON_INCLUDE_DIRS}
PATH_SUFFIXES xkbcommon
)
find_library(XKBCOMMON_LIBRARIES
NAMES xkbcommon
HINTS ${PC_XKBCOMMON_LIBDIR}
${PC_XKBCOMMON_LIBRARY_DIRS}
)
set(XKBCOMMON_VERSION ${PC_XKBCOMMON_VERSION})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(XKBCommon REQUIRED_VARS XKBCOMMON_INCLUDE_DIRS XKBCOMMON_LIBRARIES
VERSION_VAR XKBCOMMON_VERSION)
mark_as_advanced(
XKBCOMMON_INCLUDE_DIRS
XKBCOMMON_LIBRARIES
)

View File

@@ -0,0 +1,51 @@
# - Find XTEST
# Find the XTEST libraries
#
# This module defines the following variables:
# XTEST_FOUND - true if XTEST_INCLUDE_DIR & XTEST_LIBRARY are found
# XTEST_LIBRARIES - Set when XTEST_LIBRARY is found
# XTEST_INCLUDE_DIRS - Set when XTEST_INCLUDE_DIR is found
#
# XTEST_INCLUDE_DIR - where to find XTest.h, etc.
# XTEST_LIBRARY - the XTEST library
#
#=============================================================================
# Copyright 2011 O.S. Systems Software Ltda.
# Copyright 2011 Otavio Salvador <otavio@ossystems.com.br>
# Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
find_path(XTEST_INCLUDE_DIR NAMES X11/extensions/XTest.h
PATH_SUFFIXES X11/extensions
PATHS /opt/X11/include
DOC "The XTest include directory"
)
find_library(XTEST_LIBRARY NAMES Xtst
PATHS /opt/X11/lib
DOC "The XTest library"
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XTEST DEFAULT_MSG XTEST_LIBRARY XTEST_INCLUDE_DIR)
if(XTEST_FOUND)
set( XTEST_LIBRARIES ${XTEST_LIBRARY} )
set( XTEST_INCLUDE_DIRS ${XTEST_INCLUDE_DIR} )
endif()
mark_as_advanced(XTEST_INCLUDE_DIR XTEST_LIBRARY)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
# cotire example project
cmake_minimum_required(VERSION 2.8.12)
if (POLICY CMP0058)
# Ninja requires custom command byproducts to be explicit
cmake_policy(SET CMP0058 NEW)
endif()
project (CotireExample)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/..")
if (NOT CMAKE_VERSION VERSION_LESS "3.1.0")
set (CMAKE_CXX_STANDARD "98")
set (CMAKE_CXX_EXTENSIONS OFF)
endif()
include(cotire)
add_subdirectory(src)

View File

@@ -0,0 +1,22 @@
Copyright (c) 2012-2018 Sascha Kratky
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,31 @@
# cotire example project
add_executable(example main.cpp example.cpp log.cpp log.h example.h)
# enable warnings
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(example PROPERTIES COMPILE_FLAGS "-Weverything")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set_target_properties(example PROPERTIES COMPILE_FLAGS "-Wall -Wextra")
endif()
cotire(example)
# cotire sets the following properties
get_target_property(_unitySource example COTIRE_CXX_UNITY_SOURCE)
get_target_property(_prefixHeader example COTIRE_CXX_PREFIX_HEADER)
get_target_property(_precompiledHeader example COTIRE_CXX_PRECOMPILED_HEADER)
get_target_property(_unityTargetName example COTIRE_UNITY_TARGET_NAME)
if (_unitySource)
message(STATUS "example unity source: ${_unitySource}")
endif()
if (_prefixHeader)
message(STATUS "example prefix header: ${_prefixHeader}")
endif()
if (_precompiledHeader)
message(STATUS "example precompiled header: ${_precompiledHeader}")
endif()
if (TARGET ${_unityTargetName})
message(STATUS "example unity target: ${_unityTargetName}")
endif()

View File

@@ -0,0 +1,24 @@
// cotire example project
#include "example.h"
#ifndef NDEBUG
#include <algorithm>
#include <iterator>
#endif
namespace example {
std::string get_message() {
char msg_chrs[] = { 'C', 'o', 't', 'i', 'r', 'e', 'd', '!' };
#ifdef NDEBUG
return std::string(&msg_chrs[0], &msg_chrs[sizeof(msg_chrs)]);
#else
std::string msg;
msg.reserve(sizeof(msg_chrs));
std::copy(msg_chrs, msg_chrs + sizeof(msg_chrs), std::back_inserter(msg));
return msg;
#endif
}
}

View File

@@ -0,0 +1,10 @@
// cotire example project
#include <string>
namespace example {
std::string get_message();
}

View File

@@ -0,0 +1,17 @@
// cotire example project
#include "log.h"
#include <iostream>
namespace logging {
void error(const std::string& msg) {
std::cerr << msg << std::endl;
}
void info(const std::string& msg) {
std::cout << msg << std::endl;
}
}

View File

@@ -0,0 +1,10 @@
// cotire example project
#include <string>
namespace logging {
void error(const std::string& msg);
void info(const std::string& msg);
}

View File

@@ -0,0 +1,12 @@
// cotire example project main
#include <string>
#include "example.h"
#include "log.h"
int main()
{
std::string msg = example::get_message();
logging::info(msg);
}

View File

@@ -0,0 +1,528 @@
#############################################################################
# Name: build/cmake/options.cmake
# Purpose: User selectable build options
# Author: Tobias Taschner
# Created: 2016-09-24
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
# Global build options
wx_option(wxBUILD_SHARED "Build wx libraries as shared libs" ${BUILD_SHARED_LIBS})
wx_option(wxBUILD_MONOLITHIC "build wxWidgets as single library" OFF)
wx_option(wxBUILD_SAMPLES "Build only important samples (SOME) or ALL" OFF
STRINGS SOME ALL OFF)
wx_option(wxBUILD_TESTS "Build console tests (CONSOLE_ONLY) or ALL" OFF
STRINGS CONSOLE_ONLY ALL OFF)
wx_option(wxBUILD_DEMOS "Build demos" OFF)
wx_option(wxBUILD_BENCHMARKS "Build benchmarks" OFF)
wx_option(wxBUILD_LOCALES "Build locales" AUTO STRINGS ON OFF AUTO)
mark_as_advanced(wxBUILD_LOCALES)
wx_option(wxBUILD_PRECOMP "Use precompiled headers" ON STRINGS ON OFF COTIRE)
mark_as_advanced(wxBUILD_PRECOMP)
wx_option(wxBUILD_INSTALL "Create install/uninstall target for wxWidgets")
wx_option(wxBUILD_COMPATIBILITY
"enable compatibilty with earlier wxWidgets versions" 3.2 STRINGS 3.0 3.2 NONE)
mark_as_advanced(wxBUILD_COMPATIBILITY)
# Allow user specified setup.h folder
set(wxBUILD_CUSTOM_SETUP_HEADER_PATH "" CACHE PATH "Include path containing custom wx/setup.h")
mark_as_advanced(wxBUILD_CUSTOM_SETUP_HEADER_PATH)
if(WIN32)
wx_option(wxUSE_DPI_AWARE_MANIFEST "DPI Awareness" "per-monitor" STRINGS "none" "system" "per-monitor")
endif()
wx_option(wxBUILD_DEBUG_LEVEL "Debug Level" Default STRINGS Default 0 1 2)
mark_as_advanced(wxBUILD_DEBUG_LEVEL)
if(NOT APPLE)
set(wxBUILD_USE_STATIC_RUNTIME_DEFAULT OFF)
if(MSVC AND CMAKE_MSVC_RUNTIME_LIBRARY AND NOT CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "DLL")
set(wxBUILD_USE_STATIC_RUNTIME_DEFAULT ON)
endif()
wx_option(wxBUILD_USE_STATIC_RUNTIME "Link using the static runtime library" ${wxBUILD_USE_STATIC_RUNTIME_DEFAULT})
mark_as_advanced(wxBUILD_USE_STATIC_RUNTIME)
endif()
if(MSVC)
wx_option(wxBUILD_MSVC_MULTIPROC "Enable multi-processor compilation for MSVC")
mark_as_advanced(wxBUILD_MSVC_MULTIPROC)
endif()
# support setting the C++ standard, present it an option to the user
if(DEFINED CMAKE_CXX_STANDARD)
set(wxCXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD})
else()
set(wxCXX_STANDARD_DEFAULT COMPILER_DEFAULT)
endif()
wx_option(wxBUILD_CXX_STANDARD "C++ standard used to build wxWidgets targets"
${wxCXX_STANDARD_DEFAULT} STRINGS COMPILER_DEFAULT 11 14 17 20 23 26)
if(UNIX)
wx_option(wxBUILD_LARGEFILE_SUPPORT "support for large files")
mark_as_advanced(wxBUILD_LARGEFILE_SUPPORT)
endif()
if(WIN32)
set(wxBUILD_VENDOR "custom" CACHE STRING "Short string identifying your company (used in DLL name)")
endif()
set(wxBUILD_FLAVOUR "" CACHE STRING "Specify a name to identify the build")
mark_as_advanced(wxBUILD_FLAVOUR)
wx_option(wxBUILD_OPTIMISE "use speed-optimised C/C++ compiler flags for release build" OFF)
mark_as_advanced(wxBUILD_OPTIMISE)
if(MSVC)
set(wxBUILD_STRIPPED_RELEASE_DEFAULT OFF)
else()
set(wxBUILD_STRIPPED_RELEASE_DEFAULT ON)
endif()
wx_option(wxBUILD_STRIPPED_RELEASE "remove debug symbols in release build" ${wxBUILD_STRIPPED_RELEASE_DEFAULT})
mark_as_advanced(wxBUILD_STRIPPED_RELEASE)
wx_option(wxBUILD_PIC "Enable position independent code (PIC)." ON)
mark_as_advanced(wxBUILD_PIC)
wx_option(wxUSE_NO_RTTI "disable RTTI support" OFF)
set(wxBUILD_INSTALL_RUNTIME_DIR "" CACHE PATH "override default sub-directory to install runtime files")
mark_as_advanced(wxBUILD_INSTALL_RUNTIME_DIR)
set(wxBUILD_INSTALL_LIBRARY_DIR "" CACHE PATH "override default sub-directory to install library files")
mark_as_advanced(wxBUILD_INSTALL_LIBRARY_DIR)
set(wxBUILD_INSTALL_ARCHIVE_DIR "" CACHE PATH "override default sub-directory to install archive files")
mark_as_advanced(wxBUILD_INSTALL_ARCHIVE_DIR)
wx_option(wxBUILD_INSTALL_PLATFORM_SUBDIR "platform specific sub-directory (MSVC-naming)" ON)
mark_as_advanced(wxBUILD_INSTALL_PLATFORM_SUBDIR)
wx_option(wxBUILD_INSTALL_PDB "install pdb files in the runtime direcotry (MSVC)" OFF)
mark_as_advanced(wxBUILD_INSTALL_PDB)
# Use the MSVC/makefile naming convention, or the configure naming convention,
# this is the same check as used in FindwxWidgets.
wx_option(wxBUILD_WIN32_MSVC_NAMING "Force the MSVC / makefile.[gcc/vc] naming convention" AUTO STRINGS ON OFF AUTO)
mark_as_advanced(wxBUILD_WIN32_MSVC_NAMING)
if(wxBUILD_WIN32_MSVC_NAMING STREQUAL "AUTO")
if(MSVC)
set(WIN32_MSVC_NAMING 1)
elseif(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT CMAKE_CROSSCOMPILING)
set(WIN32_MSVC_NAMING 1)
else()
set(WIN32_MSVC_NAMING 0)
endif()
else()
set(WIN32_MSVC_NAMING ${wxBUILD_WIN32_MSVC_NAMING})
endif()
# STL options
wx_option(wxUSE_STD_IOSTREAM "use standard C++ streams" ON)
wx_option(wxUSE_STD_CONTAINERS "use standard C++ container classes" ON)
wx_option(wxUSE_UNICODE_UTF8 "use UTF-8 representation for strings" OFF)
wx_dependent_option(wxUSE_UTF8_LOCALE_ONLY "only support UTF-8 locales in UTF-8 build" ON "wxUSE_UNICODE_UTF8" OFF)
if(NOT WIN32)
wx_option(wxUSE_VISIBILITY "use of ELF symbols visibility")
endif()
wx_option(wxUSE_STD_STRING_CONV_IN_WXSTRING "provide implicit conversions to std::wstring and std::string in wxString" OFF)
wx_option(wxUSE_UNSAFE_WXSTRING_CONV "provide unsafe implicit conversions in wxString to const char* or std::string")
wx_option(wxUSE_REPRODUCIBLE_BUILD "enable reproducable build" OFF)
# ---------------------------------------------------------------------------
# external libraries
# ---------------------------------------------------------------------------
set(PCRE2_CODE_UNIT_WIDTH 8)
if(NOT DEFINED wxUSE_UNICODE_UTF8 OR NOT wxUSE_UNICODE_UTF8)
# This is also checked in setup.cmake, but setup.cmake will run after options.cmake.
include(CheckTypeSize)
check_type_size(wchar_t SIZEOF_WCHAR_T)
if(HAVE_SIZEOF_WCHAR_T AND SIZEOF_WCHAR_T EQUAL 2)
set(PCRE2_CODE_UNIT_WIDTH 16)
elseif(HAVE_SIZEOF_WCHAR_T AND SIZEOF_WCHAR_T EQUAL 4)
set(PCRE2_CODE_UNIT_WIDTH 32)
endif()
endif()
wx_option(wxUSE_SYS_LIBS "disable to force using all built-in libraries")
wx_add_thirdparty_library(wxUSE_REGEX PCRE2 "enable support for wxRegEx class")
wx_add_thirdparty_library(wxUSE_ZLIB ZLIB "use zlib for LZW compression" DEFAULT_APPLE sys)
wx_add_thirdparty_library(wxUSE_EXPAT EXPAT "use expat for XML parsing" DEFAULT_APPLE sys)
wx_add_thirdparty_library(wxUSE_LIBJPEG JPEG "use libjpeg (JPEG file format)")
wx_add_thirdparty_library(wxUSE_LIBPNG PNG "use libpng (PNG image format)")
wx_add_thirdparty_library(wxUSE_LIBTIFF TIFF "use libtiff (TIFF file format)")
wx_add_thirdparty_library(wxUSE_LIBWEBP WebP "use libwebp (WebP file format)")
wx_add_thirdparty_library(wxUSE_NANOSVG NanoSVG "use NanoSVG for rasterizing SVG" DEFAULT builtin)
wx_option(wxUSE_LIBLZMA "use LZMA compression" OFF)
set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBLZMA "use liblzma for LZMA compression")
wx_option(wxUSE_OPENGL "use OpenGL (or Mesa)")
if(UNIX)
wx_option(wxUSE_LIBSDL "use SDL for audio on Unix")
wx_option(wxUSE_LIBICONV "use libiconv (character conversion)")
wx_option(wxUSE_LIBNOTIFY "use libnotify for notifications")
wx_option(wxUSE_XTEST "use XTest extension")
wx_option(wxUSE_LIBMSPACK "use libmspack (CHM help files loading)")
wx_option(wxUSE_GTKPRINT "use GTK printing support")
wx_option(wxUSE_LIBGNOMEVFS "use GNOME VFS for associating MIME types")
wx_option(wxUSE_GLCANVAS_EGL "use EGL backend for wxGLCanvas")
set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBSDL "use SDL for audio on Unix")
set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBMSPACK "use libmspack (CHM help files loading)")
endif()
# ---------------------------------------------------------------------------
# optional non GUI features
# ---------------------------------------------------------------------------
wx_option(wxUSE_INTL "use internationalization system")
wx_option(wxUSE_XLOCALE "use x-locale support (requires wxLocale)")
wx_option(wxUSE_CONFIG "use wxConfig (and derived) classes")
wx_option(wxUSE_SOCKETS "use socket/network classes")
wx_option(wxUSE_IPV6 "enable IPv6 support in wxSocket")
if(WIN32)
wx_option(wxUSE_OLE "use OLE classes")
endif()
wx_option(wxUSE_DATAOBJ "use data object classes")
wx_option(wxUSE_IPC "use interprocess communication (wxSocket etc.)")
wx_option(wxUSE_CONSOLE_EVENTLOOP "use event loop in console programs too")
# please keep the settings below in alphabetical order
wx_option(wxUSE_ANY "use wxAny class")
wx_option(wxUSE_APPLE_IEEE "use the Apple IEEE codec")
wx_option(wxUSE_ARCHIVE_STREAMS "use wxArchive streams")
wx_option(wxUSE_BASE64 "use base64 encoding/decoding functions")
wx_option(wxUSE_STACKWALKER "use wxStackWalker class for getting backtraces")
wx_option(wxUSE_ON_FATAL_EXCEPTION "catch signals in wxApp::OnFatalException")
wx_option(wxUSE_CMDLINE_PARSER "use wxCmdLineParser class")
wx_option(wxUSE_DATETIME "use wxDateTime class")
wx_option(wxUSE_DEBUGREPORT "use wxDebugReport class")
if(APPLE)
set(wxUSE_DIALUP_MANAGER_DEFAULT OFF)
else()
set(wxUSE_DIALUP_MANAGER_DEFAULT ON)
endif()
wx_option(wxUSE_DIALUP_MANAGER "use dialup network classes" ${wxUSE_DIALUP_MANAGER_DEFAULT})
wx_option(wxUSE_DYNLIB_CLASS "use wxDynamicLibrary class for DLL loading")
wx_option(wxUSE_DYNAMIC_LOADER "use wxPluginLibrary and wxPluginManager classes")
wx_option(wxUSE_EXCEPTIONS "build exception-safe library")
wx_option(wxUSE_EXTENDED_RTTI "use extended RTTI (XTI)" OFF)
wx_option(wxUSE_FFILE "use wxFFile class")
wx_option(wxUSE_FILE "use wxFile class")
wx_option(wxUSE_FILE_HISTORY "use wxFileHistory class")
wx_option(wxUSE_FILESYSTEM "use virtual file systems classes")
wx_option(wxUSE_FONTENUM "use wxFontEnumerator class")
wx_option(wxUSE_FONTMAP "use font encodings conversion classes")
wx_option(wxUSE_FS_ARCHIVE "use virtual archive filesystems")
wx_option(wxUSE_FS_INET "use virtual HTTP/FTP filesystems")
wx_option(wxUSE_FS_ZIP "now replaced by fs_archive")
if(WIN32 OR APPLE)
wx_option(wxUSE_FSVOLUME "use wxFSVolume class")
endif()
wx_option(wxUSE_FSWATCHER "use wxFileSystemWatcher class")
wx_option(wxUSE_GEOMETRY "use geometry class")
wx_option(wxUSE_LOG "use logging system")
wx_option(wxUSE_MIMETYPE "use wxMimeTypesManager")
wx_option(wxUSE_PRINTF_POS_PARAMS "use wxVsnprintf() which supports positional parameters")
wx_option(wxUSE_SECRETSTORE "use wxSecretStore class")
wx_option(wxUSE_SNGLINST_CHECKER "use wxSingleInstanceChecker class")
wx_option(wxUSE_SOUND "use wxSound class")
wx_option(wxUSE_SPELLCHECK "enable spell checking in wxTextCtrl")
wx_option(wxUSE_STDPATHS "use wxStandardPaths class")
wx_option(wxUSE_STOPWATCH "use wxStopWatch class")
wx_option(wxUSE_STREAMS "use wxStream etc classes")
wx_option(wxUSE_SYSTEM_OPTIONS "use wxSystemOptions")
wx_option(wxUSE_TARSTREAM "use wxTar streams")
wx_option(wxUSE_TEXTBUFFER "use wxTextBuffer class")
wx_option(wxUSE_TEXTFILE "use wxTextFile class")
wx_option(wxUSE_TIMER "use wxTimer class")
wx_option(wxUSE_VARIANT "use wxVariant class")
# WebRequest options
wx_option(wxUSE_WEBREQUEST "use wxWebRequest class")
if(WIN32)
wx_option(wxUSE_WEBREQUEST_WINHTTP "use wxWebRequest WinHTTP backend")
endif()
if(APPLE)
wx_option(wxUSE_WEBREQUEST_URLSESSION "use wxWebRequest URLSession backend")
endif()
if(APPLE OR WIN32)
set(wxUSE_WEBREQUEST_CURL_DEFAULT OFF)
else()
set(wxUSE_WEBREQUEST_CURL_DEFAULT ON)
endif()
wx_option(wxUSE_WEBREQUEST_CURL "use wxWebRequest libcurl backend" ${wxUSE_WEBREQUEST_CURL_DEFAULT})
wx_option(wxUSE_ZIPSTREAM "use wxZip streams")
# URL-related classes
wx_option(wxUSE_URL "use wxURL class")
wx_option(wxUSE_PROTOCOL "use wxProtocol class")
wx_option(wxUSE_PROTOCOL_HTTP "HTTP support in wxProtocol")
wx_option(wxUSE_PROTOCOL_FTP "FTP support in wxProtocol")
wx_option(wxUSE_PROTOCOL_FILE "FILE support in wxProtocol")
wx_option(wxUSE_THREADS "use threads")
if(WIN32)
wx_option(wxUSE_DBGHELP "use dbghelp.dll API")
wx_option(wxUSE_INICONF "use wxIniConfig")
wx_option(wxUSE_WINSOCK2 "include <winsock2.h> rather than <winsock.h>" OFF)
wx_option(wxUSE_REGKEY "use wxRegKey class")
endif()
if(wxUSE_GUI)
# ---------------------------------------------------------------------------
# optional "big" GUI features
# ---------------------------------------------------------------------------
wx_option(wxUSE_DOC_VIEW_ARCHITECTURE "use document view architecture")
wx_option(wxUSE_HELP "use help subsystem")
wx_option(wxUSE_MS_HTML_HELP "use MS HTML Help (win32)")
wx_option(wxUSE_HTML "use wxHTML sub-library")
wx_option(wxUSE_WXHTML_HELP "use wxHTML-based help")
wx_option(wxUSE_XRC "use XRC resources sub-library")
wx_option(wxUSE_XML "use the xml library (overruled by wxUSE_XRC)")
wx_option(wxUSE_AUI "use AUI docking library")
wx_option(wxUSE_PROPGRID "use wxPropertyGrid library")
wx_option(wxUSE_RIBBON "use wxRibbon library")
wx_option(wxUSE_STC "use wxStyledTextCtrl library")
wx_option(wxUSE_CONSTRAINTS "use layout-constraints system")
wx_option(wxUSE_LOGGUI "use standard GUI logger")
wx_option(wxUSE_LOGWINDOW "use wxLogWindow")
wx_option(wxUSE_LOG_DIALOG "use wxLogDialog")
wx_option(wxUSE_MDI "use multiple document interface architecture")
wx_option(wxUSE_MDI_ARCHITECTURE "use docview architecture with MDI")
wx_option(wxUSE_MEDIACTRL "use wxMediaCtrl class")
wx_option(wxUSE_RICHTEXT "use wxRichTextCtrl")
wx_option(wxUSE_POSTSCRIPT "use wxPostscriptDC device context (default for gtk+)")
wx_option(wxUSE_AFM_FOR_POSTSCRIPT "in wxPostScriptDC class use AFM (adobe font metrics) file for character widths")
wx_option(wxUSE_PRINTING_ARCHITECTURE "use printing architecture")
wx_option(wxUSE_SVG "use wxSVGFileDC device context")
wx_option(wxUSE_WEBVIEW "use wxWebView library")
wx_option(wxUSE_WEBVIEW_CHROMIUM "Enable CEF based wxWebViewChromium" OFF)
# wxDC is implemented in terms of wxGraphicsContext in wxOSX so the latter
# can't be disabled, don't even provide an option to do it
if(APPLE)
set(wxUSE_GRAPHICS_CONTEXT ON)
else()
wx_option(wxUSE_GRAPHICS_CONTEXT "use graphics context 2D drawing API")
if(WIN32)
wx_option(wxUSE_GRAPHICS_DIRECT2D "enable Direct2D graphics context")
endif()
endif()
if(WXGTK)
set(wxUSE_CAIRO_DEFAULT ON)
else()
set(wxUSE_CAIRO_DEFAULT OFF)
endif()
wx_option(wxUSE_CAIRO "enable Cairo graphics context" ${wxUSE_CAIRO_DEFAULT})
# ---------------------------------------------------------------------------
# IPC &c
# ---------------------------------------------------------------------------
wx_option(wxUSE_CLIPBOARD "use wxClipboard class")
wx_option(wxUSE_DRAG_AND_DROP "use Drag'n'Drop classes")
# ---------------------------------------------------------------------------
# optional GUI controls (in alphabetical order except the first one)
# ---------------------------------------------------------------------------
# don't set DEFAULT_wxUSE_XXX below if the option is not specified
wx_option(wxUSE_CONTROLS "disable compilation of all standard controls")
# features affecting multiple controls
wx_option(wxUSE_MARKUP "support wxControl::SetLabelMarkup")
# please keep the settings below in alphabetical order
wx_option(wxUSE_ACCEL "use accelerators")
wx_option(wxUSE_ACTIVITYINDICATOR "use wxActivityIndicator class")
wx_option(wxUSE_ADDREMOVECTRL "use wxAddRemoveCtrl")
wx_option(wxUSE_ANIMATIONCTRL "use wxAnimationCtrl class")
wx_option(wxUSE_BANNERWINDOW "use wxBannerWindow class")
wx_option(wxUSE_ARTPROVIDER_STD "use standard XPM icons in wxArtProvider")
wx_option(wxUSE_ARTPROVIDER_TANGO "use Tango icons in wxArtProvider")
wx_option(wxUSE_BMPBUTTON "use wxBitmapButton class")
wx_option(wxUSE_BITMAPCOMBOBOX "use wxBitmapComboBox class")
wx_option(wxUSE_BUTTON "use wxButton class")
wx_option(wxUSE_CALENDARCTRL "use wxCalendarCtrl class")
wx_option(wxUSE_CARET "use wxCaret class")
wx_option(wxUSE_CHECKBOX "use wxCheckBox class")
wx_option(wxUSE_CHECKLISTBOX "use wxCheckListBox (listbox with checkboxes) class")
wx_option(wxUSE_CHOICE "use wxChoice class")
wx_option(wxUSE_CHOICEBOOK "use wxChoicebook class")
wx_option(wxUSE_COLLPANE "use wxCollapsiblePane class")
wx_option(wxUSE_COLOURPICKERCTRL "use wxColourPickerCtrl class")
wx_option(wxUSE_COMBOBOX "use wxComboBox class")
wx_option(wxUSE_COMBOCTRL "use wxComboCtrl class")
wx_option(wxUSE_COMMANDLINKBUTTON "use wxCommmandLinkButton class")
wx_option(wxUSE_DATAVIEWCTRL "use wxDataViewCtrl class")
wx_option(wxUSE_NATIVE_DATAVIEWCTRL "use the native wxDataViewCtrl if available")
wx_option(wxUSE_DATEPICKCTRL "use wxDatePickerCtrl class")
wx_option(wxUSE_DETECT_SM "use code to detect X11 session manager" OFF)
wx_option(wxUSE_DIRPICKERCTRL "use wxDirPickerCtrl class")
wx_option(wxUSE_DISPLAY "use wxDisplay class")
wx_option(wxUSE_EDITABLELISTBOX "use wxEditableListBox class")
wx_option(wxUSE_FILECTRL "use wxFileCtrl class")
wx_option(wxUSE_FILEPICKERCTRL "use wxFilePickerCtrl class")
wx_option(wxUSE_FONTPICKERCTRL "use wxFontPickerCtrl class")
wx_option(wxUSE_GAUGE "use wxGauge class")
wx_option(wxUSE_GRID "use wxGrid class")
wx_option(wxUSE_HEADERCTRL "use wxHeaderCtrl class")
wx_option(wxUSE_HYPERLINKCTRL "use wxHyperlinkCtrl class")
wx_option(wxUSE_IMAGLIST "use wxImageList class")
wx_option(wxUSE_INFOBAR "use wxInfoBar class")
wx_option(wxUSE_LISTBOOK "use wxListbook class")
wx_option(wxUSE_LISTBOX "use wxListBox class")
wx_option(wxUSE_LISTCTRL "use wxListCtrl class")
wx_option(wxUSE_NOTEBOOK "use wxNotebook class")
wx_option(wxUSE_NOTIFICATION_MESSAGE "use wxNotificationMessage class")
wx_option(wxUSE_ODCOMBOBOX "use wxOwnerDrawnComboBox class")
wx_option(wxUSE_POPUPWIN "use wxPopUpWindow class")
wx_option(wxUSE_PREFERENCES_EDITOR "use wxPreferencesEditor class")
wx_option(wxUSE_RADIOBOX "use wxRadioBox class")
wx_option(wxUSE_RADIOBTN "use wxRadioButton class")
wx_option(wxUSE_RICHMSGDLG "use wxRichMessageDialog class")
wx_option(wxUSE_RICHTOOLTIP "use wxRichToolTip class")
wx_option(wxUSE_REARRANGECTRL "use wxRearrangeList/Ctrl/Dialog")
wx_option(wxUSE_SASH "use wxSashWindow class")
wx_option(wxUSE_SCROLLBAR "use wxScrollBar class and scrollable windows")
wx_option(wxUSE_SEARCHCTRL "use wxSearchCtrl class")
wx_option(wxUSE_SLIDER "use wxSlider class")
wx_option(wxUSE_SPINBTN "use wxSpinButton class")
wx_option(wxUSE_SPINCTRL "use wxSpinCtrl class")
wx_option(wxUSE_SPLITTER "use wxSplitterWindow class")
wx_option(wxUSE_STATBMP "use wxStaticBitmap class")
wx_option(wxUSE_STATBOX "use wxStaticBox class")
wx_option(wxUSE_STATLINE "use wxStaticLine class")
wx_option(wxUSE_STATTEXT "use wxStaticText class")
wx_option(wxUSE_STATUSBAR "use wxStatusBar class")
wx_option(wxUSE_TASKBARBUTTON "use wxTaskBarButton class")
wx_option(wxUSE_TASKBARICON "use wxTaskBarIcon class")
wx_option(wxUSE_TOOLBAR_NATIVE "use native wxToolBar class")
wx_option(wxUSE_TEXTCTRL "use wxTextCtrl class")
if(wxUSE_TEXTCTRL)
# we don't have special switches to disable wxUSE_RICHEDIT[2], it doesn't
# seem useful to allow disabling them
set(wxUSE_RICHEDIT ON)
set(wxUSE_RICHEDIT2 ON)
endif()
wx_option(wxUSE_TIMEPICKCTRL "use wxTimePickerCtrl class")
wx_option(wxUSE_TIPWINDOW "use wxTipWindow class")
wx_option(wxUSE_TOGGLEBTN "use wxToggleButton class")
wx_option(wxUSE_TOOLBAR "use wxToolBar class")
wx_option(wxUSE_TOOLBOOK "use wxToolbook class")
wx_option(wxUSE_TREEBOOK "use wxTreebook class")
wx_option(wxUSE_TREECTRL "use wxTreeCtrl class")
wx_option(wxUSE_TREELISTCTRL "use wxTreeListCtrl class")
# ---------------------------------------------------------------------------
# common dialogs
# ---------------------------------------------------------------------------
wx_option(wxUSE_ABOUTDLG "use wxAboutBox")
wx_option(wxUSE_CHOICEDLG "use wxChoiceDialog")
wx_option(wxUSE_COLOURDLG "use wxColourDialog")
wx_option(wxUSE_CREDENTIALDLG "use wxCredentialEntryDialog")
wx_option(wxUSE_FILEDLG "use wxFileDialog")
wx_option(wxUSE_FINDREPLDLG "use wxFindReplaceDialog")
wx_option(wxUSE_FONTDLG "use wxFontDialog")
wx_option(wxUSE_DIRDLG "use wxDirDialog")
wx_option(wxUSE_MSGDLG "use wxMessageDialog")
wx_option(wxUSE_NUMBERDLG "use wxNumberEntryDialog")
wx_option(wxUSE_SPLASH "use wxSplashScreen")
wx_option(wxUSE_TEXTDLG "use wxTextDialog")
wx_option(wxUSE_STARTUP_TIPS "use startup tips")
wx_option(wxUSE_PROGRESSDLG "use wxProgressDialog")
wx_option(wxUSE_WIZARDDLG "use wxWizard")
# ---------------------------------------------------------------------------
# misc GUI options
# ---------------------------------------------------------------------------
wx_option(wxUSE_MENUS "use wxMenu and wxMenuItem classes")
wx_option(wxUSE_MENUBAR "use wxMenuBar class")
wx_option(wxUSE_MINIFRAME "use wxMiniFrame class")
wx_option(wxUSE_TOOLTIPS "use wxToolTip class")
wx_option(wxUSE_SPLINES "use spline drawing code")
wx_option(wxUSE_MOUSEWHEEL "use mousewheel")
wx_option(wxUSE_VALIDATORS "use wxValidator and derived classes")
wx_option(wxUSE_BUSYINFO "use wxBusyInfo")
if(WXMSW OR WXOSX_COCOA)
set(wxUSE_HOTKEY_DEFAULT ON)
else()
set(wxUSE_HOTKEY_DEFAULT OFF)
endif()
wx_option(wxUSE_HOTKEY "use wxWindow::RegisterHotKey()" ${wxUSE_HOTKEY_DEFAULT})
if(UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(wxUSE_JOYSTICK_DEFAULT OFF)
else()
set(wxUSE_JOYSTICK_DEFAULT ON)
endif()
wx_option(wxUSE_JOYSTICK "use wxJoystick" ${wxUSE_JOYSTICK_DEFAULT})
wx_option(wxUSE_METAFILE "use wxMetaFile")
wx_option(wxUSE_DRAGIMAGE "use wxDragImage")
wx_option(wxUSE_UIACTIONSIMULATOR "use wxUIActionSimulator (experimental)")
wx_option(wxUSE_DC_TRANSFORM_MATRIX "use wxDC::SetTransformMatrix and related")
wx_option(wxUSE_WEBVIEW_WEBKIT "use wxWebView WebKit backend")
if(WIN32 OR APPLE)
set(wxUSE_PRIVATE_FONTS_DEFAULT ON)
else()
set(wxUSE_PRIVATE_FONTS_DEFAULT OFF)
endif()
wx_option(wxUSE_PRIVATE_FONTS "use fonts not installed on the system" ${wxUSE_PRIVATE_FONTS_DEFAULT})
# ---------------------------------------------------------------------------
# support for image formats that do not rely on external library
# ---------------------------------------------------------------------------
wx_option(wxUSE_PALETTE "use wxPalette class")
wx_option(wxUSE_IMAGE "use wxImage class")
wx_option(wxUSE_GIF "use gif images (GIF file format)")
wx_option(wxUSE_PCX "use pcx images (PCX file format)")
wx_option(wxUSE_TGA "use tga images (TGA file format)")
wx_option(wxUSE_IFF "use iff images (IFF file format)")
wx_option(wxUSE_PNM "use pnm images (PNM file format)")
wx_option(wxUSE_XPM "use xpm images (XPM file format)")
wx_option(wxUSE_ICO_CUR "use Windows ICO and CUR formats")
# ---------------------------------------------------------------------------
# wxMSW-only options
# ---------------------------------------------------------------------------
if(WIN32)
if(MSVC)
set(wxUSE_WINRT_DEFAULT ON)
else()
set(wxUSE_WINRT_DEFAULT OFF)
endif()
wx_option(wxUSE_ACCESSIBILITY "enable accessibility support")
wx_option(wxUSE_ACTIVEX " enable wxActiveXContainer class (Win32 only)")
wx_option(wxUSE_CRASHREPORT "enable wxCrashReport::Generate() to create mini dumps (Win32 only)")
wx_option(wxUSE_DC_CACHEING "cache temporary wxDC objects (Win32 only)")
wx_option(wxUSE_NATIVE_PROGRESSDLG "use native progress dialog implementation")
wx_option(wxUSE_NATIVE_STATUSBAR "use native statusbar implementation)")
wx_option(wxUSE_OWNER_DRAWN "use owner drawn controls (Win32)")
wx_option(wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW "use PS printing in wxMSW (Win32 only)")
wx_option(wxUSE_TASKBARICON_BALLOONS "enable wxTaskBarIcon::ShowBalloon() method (Win32 only)")
wx_option(wxUSE_UXTHEME "enable support for Windows XP themed look (Win32 only)")
wx_option(wxUSE_WEBVIEW_EDGE "use wxWebView Edge (Chromium) backend (Windows only)")
wx_option(wxUSE_WEBVIEW_EDGE_STATIC "use wxWebView Edge with static loader" OFF)
wx_option(wxUSE_WEBVIEW_IE "use wxWebView IE backend (Win32 only)")
wx_option(wxUSE_WINRT "enable WinRT support" ${wxUSE_WINRT_DEFAULT})
wx_option(wxUSE_WXDIB "use wxDIB class (Win32 only)")
endif()
# this one is not really MSW-specific but it exists mainly to be turned off
# under MSW, it should be off by default on the other platforms
if(WIN32)
set(wxDEFAULT_wxUSE_AUTOID_MANAGEMENT ON)
else()
set(wxDEFAULT_wxUSE_AUTOID_MANAGEMENT OFF)
endif()
wx_option(wxUSE_AUTOID_MANAGEMENT "use automatic ids management" ${wxDEFAULT_wxUSE_AUTOID_MANAGEMENT})
endif() # wxUSE_GUI

View File

@@ -0,0 +1,45 @@
#############################################################################
# Name: build/cmake/pch.cmake
# Purpose: precompiled header support for wxWidgets
# Author: Maarten Bent
# Created: 2022-04-15
# Copyright: (c) 2022 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if((wxBUILD_PRECOMP STREQUAL "ON" AND CMAKE_VERSION VERSION_LESS "3.16") OR (wxBUILD_PRECOMP STREQUAL "COTIRE"))
if(CMAKE_GENERATOR STREQUAL "Xcode")
# wxWidgets does not use the unity features of cotire so we can
# include Obj-C files when using precompiled headers with Xcode
set(COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "" CACHE STRING "wxWidgets override of cotire exclude")
endif()
include(cotire)
endif()
# Enable precompiled headers for target
macro(wx_target_enable_precomp target_name prec_header)
if(wxBUILD_PRECOMP)
target_compile_definitions(${target_name} PRIVATE WX_PRECOMP)
if(USE_COTIRE)
set_target_properties(${target_name} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT ${prec_header})
set_target_properties(${target_name} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(${target_name})
else()
# Only use pch when there are at least two source files
get_target_property(cpp_source_files ${target_name} SOURCES)
list(FILTER cpp_source_files INCLUDE REGEX ".*(\\.cpp|\\.cxx)$")
list(LENGTH cpp_source_files cpp_source_count)
if(cpp_source_count GREATER_EQUAL 2)
target_precompile_headers(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${prec_header}>")
endif()
get_target_property(mm_source_files ${target_name} SOURCES)
list(FILTER mm_source_files INCLUDE REGEX ".*\\.mm$")
list(LENGTH mm_source_files mm_source_count)
if(mm_source_count GREATER_EQUAL 2)
target_precompile_headers(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:OBJCXX>:${prec_header}>")
endif()
endif()
elseif(MSVC)
target_compile_definitions(${target_name} PRIVATE NOPCH)
endif()
endmacro()

View File

@@ -0,0 +1,95 @@
#############################################################################
# Name: build/cmake/policies.cmake
# Purpose: CMake policies for wxWidgets
# Author: Tobias Taschner
# Created: 2016-10-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
# Please keep the policies in the order of their numbers.
if(POLICY CMP0025)
# Compiler id for Apple Clang is now AppleClang.
cmake_policy(SET CMP0025 NEW)
endif()
if(POLICY CMP0028)
# Double colon in target name means ALIAS or IMPORTED target.
cmake_policy(SET CMP0028 NEW)
endif()
if(POLICY CMP0038)
# Targets may not link directly to themselves.
cmake_policy(SET CMP0038 NEW)
endif()
if(POLICY CMP0042)
# MACOSX_RPATH is enabled by default.
cmake_policy(SET CMP0042 NEW)
endif()
if(POLICY CMP0045)
# Error on non-existent target in get_target_property.
cmake_policy(SET CMP0045 NEW)
endif()
if(POLICY CMP0046)
# Error on non-existent dependency in add_dependencies.
cmake_policy(SET CMP0046 NEW)
endif()
if(POLICY CMP0048)
# The project() command manages VERSION variables.
cmake_policy(SET CMP0048 NEW)
endif()
if(POLICY CMP0049)
# Do not expand variables in target source entries.
cmake_policy(SET CMP0049 NEW)
endif()
if(POLICY CMP0053)
# Simplify variable reference and escape sequence evaluation.
cmake_policy(SET CMP0053 NEW)
endif()
if(POLICY CMP0054)
# Only interpret if() arguments as variables or keywords when unquoted.
cmake_policy(SET CMP0054 NEW)
endif()
if(POLICY CMP0057)
# Support new if() IN_LIST operator.
cmake_policy(SET CMP0057 NEW)
endif()
if(POLICY CMP0060)
# Link libraries by full path even in implicit directories.
cmake_policy(SET CMP0060 NEW)
endif()
if(POLICY CMP0067)
# Honor language standard in try_compile() source-file signature.
cmake_policy(SET CMP0067 NEW)
endif()
if(POLICY CMP0072)
# FindOpenGL prefers GLVND by default when available.
cmake_policy(SET CMP0072 NEW)
endif()
if(POLICY CMP0079)
# target_link_libraries() allows use with targets in other directories.
cmake_policy(SET CMP0079 NEW)
endif()
if(POLICY CMP0091)
# MSVC runtime library flags are selected by an abstraction.
cmake_policy(SET CMP0091 NEW)
endif()
if(POLICY CMP0092)
# MSVC warning flags are not in CMAKE_<LANG>_FLAGS by default.
cmake_policy(SET CMP0092 NEW)
endif()

View File

@@ -0,0 +1,289 @@
#############################################################################
# Name: build/cmake/samples/CMakeLists.txt
# Purpose: CMake script to build samples
# Author: Tobias Taschner
# Created: 2016-10-04
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_add_sample(access accesstest.cpp DEPENDS wxUSE_ACCESSIBILITY)
wx_add_sample(animate anitest.cpp anitest.h DATA throbber.gif throbber_2x.gif hourglass.ani DEPENDS wxUSE_ANIMATIONCTRL)
wx_add_sample(archive CONSOLE)
wx_add_sample(artprov arttest.cpp artbrows.cpp artbrows.h)
wx_add_sample(aui auidemo.cpp LIBRARIES wxaui wxhtml wxxml NAME auidemo DEPENDS wxUSE_AUI)
wx_add_sample(calendar DEPENDS wxUSE_CALENDARCTRL)
wx_add_sample(caret DEPENDS wxUSE_CARET)
wx_add_sample(collpane DEPENDS wxUSE_COLLPANE)
wx_add_sample(combo DATA dropbuth.svg dropbutn.svg dropbutp.svg three-dots.svg DEPENDS wxUSE_COMBOCTRL)
wx_add_sample(config conftest.cpp DEPENDS wxUSE_CONFIG)
wx_add_sample(console CONSOLE IMPORTANT)
wx_add_sample(dataview IMPORTANT dataview.cpp mymodels.cpp mymodels.h DEPENDS wxUSE_DATAVIEWCTRL)
if(wxUSE_ON_FATAL_EXCEPTION AND (NOT WIN32 OR MSVC))
wx_add_sample(debugrpt LIBRARIES wxqa DEPENDS wxUSE_DEBUGREPORT)
endif()
set(SAMPLE_DIALOGS_SRC dialogs.cpp dialogs.h)
if(NOT wxBUILD_SHARED AND (WXMSW OR APPLE)) # AND NOT WXUNIV
wx_list_add_prefix(SAMPLE_DIALOGS_SRC ../../src/generic/ colrdlgg.cpp dirdlgg.cpp filedlgg.cpp)
if(WXMSW)
wx_list_add_prefix(SAMPLE_DIALOGS_SRC ../../src/generic/ fontdlgg.cpp)
endif()
endif()
if(WXGTK2)
wx_list_add_prefix(SAMPLE_DIALOGS_SRC ../../src/generic/ filedlgg.cpp)
endif()
wx_add_sample(dialogs ${SAMPLE_DIALOGS_SRC} DATA tips.txt)
wx_add_sample(dialup nettest.cpp LIBRARIES wxnet DEPENDS wxUSE_DIALUP_MANAGER)
wx_add_sample(display)
wx_add_sample(dnd dnd.cpp RES dnd.rc DATA wxwin.png DEPENDS wxUSE_DRAG_AND_DROP)
wx_add_sample(docview docview.cpp doc.cpp view.cpp docview.h doc.h view.h
RES docview.rc PLIST Info.plist.in LIBRARIES wxaui DEPENDS wxUSE_DOC_VIEW_ARCHITECTURE)
wx_add_sample(dragimag dragimag.cpp dragimag.h RES dragimag.rc
DATA backgrnd.png shape01.png shape02.png shape03.png
DEPENDS wxUSE_DRAGIMAGE)
wx_add_sample(drawing DATA pat4.bmp pat35.bmp pat36.bmp image.bmp mask.bmp NAME drawingsample)
wx_add_sample(erase)
wx_add_sample(event event.cpp gestures.cpp gestures.h chessboard.cpp chessboard.h)
wx_add_sample(except DEPENDS wxUSE_EXCEPTIONS)
wx_add_sample(exec)
wx_add_sample(font DATA wxprivate.ttf)
wx_add_sample(fswatcher DEPENDS wxUSE_FSWATCHER)
wx_add_sample(grid griddemo.cpp griddemo.h DEPENDS wxUSE_GRID)
wx_list_add_prefix(HELP_DOC_FILES doc/
aindex.html down.gif dxxgifs.tex HIER.html icon1.gif icon2.gif index.html
logo.gif wx204.htm wx34.htm wxExtHelpController.html wxhelp.map wx.htm
)
wx_add_sample(help demo.cpp LIBRARIES wxhtml
DATA
back.gif bullet.bmp contents.gif cshelp.txt doc.chm doc.cnt doc.hhc
doc.hhk doc.hhp doc.hlp doc.hpj doc.zip forward.gif up.gif
${HELP_DOC_FILES}
NAME helpdemo
DEPENDS wxUSE_HELP
)
wx_add_sample(htlbox LIBRARIES wxhtml DEPENDS wxUSE_HTML)
if(wxUSE_HTML)
include(html.cmake)
endif()
wx_add_sample(image image.cpp canvas.cpp canvas.h RES image.rc
DATA horse.png horse.jpg horse.bmp horse.gif horse.pcx horse.pnm horse.webp
horse_ag.pnm horse_rg.pnm horse.tif horse.tga horse.xpm horse.cur
horse.ico horse3.ani horse.svg smile.xbm toucan.png cmyk.jpg cursor.png
NAME imagesample DEPENDS wxUSE_IMAGE)
foreach(lang ar bg cs de fr it ka pl ru sv ja ja_JP.EUC-JP)
list(APPEND INTERNAT_DATA_FILES ${lang}/internat.po ${lang}/internat.mo)
endforeach()
wx_add_sample(internat DATA ${INTERNAT_DATA_FILES} PLIST Info.plist.in DEPENDS wxUSE_INTL)
# IPC samples
set(wxSAMPLE_FOLDER ipc)
wx_add_sample(ipc client.cpp client.h connection.h ipcsetup.h NAME ipcclient LIBRARIES wxnet DEPENDS wxUSE_IPC)
wx_add_sample(ipc server.cpp server.h connection.h ipcsetup.h NAME ipcserver LIBRARIES wxnet DEPENDS wxUSE_IPC)
wx_add_sample(ipc CONSOLE baseclient.cpp connection.h ipcsetup.h NAME baseipcclient LIBRARIES wxnet DEPENDS wxUSE_IPC)
wx_add_sample(ipc CONSOLE baseserver.cpp connection.h ipcsetup.h NAME baseipcserver LIBRARIES wxnet DEPENDS wxUSE_IPC)
set(wxSAMPLE_FOLDER)
wx_add_sample(joytest joytest.cpp joytest.h DATA buttonpress.wav DEPENDS wxUSE_JOYSTICK)
wx_add_sample(keyboard)
wx_add_sample(layout layout.cpp layout.h)
wx_add_sample(listctrl listtest.cpp listtest.h RES listtest.rc DEPENDS wxUSE_LISTCTRL)
wx_add_sample(mdi mdi.cpp mdi.h RES mdi.rc DEPENDS wxUSE_MDI wxUSE_DOC_VIEW_ARCHITECTURE wxUSE_MDI_ARCHITECTURE)
wx_add_sample(mediaplayer LIBRARIES wxmedia DEPENDS wxUSE_MEDIACTRL)
wx_add_sample(menu DEPENDS wxUSE_MENUS wxUSE_MENUBAR)
wx_add_sample(minimal IMPORTANT)
wx_add_sample(notebook notebook.cpp notebook.h LIBRARIES wxaui DEPENDS wxUSE_NOTEBOOK)
if(wxUSE_OPENGL)
set(wxSAMPLE_SUBDIR opengl/)
set(wxSAMPLE_FOLDER OpenGL)
wx_add_sample(cube cube.cpp cube.h LIBRARIES wxgl)
wx_add_sample(isosurf isosurf.cpp isosurf.h LIBRARIES wxgl DATA isosurf.dat.gz)
wx_add_sample(penguin
penguin.cpp dxfrenderer.cpp trackball.c
dxfrenderer.h penguin.h trackball.h
LIBRARIES wxgl
DATA penguin.dxf.gz)
wx_add_sample(pyramid
pyramid.cpp oglstuff.cpp mathstuff.cpp oglpfuncs.cpp
pyramid.h oglstuff.h mathstuff.h oglpfuncs.h
LIBRARIES wxgl)
set(wxSAMPLE_SUBDIR)
set(wxSAMPLE_FOLDER)
endif()
wx_add_sample(ownerdrw RES ownerdrw.rc DATA sound.png nosound.png DEPENDS wxUSE_OWNER_DRAWN)
wx_add_sample(popup DEPENDS wxUSE_POPUPWIN)
wx_add_sample(power)
wx_add_sample(preferences DEPENDS wxUSE_PREFERENCES_EDITOR)
wx_add_sample(printing printing.cpp printing.h DEPENDS wxUSE_PRINTING_ARCHITECTURE)
wx_add_sample(propgrid propgrid.cpp propgrid_minimal.cpp sampleprops.cpp
sampleprops.h propgrid.h LIBRARIES wxpropgrid wxxrc NAME propgriddemo DEPENDS wxUSE_PROPGRID)
wx_add_sample(render FOLDER render)
wx_add_sample(render DLL renddll.cpp NAME renddll FOLDER render)
wx_add_sample(ribbon ribbondemo.cpp LIBRARIES wxribbon NAME ribbondemo DEPENDS wxUSE_RIBBON)
wx_add_sample(richtext LIBRARIES wxrichtext wxhtml wxxml NAME richtextdemo DEPENDS wxUSE_XML wxUSE_RICHTEXT)
wx_add_sample(sashtest sashtest.cpp sashtest.h RES sashtest.rc DEPENDS wxUSE_SASH)
wx_add_sample(scroll)
wx_add_sample(secretstore CONSOLE DEPENDS wxUSE_SECRETSTORE)
wx_add_sample(shaped DATA star.png)
if(wxUSE_SOCKETS)
wx_add_sample(sockets client.cpp NAME client LIBRARIES wxnet FOLDER sockets)
wx_add_sample(sockets server.cpp NAME server LIBRARIES wxnet FOLDER sockets)
wx_add_sample(sockets CONSOLE baseclient.cpp NAME baseclient LIBRARIES wxnet FOLDER sockets)
wx_add_sample(sockets CONSOLE baseserver.cpp NAME baseserver LIBRARIES wxnet FOLDER sockets)
endif()
wx_add_sample(sound RES sound.rc DATA 9000g.wav cuckoo.wav doggrowl.wav tinkalink2.wav DEPENDS wxUSE_SOUND)
wx_add_sample(splash DATA splash.png press.mpg DEPENDS wxUSE_SPLASH)
if(TARGET splash AND wxUSE_MEDIACTRL)
wx_exe_link_libraries(splash wxmedia)
endif()
wx_add_sample(splitter DEPENDS wxUSE_SPLITTER)
wx_add_sample(statbar DEPENDS wxUSE_STATUSBAR)
wx_add_sample(stc stctest.cpp edit.cpp prefs.cpp edit.h defsext.h prefs.h
DATA stctest.cpp NAME stctest LIBRARIES wxstc DEPENDS wxUSE_STC)
wx_add_sample(svg svgtest.cpp RES svgtest.rc DEPENDS wxUSE_SVG)
wx_add_sample(taborder)
wx_add_sample(taskbar tbtest.cpp tbtest.h DATA info.svg DEPENDS wxUSE_TASKBARICON)
wx_add_sample(text DEPENDS wxUSE_TEXTCTRL)
wx_add_sample(thread DEPENDS wxUSE_THREADS)
wx_add_sample(toolbar RES toolbar.rc DEPENDS wxUSE_TOOLBAR)
wx_add_sample(touchtest touchtest.cpp)
wx_add_sample(treectrl treetest.cpp treetest.h DEPENDS wxUSE_TREECTRL)
wx_add_sample(treelist DEPENDS wxUSE_TREELISTCTRL)
wx_add_sample(typetest typetest.cpp typetest.h)
wx_add_sample(uiaction DEPENDS wxUSE_UIACTIONSIMULATOR)
wx_add_sample(validate validate.cpp validate.h DEPENDS wxUSE_VALIDATORS)
wx_add_sample(vscroll vstest.cpp)
if(wxUSE_WEBVIEW)
include(webview.cmake)
endif()
wx_add_sample(webrequest LIBRARIES wxnet DEPENDS wxUSE_WEBREQUEST)
# widgets Sample
set(SAMPLE_WIDGETS_SRC
activityindicator.cpp
bmpcombobox.cpp
button.cpp
checkbox.cpp
choice.cpp
clrpicker.cpp
combobox.cpp
datepick.cpp
dirctrl.cpp
dirpicker.cpp
editlbox.cpp
filectrl.cpp
filepicker.cpp
fontpicker.cpp
gauge.cpp
headerctrl.cpp
hyperlnk.cpp
itemcontainer.cpp
listbox.cpp
native.cpp
notebook.cpp
odcombobox.cpp
radiobox.cpp
searchctrl.cpp
slider.cpp
spinbtn.cpp
static.cpp
statbmp.cpp
textctrl.cpp
timepick.cpp
toggle.cpp
widgets.cpp
widgets.h
itemcontainer.h
)
if(APPLE)
# The source file using native controls uses Cocoa under OS X, so it must
# be compiled as Objective C++ which means it must have .mm extension.
# But this would make it uncompilable under the other platforms and we
# don't want to have two files with identical contents. Hence this hack:
# we have native.mm which just includes native.cpp under OS X, while
# elsewhere we just compile native.cpp directly.
list(APPEND SAMPLE_WIDGETS_SRC native_wrapper.mm)
endif()
wx_list_add_prefix(WIDGETS_RC_FILES icons/
activityindicator.xpm bmpbtn.xpm bmpcombobox.xpm button.xpm
checkbox.xpm choice.xpm choicebk.xpm clrpicker.xpm
combobox.xpm datepick.xpm dirctrl.xpm dirpicker.xpm
filepicker.xpm fontpicker.xpm gauge.xpm header.xpm
hyperlnk.xpm listbook.xpm listbox.xpm native.xpm
notebook.xpm odcombobox.xpm radiobox.xpm scrolbar.xpm
slider.xpm spinbtn.xpm statbmp.xpm statbox.xpm
stattext.xpm text.xpm timepick.xpm toggle.xpm
)
wx_add_sample(widgets IMPORTANT ${SAMPLE_WIDGETS_SRC}
DATA ${WIDGETS_RC_FILES} textctrl.cpp ../image/toucan.png:toucan.png
)
# includes needed by the native widget (like gtk.h)
target_include_directories(widgets PRIVATE ${wxTOOLKIT_INCLUDE_DIRS})
wx_add_sample(wizard DATA wiztest.svg wiztest2.svg DEPENDS wxUSE_WIZARDDLG)
wx_add_sample(wrapsizer)
wx_list_add_prefix(XRC_RC_FILES rc/
aui.xpm aui.xrc
artprov.xpm artprov.xrc basicdlg.xpm basicdlg2.xpm
basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas2.xpm custclas.xrc
derivdlg.xpm derivdlg2.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc
fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif
resource.xrc toolbar.xrc uncenter.xpm uncenter2.xpm
objref.xrc objrefdlg.xpm
uncenter.xrc update.gif
variable.xpm variable.xrc
variants.xpm variants.xrc
throbber.gif stop.xpm
stop_2x.xpm wxbanner.gif
)
wx_add_sample(xrc
xrcdemo.cpp
myframe.cpp
derivdlg.cpp
custclas.cpp
objrefdlg.cpp
derivdlg.h
xrcdemo.h
myframe.h
custclas.h
objrefdlg.h
DATA ${XRC_RC_FILES}
LIBRARIES wxaui wxribbon wxxrc wxhtml
NAME xrcdemo
DEPENDS wxUSE_XML wxUSE_XRC
)
wx_add_sample(xti xti.cpp classlist.cpp codereadercallback.cpp
classlist.h codereadercallback.h LIBRARIES wxxml
DEPENDS wxUSE_XML wxUSE_EXTENDED_RTTI)
if(WIN32)
# Windows only samples
# DLL Sample
if(wxUSE_DYNLIB_CLASS)
wx_add_sample(dll DLL my_dll.cpp my_dll.h NAME my_dll FOLDER dll
DEFINITIONS MY_DLL_BUILDING)
if(NOT wxBUILD_SHARED)
# this test only makes sense with statically built wx, otherwise
# the same copy of wx would be used
wx_add_sample(dll wx_exe.cpp my_dll.h NAME wx_exe FOLDER dll)
wx_link_sample_libraries(wx_exe my_dll)
endif()
wx_add_sample(dll sdk_exe.cpp my_dll.h NAME sdk_exe FOLDER dll)
wx_link_sample_libraries(sdk_exe my_dll)
endif()
wx_add_sample(regtest RES regtest.rc DEPENDS wxUSE_REGKEY)
wx_add_sample(oleauto DEPENDS wxUSE_OLE)
if(WXMSW)
wx_add_sample(nativdlg nativdlg.cpp nativdlg.h resource.h RES nativdlg.rc)
wx_add_sample(taskbarbutton DEPENDS wxUSE_TASKBARBUTTON)
# only check if MFC is available when the mfc sample is enabled
if(wxBUILD_SAMPLES STREQUAL "ALL")
find_package(MFC QUIET)
if(MFC_FOUND)
wx_add_sample(mfc mfctest.cpp mfctest.h resource.h stdafx.h RES mfctest.rc)
endif()
endif()
endif()
endif()

View File

@@ -0,0 +1,41 @@
#############################################################################
# Name: build/cmake/samples/html.cmake
# Purpose: CMake script to build html samples
# Author: Tobias Taschner
# Created: 2016-10-22
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(wxSAMPLE_FOLDER html)
set(wxSAMPLE_SUBDIR html/)
wx_add_sample(about DATA data/about.htm data/logo.png data/bg.svg LIBRARIES wxhtml)
wx_list_add_prefix(HELP_DATA_FILES helpfiles/
Index.hhk
another.hhc
another.hhp
another.htm
book1.htm
book2.htm
contents.hhc
main.htm
page2-b.htm
testing.hhp
)
wx_add_sample(help DATA ${HELP_DATA_FILES} LIBRARIES wxhtml NAME htmlhelp DEPENDS wxUSE_HELP)
wx_add_sample(helpview DATA test.zip LIBRARIES wxhtml DEPENDS wxUSE_HELP)
wx_add_sample(printing DATA logo6.gif test.htm LIBRARIES wxhtml NAME htmlprinting
DEPENDS wxUSE_PRINTING_ARCHITECTURE)
wx_add_sample(test
DATA
imagemap.png pic.png pic2.bmp i18n.gif
imagemap.htm tables.htm test.htm id.html listtest.htm 8859_2.htm cp1250.htm
regres.htm foo.png subsup.html
LIBRARIES wxnet wxhtml NAME htmltest)
wx_add_sample(virtual DATA start.htm LIBRARIES wxhtml)
wx_add_sample(widget DATA start.htm LIBRARIES wxhtml)
wx_add_sample(zip DATA pages.zip start.htm LIBRARIES wxhtml DEPENDS wxUSE_FS_ZIP)
set(wxSAMPLE_SUBDIR)
set(wxSAMPLE_FOLDER)

View File

@@ -0,0 +1,103 @@
#############################################################################
# Name: build/cmake/samples/webview.cmake
# Purpose: CMake script to build webview samples
# Author: Tobias Taschner
# Created: 2018-02-17
# Copyright: (c) 2018 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
wx_add_sample(webview LIBRARIES wxwebview
DATA ../help/doc.zip:doc.zip handler_advanced.html
NAME webviewsample)
if(wxUSE_STC)
wx_exe_link_libraries(webviewsample wxstc)
endif()
if(wxUSE_WEBVIEW_CHROMIUM AND TARGET webviewsample)
if(WIN32 OR (UNIX AND NOT APPLE))
# Copy CEF libraries and resources next to the executable.
add_custom_command(
TARGET webviewsample
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CEF_ROOT}/Release $<TARGET_FILE_DIR:webviewsample>
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CEF_ROOT}/Resources $<TARGET_FILE_DIR:webviewsample>
COMMENT "Copying webviewsample CEF resources..."
)
if(UNIX)
# Set rpath so that libraries can be placed next to the executable.
# Fixes error: "Invalid file descriptor to ICU data received."
set_target_properties(webviewsample PROPERTIES
INSTALL_RPATH "$ORIGIN"
BUILD_WITH_INSTALL_RPATH TRUE
)
endif()
elseif(APPLE)
# Copy the CEF framework into the Frameworks directory.
add_custom_command(
TARGET webviewsample
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CEF_ROOT}/Release/Chromium Embedded Framework.framework"
"$<TARGET_FILE_DIR:webviewsample>/../Frameworks/Chromium Embedded Framework.framework"
)
# CEF Helper app suffixes.
# Format is "<name suffix>:<target suffix>:<plist suffix>".
set(CEF_HELPER_APP_SUFFIXES
"::"
" (Alerts):_alerts:.alerts"
" (GPU):_gpu:.gpu"
" (Plugin):_plugin:.plugin"
" (Renderer):_renderer:.renderer"
)
set(CEF_HELPER_TARGET "webviewsample_Helper")
set(CEF_HELPER_OUTPUT_NAME "webviewsample Helper")
# Create the multiple Helper app bundle targets.
foreach(_suffix_list ${CEF_HELPER_APP_SUFFIXES})
# Convert to a list and extract the suffix values.
string(REPLACE ":" ";" _suffix_list ${_suffix_list})
list(GET _suffix_list 0 _name_suffix)
list(GET _suffix_list 1 _target_suffix)
list(GET _suffix_list 2 _plist_suffix)
# Define Helper target and output names.
set(_helper_target "${CEF_HELPER_TARGET}${_target_suffix}")
set(_helper_output_name "${CEF_HELPER_OUTPUT_NAME}${_name_suffix}")
# Create Helper-specific variants of the helper-Info.plist file. Do this
# manually because the configure_file command (which is executed as part of
# MACOSX_BUNDLE_INFO_PLIST) uses global env variables and would insert the
# wrong values with multiple targets.
set(_helper_info_plist "${CMAKE_CURRENT_BINARY_DIR}/helper-Info${_target_suffix}.plist")
file(READ "${wxSOURCE_DIR}/samples/webview/cef_helper_info.plist.in" _plist_contents)
string(REPLACE "\${EXECUTABLE_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents})
string(REPLACE "\${PRODUCT_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents})
string(REPLACE "\${BUNDLE_ID_SUFFIX}" "${_plist_suffix}" _plist_contents ${_plist_contents})
file(WRITE ${_helper_info_plist} ${_plist_contents})
# Create Helper executable target.
add_executable(${_helper_target} MACOSX_BUNDLE ${wxSOURCE_DIR}/samples/webview/cef_process_helper.cpp)
target_include_directories(${_helper_target} PRIVATE "${CEF_ROOT}")
target_link_libraries(${_helper_target} libcef_dll_wrapper)
set_target_properties(${_helper_target} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist}
OUTPUT_NAME ${_helper_output_name}
)
# Add the Helper as a dependency of the main executable target.
add_dependencies(webviewsample "${_helper_target}")
# Copy the Helper app bundle into the Frameworks directory.
add_custom_command(
TARGET webviewsample
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"$<TARGET_FILE_DIR:${_helper_target}>/../../../${_helper_output_name}.app"
"$<TARGET_FILE_DIR:webviewsample>/../Frameworks/${_helper_output_name}.app"
VERBATIM
)
endforeach()
endif()
endif()

View File

@@ -0,0 +1,628 @@
#############################################################################
# Name: build/cmake/setup.cmake
# Purpose: Create and configure setup.h
# Author: Tobias Taschner
# Created: 2016-09-22
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
# Include modules required for setup.h generation
include(CheckCSourceCompiles)
include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(CheckCXXSymbolExists)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckIncludeFiles)
include(CheckPrototypeDefinition)
include(CheckStructHasMember)
include(CheckSymbolExists)
include(CheckTypeSize)
include(CMakePushCheckState)
include(TestBigEndian)
# Add a definition to setup.h and append it to a list of defines for
# for compile checks
macro(wx_setup_definition def)
set(${def} YES)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D${def})
endmacro()
# Add define based on system name
string(TOUPPER ${CMAKE_SYSTEM_NAME} wxSYS_NAME)
wx_setup_definition(__${wxSYS_NAME}__)
if(WIN32)
wx_setup_definition(__WIN32__)
endif()
if(CYGWIN)
wx_setup_definition(__GNUWIN32__)
endif()
if(UNIX)
wx_setup_definition(wxUSE_UNIX)
wx_setup_definition(__UNIX__)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_FILE_OFFSET_BITS=64)
endif()
if(UNIX AND NOT APPLE)
wx_setup_definition(_GNU_SOURCE)
endif()
if(APPLE)
wx_setup_definition(__BSD__)
endif()
if(WXGTK)
# Add GTK version definitions
foreach(gtk_version 2.0 2.10 2.18 2.20 3.0 3.90.0)
if(NOT wxTOOLKIT_VERSION VERSION_LESS gtk_version)
if(gtk_version EQUAL 3.90.0)
set(__WXGTK4__ ON)
elseif(gtk_version EQUAL 3.0)
set(__WXGTK3__ ON)
else()
string(REPLACE . "" gtk_version_dotless ${gtk_version})
set(__WXGTK${gtk_version_dotless}__ ON)
endif()
endif()
endforeach()
endif()
set(wxINSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
if(NOT WIN32 AND wxUSE_VISIBILITY)
check_cxx_compiler_flag(-fvisibility=hidden HAVE_VISIBILITY)
else()
set(HAVE_VISIBILITY 0)
endif()
if(MSVC)
set(DISABLE_ALL_WARNINGS "/w")
else()
set(DISABLE_ALL_WARNINGS "-w")
endif()
# wx_check_cxx_source_compiles(<code> <var> [headers...])
function(wx_check_cxx_source_compiles code res_var)
set(src)
foreach(header ${ARGN})
if(header STREQUAL "DEFINITION")
set(is_definition TRUE)
elseif(is_definition)
set(src "${src}${header}")
set(is_definition FALSE)
else()
set(src "${src}#include <${header}>\n")
endif()
endforeach()
set(src "${src}\n\nint main(int argc, char* argv[]) {\n ${code}\nreturn 0; }")
# We're not interested in any warnings that can arise in the test, which is
# especially important if -Werror is globally in effect.
cmake_push_check_state()
set(CMAKE_REQUIRED_FLAGS ${DISABLE_ALL_WARNINGS})
check_cxx_source_compiles("${src}" ${res_var})
cmake_pop_check_state()
endfunction()
# wx_check_c_source_compiles(<code> <var> [headers...])
function(wx_check_c_source_compiles code res_var)
set(src)
foreach(header ${ARGN})
if(header STREQUAL "DEFINITION")
set(is_definition TRUE)
elseif(is_definition)
set(src "${src}${header}")
set(is_definition FALSE)
else()
set(src "${src}#include <${header}>\n")
endif()
endforeach()
set(src "${src}\n\nint main(int argc, char* argv[]) {\n ${code}\nreturn 0; }")
check_c_source_compiles("${src}" ${res_var})
endfunction()
# wx_check_funcs(<...>)
# define a HAVE_... for every function in list if available
function(wx_check_funcs)
foreach(func ${ARGN})
string(TOUPPER ${func} func_upper)
check_function_exists(${func} HAVE_${func_upper})
endforeach()
endfunction()
if(NOT MSVC)
check_symbol_exists(va_copy stdarg.h HAVE_VA_COPY)
if(NOT HAVE_VA_COPY)
# try to understand how can we copy va_lists
set(VA_LIST_IS_ARRAY YES)
endif()
endif()
# Check for availability of GCC's atomic operations builtins.
wx_check_c_source_compiles("
unsigned int value=0;
/* wxAtomicInc doesn't use return value here */
__sync_fetch_and_add(&value, 2);
__sync_sub_and_fetch(&value, 1);
/* but wxAtomicDec does, so mimic that: */
volatile unsigned int r2 = __sync_sub_and_fetch(&value, 1);"
HAVE_GCC_ATOMIC_BUILTINS
)
macro(wx_get_socket_param_type name code)
# This test needs to be done in C++ mode since gsocket.cpp now
# is C++ code and pointer cast that are possible even without
# warning in C still fail in C++.
wx_check_cxx_source_compiles(
"socklen_t len;
${code}"
${name}_IS_SOCKLEN_T
sys/types.h sys/socket.h
)
if(${name}_IS_SOCKLEN_T)
set(${name} socklen_t)
else()
wx_check_cxx_source_compiles(
"size_t len;
${code}"
${name}_IS_SIZE_T
sys/types.h sys/socket.h
)
if(${name}_IS_SIZE_T)
set(${name} size_t)
else()
wx_check_cxx_source_compiles(
"int len;
${code}"
${name}_IS_INT
sys/types.h sys/socket.h
)
if(${name}_IS_INT)
set(${name} int)
else()
message(ERROR "Couldn't find ${name} for this system")
endif()
endif()
endif()
endmacro()
# the following tests are for Unix(like) systems only
if(UNIX)
if(wxUSE_LIBICONV)
set(HAVE_ICONV ON)
set(ICONV_CONST " ")
if(ICONV_SECOND_ARGUMENT_IS_CONST)
set(ICONV_CONST "const")
endif()
endif()
# check for POSIX signals if we need them
if(wxUSE_ON_FATAL_EXCEPTION)
wx_check_funcs(sigaction)
if(NOT HAVE_SIGACTION)
message(WARNING "No POSIX signal functions on this system, wxApp::OnFatalException will not be called")
wx_option_force_value(wxUSE_ON_FATAL_EXCEPTION OFF)
endif()
endif()
# backtrace() and backtrace_symbols() for wxStackWalker
if(wxUSE_STACKWALKER)
wx_check_cxx_source_compiles("
void *trace[1];
char **messages;
backtrace(trace, 1);
messages = backtrace_symbols(trace, 1);"
wxHAVE_BACKTRACE
execinfo.h)
if(NOT wxHAVE_BACKTRACE)
message(WARNING "backtrace() is not available, wxStackWalker will not be available")
wx_option_force_value(wxUSE_STACKWALKER OFF)
else()
wx_check_cxx_source_compiles(
"int rc;
__cxxabiv1::__cxa_demangle(\"foo\", 0, 0, &rc);"
HAVE_CXA_DEMANGLE
cxxabi.h)
endif()
endif()
wx_check_funcs(mkstemp mktemp)
# get the library function to use for wxGetDiskSpace(): it is statfs() under
# Linux and *BSD and statvfs() under Solaris and NetBSD
wx_check_c_source_compiles("
return 0; }
#if defined(__BSD__)
#include <sys/param.h>
#include <sys/mount.h>
#else
#include <sys/vfs.h>
#endif
int foo() {
long l;
struct statfs fs;
statfs(\"/\", &fs);
l = fs.f_bsize;
l += fs.f_blocks;
l += fs.f_bavail;"
HAVE_STATFS)
wx_check_c_source_compiles("
return 0; }
#include <sys/statvfs.h>
int foo() {
long l;
struct statvfs fs;
statvfs(\"/\", &fs);
l = fs.f_bsize;
l += fs.f_blocks;
l += fs.f_bavail;"
HAVE_STATVFS)
if(HAVE_STATVFS)
set(WX_STATFS_T "struct statvfs")
elseif(HAVE_STATFS)
set(WX_STATFS_T "struct statfs")
wx_check_cxx_source_compiles("
return 0; }
#if defined(__BSD__)
#include <sys/param.h>
#include <sys/mount.h>
#else
#include <sys/vfs.h>
#endif
int foo() {
struct statfs fs;
statfs(\"/\", &fs);"
HAVE_STATFS_DECL)
endif()
if(NOT HAVE_STATFS AND NOT HAVE_STATVFS)
message(WARNING "wxGetDiskSpace() function won't work without statfs()")
endif()
# check for fcntl() or at least flock() needed by Unix implementation of
# wxSingleInstanceChecker
if(wxUSE_SNGLINST_CHECKER)
wx_check_funcs(fcntl flock)
if(NOT HAVE_FCNTL AND NOT HAVE_FLOCK)
message(WARNING "wxSingleInstanceChecker not available")
wx_option_force_value(wxUSE_SNGLINST_CHECKER OFF)
endif()
endif()
# look for a function to modify the environment
wx_check_funcs(setenv putenv)
if(HAVE_SETENV)
wx_check_funcs(unsetenv)
endif()
set(HAVE_SOME_SLEEP_FUNC FALSE)
if(APPLE)
# Mac OS X/Darwin has both nanosleep and usleep
# but only usleep is defined in unistd.h
set(HAVE_USLEEP TRUE)
set(HAVE_SOME_SLEEP_FUNC TRUE)
endif()
if(NOT HAVE_SOME_SLEEP_FUNC)
# try nanosleep() in libc and libposix4, if this fails - usleep()
check_symbol_exists(nanosleep time.h HAVE_NANOSLEEP)
if(NOT HAVE_NANOSLEEP)
check_symbol_exists(usleep unistd.h HAVE_USLEEP)
if(NOT HAVE_USLEEP)
message(WARNING "wxSleep() function will not work")
endif()
endif()
endif()
# check for uname (POSIX) and gethostname (BSD)
check_symbol_exists(uname sys/utsname.h HAVE_UNAME)
if(HAVE_UNAME)
wx_check_funcs(gethostname)
endif()
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_REENTRANT)
wx_check_funcs(strtok_r)
cmake_pop_check_state()
# check for inet_addr and inet_aton (these may live either in libc, or in
# libnsl or libresolv or libsocket)
# TODO
wx_check_funcs(fdopen)
if(wxBUILD_LARGEFILE_SUPPORT)
wx_check_funcs(fseeko)
endif()
if(wxUSE_TARSTREAM)
wx_check_funcs(sysconf)
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_REENTRANT)
check_symbol_exists(getpwuid_r pwd.h HAVE_GETPWUID_R)
check_symbol_exists(getgrgid_r grp.h HAVE_GETGRGID_R)
cmake_pop_check_state()
endif()
check_include_file(sys/soundcard.h HAVE_SYS_SOUNDCARD_H)
set(HAVE_UNIX98_PRINTF ON)
if(wxUSE_SOCKETS)
# determine the type of third argument for getsockname
wx_get_socket_param_type(WX_SOCKLEN_T "getsockname(0, 0, &len);")
# Do this again for getsockopt as it may be different
wx_get_socket_param_type(SOCKOPTLEN_T "getsockopt(0, 0, 0, 0, &len);")
check_symbol_exists(gethostbyname netdb.h HAVE_GETHOSTBYNAME)
check_symbol_exists(gethostbyname_r netdb.h HAVE_GETHOSTBYNAME_R)
if(HAVE_GETHOSTBYNAME_R)
check_prototype_definition(gethostbyname_r
"int gethostbyname_r(const char *name, struct hostent *hp, struct hostent_data *hdata)"
"0"
"netdb.h"
HAVE_FUNC_GETHOSTBYNAME_R_3)
check_prototype_definition(gethostbyname_r
"struct hostent *gethostbyname_r(const char *name, struct hostent *hp, char *buf, size_t buflen, int *herr)"
"NULL"
"netdb.h"
HAVE_FUNC_GETHOSTBYNAME_R_5)
check_prototype_definition(gethostbyname_r
"int gethostbyname_r(const char *name, struct hostent *hp, char *buf, size_t buflen, struct hostent **result, int *herr)"
"0"
"netdb.h"
HAVE_FUNC_GETHOSTBYNAME_R_6)
endif()
check_symbol_exists(getservbyname netdb.h HAVE_GETSERVBYNAME)
check_symbol_exists(inet_aton arpa/inet.h HAVE_INET_ATON)
check_symbol_exists(inet_addr arpa/inet.h HAVE_INET_ADDR)
endif(wxUSE_SOCKETS)
if(wxUSE_JOYSTICK AND WXGTK)
check_include_files("linux/joystick.h" HAVE_JOYSTICK_H)
if(NOT HAVE_JOYSTICK_H)
message(WARNING "wxJoystick is not available")
wx_option_force_value(wxUSE_JOYSTICK OFF)
endif()
endif()
endif(UNIX)
if(CMAKE_USE_PTHREADS_INIT)
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
wx_check_cxx_source_compiles("
void *p;
pthread_cleanup_push(ThreadCleanupFunc, p);
pthread_cleanup_pop(0);"
wxHAVE_PTHREAD_CLEANUP
pthread.h
DEFINITION
"void ThreadCleanupFunc(void *p) { }\;"
)
wx_check_c_source_compiles(
"pthread_mutexattr_t attr;
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);"
HAVE_PTHREAD_MUTEXATTR_T
pthread.h
)
if(HAVE_PTHREAD_MUTEXATTR_T)
# check if we already have the declaration we need, it is not
# present in some systems' headers
wx_check_c_source_compiles(
"pthread_mutexattr_t attr;
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);"
HAVE_PTHREAD_MUTEXATTR_SETTYPE_DECL
pthread.h
)
else()
# don't despair, there may be another way to do it
wx_check_c_source_compiles(
"pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;"
HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER
pthread.h
)
if(NOT HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
# this may break code working elsewhere, so at least warn about it
message(WARNING "wxMutex won't be recursive on this platform")
endif()
endif()
wx_check_cxx_source_compiles(
"void foo(abi::__forced_unwind&);"
HAVE_ABI_FORCEDUNWIND
cxxabi.h)
cmake_pop_check_state()
endif() # CMAKE_USE_PTHREADS_INIT
check_symbol_exists(localtime_r time.h HAVE_LOCALTIME_R)
check_symbol_exists(gmtime_r time.h HAVE_GMTIME_R)
# ---------------------------------------------------------------------------
# Checks for typedefs
# ---------------------------------------------------------------------------
# check what exactly size_t is on this machine - this is necessary to avoid
# ambiguous overloads in several places, notably wx/string.h and wx/array.h
# an obvious check like wx_check_cxx_source_compiles(struct Foo { ... };) doesn't work
# with egcs (at least) up to 1.1.1 as it allows you to compile duplicate
# methods in a local class (i.e. class inside a function) declaration
# without any objections!!
#
# hence the hack below: we must have Foo at global scope!
wx_check_cxx_source_compiles("return 0; }
struct Foo { void foo(size_t); void foo(unsigned int); };
int bar() {"
wxSIZE_T_IS_NOT_UINT
stddef.h)
if(wxSIZE_T_IS_NOT_UINT)
wx_check_cxx_source_compiles("return 0; }
struct Foo { void foo(size_t); void foo(unsigned long); };
int bar() {"
wxSIZE_T_IS_NOT_ULONG
stddef.h)
if(NOT wxSIZE_T_IS_NOT_ULONG)
set(wxSIZE_T_IS_ULONG YES)
endif()
else()
set(wxSIZE_T_IS_UINT YES)
endif()
# check if wchar_t is separate type
wx_check_cxx_source_compiles("return 0; }
struct Foo { void foo(wchar_t);
void foo(unsigned short);
void foo(unsigned int);
void foo(unsigned long); };
int bar() {"
wxWCHAR_T_IS_REAL_TYPE
wchar.h)
# ---------------------------------------------------------------------------
# Checks for structures
# ---------------------------------------------------------------------------
check_struct_has_member("struct passwd" pw_gecos pwd.h HAVE_PW_GECOS)
# ---------------------------------------------------------------------------
# Check for functions
# ---------------------------------------------------------------------------
# Check various string symbols
foreach(func
ftime
wcsftime wprintf
putws fputws wprintf vswprintf vswscanf
wcsdup wcsnlen wcscasecmp wcsncasecmp
wcsrctombs
wcstoull
wcslen
)
string(TOUPPER ${func} func_upper)
check_symbol_exists(${func} wchar.h HAVE_${func_upper})
endforeach()
# Check various functions
wx_check_funcs(fsync
snprintf vsnprintf strnlen strtoull
setpriority
gettimeofday
)
if(MSVC)
check_symbol_exists(vsscanf stdio.h HAVE_VSSCANF)
endif()
# Check includes
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(langinfo.h HAVE_LANGINFO_H)
check_include_file(sched.h HAVE_SCHED_H)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(wchar.h HAVE_WCHAR_H)
check_include_file(wcstr.h HAVE_WCSTR_H)
if(wxUSE_DATETIME)
# check for timezone variable
# doesn't exist under Darwin / Mac OS X which uses tm_gmtoff instead
foreach(timezone_def _timezone __timezone timezone)
wx_check_cxx_source_compiles("
int tz;
tz = ${timezone_def};"
wxTEST_TZ_${timezone_def}
time.h
)
if(${wxTEST_TZ_${timezone_def}})
set(WX_TIMEZONE ${timezone_def})
break()
endif()
endforeach()
check_struct_has_member("struct tm" tm_gmtoff time.h WX_GMTOFF_IN_TM)
endif()
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
check_symbol_exists(dlopen dlfcn.h HAVE_DLOPEN)
cmake_pop_check_state()
if(HAVE_DLOPEN)
check_symbol_exists(dladdr dlfcn.h HAVE_DLADDR)
check_symbol_exists(dl_iterate_phdr link.h HAVE_DL_ITERATE_PHDR)
endif()
if(APPLE)
set(wxUSE_EPOLL_DISPATCHER OFF)
set(wxUSE_SELECT_DISPATCHER ON)
else()
if(NOT WIN32)
set(wxUSE_SELECT_DISPATCHER ON)
endif()
check_include_file(sys/epoll.h wxUSE_EPOLL_DISPATCHER)
endif()
check_include_file(sys/select.h HAVE_SYS_SELECT_H)
if(wxUSE_FSWATCHER)
check_include_file(sys/inotify.h wxHAS_INOTIFY)
if(NOT wxHAS_INOTIFY)
check_include_file(sys/event.h wxHAS_KQUEUE)
endif()
endif()
if(wxUSE_XLOCALE)
check_include_file(xlocale.h HAVE_XLOCALE_H)
set(CMAKE_EXTRA_INCLUDE_FILES locale.h)
if(HAVE_XLOCALE_H)
list(APPEND CMAKE_EXTRA_INCLUDE_FILES xlocale.h)
endif()
check_type_size(locale_t LOCALE_T)
set(CMAKE_EXTRA_INCLUDE_FILES)
endif()
# Check sizes of various types
set(SYSTYPES size_t wchar_t int long short)
foreach(SYSTYPE ${SYSTYPES})
string(TOUPPER ${SYSTYPE} SYSTYPE_UPPER)
check_type_size(${SYSTYPE} SIZEOF_${SYSTYPE_UPPER})
if(NOT HAVE_SIZEOF_${SYSTYPE_UPPER})
# Add a definition if it is not available
set(${SYSTYPE} ON)
endif()
endforeach()
check_type_size("long long" SIZEOF_LONG_LONG)
check_type_size(ssize_t SSIZE_T)
test_big_endian(WORDS_BIGENDIAN)
# For generators using build type, ensure that wxHAVE_CEF_DEBUG matches it.
if(wxUSE_WEBVIEW_CHROMIUM AND DEFINED CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
if(${build_type} STREQUAL DEBUG)
set(wxHAVE_CEF_DEBUG ON)
endif()
endif()
configure_file(build/cmake/setup.h.in ${wxSETUP_HEADER_FILE})
if(DEFINED wxSETUP_HEADER_FILE_DEBUG)
# The debug version may be configured with different values in the future
configure_file(build/cmake/setup.h.in ${wxSETUP_HEADER_FILE_DEBUG})
endif()

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
#############################################################################
# Name: build/cmake/source_groups.cmake
# Purpose: CMake source groups file
# Author: Tobias Taschner
# Created: 2016-10-14
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
# Define source groups for supported IDEs
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
function(wx_set_source_groups)
source_group("Common Headers" REGULAR_EXPRESSION "/include/wx/.*\\.h")
source_group("Common Sources" REGULAR_EXPRESSION "/src/common/.*")
source_group("GTK+ Sources" REGULAR_EXPRESSION "/src/gtk/.*")
source_group("MSW Sources" REGULAR_EXPRESSION "/src/msw/.*")
source_group("OSX Sources" REGULAR_EXPRESSION "/src/osx/.*")
source_group("Generic Sources" REGULAR_EXPRESSION "/src/generic/.*")
source_group("wxUniv Sources" REGULAR_EXPRESSION "/src/univ/.*")
source_group("wxHTML Sources" REGULAR_EXPRESSION "/src/html/.*")
source_group("Setup Headers" REGULAR_EXPRESSION "/include/.*/setup.h")
source_group("GTK+ Headers" REGULAR_EXPRESSION "/include/wx/gtk/.*")
source_group("MSW Headers" REGULAR_EXPRESSION "/include/wx/msw/.*")
source_group("OSX Headers" REGULAR_EXPRESSION "/include/wx/osx/.*")
source_group("Generic Headers" REGULAR_EXPRESSION "/include/wx/generic/.*")
source_group("wxUniv Headers" REGULAR_EXPRESSION "/include/wx/univ/.*")
source_group("wxHTML Headers" REGULAR_EXPRESSION "/include/wx/html/.*")
source_group("Setup Headers" FILES ${wxSETUP_HEADER_FILE})
source_group("Resource Files" REGULAR_EXPRESSION "/[^.]*.(rc|ico|png|icns|manifest|plist)$")
source_group("CMake" REGULAR_EXPRESSION "(CMakeLists\\.txt|cmake_pch.*|.*_CXX_prefix\\.hxx\\.rule)$")
endfunction()

View File

@@ -0,0 +1,13 @@
#############################################################################
# Name: build/cmake/tests/CMakeLists.txt
# Purpose: Build test executables
# Author: Tobias Taschner
# Created: 2016-09-24
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
add_subdirectory(base)
add_subdirectory(drawing)
add_subdirectory(gui)
add_subdirectory(headers)

View File

@@ -0,0 +1,131 @@
#############################################################################
# Name: build/cmake/tests/base/CMakeLists.txt
# Purpose: CMake file for base test
# Author: Tobias Taschner
# Created: 2016-10-31
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(TEST_SRC
test.cpp
any/anytest.cpp
archive/archivetest.cpp
archive/ziptest.cpp
archive/tartest.cpp
arrays/arrays.cpp
base64/base64.cpp
cmdline/cmdlinetest.cpp
config/fileconf.cpp
config/regconf.cpp
datetime/datetimetest.cpp
events/evthandler.cpp
events/evtlooptest.cpp
events/evtsource.cpp
events/stopwatch.cpp
events/timertest.cpp
exec/exec.cpp
file/dir.cpp
file/filefn.cpp
file/filetest.cpp
filekind/filekind.cpp
filename/filenametest.cpp
filesys/filesystest.cpp
fontmap/fontmaptest.cpp
formatconverter/formatconvertertest.cpp
fswatcher/fswatchertest.cpp
hashes/hashes.cpp
interactive/output.cpp
interactive/input.cpp
intl/intltest.cpp
lists/lists.cpp
log/logtest.cpp
longlong/longlongtest.cpp
mbconv/convautotest.cpp
mbconv/mbconvtest.cpp
misc/dynamiclib.cpp
misc/environ.cpp
misc/metatest.cpp
misc/misctests.cpp
misc/module.cpp
misc/pathlist.cpp
misc/typeinfotest.cpp
net/ipc.cpp
net/socket.cpp
net/webrequest.cpp
regex/regextest.cpp
regex/wxregextest.cpp
scopeguard/scopeguardtest.cpp
strings/iostream.cpp
strings/numformatter.cpp
strings/strings.cpp
strings/stdstrings.cpp
strings/tokenizer.cpp
strings/unichar.cpp
strings/unicode.cpp
strings/vararg.cpp
strings/crt.cpp
strings/vsnprintf.cpp
strings/hexconv.cpp
streams/datastreamtest.cpp
streams/ffilestream.cpp
streams/fileback.cpp
streams/filestream.cpp
streams/iostreams.cpp
streams/largefile.cpp
streams/lzmastream.cpp
streams/memstream.cpp
streams/socketstream.cpp
streams/sstream.cpp
streams/stdstream.cpp
streams/tempfile.cpp
streams/textstreamtest.cpp
streams/zlibstream.cpp
textfile/textfiletest.cpp
thread/atomic.cpp
thread/misc.cpp
thread/queue.cpp
thread/tls.cpp
uris/ftp.cpp
uris/uris.cpp
uris/url.cpp
weakref/evtconnection.cpp
weakref/weakref.cpp
xlocale/xlocale.cpp
testprec.h
testableframe.h
testdate.h
testfile.h
archive/archivetest.h
streams/bstream.h
)
if(wxUSE_XML)
list(APPEND TEST_SRC xml/xmltest.cpp)
endif()
set(TEST_DATA
intl/en_GB/internat.mo
intl/en_GB/internat.po
intl/fr/internat.mo
intl/fr/internat.po
intl/ja/internat.mo
intl/ja/internat.po
intl/xart-dothraki/internat.mo
intl/xart-dothraki/internat.po
horse.bmp
horse.png
horse.xpm
testdata.conf
)
wx_add_test(test_base CONSOLE ${TEST_SRC}
DATA ${TEST_DATA}
)
if(wxUSE_SOCKETS)
wx_exe_link_libraries(test_base wxnet)
endif()
if(wxUSE_XML)
wx_exe_link_libraries(test_base wxxml)
endif()

View File

@@ -0,0 +1,53 @@
#############################################################################
# Name: build/cmake/tests/drawing/CMakeLists.txt
# Purpose: CMake file for drawing test
# Author: Tobias Taschner
# Created: 2016-10-31
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
# This test program is targeted to "headless GUI" tests, tests which are
# typically tied to the "core" component but that should run nicely in a
# console only program. This program should be executable from a console
# only Unix session (such as telnet or ssh) although it uses graphics
# contexts, so if you modify this project, please check that it can still
# be ran in such configuration and doesn't require an X server connection.
set(TEST_DRAWING_SRC
test.cpp
testableframe.cpp
drawing/drawing.cpp
drawing/plugindriver.cpp
drawing/basictest.cpp
drawing/fonttest.cpp
testprec.h
testableframe.h
testimage.h
drawing/drawing.h
drawing/gcfactory.h
drawing/plugin.h
drawing/pluginsample.cpp
drawing/testimagefile.h
)
set(TEST_DRAWING_DATA
drawing/references/image_test_image_cairo-1.8_2_ref.png
drawing/references/image_test_image_cg-10.5_2_ref.png
drawing/references/image_test_image_gdiplus-6.1_2_ref.png
)
wx_add_test(test_drawing CONSOLE_GUI ${TEST_DRAWING_SRC}
DATA ${TEST_DRAWING_DATA}
)
if(wxUSE_SOCKETS)
wx_exe_link_libraries(test_drawing wxnet)
endif()
# This is a sample plugin, it simply uses a wxImage based
# wxGraphicsContext. It should render the same as the built-in test. Use
# the WX_TEST_SUITE_GC_DRAWING_PLUGINS variable to specify the location of
# the produced DLL/so to get it loaded and tested. To make your own plugin,
# you can copy this sample and link toward your own implementation of
# wxGraphicsContext interface, building the appropriate DrawingTestGCFactory
# TODO: test_drawingplugin

View File

@@ -0,0 +1,261 @@
#############################################################################
# Name: build/cmake/tests/gui/CMakeLists.txt
# Purpose: CMake file for gui test
# Author: Tobias Taschner
# Created: 2016-10-31
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(TEST_GUI_SRC
asserthelper.cpp
test.cpp
testableframe.cpp
geometry/rect.cpp
geometry/size.cpp
geometry/point.cpp
geometry/region.cpp
graphics/bitmap.cpp
graphics/colour.cpp
graphics/ellipsization.cpp
graphics/measuring.cpp
graphics/affinematrix.cpp
graphics/boundingbox.cpp
graphics/clipper.cpp
graphics/clippingbox.cpp
graphics/coords.cpp
graphics/graphbitmap.cpp
graphics/graphmatrix.cpp
graphics/graphpath.cpp
graphics/imagelist.cpp
config/config.cpp
controls/auitest.cpp
controls/bitmapcomboboxtest.cpp
controls/bitmaptogglebuttontest.cpp
controls/bookctrlbasetest.cpp
controls/buttontest.cpp
controls/checkboxtest.cpp
controls/checklistboxtest.cpp
controls/choicebooktest.cpp
controls/choicetest.cpp
controls/comboboxtest.cpp
controls/dataviewctrltest.cpp
controls/datepickerctrltest.cpp
controls/frametest.cpp
controls/gaugetest.cpp
controls/gridtest.cpp
controls/headerctrltest.cpp
controls/htmllboxtest.cpp
controls/hyperlinkctrltest.cpp
controls/itemcontainertest.cpp
controls/infobar.cpp
controls/label.cpp
controls/listbasetest.cpp
controls/listbooktest.cpp
controls/listboxtest.cpp
controls/listctrltest.cpp
controls/listviewtest.cpp
controls/markuptest.cpp
controls/notebooktest.cpp
controls/ownerdrawncomboboxtest.cpp
controls/pickerbasetest.cpp
controls/pickertest.cpp
controls/propgridtest.cpp
controls/radioboxtest.cpp
controls/radiobuttontest.cpp
controls/rearrangelisttest.cpp
controls/richtextctrltest.cpp
controls/searchctrltest.cpp
controls/simplebooktest.cpp
controls/slidertest.cpp
controls/spinctrldbltest.cpp
controls/spinctrltest.cpp
controls/styledtextctrltest.cpp
controls/textctrltest.cpp
controls/textentrytest.cpp
controls/togglebuttontest.cpp
controls/toolbooktest.cpp
controls/treebooktest.cpp
controls/treectrltest.cpp
controls/treelistctrltest.cpp
controls/virtlistctrltest.cpp
controls/webtest.cpp
controls/windowtest.cpp
controls/dialogtest.cpp
events/clone.cpp
# Duplicate this file here to test GUI event loops too.
events/evtlooptest.cpp
events/propagation.cpp
events/keyboard.cpp
# And duplicate this one too as wxExecute behaves differently in
# console and GUI applications.
exec/exec.cpp
font/fonttest.cpp
image/image.cpp
image/imagwebp.cpp
image/rawbmp.cpp
html/htmlparser.cpp
html/htmlwindow.cpp
html/htmprint.cpp
menu/accelentry.cpp
menu/menu.cpp
misc/guifuncs.cpp
misc/selstoretest.cpp
misc/garbage.cpp
misc/safearrayconverttest.cpp
misc/settings.cpp
# This one is intentionally duplicated here (it is also part of
# non-GUI test) as sockets behave differently in console and GUI
# applications.
net/socket.cpp
persistence/tlw.cpp
persistence/dataview.cpp
rowheightcache/rowheightcachetest.cpp
sizers/boxsizer.cpp
sizers/gridsizer.cpp
sizers/wrapsizer.cpp
toplevel/toplevel.cpp
validators/valnum.cpp
validators/valtext.cpp
window/clientsize.cpp
window/setsize.cpp
xml/xrctest.cpp
testprec.h
testableframe.h
asserthelper.h
testdate.h
testfile.h
testimage.h
controls/bookctrlbasetest.h
controls/itemcontainertest.h
controls/listbasetest.h
controls/pickerbasetest.h
controls/textentrytest.h
persistence/testpersistence.h
)
set(TEST_GUI_DATA
horse.ani
horse.bmp
horse.cur
horse.gif
horse.ico
horse.jpg
horse.pcx
horse.png
horse.pnm
horse.svg
horse.tga
horse.tif
horse.xpm
horse.webp
image/bitfields.bmp
image/bitfields-alpha.bmp
image/8bpp-colorsused-large.bmp
image/8bpp-colorsused-negative.bmp
image/32bpp_rgb.bmp
image/32bpp_rgb.ico
image/32bpp_rgb_a0.ico
image/badrle4.bmp
image/rgb16-3103.bmp
image/rgb32-7187.bmp
image/rgb32bf.bmp
image/rgba32.bmp
image/rle4-delta-320x240.bmp
image/rle8-delta-320x240-expected.bmp
image/rle8-delta-320x240.bmp
image/horse_grey.bmp
image/horse_grey_flipped.bmp
image/horse_rle4.bmp
image/horse_rle4_flipped.bmp
image/horse_rle8.bmp
image/horse_rle8_flipped.bmp
image/cross_bicubic_256x256.png
image/cross_bilinear_256x256.png
image/cross_box_average_256x256.png
image/cross_nearest_neighb_256x256.png
image/horse_bicubic_50x50.png
image/horse_bicubic_100x100.png
image/horse_bicubic_150x150.png
image/horse_bicubic_300x300.png
image/horse_bilinear_50x50.png
image/horse_bilinear_100x100.png
image/horse_bilinear_150x150.png
image/horse_bilinear_300x300.png
image/horse_box_average_50x50.png
image/horse_box_average_100x100.png
image/horse_box_average_150x150.png
image/horse_box_average_300x300.png
image/paste_input_background.png
image/paste_input_black.png
image/paste_input_overlay_transparent_border_opaque_square.png
image/paste_input_overlay_transparent_border_semitransparent_circle.png
image/paste_input_overlay_transparent_border_semitransparent_square.png
image/paste_result_background_plus_circle_plus_square.png
image/paste_result_background_plus_overlay_transparent_border_opaque_square.png
image/paste_result_background_plus_overlay_transparent_border_semitransparent_square.png
image/paste_result_no_background_square_over_circle.png
image/wx.png
image/toucan.png
image/toucan_hue_0.538.png
image/toucan_sat_-0.41.png
image/toucan_bright_-0.259.png
image/toucan_hsv_0.538_-0.41_-0.259.png
image/toucan_light_46.png
image/toucan_dis_240.png
image/toucan_grey.png
image/toucan_mono_255_255_255.png
image/width-times-height-overflow.bmp
image/width_height_32_bit_overflow.pgm
image/bad_truncated.gif
intl/ja/internat.mo
intl/ja/internat.po
)
set(TEST_GUI_RES_BUNDLE
horse.png
../include/wx/msw/bullseye.cur
)
# On macOS create an .app bundle so the resources can be added.
# On other platforms, just use a console app with gui libraries.
set(APP_TYPE)
if(NOT APPLE)
set(APP_TYPE CONSOLE_GUI)
endif()
wx_add_test(test_gui ${APP_TYPE} ${TEST_GUI_SRC}
DATA ${TEST_GUI_DATA}
RES_BUNDLE ${TEST_GUI_RES_BUNDLE}
)
if(wxUSE_AUI)
wx_exe_link_libraries(test_gui wxaui)
endif()
if(wxUSE_RICHTEXT)
wx_exe_link_libraries(test_gui wxrichtext)
endif()
if(wxUSE_STC)
wx_exe_link_libraries(test_gui wxstc)
endif()
if(wxUSE_MEDIACTRL)
wx_exe_link_libraries(test_gui wxmedia)
endif()
if(wxUSE_XRC)
wx_exe_link_libraries(test_gui wxxrc)
endif()
if(wxUSE_XML)
wx_exe_link_libraries(test_gui wxxml)
endif()
if(wxUSE_HTML)
wx_exe_link_libraries(test_gui wxhtml)
endif()
if(wxUSE_SOCKETS)
wx_exe_link_libraries(test_gui wxnet)
endif()
if(wxUSE_WEBVIEW)
wx_exe_link_libraries(test_gui wxwebview)
endif()
if(wxUSE_PROPGRID)
wx_exe_link_libraries(test_gui wxpropgrid)
endif()

View File

@@ -0,0 +1,23 @@
#############################################################################
# Name: build/cmake/tests/headers/CMakeLists.txt
# Purpose: CMake file for headers test
# Author: Maarten Bent
# Created: 2020-07-23
# Copyright: (c) 2020 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(TEST_SRC
test.cpp
testableframe.cpp
allheaders.cpp
testprec.h
testableframe.h
allheaders.h
)
wx_add_test(test_headers CONSOLE_GUI ${TEST_SRC})
if(wxUSE_SOCKETS)
wx_exe_link_libraries(test_headers wxnet)
endif()

View File

@@ -0,0 +1,157 @@
#############################################################################
# Name: build/cmake/toolkit.cmake
# Purpose: CMake platform toolkit options
# Author: Tobias Taschner
# Created: 2016-10-03
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
# Options required for toolkit selection/detection
wx_option(wxUSE_GUI "Use GUI" ON)
if(CMAKE_OSX_SYSROOT MATCHES iphoneos)
set(IPHONE ON)
# workaround a bug where try_compile (and functions using it,
# like find_package, check_c_source_compiles) fails
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
endif()
if(WIN32)
set(wxDEFAULT_TOOLKIT msw)
set(wxTOOLKIT_OPTIONS msw gtk2 gtk3 qt)
set(wxPLATFORM WIN32)
elseif(APPLE AND IPHONE)
set(wxDEFAULT_TOOLKIT osx_iphone)
set(wxTOOLKIT_OPTIONS osx_iphone)
set(wxPLATFORM OSX)
elseif(APPLE)
set(wxDEFAULT_TOOLKIT osx_cocoa)
set(wxTOOLKIT_OPTIONS osx_cocoa gtk2 gtk3 gtk4 qt)
set(wxPLATFORM OSX)
elseif(UNIX)
set(wxDEFAULT_TOOLKIT gtk3)
set(wxTOOLKIT_OPTIONS gtk2 gtk3 gtk4 qt)
set(wxPLATFORM UNIX)
else()
message(FATAL_ERROR "Unsupported platform")
endif()
wx_option(wxBUILD_TOOLKIT "Toolkit used by wxWidgets" ${wxDEFAULT_TOOLKIT}
STRINGS ${wxTOOLKIT_OPTIONS})
# TODO: set to univ for universal build
set(wxBUILD_WIDGETSET "")
# Create shortcut variable for easy toolkit tests
string(TOUPPER ${wxBUILD_TOOLKIT} wxBUILD_TOOLKIT_UPPER)
set(WX${wxBUILD_TOOLKIT_UPPER} ON)
if(wxBUILD_TOOLKIT MATCHES "^gtk*")
set(WXGTK ON)
elseif(wxBUILD_TOOLKIT MATCHES "^osx*")
set(WXOSX ON)
elseif(wxBUILD_TOOLKIT MATCHES "qt")
set(WXQT ON)
endif()
set(wxTOOLKIT_DEFINITIONS __WX${wxBUILD_TOOLKIT_UPPER}__)
if(NOT wxUSE_GUI)
set(wxBUILD_TOOLKIT "base")
string(TOUPPER ${wxBUILD_TOOLKIT} wxBUILD_TOOLKIT_UPPER)
set(WX${wxBUILD_TOOLKIT_UPPER} ON)
set(wxTOOLKIT_DEFINITIONS __WX${wxBUILD_TOOLKIT_UPPER}__)
endif()
# Initialize toolkit variables
if(wxUSE_GUI)
set(wxTOOLKIT_INCLUDE_DIRS)
set(wxTOOLKIT_LIBRARIES)
set(wxTOOLKIT_VERSION)
if(WXGTK)
if(WXGTK4)
set(gtk_lib GTK4)
elseif(WXGTK3)
set(gtk_lib GTK3)
elseif(WXGTK2)
set(gtk_lib GTK2)
endif()
find_package(${gtk_lib} REQUIRED)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${${gtk_lib}_INCLUDE_DIRS})
list(APPEND wxTOOLKIT_LIBRARIES ${${gtk_lib}_LIBRARIES})
list(APPEND wxTOOLKIT_DEFINITIONS ${${gtk_lib}_DEFINITIONS})
list(APPEND wxTOOLKIT_DEFINITIONS __WXGTK__)
set(wxTOOLKIT_VERSION ${${gtk_lib}_VERSION})
if(WIN32 AND MSVC)
if(WXGTK4)
list(APPEND wxTOOLKIT_LIBRARIES
libgtk-4.dll.a
libgdk-4.dll.a
)
elseif(WXGTK3)
list(APPEND wxTOOLKIT_LIBRARIES
libgtk-3.dll.a
libgdk-3.dll.a
)
elseif(WXGTK2)
list(APPEND wxTOOLKIT_LIBRARIES
gtk-win32-2.0
gdk-win32-2.0
)
endif()
list(APPEND wxTOOLKIT_LIBRARIES
gio-2.0
pangocairo-1.0
gdk_pixbuf-2.0
cairo
pango-1.0
gobject-2.0
gthread-2.0
glib-2.0
)
endif()
endif()
# We need X11 for non-GTK Unix ports (X11) and for GTK with X11
# support, but not for Wayland-only GTK (necessarily 3 or later), which is why
# we have to do this after find_package(GTKx) above, as this is what sets
# wxHAVE_GDK_X11.
if(UNIX AND NOT WIN32 AND (WXX11 OR WXGTK2 OR (WXGTK AND wxHAVE_GDK_X11)))
find_package(X11 REQUIRED)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${X11_INCLUDE_DIR})
list(APPEND wxTOOLKIT_LIBRARIES ${X11_LIBRARIES})
endif()
if(WXQT)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
if(QT_VERSION_MAJOR EQUAL 5)
set(QT_COMPONENTS Core Widgets Gui OpenGL OpenGL Test)
elseif(QT_VERSION_MAJOR EQUAL 6)
set(QT_COMPONENTS Core Widgets Gui OpenGL OpenGLWidgets Test)
endif()
foreach(QT_COMPONENT ${QT_COMPONENTS})
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS ${QT_COMPONENT} REQUIRED)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${Qt${QT_VERSION_MAJOR}${QT_COMPONENT}_INCLUDE_DIRS})
list(APPEND wxTOOLKIT_LIBRARIES ${Qt${QT_VERSION_MAJOR}${QT_COMPONENT}_LIBRARIES})
list(APPEND wxTOOLKIT_DEFINITIONS ${Qt${QT_VERSION_MAJOR}${QT_COMPONENT}_COMPILE_DEFINITIONS})
endforeach()
set(wxTOOLKIT_VERSION ${Qt${QT_VERSION_MAJOR}Core_VERSION})
if(ANDROID)
# A hack to remove _${ANDROID_ABI} that Qt5AndroidSupport.cmake added
# which breaks wx-config.
set(CMAKE_SHARED_LIBRARY_SUFFIX_C ${CMAKE_SHARED_LIBRARY_SUFFIX})
set(CMAKE_SHARED_LIBRARY_SUFFIX_CXX ${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
if(wxBUILD_TOOLKIT MATCHES "osx_cocoa")
list(APPEND wxTOOLKIT_DEFINITIONS __WXMAC__ __WXOSX__)
endif()
endif() # wxUSE_GUI

View File

@@ -0,0 +1,31 @@
#############################################################################
# Name: build/cmake/uninstall.cmake.in
# Purpose: CMake uinstall template
# Author: Tobias Taschner
# Created: 2016-10-18
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif()
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
list(APPEND files @WX_EXTRA_UNINSTALL_FILES@)
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else()
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach(file)

View File

@@ -0,0 +1,50 @@
#############################################################################
# Name: build/cmake/utils/CMakeLists.txt
# Purpose: CMake script for utilities
# Author: Tobias Taschner
# Created: 2016-10-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_XRC)
add_executable(wxrc "${wxSOURCE_DIR}/utils/wxrc/wxrc.cpp")
wx_set_common_target_properties(wxrc)
if(wxUSE_XML)
wx_exe_link_libraries(wxrc wxxml)
endif()
wx_exe_link_libraries(wxrc wxbase)
set(wxrc_output_name "wxrc")
if(NOT WIN32_MSVC_NAMING)
wx_get_flavour(lib_flavour "-")
set(wxrc_output_name "wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${lib_flavour}")
endif()
set_target_properties(wxrc PROPERTIES OUTPUT_NAME ${wxrc_output_name})
set_target_properties(wxrc PROPERTIES FOLDER "Utilities")
wx_install(TARGETS wxrc
RUNTIME DESTINATION "bin"
BUNDLE DESTINATION "bin"
)
if(NOT WIN32_MSVC_NAMING AND wxBUILD_INSTALL)
if(IPHONE)
set(EXE_SUFFIX ".app")
else()
set(EXE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX})
endif()
# Don't use wx_install() here to preserve escaping.
install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
\"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/${wxrc_output_name}${EXE_SUFFIX}\" \
\"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX}\" \
)"
)
endif()
endif()
# TODO: build targets for other utils

View File

@@ -0,0 +1,164 @@
@PACKAGE_INIT@
cmake_policy(PUSH)
# Set policies to prevent warnings
if(POLICY CMP0057)
# Support new if() IN_LIST operator.
cmake_policy(SET CMP0057 NEW)
endif()
if(POLICY CMP0072)
# FindOpenGL prefers GLVND by default when available.
cmake_policy(GET CMP0072 _OpenGL_GL_POLICY)
if (_OpenGL_GL_POLICY STREQUAL "")
cmake_policy(SET CMP0072 NEW)
endif()
endif()
# determine target from compiler, platform and library type
if(WIN32 AND NOT CYGWIN AND NOT MSYS)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
set(wxCOMPILER_PREFIX "vc")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
set(wxCOMPILER_PREFIX "gcc")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
set(wxCOMPILER_PREFIX "clang")
endif()
set(wxPLATFORM_ARCH)
if(CMAKE_GENERATOR_PLATFORM)
if(NOT CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
string(TOLOWER ${CMAKE_GENERATOR_PLATFORM} wxPLATFORM_ARCH)
endif()
elseif(CMAKE_VS_PLATFORM_NAME)
if(NOT CMAKE_VS_PLATFORM_NAME STREQUAL "Win32")
string(TOLOWER ${CMAKE_VS_PLATFORM_NAME} wxPLATFORM_ARCH)
endif()
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(wxPLATFORM_ARCH "x64")
endif()
endif()
if(wxPLATFORM_ARCH)
set(wxARCH_SUFFIX "_${wxPLATFORM_ARCH}")
endif()
# use wxWidgets_USE_STATIC to force static libraries, otherwise shared is searched first
if(NOT wxWidgets_USE_STATIC AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${wxCOMPILER_PREFIX}${wxARCH_SUFFIX}_dll/@PROJECT_NAME@Targets.cmake")
set(wxPLATFORM_LIB_DIR "/${wxCOMPILER_PREFIX}${wxARCH_SUFFIX}_dll")
elseif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${wxCOMPILER_PREFIX}${wxARCH_SUFFIX}_lib/@PROJECT_NAME@Targets.cmake")
set(wxPLATFORM_LIB_DIR "/${wxCOMPILER_PREFIX}${wxARCH_SUFFIX}_lib")
endif()
endif()
include("${CMAKE_CURRENT_LIST_DIR}${wxPLATFORM_LIB_DIR}/@PROJECT_NAME@Targets.cmake")
macro(wx_inherit_property source dest name)
# property name without _<CONFIG>
get_target_property(prop ${source} ${name})
if(prop)
set_target_properties(${dest} PROPERTIES ${name} "${prop}")
endif()
# property name with _<CONFIG>
get_target_property(configs ${source} IMPORTED_CONFIGURATIONS)
foreach(cfg ${configs})
set(name_cfg "${name}_${cfg}")
get_target_property(prop ${source} ${name_cfg})
if(prop)
set_target_properties(${dest} PROPERTIES ${name_cfg} "${prop}")
endif()
endforeach()
endmacro()
# for compatibility with FindwxWidgets
set(wxWidgets_LIBRARIES)
# create one target with all libraries, same as FindwxWidgets
set(CREATE_WX_TARGET OFF)
if(NOT TARGET wxWidgets::wxWidgets)
add_library(wxWidgets::wxWidgets INTERFACE IMPORTED)
set(CREATE_WX_TARGET ON)
endif()
# list all available components
set(@PROJECT_NAME@_COMPONENTS)
foreach(libname @wxLIB_TARGETS@)
if(TARGET wx::${libname})
# remove wx prefix from component name
string(SUBSTRING ${libname} 2 -1 name)
# set variables used in check_required_components
list(APPEND @PROJECT_NAME@_COMPONENTS ${name})
set(@PROJECT_NAME@_${name}_FOUND 1)
set(@PROJECT_NAME@_FIND_REQUIRED_${name} 1)
# use the Release configuration for MinSizeRel and RelWithDebInfo configurations
# only when Release target exists, and MinSizeRel/RelWithDebInfo doesn't exist
get_target_property(configs wx::${libname} IMPORTED_CONFIGURATIONS)
if("RELEASE" IN_LIST configs)
if(NOT "MINSIZEREL" IN_LIST configs)
if("MinSizeRel" IN_LIST CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
set_target_properties(wx::${libname} PROPERTIES MAP_IMPORTED_CONFIG_MINSIZEREL "Release")
endif()
endif()
if(NOT "RELWITHDEBINFO" IN_LIST configs)
if("RelWithDebInfo" IN_LIST CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set_target_properties(wx::${libname} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO "Release")
endif()
endif()
endif()
# add an alias from wx::<lib> to wx::wx<lib>
if(CMAKE_VERSION VERSION_LESS "3.18")
# CMake <3.18 does not support alias to non-global imported target, create a copy of the library
get_target_property(target_type wx::${libname} TYPE)
if(target_type STREQUAL STATIC_LIBRARY)
add_library(wx::${name} STATIC IMPORTED)
else()
add_library(wx::${name} SHARED IMPORTED)
endif()
wx_inherit_property(wx::${libname} wx::${name} IMPORTED_CONFIGURATIONS)
wx_inherit_property(wx::${libname} wx::${name} INTERFACE_COMPILE_DEFINITIONS)
wx_inherit_property(wx::${libname} wx::${name} INTERFACE_INCLUDE_DIRECTORIES)
wx_inherit_property(wx::${libname} wx::${name} INTERFACE_LINK_LIBRARIES)
wx_inherit_property(wx::${libname} wx::${name} IMPORTED_LINK_INTERFACE_LANGUAGES)
wx_inherit_property(wx::${libname} wx::${name} IMPORTED_LOCATION)
wx_inherit_property(wx::${libname} wx::${name} IMPORTED_IMPLIB)
wx_inherit_property(wx::${libname} wx::${name} IMPORTED_LINK_DEPENDENT_LIBRARIES)
else()
add_library(wx::${name} ALIAS wx::${libname})
endif()
# add to FindwxWidgets variable
if(NOT @PROJECT_NAME@_FIND_COMPONENTS OR ${name} IN_LIST @PROJECT_NAME@_FIND_COMPONENTS)
list(APPEND wxWidgets_LIBRARIES wx::${name})
if(CREATE_WX_TARGET)
target_link_libraries(wxWidgets::wxWidgets INTERFACE wx::${name})
endif()
endif()
endif()
endforeach()
if(TARGET wx::wxnet AND @wxUSE_WEBREQUEST_CURL@)
# make sure CURL targets are available:
# The link interface of target "wx::wxnet" contains: CURL::libcurl_shared
find_package(CURL QUIET)
endif()
if(TARGET wx::wxgl)
# make sure OpenGL targets are available:
# The link interface of target "wx::wxgl" contains: OpenGL::GLU
find_package(OpenGL QUIET)
endif()
# make sure Threads targets are available
find_package(Threads QUIET)
# if no components are specified in find_package, check all of them
if(NOT @PROJECT_NAME@_FIND_COMPONENTS)
set(@PROJECT_NAME@_FIND_COMPONENTS ${@PROJECT_NAME@_COMPONENTS})
endif()
check_required_components("@PROJECT_NAME@")
cmake_policy(POP)