CMake: don't globally include wxWidgets headers
This commit is contained in:
parent
f4c0723387
commit
6e1940c404
|
@ -796,17 +796,20 @@ if(NOT DISABLE_WX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(wxWidgets_FOUND)
|
if(wxWidgets_FOUND)
|
||||||
include(${wxWidgets_USE_FILE})
|
|
||||||
message(STATUS "wxWidgets found, enabling GUI build")
|
message(STATUS "wxWidgets found, enabling GUI build")
|
||||||
|
if(NOT TARGET wxWidgets::wxWidgets)
|
||||||
|
add_library(wxWidgets::wxWidgets INTERFACE IMPORTED)
|
||||||
|
set_target_properties(wxWidgets::wxWidgets PROPERTIES
|
||||||
|
INTERFACE_LINK_LIBRARIES "${wxWidgets_LIBRARIES}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${wxWidgets_INCLUDE_DIRS}"
|
||||||
|
INTERFACE_COMPILE_DEFINITIONS "${wxWidgets_DEFINITIONS}"
|
||||||
|
INTERFACE_COMPILE_OPTIONS "${wxWidgets_CXX_FLAGS}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using static wxWidgets from Externals")
|
message(STATUS "Using static wxWidgets from Externals")
|
||||||
|
|
||||||
include_directories(SYSTEM
|
|
||||||
Externals/wxWidgets3
|
|
||||||
Externals/wxWidgets3/include)
|
|
||||||
add_subdirectory(Externals/wxWidgets3)
|
add_subdirectory(Externals/wxWidgets3)
|
||||||
set(wxWidgets_FOUND TRUE)
|
set(wxWidgets_FOUND TRUE)
|
||||||
set(wxWidgets_LIBRARIES "wx")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -895,3 +895,4 @@ else()
|
||||||
message(FATAL_ERROR "wxWidgets in Externals is not compatible with your platform")
|
message(FATAL_ERROR "wxWidgets in Externals is not compatible with your platform")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_library(wxWidgets::wxWidgets ALIAS wx)
|
||||||
|
|
|
@ -78,7 +78,7 @@ set(GUI_SRCS
|
||||||
WxUtils.cpp
|
WxUtils.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(WXLIBS ${wxWidgets_LIBRARIES})
|
set(WXLIBS wxWidgets::wxWidgets)
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||||
set(WXLIBS ${WXLIBS} dl)
|
set(WXLIBS ${WXLIBS} dl)
|
||||||
|
|
Loading…
Reference in New Issue