Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 35 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ set_target_properties(csv_explorer PROPERTIES
OUTPUT_NAME "csv-explorer"
)

if((APPLE OR WIN32) AND CMAKE_STRIP)
add_custom_command(
TARGET csv_explorer POST_BUILD
COMMAND "${CMAKE_STRIP}" "$<TARGET_FILE:csv_explorer>"
COMMENT "Stripping csv-explorer binary"
)
endif()

target_include_directories(csv_explorer
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
Expand All @@ -95,10 +103,34 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR APPLE)
endif()

set(wxBUILD_SHARED OFF CACHE BOOL "" FORCE)
set(wxBUILD_MONOLITHIC ON CACHE BOOL "" FORCE)
set(wxBUILD_MONOLITHIC OFF CACHE BOOL "" FORCE)
set(wxBUILD_PRECOMP OFF CACHE BOOL "" FORCE)
set(wxBUILD_USE_STATIC_RUNTIME ON CACHE BOOL "" FORCE)
set(wxUSE_AUI ON CACHE BOOL "" FORCE)
set(wxUSE_DEBUGREPORT OFF CACHE BOOL "" FORCE)
set(wxUSE_FS_INET OFF CACHE BOOL "" FORCE)
set(wxUSE_GRID ON CACHE BOOL "" FORCE)
set(wxUSE_HELP OFF CACHE BOOL "" FORCE)
set(wxUSE_OPENGL OFF CACHE BOOL "" FORCE)
set(wxUSE_PRINTING_ARCHITECTURE ON CACHE BOOL "" FORCE)
set(wxUSE_PROTOCOL OFF CACHE BOOL "" FORCE)
set(wxUSE_PROTOCOL_FILE OFF CACHE BOOL "" FORCE)
set(wxUSE_PROTOCOL_FTP OFF CACHE BOOL "" FORCE)
set(wxUSE_PROTOCOL_HTTP OFF CACHE BOOL "" FORCE)
set(wxUSE_HTML OFF CACHE BOOL "" FORCE)
set(wxUSE_MEDIACTRL OFF CACHE BOOL "" FORCE)
set(wxUSE_MS_HTML_HELP OFF CACHE BOOL "" FORCE)
set(wxUSE_PROPGRID OFF CACHE BOOL "" FORCE)
set(wxUSE_RIBBON OFF CACHE BOOL "" FORCE)
set(wxUSE_RICHTEXT OFF CACHE BOOL "" FORCE)
set(wxUSE_SOCKETS OFF CACHE BOOL "" FORCE)
set(wxUSE_STC OFF CACHE BOOL "" FORCE)
set(wxUSE_URL OFF CACHE BOOL "" FORCE)
set(wxUSE_WEBVIEW OFF CACHE BOOL "" FORCE)
set(wxUSE_WEBREQUEST OFF CACHE BOOL "" FORCE)
set(wxUSE_WXHTML_HELP OFF CACHE BOOL "" FORCE)
set(wxUSE_XML OFF CACHE BOOL "" FORCE)
set(wxUSE_XRC OFF CACHE BOOL "" FORCE)

if(CSV_EXPLORER_MINGW_CROSS)
set(wxUSE_WEBVIEW OFF CACHE BOOL "" FORCE)
Expand All @@ -119,13 +151,7 @@ endif()
)
FetchContent_MakeAvailable(wxwidgets)

if(TARGET wx::wx)
target_link_libraries(csv_explorer PRIVATE wx::wx)
elseif(TARGET wx::mono)
target_link_libraries(csv_explorer PRIVATE wx::mono)
elseif(TARGET wxmono)
target_link_libraries(csv_explorer PRIVATE wxmono)
elseif(TARGET wx::wxcore AND TARGET wx::wxbase)
if(TARGET wx::wxcore AND TARGET wx::wxbase)
set(_wx_widgets_targets wx::wxbase wx::wxcore)
if(TARGET wx::wxadv)
list(APPEND _wx_widgets_targets wx::wxadv)
Expand All @@ -142,13 +168,7 @@ endif()
if(TARGET wx::aui)
list(APPEND _wx_widgets_targets wx::aui)
endif()
if(TARGET wxWidgets::wxWidgets)
target_link_libraries(csv_explorer PRIVATE wxWidgets::wxWidgets)
else()
target_link_libraries(csv_explorer PRIVATE ${_wx_widgets_targets})
endif()
elseif(TARGET wxWidgets::wxWidgets)
target_link_libraries(csv_explorer PRIVATE wxWidgets::wxWidgets)
target_link_libraries(csv_explorer PRIVATE ${_wx_widgets_targets})
else()
# As a final fallback, use the FindwxWidgets-compatible variables generated
# by wxWidgetsConfig.cmake if available.
Expand Down
Loading