Use_wxWindows.cmake 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file LICENSE.rst or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. Use_wxWindows
  5. -------------
  6. .. deprecated:: 2.8.10
  7. Use :module:`find_package(wxWidgets) <FindwxWidgets>` instead.
  8. This convenience include finds if wxWindows library is installed and sets the
  9. appropriate libraries, include directories, flags, etc.
  10. Examples
  11. ^^^^^^^^
  12. Include ``Use_wxWindows`` module in project's ``CMakeLists.txt``:
  13. .. code-block:: cmake
  14. # CMakeLists.txt
  15. include(Use_wxWindows)
  16. When the GL support is required, set ``WXWINDOWS_USE_GL`` *before* including
  17. this module:
  18. .. code-block:: cmake
  19. set(WXWINDOWS_USE_GL ON)
  20. include(Use_wxWindows)
  21. #]=======================================================================]
  22. # Author: Jan Woetzel <jw -at- mip.informatik.uni-kiel.de> (07/2003)
  23. # -----------------------------------------------------
  24. # 16.Feb.2004: changed INCLUDE to FIND_PACKAGE to read from users own non-system CMAKE_MODULE_PATH (Jan Woetzel JW)
  25. # 07/2006: rewrite as FindwxWidgets.cmake, kept for backward compatibility JW
  26. message(
  27. DEPRECATION
  28. "Use_wxWindows module is DEPRECATED.\n"
  29. "Please use find_package(wxWidgets) instead. (JW)"
  30. )
  31. # ------------------------
  32. find_package( wxWindows )
  33. if(WXWINDOWS_FOUND)
  34. #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}")
  35. if(WXWINDOWS_INCLUDE_DIR)
  36. include_directories(${WXWINDOWS_INCLUDE_DIR})
  37. endif()
  38. if(WXWINDOWS_LINK_DIRECTORIES)
  39. link_directories(${WXWINDOWS_LINK_DIRECTORIES})
  40. endif()
  41. if(WXWINDOWS_LIBRARIES)
  42. link_libraries(${WXWINDOWS_LIBRARIES})
  43. endif()
  44. if (CMAKE_WXWINDOWS_CXX_FLAGS)
  45. string(APPEND CMAKE_CXX_FLAGS " ${CMAKE_WXWINDOWS_CXX_FLAGS}")
  46. endif()
  47. if(WXWINDOWS_DEFINITIONS)
  48. add_definitions(${WXWINDOWS_DEFINITIONS})
  49. endif()
  50. else()
  51. message(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
  52. endif()