@@ -70,8 +70,42 @@ if (UNIX)
7070 find_package (wxWidgets QUIET REQUIRED xrc stc richtext ribbon propgrid aui gl html qa adv core xml net base )
7171 endif ()
7272else ()
73+ # set(wxWidgets_ROOT_DIR $ENV{WXMSW3})
74+ # find_package(wxWidgets QUIET COMPONENTS qa webview aui richtext html propgrid adv net stc core base scintilla REQUIRED)
75+ set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Debug and Release Builds Configured" FORCE )
76+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++20" )
77+ # for linking to Release build of ortools
78+ set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL" )
79+ # Get the current debug flags and remove the /D_DEBUG option.
80+ string (REPLACE "/D_DEBUG" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} " )
81+ # following does not force release libraries for wxWidgets using find_package
82+ #set(CMAKE_MAP_IMPORTED_CONFIG_DEBUG RELEASE)
83+
7384 set (wxWidgets_ROOT_DIR $ENV{WXMSW3} )
74- find_package (wxWidgets QUIET COMPONENTS qa webview aui richtext html propgrid adv net stc core base scintilla REQUIRED )
85+ find_package (wxWidgets QUIET REQUIRED xrc webview stc richtext ribbon propgrid aui gl html qa adv core xml net base scintilla )
86+
87+ # message("All wxWidgets: " ${wxWidgets_LIBRARIES})
88+ set (FOUND "false" )
89+ foreach (lib ${wxWidgets_LIBRARIES} )
90+ string (FIND ${lib} "optimized" INDEX)
91+ string (FIND ${lib} "debug" INDEX2)
92+ string (FIND ${lib} "wxWidgets" INDEX3)
93+ if (INDEX GREATER_EQUAL 0) # skip once
94+ set (FOUND "true" )
95+ continue ()
96+ elseif ((INDEX2 LESS 0) AND (INDEX3 LESS 0))
97+ set (FOUND "true" )
98+ endif ()
99+ if (${FOUND} STREQUAL "true" )
100+ set (FOUND "false" )
101+ message ("lib: ${lib} " )
102+ list (APPEND WX_LIBS_LIST ${lib} )
103+ endif ()
104+ endforeach ()
105+
106+ list (JOIN WX_LIBS_LIST ";" wxWidgets_LIBRARIES)
107+ # message("Link Libraries for wxWidgets: ${wxWidgets_LIBRARIES}")
108+
75109endif ()
76110
77111include (${wxWidgets_USE_FILE} )
0 commit comments