Use_wxWindows.cmake 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #
  2. # This convenience include finds if wxWindows is installed
  3. # and set the appropriate libs, incdirs, flags etc.
  4. # author Jan Woetzel <jw -at- mip.informatik.uni-kiel.de> (07/2003)
  5. ##
  6. # -----------------------------------------------------
  7. # USAGE:
  8. # just include Use_wxWindows.cmake
  9. # in your projects CMakeLists.txt
  10. # INCLUDE( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
  11. ##
  12. # if you are sure you need GL then
  13. # SET(WXWINDOWS_USE_GL 1)
  14. # *before* you include this file.
  15. #=============================================================================
  16. # Copyright 2003-2009 Kitware, Inc.
  17. # Copyright 2003 Jan Woetzel
  18. #
  19. # Distributed under the OSI-approved BSD License (the "License");
  20. # see accompanying file Copyright.txt for details.
  21. #
  22. # This software is distributed WITHOUT ANY WARRANTY; without even the
  23. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  24. # See the License for more information.
  25. #=============================================================================
  26. # (To distributed this file outside of CMake, substitute the full
  27. # License text for the above reference.)
  28. # -----------------------------------------------------
  29. # 16.Feb.2004: changed INCLUDE to FIND_PACKAGE to read from users own non-system CMAKE_MODULE_PATH (Jan Woetzel JW)
  30. # 07/2006: rewrite as FindwxWidgets.cmake, kept for backward compatibility JW
  31. MESSAGE(STATUS "Use_wxWindows.cmake is DEPRECATED. \n"
  32. "Please use FIND_PACKAGE(wxWidgets) and INCLUDE(${wxWidgets_USE_FILE}) instead. (JW)")
  33. # ------------------------
  34. FIND_PACKAGE( wxWindows )
  35. IF(WXWINDOWS_FOUND)
  36. #MESSAGE("DBG Use_wxWindows.cmake: WXWINDOWS_INCLUDE_DIR=${WXWINDOWS_INCLUDE_DIR} WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES} WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES} CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS} WXWINDOWS_DEFINITIONS=${WXWINDOWS_DEFINITIONS}")
  37. IF(WXWINDOWS_INCLUDE_DIR)
  38. INCLUDE_DIRECTORIES(${WXWINDOWS_INCLUDE_DIR})
  39. ENDIF(WXWINDOWS_INCLUDE_DIR)
  40. IF(WXWINDOWS_LINK_DIRECTORIES)
  41. LINK_DIRECTORIES(${WXWINDOWS_LINK_DIRECTORIES})
  42. ENDIF(WXWINDOWS_LINK_DIRECTORIES)
  43. IF(WXWINDOWS_LIBRARIES)
  44. LINK_LIBRARIES(${WXWINDOWS_LIBRARIES})
  45. ENDIF(WXWINDOWS_LIBRARIES)
  46. IF (CMAKE_WXWINDOWS_CXX_FLAGS)
  47. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_WXWINDOWS_CXX_FLAGS}")
  48. ENDIF(CMAKE_WXWINDOWS_CXX_FLAGS)
  49. IF(WXWINDOWS_DEFINITIONS)
  50. ADD_DEFINITIONS(${WXWINDOWS_DEFINITIONS})
  51. ENDIF(WXWINDOWS_DEFINITIONS)
  52. ELSE(WXWINDOWS_FOUND)
  53. MESSAGE(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
  54. ENDIF(WXWINDOWS_FOUND)