From 0dafd886fc719b5fbb0d56f30262ba09c76a160b Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Thu, 19 Sep 2002 09:42:58 -0400 Subject: Improve searching for wxWindows --- Modules/FindwxWindows.cmake | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index 591a8a3..a02ea01 100644 --- a/Modules/FindwxWindows.cmake +++ b/Modules/FindwxWindows.cmake @@ -40,29 +40,36 @@ IF(WIN32) MARK_AS_ADVANCED(WXWINDOWS_USE_SHARED_LIBS) ENDIF(WXWINDOWS_SHARED_LIBRARY) + SET(CMAKE_WX_LIBRARIES ${CMAKE_WX_LIBRARIES} comctl32 ctl3d32 wsock32 rpcrt4) + IF(WXWINDOWS_USE_SHARED_LIBS) - SET(WXWINDOWS_LIBRARY ${WXWINDOWS_SHARED_LIBRARY}) + SET(WXWINDOWS_LIBRARY ${WXWINDOWS_SHARED_LIBRARY} ${CMAKE_WX_LIBRARIES}) ELSE(WXWINDOWS_USE_SHARED_LIBS) - SET(WXWINDOWS_LIBRARY ${WXWINDOWS_STATIC_LIBRARY}) + SET(WXWINDOWS_LIBRARY ${WXWINDOWS_STATIC_LIBRARY} ${CMAKE_WX_LIBRARIES}) ENDIF(WXWINDOWS_USE_SHARED_LIBS) + MARK_AS_ADVANCED( + WXWINDOWS_STATIC_LIBRARY + WXWINDOWS_SHARED_LIBRARY + WXWINDOWS_INCLUDE_PATH + ) + ELSE(WIN32) FIND_PROGRAM(CMAKE_WX_CONFIG wx-config) - # This has to be done at some point - #EXEC_PROGRAM(wx-config ARGS --cflags OUTPUT_VARIABLE WXWINDOWS_COMPILE_FLAGS RETURN_VALUE WX_CFLAGS_) - #EXEC_PROGRAM(wx-config ARGS --libs OUTPUT_VARIABLE WXWINDOWS_LINK_FLAGS RETURN_VALUE WX_LIBS_RVAL) - #IF(WX_CFLAGS_RVAL) - SET(CMAKE_WX_CXX_FLAGS "`${CMAKE_WX_CONFIG} --cflags`") - #ELSE(WX_CFLAGS_RVAL) - # MESSAGE("Cannot find \"wx-config\" or wxWindows is not configured properly") - #ENDIF(WX_CFLAGS_RVAL) - SET(CMAKE_WX_LIBRARIES "`${CMAKE_WX_CONFIG} --libs`") + SET(CMAKE_WX_CXX_FLAGS "`${CMAKE_WX_CONFIG} --cflags`") + SET(WXWINDOWS_LIBRARY "`${CMAKE_WX_CONFIG} --libs`") ENDIF(WIN32) MARK_AS_ADVANCED( - WXWINDOWS_STATIC_LIBRARY - WXWINDOWS_SHARED_LIBRARY + CMAKE_WX_CXX_FLAGS WXWINDOWS_INCLUDE_PATH ) + +IF(WXWINDOWS_LIBRARY) + IF(WXWINDOWS_INCLUDE_PATH OR CMAKE_WX_CXX_FLAGS) + SET(CMAKE_WX_CAN_COMPILE 1) + ENDIF(WXWINDOWS_INCLUDE_PATH OR CMAKE_WX_CXX_FLAGS) +ENDIF(WXWINDOWS_LIBRARY) + -- cgit v0.12