Use_wxWindows.cmake 2.1 KB

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