File: Use_wxWindows.cmake

package info (click to toggle)
cmake 4.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 152,312 kB
  • sloc: ansic: 403,890; cpp: 303,778; sh: 4,097; python: 3,582; yacc: 3,106; lex: 1,279; f90: 534; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 235; objc: 215; perl: 213; xml: 198; makefile: 108; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (97 lines) | stat: -rw-r--r-- 3,002 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file LICENSE.rst or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
Use_wxWindows
-------------

.. deprecated:: 2.8.10

  This module should no longer be used.  Use :module:`find_package(wxWidgets)
  <FindwxWidgets>` instead.

This module serves as a convenience wrapper for finding the wxWidgets library
(formerly known as wxWindows) and propagates its usage requirements, such as
libraries, include directories, and compiler flags, into the current directory
scope for use by targets.

Load this module in a CMake project with:

.. code-block:: cmake

  include(Use_wxWindows)

Examples
^^^^^^^^

In earlier versions of CMake, wxWidgets (wxWindows) could be found and used in
the current directory like this:

.. code-block:: cmake
  :caption: ``CMakeLists.txt``

  include(Use_wxWindows)

To request OpenGL support, the ``WXWINDOWS_USE_GL`` variable could be set before
including this module:

.. code-block:: cmake
  :caption: ``CMakeLists.txt``

  set(WXWINDOWS_USE_GL ON)
  include(Use_wxWindows)

  add_library(example example.cxx)

Starting with CMake 3.0, wxWidgets can be found using the
:module:`FindwxWidgets` module, which provides the wxWidgets usage requirements
either using result variables or imported target as of CMake 3.27:

.. code-block:: cmake
  :caption: ``CMakeLists.txt``

  find_package(wxWidgets)

  add_library(example example.cxx)

  target_link_libraries(example PRIVATE wxWidgets::wxWidgets)
#]=======================================================================]

# Author: Jan Woetzel <jw -at- mip.informatik.uni-kiel.de> (07/2003)

# -----------------------------------------------------
# 16.Feb.2004: changed INCLUDE to FIND_PACKAGE to read from users own non-system CMAKE_MODULE_PATH (Jan Woetzel JW)
# 07/2006: rewrite as FindwxWidgets.cmake, kept for backward compatibility JW

message(
  DEPRECATION
  "Use_wxWindows module is DEPRECATED.\n"
  "Please use find_package(wxWidgets) instead. (JW)"
)

# ------------------------

find_package( wxWindows )

if(WXWINDOWS_FOUND)

#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}")

 if(WXWINDOWS_INCLUDE_DIR)
    include_directories(${WXWINDOWS_INCLUDE_DIR})
  endif()
 if(WXWINDOWS_LINK_DIRECTORIES)
    link_directories(${WXWINDOWS_LINK_DIRECTORIES})
  endif()
  if(WXWINDOWS_LIBRARIES)
    link_libraries(${WXWINDOWS_LIBRARIES})
  endif()
  if (CMAKE_WXWINDOWS_CXX_FLAGS)
    string(APPEND CMAKE_CXX_FLAGS " ${CMAKE_WXWINDOWS_CXX_FLAGS}")
  endif()
  if(WXWINDOWS_DEFINITIONS)
    add_definitions(${WXWINDOWS_DEFINITIONS})
  endif()
else()
  message(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
endif()