2016-09-25 16:19:39 -04:00
|
|
|
#############################################################################
|
|
|
|
# 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)
|
2022-04-10 14:39:17 -04:00
|
|
|
set(wxMONO_INCLUDE_DIRS)
|
2022-04-10 13:35:15 -04:00
|
|
|
set(wxMONO_DEFINITIONS)
|
2018-05-18 16:01:02 -04:00
|
|
|
set(wxMONO_NONCOMPILED_CPP_FILES)
|
2022-04-09 11:23:26 -04:00
|
|
|
set(wxMONO_DEPENDENCIES)
|
2016-09-25 16:19:39 -04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Define third party libraries
|
2018-01-27 07:33:31 -05:00
|
|
|
set(LIBS_THIRDPARTY regex zlib expat)
|
2016-09-25 16:19:39 -04:00
|
|
|
if(wxUSE_GUI)
|
|
|
|
list(APPEND LIBS_THIRDPARTY jpeg png tiff)
|
|
|
|
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 var_name)
|
|
|
|
if(${var_name})
|
|
|
|
list(APPEND LIBS ${name})
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
# Define base libraries
|
|
|
|
set(LIBS base)
|
|
|
|
add_opt_lib(net wxUSE_SOCKETS)
|
|
|
|
|
|
|
|
# Define UI libraries
|
|
|
|
if(wxUSE_GUI)
|
2018-09-04 05:18:03 -04:00
|
|
|
list(APPEND LIBS core adv)
|
2016-09-25 16:19:39 -04:00
|
|
|
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)
|
|
|
|
endif() # wxUSE_GUI
|
|
|
|
|
2018-05-18 16:01:02 -04:00
|
|
|
# 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)
|
|
|
|
|
2016-09-25 16:19:39 -04:00
|
|
|
# Include cmake file for every library
|
|
|
|
foreach(LIB ${LIBS})
|
|
|
|
add_subdirectory(${LIB})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(wxBUILD_MONOLITHIC)
|
|
|
|
# Create monolithic library target
|
2020-05-17 13:41:44 -04:00
|
|
|
wx_add_library(wxmono ${wxMONO_SRC_FILES})
|
2016-09-25 16:19:39 -04:00
|
|
|
foreach(vis PRIVATE PUBLIC)
|
|
|
|
if(wxMONO_LIBS_${vis})
|
|
|
|
# Remove libs included in mono from list
|
|
|
|
foreach(lib IN LISTS LIBS)
|
2020-05-17 13:41:44 -04:00
|
|
|
list(REMOVE_ITEM wxMONO_LIBS_${vis} wx${lib})
|
2016-09-25 16:19:39 -04:00
|
|
|
endforeach()
|
|
|
|
|
2020-05-17 13:41:44 -04:00
|
|
|
target_link_libraries(wxmono ${vis} ${wxMONO_LIBS_${vis}})
|
2016-09-25 16:19:39 -04:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2022-04-10 14:39:17 -04:00
|
|
|
if(wxMONO_INCLUDE_DIRS)
|
|
|
|
target_include_directories(wxmono BEFORE PRIVATE ${wxMONO_INCLUDE_DIRS})
|
|
|
|
endif()
|
2022-04-10 13:35:15 -04:00
|
|
|
if(wxMONO_DEFINITIONS)
|
|
|
|
target_compile_definitions(wxmono PRIVATE ${wxMONO_DEFINITIONS})
|
|
|
|
endif()
|
2018-05-18 16:01:02 -04:00
|
|
|
foreach(file ${wxMONO_NONCOMPILED_CPP_FILES})
|
|
|
|
set_source_files_properties(${file} PROPERTIES HEADER_FILE_ONLY TRUE)
|
|
|
|
endforeach()
|
2022-04-09 11:23:26 -04:00
|
|
|
foreach(dep ${wxMONO_DEPENDENCIES})
|
|
|
|
add_dependencies(wxmono ${dep})
|
|
|
|
endforeach()
|
2021-03-07 18:26:24 -05:00
|
|
|
wx_webview_copy_webview2_loader(wxmono)
|
2016-09-25 16:19:39 -04:00
|
|
|
endif()
|
2018-12-28 13:26:39 -05:00
|
|
|
|
|
|
|
# Propagate variable(s) to parent scope
|
|
|
|
set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE)
|