############################################################################# # 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_DESKTOP_LOWLEVEL) wx_append_sources(CORE_SRC MSW) wx_append_sources(CORE_SRC MSW_DESKTOP) if(NOT wxUSE_OLE) wx_list_add_prefix(CORE_SRC "${wxSOURCE_DIR}/" "src/generic/dirdlgg.cpp") endif() elseif(WXGTK) if(WXGTK2) 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_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() endif() wx_add_library(wxcore ${CORE_SRC}) foreach(lib JPEG PNG TIFF NANOSVG) 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()