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