2006-07-21 23:43:19 +04:00
# - Find wxWindows (wxWidgets) installation
# This module finds if wxWindows/wxWidgets is installed and determines where
2006-01-12 19:10:22 +03:00
# the include files and libraries are. It also determines what the name of
2006-07-21 23:43:19 +04:00
# the library is.
# Please note this file is DEPRECATED and replaced by FindwxWidgets.cmake.
# This code sets the following variables:
#
# WXWINDOWS_FOUND = system has WxWindows
2005-12-15 22:17:43 +03:00
# WXWINDOWS_LIBRARIES = path to the wxWindows libraries
2006-07-21 23:43:19 +04:00
# on Unix/Linux with additional
# linker flags from
2005-12-15 22:17:43 +03:00
# "wx-config --libs"
2006-07-21 23:43:19 +04:00
# CMAKE_WXWINDOWS_CXX_FLAGS = Compiler flags for wxWindows,
2006-01-12 19:10:22 +03:00
# essentially "`wx-config --cxxflags`"
# on Linux
# WXWINDOWS_INCLUDE_DIR = where to find "wx/wx.h" and "wx/setup.h"
# WXWINDOWS_LINK_DIRECTORIES = link directories, useful for rpath on
# Unix
2005-12-14 21:51:08 +03:00
# WXWINDOWS_DEFINITIONS = extra defines
2006-01-12 19:10:22 +03:00
#
2006-07-21 23:43:19 +04:00
# OPTIONS
# If you need OpenGL support please
# SET(WXWINDOWS_USE_GL 1)
2006-01-12 19:10:22 +03:00
# in your CMakeLists.txt *before* you include this file.
2006-07-21 23:43:19 +04:00
#
# HAVE_ISYSTEM - true required to replace -I by -isystem on g++
#
2006-01-12 19:10:22 +03:00
# For convenience include Use_wxWindows.cmake in your project's
2006-07-21 23:43:19 +04:00
# CMakeLists.txt using INCLUDE(Use_wxWindows).
#
# USAGE
# SET(WXWINDOWS_USE_GL 1)
2006-01-12 19:10:22 +03:00
# FIND_PACKAGE(wxWindows)
2006-07-21 23:43:19 +04:00
#
2006-01-12 19:10:22 +03:00
# NOTES
2006-07-21 23:43:19 +04:00
# wxWidgets 2.6.x is supported for monolithic builds
# e.g. compiled in wx/build/msw dir as:
2006-01-12 19:10:22 +03:00
# nmake -f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 MONOLITHIC=1
#
2006-07-21 23:43:19 +04:00
# DEPRECATED
#
# CMAKE_WX_CAN_COMPILE
# WXWINDOWS_LIBRARY
# CMAKE_WX_CXX_FLAGS
# WXWINDOWS_INCLUDE_PATH
#
2006-01-12 19:10:22 +03:00
# AUTHOR
# Jan Woetzel <http://www.mip.informatik.uni-kiel.de/~jw> (07/2003-01/2006)
2005-12-14 21:51:08 +03:00
2009-09-28 19:45:50 +04:00
#=============================================================================
# Copyright 2000-2009 Kitware, Inc.
# Copyright 2003-2006 Jan Woetzel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
2010-08-07 04:48:47 +04:00
# (To distribute this file outside of CMake, substitute the full
2009-09-28 19:45:50 +04:00
# License text for the above reference.)
2005-12-14 21:51:08 +03:00
# ------------------------------------------------------------------
2006-07-21 23:43:19 +04:00
#
2006-01-12 19:10:22 +03:00
# -removed OPTION for CMAKE_WXWINDOWS_USE_GL. Force the developer to SET it before calling this.
# -major update for wx 2.6.2 and monolithic build option. (10/2005)
#
2006-07-21 23:43:19 +04:00
# STATUS
2005-12-14 21:51:08 +03:00
# tested with:
2006-01-12 19:10:22 +03:00
# cmake 1.6.7, Linux (Suse 7.3), wxWindows 2.4.0, gcc 2.95
# cmake 1.6.7, Linux (Suse 8.2), wxWindows 2.4.0, gcc 3.3
# cmake 1.6.7, Linux (Suse 8.2), wxWindows 2.4.1-patch1, gcc 3.3
# cmake 1.6.7, MS Windows XP home, wxWindows 2.4.1, MS Visual Studio .net 7 2002 (static build)
# cmake 2.0.5 on Windows XP and Suse Linux 9.2
# cmake 2.0.6 on Windows XP and Suse Linux 9.2, wxWidgets 2.6.2 MONOLITHIC build
# cmake 2.2.2 on Windows XP, MS Visual Studio .net 2003 7.1 wxWidgets 2.6.2 MONOLITHIC build
#
# TODO
# -OPTION for unicode builds
# -further testing of DLL linking under MS WIN32
# -better support for non-monolithic builds
#
2004-04-21 23:09:07 +04:00
IF ( WIN32 )
SET ( WIN32_STYLE_FIND 1 )
2004-04-22 19:12:04 +04:00
ENDIF ( WIN32 )
2004-04-21 23:09:07 +04:00
IF ( MINGW )
SET ( WIN32_STYLE_FIND 0 )
SET ( UNIX_STYLE_FIND 1 )
ENDIF ( MINGW )
IF ( UNIX )
SET ( UNIX_STYLE_FIND 1 )
2004-04-22 19:12:04 +04:00
ENDIF ( UNIX )
2004-04-21 23:09:07 +04:00
IF ( WIN32_STYLE_FIND )
2006-01-12 19:10:22 +03:00
## ######################################################################
##
## Windows specific:
##
## candidates for root/base directory of wxwindows
## should have subdirs include and lib containing include/wx/wx.h
## fix the root dir to avoid mixing of headers/libs from different
## versions/builds:
2006-07-21 23:43:19 +04:00
2004-04-21 23:09:07 +04:00
SET ( WXWINDOWS_POSSIBLE_ROOT_PATHS
$ E N V { W X W I N }
2006-01-12 19:10:22 +03:00
" [ H K E Y _ L O C A L _ M A C H I N E \ \ S O F T W A R E \ \ M i c r o s o f t \ \ W i n d o w s \ \ C u r r e n t V e r s i o n \ \ U n i n s t a l l \ \ w x W i d g e t s _ i s 1 ; I n n o S e t u p : A p p P a t h ] " ## WX 2.6.x
" [ H K E Y _ L O C A L _ M A C H I N E \ \ S O F T W A R E \ \ M i c r o s o f t \ \ W i n d o w s \ \ C u r r e n t V e r s i o n \ \ U n i n s t a l l \ \ w x W i n d o w s _ i s 1 ; I n n o S e t u p : A p p P a t h ] " ## WX 2.4.x
2006-07-21 23:43:19 +04:00
C : \ \ w x W i d g e t s - 2 . 6 . 2
D : \ \ w x W i d g e t s - 2 . 6 . 2
C : \ \ w x W i d g e t s - 2 . 6 . 1
D : \ \ w x W i d g e t s - 2 . 6 . 1
C : \ \ w x W i n d o w s - 2 . 4 . 2
D : \ \ w x W i n d o w s - 2 . 4 . 2
2006-01-12 19:10:22 +03:00
)
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## WX supports monolithic and multiple smaller libs (since 2.5.x), we prefer monolithic for now.
## monolithic = WX is built as a single big library
## e.g. compile on WIN32 as "nmake -f makefile.vc MONOLITHIC=1 BUILD=debug SHARED=0 USE_OPENGL=1" (JW)
OPTION ( WXWINDOWS_USE_MONOLITHIC "Use monolithic build of WX??" ON )
MARK_AS_ADVANCED ( WXWINDOWS_USE_MONOLITHIC )
## GL libs used?
OPTION ( WXWINDOWS_USE_GL "Use Wx with GL support(glcanvas)?" ON )
MARK_AS_ADVANCED ( WXWINDOWS_USE_GL )
## avoid mixing of headers and libs between multiple installed WX versions,
2006-07-21 23:43:19 +04:00
## select just one tree here:
FIND_PATH ( WXWINDOWS_ROOT_DIR include/wx/wx.h
$ { W X W I N D O W S _ P O S S I B L E _ R O O T _ P A T H S } )
2005-12-14 21:51:08 +03:00
# MESSAGE("DBG found WXWINDOWS_ROOT_DIR: ${WXWINDOWS_ROOT_DIR}")
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## find libs for combination of static/shared with release/debug
2006-07-21 23:43:19 +04:00
## be careful if you add something here,
## avoid mixing of headers and libs of different wx versions,
## there may be multiple WX version s installed.
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_POSSIBLE_LIB_PATHS
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b "
2006-07-21 23:43:19 +04:00
)
2006-01-12 19:10:22 +03:00
## monolithic?
IF ( WXWINDOWS_USE_MONOLITHIC )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
FIND_LIBRARY ( WXWINDOWS_STATIC_LIBRARY
N A M E S w x w x m s w w x m s w 2 6
2006-07-21 23:43:19 +04:00
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-07-21 23:43:19 +04:00
D O C " w x W i n d o w s s t a t i c r e l e a s e b u i l d l i b r a r y " )
2006-01-12 19:10:22 +03:00
FIND_LIBRARY ( WXWINDOWS_STATIC_DEBUG_LIBRARY
2006-07-21 23:43:19 +04:00
N A M E S w x d w x m s w d w x m s w 2 6 d
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c d e b u g b u i l d l i b r a r y " )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
FIND_LIBRARY ( WXWINDOWS_SHARED_LIBRARY
2006-07-21 23:43:19 +04:00
N A M E S w x m s w 2 6 w x m s w 2 6 2 w x m s w 2 4 w x m s w 2 4 2 w x m s w 2 4 1 w x m s w 2 4 0 w x 2 3 _ 2 w x 2 2 _ 9
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ d l l "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s h a r e d r e l e a s e b u i l d l i b r a r y " )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
FIND_LIBRARY ( WXWINDOWS_SHARED_DEBUG_LIBRARY
2006-07-21 23:43:19 +04:00
N A M E S w x m s w 2 6 d w x m s w 2 6 2 d w x m s w 2 4 d w x m s w 2 4 1 d w x m s w 2 4 0 d w x 2 3 _ 2 d w x 2 2 _ 9 d
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ d l l "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s h a r e d d e b u g b u i l d l i b r a r y " )
##
## required for WXWINDOWS_USE_GL
## gl lib is always build separate:
##
FIND_LIBRARY ( WXWINDOWS_STATIC_LIBRARY_GL
2006-07-21 23:43:19 +04:00
N A M E S w x _ g l w x m s w _ g l w x m s w 2 6 _ g l
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c r e l e a s e b u i l d G L l i b r a r y " )
FIND_LIBRARY ( WXWINDOWS_STATIC_DEBUG_LIBRARY_GL
2006-07-21 23:43:19 +04:00
N A M E S w x d _ g l w x m s w d _ g l w x m s w 2 6 d _ g l
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c d e b u g b u i l d G L l i b r a r y " )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
FIND_LIBRARY ( WXWINDOWS_STATIC_DEBUG_LIBRARY_PNG
2006-07-21 23:43:19 +04:00
N A M E S w x p n g d
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c d e b u g p n g l i b r a r y " )
FIND_LIBRARY ( WXWINDOWS_STATIC_LIBRARY_PNG
N A M E S w x p n g
2006-07-21 23:43:19 +04:00
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c p n g l i b r a r y " )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
FIND_LIBRARY ( WXWINDOWS_STATIC_DEBUG_LIBRARY_TIFF
2006-07-21 23:43:19 +04:00
N A M E S w x t i f f d
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c d e b u g t i f f l i b r a r y " )
FIND_LIBRARY ( WXWINDOWS_STATIC_LIBRARY_TIFF
N A M E S w x t i f f
2006-07-21 23:43:19 +04:00
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c t i f f l i b r a r y " )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
FIND_LIBRARY ( WXWINDOWS_STATIC_DEBUG_LIBRARY_JPEG
N A M E S w x j p e g d w x j p g d
2006-07-21 23:43:19 +04:00
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c d e b u g j p e g l i b r a r y " )
FIND_LIBRARY ( WXWINDOWS_STATIC_LIBRARY_JPEG
N A M E S w x j p e g w x j p g
2006-07-21 23:43:19 +04:00
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c j p e g l i b r a r y " )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
FIND_LIBRARY ( WXWINDOWS_STATIC_DEBUG_LIBRARY_ZLIB
N A M E S w x z l i b d
2006-07-21 23:43:19 +04:00
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c d e b u g z l i b l i b r a r y " )
FIND_LIBRARY ( WXWINDOWS_STATIC_LIBRARY_ZLIB
N A M E S w x z l i b
2006-07-21 23:43:19 +04:00
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c z i b l i b r a r y " )
FIND_LIBRARY ( WXWINDOWS_STATIC_DEBUG_LIBRARY_REGEX
N A M E S w x r e g e x d
2006-07-21 23:43:19 +04:00
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c d e b u g r e g e x l i b r a r y " )
FIND_LIBRARY ( WXWINDOWS_STATIC_LIBRARY_REGEX
N A M E S w x r e g e x
2006-07-21 23:43:19 +04:00
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s t a t i c r e g e x l i b r a r y " )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## untested:
FIND_LIBRARY ( WXWINDOWS_SHARED_LIBRARY_GL
2006-07-21 23:43:19 +04:00
N A M E S w x _ g l w x m s w _ g l w x m s w 2 6 _ g l
P A T H S
2006-01-12 19:10:22 +03:00
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ d l l "
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
2006-01-12 19:10:22 +03:00
D O C " w x W i n d o w s s h a r e d r e l e a s e b u i l d G L l i b r a r y " )
FIND_LIBRARY ( WXWINDOWS_SHARED_DEBUG_LIBRARY_GL
2006-07-21 23:43:19 +04:00
N A M E S w x d _ g l w x m s w d _ g l w x m s w 2 6 d _ g l
P A T H S
" $ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ d l l "
$ { W X W I N D O W S _ P O S S I B L E _ L I B _ P A T H S }
D O C " w x W i n d o w s s h a r e d d e b u g b u i l d G L l i b r a r y " )
2006-01-12 19:10:22 +03:00
ELSE ( WXWINDOWS_USE_MONOLITHIC )
## WX is built as multiple small pieces libraries instead of monolithic
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## DEPECATED (jw) replaced by more general WXWINDOWS_USE_MONOLITHIC ON/OFF
2006-07-21 23:43:19 +04:00
# OPTION(WXWINDOWS_SEPARATE_LIBS_BUILD "Is wxWindows build with separate libs?" OFF)
2006-01-12 19:10:22 +03:00
## HACK: This is very dirty.
## because the libs of a particular version are explicitly listed
## and NOT searched/verified.
2006-07-21 23:43:19 +04:00
## TODO: Really search for each lib, then decide for
## monolithic x debug x shared x GL (=16 combinations) for at least 18 libs
## --> about 288 combinations
2006-01-12 19:10:22 +03:00
## thus we need a different approach so solve this correctly ...
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
MESSAGE ( STATUS "Warning: You are trying to use wxWidgets without monolithic build (WXWINDOWS_SEPARATE_LIBS_BUILD). This is a HACK, libraries are not verified! (JW)." )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_STATIC_LIBS ${ WXWINDOWS_STATIC_LIBS }
w x b a s e 2 6
w x b a s e 2 6 _ n e t
w x b a s e 2 6 _ o d b c
w x b a s e 2 6 _ x m l
w x m s w 2 6 _ a d v
w x m s w 2 6 _ c o r e
w x m s w 2 6 _ d b g r i d
w x m s w 2 6 _ g l
w x m s w 2 6 _ h t m l
w x m s w 2 6 _ m e d i a
w x m s w 2 6 _ q a
w x m s w 2 6 _ x r c
w x e x p a t
w x j p e g
w x p n g
w x r e g e x
w x t i f f
w x z l i b
c o m c t l 3 2
r p c r t 4
w s o c k 3 2
)
2006-07-21 23:43:19 +04:00
## HACK: feed in to optimized / debug libaries if both were FOUND.
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_STATIC_DEBUG_LIBS ${ WXWINDOWS_STATIC_DEBUG_LIBS }
w x b a s e 2 6 d
w x b a s e 2 6 d _ n e t
w x b a s e 2 6 d _ o d b c
w x b a s e 2 6 d _ x m l
w x m s w 2 6 d _ a d v
w x m s w 2 6 d _ c o r e
w x m s w 2 6 d _ d b g r i d
w x m s w 2 6 d _ g l
w x m s w 2 6 d _ h t m l
w x m s w 2 6 d _ m e d i a
w x m s w 2 6 d _ q a
w x m s w 2 6 d _ x r c
w x e x p a t d
w x j p e g d
w x p n g d
w x r e g e x d
w x t i f f d
w x z l i b d
c o m c t l 3 2
r p c r t 4
w s o c k 3 2
)
ENDIF ( WXWINDOWS_USE_MONOLITHIC )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
##
## now we should have found all WX libs available on the system.
## let the user decide which of the available onse to use.
2006-07-21 23:43:19 +04:00
##
2006-01-12 19:10:22 +03:00
## if there is at least one shared lib available
2006-07-21 23:43:19 +04:00
## let user choose wether to use shared or static wxwindows libs
2004-04-21 23:09:07 +04:00
IF ( WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY )
2006-01-12 19:10:22 +03:00
## default value OFF because wxWindows MSVS default build is static
2004-04-21 23:09:07 +04:00
OPTION ( WXWINDOWS_USE_SHARED_LIBS
" U s e s h a r e d versions ( dll ) o f w x W i n d o w s l i b r a r i e s ? " O F F )
MARK_AS_ADVANCED ( WXWINDOWS_USE_SHARED_LIBS )
2006-07-21 23:43:19 +04:00
ENDIF ( WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY )
2006-01-12 19:10:22 +03:00
## add system libraries wxwindows always seems to depend on
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
2004-04-21 23:09:07 +04:00
c o m c t l 3 2
r p c r t 4
w s o c k 3 2
2006-07-21 23:43:19 +04:00
)
2006-01-12 19:10:22 +03:00
IF ( NOT WXWINDOWS_USE_SHARED_LIBS )
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
## these ones dont seem required, in particular ctl3d32 is not neccesary (Jan Woetzel 07/2003)
# ctl3d32
d e b u g $ { W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ Z L I B } o p t i m i z e d $ { W X W I N D O W S _ S T A T I C _ L I B R A R Y _ Z L I B }
d e b u g $ { W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ R E G E X } o p t i m i z e d $ { W X W I N D O W S _ S T A T I C _ L I B R A R Y _ R E G E X }
d e b u g $ { W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ P N G } o p t i m i z e d $ { W X W I N D O W S _ S T A T I C _ L I B R A R Y _ P N G }
d e b u g $ { W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ J P E G } o p t i m i z e d $ { W X W I N D O W S _ S T A T I C _ L I B R A R Y _ J P E G }
d e b u g $ { W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ T I F F } o p t i m i z e d $ { W X W I N D O W S _ S T A T I C _ L I B R A R Y _ T I F F }
)
ENDIF ( NOT WXWINDOWS_USE_SHARED_LIBS )
2006-07-21 23:43:19 +04:00
## opengl/glu: TODO/FIXME: better use FindOpenGL.cmake here
2006-01-12 19:10:22 +03:00
## assume release versions of glu an dopengl, here.
2004-04-21 23:09:07 +04:00
IF ( WXWINDOWS_USE_GL )
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
2004-04-21 23:09:07 +04:00
o p e n g l 3 2
2006-01-12 19:10:22 +03:00
g l u 3 2 )
2004-04-21 23:09:07 +04:00
ENDIF ( WXWINDOWS_USE_GL )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
##
## select between use of shared or static wxWindows lib then set libs to use
## for debug and optimized build. so the user can switch between debug and
## release build e.g. within MS Visual Studio without running cmake with a
## different build directory again.
2006-07-21 23:43:19 +04:00
##
2006-01-12 19:10:22 +03:00
## then add the build specific include dir for wx/setup.h
2006-07-21 23:43:19 +04:00
##
2004-04-21 23:09:07 +04:00
IF ( WXWINDOWS_USE_SHARED_LIBS )
2006-01-12 19:10:22 +03:00
##MESSAGE("DBG wxWindows use shared lib selected.")
## assume that both builds use the same setup(.h) for simplicity
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## shared: both wx (debug and release) found?
## assume that both builds use the same setup(.h) for simplicity
2004-04-21 23:09:07 +04:00
IF ( WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY )
2006-01-12 19:10:22 +03:00
##MESSAGE("DBG wx shared: debug and optimized found.")
2004-04-21 23:09:07 +04:00
FIND_PATH ( WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / m s w d l l d
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / m s w d l l
2006-01-12 19:10:22 +03:00
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ d l l / m s w d
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ d l l / m s w )
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
d e b u g $ { W X W I N D O W S _ S H A R E D _ D E B U G _ L I B R A R Y }
o p t i m i z e d $ { W X W I N D O W S _ S H A R E D _ L I B R A R Y } )
IF ( WXWINDOWS_USE_GL )
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
d e b u g $ { W X W I N D O W S _ S H A R E D _ D E B U G _ L I B R A R Y _ G L }
o p t i m i z e d $ { W X W I N D O W S _ S H A R E D _ L I B R A R Y _ G L } )
ENDIF ( WXWINDOWS_USE_GL )
2004-04-21 23:09:07 +04:00
ENDIF ( WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## shared: only debug wx lib found?
2004-04-21 23:09:07 +04:00
IF ( WXWINDOWS_SHARED_DEBUG_LIBRARY )
IF ( NOT WXWINDOWS_SHARED_LIBRARY )
2006-01-12 19:10:22 +03:00
##MESSAGE("DBG wx shared: debug (but no optimized) found.")
2004-04-21 23:09:07 +04:00
FIND_PATH ( WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / m s w d l l d
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ d l l / m s w d )
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
$ { W X W I N D O W S _ S H A R E D _ D E B U G _ L I B R A R Y } )
2006-07-21 23:43:19 +04:00
IF ( WXWINDOWS_USE_GL )
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
$ { W X W I N D O W S _ S H A R E D _ D E B U G _ L I B R A R Y _ G L } )
ENDIF ( WXWINDOWS_USE_GL )
2004-04-21 23:09:07 +04:00
ENDIF ( NOT WXWINDOWS_SHARED_LIBRARY )
ENDIF ( WXWINDOWS_SHARED_DEBUG_LIBRARY )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## shared: only release wx lib found?
2004-04-21 23:09:07 +04:00
IF ( NOT WXWINDOWS_SHARED_DEBUG_LIBRARY )
IF ( WXWINDOWS_SHARED_LIBRARY )
2006-01-12 19:10:22 +03:00
##MESSAGE("DBG wx shared: optimized (but no debug) found.")
2004-04-21 23:09:07 +04:00
FIND_PATH ( WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / m s w d l l
2006-01-12 19:10:22 +03:00
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ d l l / m s w )
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
$ { W X W I N D O W S _ S H A R E D _ D E B U G _ L I B R A R Y } )
IF ( WXWINDOWS_USE_GL )
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
$ { W X W I N D O W S _ S H A R E D _ D E B U G _ L I B R A R Y _ G L } )
ENDIF ( WXWINDOWS_USE_GL )
2006-07-21 23:43:19 +04:00
ENDIF ( WXWINDOWS_SHARED_LIBRARY )
2004-04-21 23:09:07 +04:00
ENDIF ( NOT WXWINDOWS_SHARED_DEBUG_LIBRARY )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## shared: none found?
2004-04-21 23:09:07 +04:00
IF ( NOT WXWINDOWS_SHARED_DEBUG_LIBRARY )
IF ( NOT WXWINDOWS_SHARED_LIBRARY )
2006-07-21 23:43:19 +04:00
MESSAGE ( STATUS
2004-04-21 23:09:07 +04:00
" N o s h a r e d w x W i n d o w s l i b f o u n d , b u t W X W I N D O W S _ U S E _ S H A R E D _ L I B S = $ { W X W I N D O W S _ U S E _ S H A R E D _ L I B S } . " )
ENDIF ( NOT WXWINDOWS_SHARED_LIBRARY )
ENDIF ( NOT WXWINDOWS_SHARED_DEBUG_LIBRARY )
2006-01-12 19:10:22 +03:00
#########################################################################################
2004-04-21 23:09:07 +04:00
ELSE ( WXWINDOWS_USE_SHARED_LIBS )
2006-01-12 19:10:22 +03:00
##jw: DEPRECATED IF(NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## static: both wx (debug and release) found?
## assume that both builds use the same setup(.h) for simplicity
2004-04-21 23:09:07 +04:00
IF ( WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY )
2006-01-12 19:10:22 +03:00
##MESSAGE("DBG wx static: debug and optimized found.")
2004-04-21 23:09:07 +04:00
FIND_PATH ( WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / m s w d
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / m s w
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b / m s w d
2006-01-12 19:10:22 +03:00
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b / m s w )
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
d e b u g $ { W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y }
o p t i m i z e d $ { W X W I N D O W S _ S T A T I C _ L I B R A R Y } )
IF ( WXWINDOWS_USE_GL )
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
d e b u g $ { W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ G L }
o p t i m i z e d $ { W X W I N D O W S _ S T A T I C _ L I B R A R Y _ G L } )
2006-07-21 23:43:19 +04:00
ENDIF ( WXWINDOWS_USE_GL )
2004-04-21 23:09:07 +04:00
ENDIF ( WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## static: only debug wx lib found?
2004-04-21 23:09:07 +04:00
IF ( WXWINDOWS_STATIC_DEBUG_LIBRARY )
IF ( NOT WXWINDOWS_STATIC_LIBRARY )
2006-01-12 19:10:22 +03:00
##MESSAGE("DBG wx static: debug (but no optimized) found.")
2004-04-21 23:09:07 +04:00
FIND_PATH ( WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / m s w d
2006-01-12 19:10:22 +03:00
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b / m s w d )
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
$ { W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y } )
2006-07-21 23:43:19 +04:00
IF ( WXWINDOWS_USE_GL )
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
$ { W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ G L } )
ENDIF ( WXWINDOWS_USE_GL )
2004-04-21 23:09:07 +04:00
ENDIF ( NOT WXWINDOWS_STATIC_LIBRARY )
ENDIF ( WXWINDOWS_STATIC_DEBUG_LIBRARY )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## static: only release wx lib found?
2004-04-21 23:09:07 +04:00
IF ( NOT WXWINDOWS_STATIC_DEBUG_LIBRARY )
IF ( WXWINDOWS_STATIC_LIBRARY )
2006-01-12 19:10:22 +03:00
##MESSAGE("DBG wx static: optimized (but no debug) found.")
2004-04-21 23:09:07 +04:00
FIND_PATH ( WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
2006-07-21 23:43:19 +04:00
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / m s w
$ { W X W I N D O W S _ R O O T _ D I R } / l i b / v c _ l i b / m s w )
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
$ { W X W I N D O W S _ S T A T I C _ L I B R A R Y } )
2006-07-21 23:43:19 +04:00
IF ( WXWINDOWS_USE_GL )
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_LIBRARIES ${ WXWINDOWS_LIBRARIES }
$ { W X W I N D O W S _ S T A T I C _ L I B R A R Y _ G L } )
2006-07-21 23:43:19 +04:00
ENDIF ( WXWINDOWS_USE_GL )
2004-04-21 23:09:07 +04:00
ENDIF ( WXWINDOWS_STATIC_LIBRARY )
ENDIF ( NOT WXWINDOWS_STATIC_DEBUG_LIBRARY )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## static: none found?
IF ( NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD )
2004-04-21 23:09:07 +04:00
IF ( NOT WXWINDOWS_STATIC_LIBRARY )
2006-07-21 23:43:19 +04:00
MESSAGE ( STATUS
2004-04-21 23:09:07 +04:00
" N o s t a t i c w x W i n d o w s l i b f o u n d , b u t W X W I N D O W S _ U S E _ S H A R E D _ L I B S = $ { W X W I N D O W S _ U S E _ S H A R E D _ L I B S } . " )
ENDIF ( NOT WXWINDOWS_STATIC_LIBRARY )
2006-07-21 23:43:19 +04:00
ENDIF ( NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD )
ENDIF ( WXWINDOWS_USE_SHARED_LIBS )
2006-01-12 19:10:22 +03:00
## not neccessary in wxWindows 2.4.1 and 2.6.2
## but it may fix a previous bug, see
## http://lists.wxwindows.org/cgi-bin/ezmlm-cgi?8:mss:37574:200305:mpdioeneabobmgjenoap
2004-04-21 23:09:07 +04:00
OPTION ( WXWINDOWS_SET_DEFINITIONS "Set additional defines for wxWindows" OFF )
MARK_AS_ADVANCED ( WXWINDOWS_SET_DEFINITIONS )
2006-07-21 23:43:19 +04:00
IF ( WXWINDOWS_SET_DEFINITIONS )
2004-04-21 23:09:07 +04:00
SET ( WXWINDOWS_DEFINITIONS "-DWINVER=0x400" )
2006-07-21 23:43:19 +04:00
ELSE ( WXWINDOWS_SET_DEFINITIONS )
2004-04-21 23:09:07 +04:00
# clear:
SET ( WXWINDOWS_DEFINITIONS "" )
2006-07-21 23:43:19 +04:00
ENDIF ( WXWINDOWS_SET_DEFINITIONS )
2006-01-12 19:10:22 +03:00
## Find the include directories for wxwindows
## the first, build specific for wx/setup.h was determined before.
## add inc dir for general for "wx/wx.h"
2006-07-21 23:43:19 +04:00
FIND_PATH ( WXWINDOWS_INCLUDE_DIR wx/wx.h
" $ { W X W I N D O W S _ R O O T _ D I R } / i n c l u d e " )
2006-01-12 19:10:22 +03:00
## append the build specific include dir for wx/setup.h:
2004-04-21 23:09:07 +04:00
IF ( WXWINDOWS_INCLUDE_DIR_SETUPH )
SET ( WXWINDOWS_INCLUDE_DIR ${ WXWINDOWS_INCLUDE_DIR } ${ WXWINDOWS_INCLUDE_DIR_SETUPH } )
ENDIF ( WXWINDOWS_INCLUDE_DIR_SETUPH )
2006-07-21 23:43:19 +04:00
2004-04-21 23:09:07 +04:00
MARK_AS_ADVANCED (
W X W I N D O W S _ R O O T _ D I R
W X W I N D O W S _ I N C L U D E _ D I R
W X W I N D O W S _ I N C L U D E _ D I R _ S E T U P H
W X W I N D O W S _ S T A T I C _ L I B R A R Y
2006-01-12 19:10:22 +03:00
W X W I N D O W S _ S T A T I C _ L I B R A R Y _ G L
2004-04-21 23:09:07 +04:00
W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y
2006-01-12 19:10:22 +03:00
W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ G L
W X W I N D O W S _ S T A T I C _ L I B R A R Y _ Z L I B
W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ Z L I B
W X W I N D O W S _ S T A T I C _ L I B R A R Y _ R E G E X
W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ R E G E X
W X W I N D O W S _ S T A T I C _ L I B R A R Y _ P N G
W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ P N G
W X W I N D O W S _ S T A T I C _ L I B R A R Y _ J P E G
W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ J P E G
W X W I N D O W S _ S T A T I C _ D E B U G _ L I B R A R Y _ T I F F
W X W I N D O W S _ S T A T I C _ L I B R A R Y _ T I F F
2004-04-21 23:09:07 +04:00
W X W I N D O W S _ S H A R E D _ L I B R A R Y
W X W I N D O W S _ S H A R E D _ D E B U G _ L I B R A R Y
2006-01-12 19:10:22 +03:00
W X W I N D O W S _ S H A R E D _ L I B R A R Y _ G L
2006-07-21 23:43:19 +04:00
W X W I N D O W S _ S H A R E D _ D E B U G _ L I B R A R Y _ G L
2004-04-21 23:09:07 +04:00
)
2006-07-21 23:43:19 +04:00
2004-04-21 23:09:07 +04:00
ELSE ( WIN32_STYLE_FIND )
2006-01-12 19:10:22 +03:00
2006-07-21 23:43:19 +04:00
IF ( UNIX_STYLE_FIND )
2006-01-12 19:10:22 +03:00
## ######################################################################
2006-07-21 23:43:19 +04:00
##
2006-01-12 19:10:22 +03:00
## UNIX/Linux specific:
2006-07-21 23:43:19 +04:00
##
2006-01-12 19:10:22 +03:00
## use backquoted wx-config to query and set flags and libs:
## 06/2003 Jan Woetzel
2006-07-21 23:43:19 +04:00
##
2004-04-21 23:09:07 +04:00
OPTION ( WXWINDOWS_USE_SHARED_LIBS "Use shared versions (.so) of wxWindows libraries" ON )
MARK_AS_ADVANCED ( WXWINDOWS_USE_SHARED_LIBS )
2006-07-21 23:43:19 +04:00
# JW removed option and force the develper th SET it.
2004-04-21 23:09:07 +04:00
# OPTION(WXWINDOWS_USE_GL "use wxWindows with GL support (use additional
2006-07-21 23:43:19 +04:00
# --gl-libs for wx-config)?" OFF)
2004-04-21 23:09:07 +04:00
# wx-config should be in your path anyhow, usually no need to set WXWIN or
# search in ../wx or ../../wx
FIND_PROGRAM ( CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE wx-config
$ E N V { W X W I N }
2006-01-12 19:10:22 +03:00
$ E N V { W X W I N } / b i n
2004-04-21 23:09:07 +04:00
. . / w x / b i n
. . / . . / w x / b i n )
2006-07-21 23:43:19 +04:00
2004-04-21 23:09:07 +04:00
# check wether wx-config was found:
2006-07-21 23:43:19 +04:00
IF ( CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE )
2004-04-21 23:09:07 +04:00
# use shared/static wx lib?
# remember: always link shared to use systems GL etc. libs (no static
2006-07-21 23:43:19 +04:00
# linking, just link *against* static .a libs)
2004-04-21 23:09:07 +04:00
IF ( WXWINDOWS_USE_SHARED_LIBS )
SET ( WX_CONFIG_ARGS_LIBS "--libs" )
ELSE ( WXWINDOWS_USE_SHARED_LIBS )
SET ( WX_CONFIG_ARGS_LIBS "--static --libs" )
ENDIF ( WXWINDOWS_USE_SHARED_LIBS )
2006-07-21 23:43:19 +04:00
2004-04-21 23:09:07 +04:00
# do we need additionial wx GL stuff like GLCanvas ?
IF ( WXWINDOWS_USE_GL )
SET ( WX_CONFIG_ARGS_LIBS "${WX_CONFIG_ARGS_LIBS} --gl-libs" )
ENDIF ( WXWINDOWS_USE_GL )
2006-01-12 19:10:22 +03:00
##MESSAGE("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===")
2006-07-21 23:43:19 +04:00
2004-04-21 23:09:07 +04:00
# set CXXFLAGS to be fed into CMAKE_CXX_FLAGS by the user:
2006-07-21 23:43:19 +04:00
IF ( HAVE_ISYSTEM ) # does the compiler support -isystem ?
IF ( NOT APPLE ) # -isystem seem sto be unsuppored on Mac
IF ( CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
IF ( CMAKE_CXX_COMPILER MATCHES g\\+\\+ )
SET ( CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags|sed -e s/-I/-isystem/g`" )
ELSE ( CMAKE_CXX_COMPILER MATCHES g\\+\\+ )
SET ( CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags`" )
ENDIF ( CMAKE_CXX_COMPILER MATCHES g\\+\\+ )
ENDIF ( CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
ENDIF ( NOT APPLE )
ENDIF ( HAVE_ISYSTEM )
2006-01-12 19:10:22 +03:00
##MESSAGE("DBG: for compilation:
2006-07-21 23:43:19 +04:00
##CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS}===")
2004-04-21 23:09:07 +04:00
# keep the back-quoted string for clarity
SET ( WXWINDOWS_LIBRARIES "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} ${WX_CONFIG_ARGS_LIBS}`" )
2006-01-12 19:10:22 +03:00
##MESSAGE("DBG2: for linking:
2006-07-21 23:43:19 +04:00
##WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES}===")
2004-04-21 23:09:07 +04:00
# evaluate wx-config output to separate linker flags and linkdirs for
# rpath:
EXEC_PROGRAM ( ${ CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE }
A R G S $ { W X _ C O N F I G _ A R G S _ L I B S }
O U T P U T _ V A R I A B L E W X _ C O N F I G _ L I B S )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## extract linkdirs (-L) for rpath
## use regular expression to match wildcard equivalent "-L*<endchar>"
## with <endchar> is a space or a semicolon
2004-04-21 23:09:07 +04:00
STRING ( REGEX MATCHALL "[-][L]([^ ;])+" WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX "${WX_CONFIG_LIBS}" )
2006-01-12 19:10:22 +03:00
# MESSAGE("DBG WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX=${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX}")
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## remove prefix -L because we need the pure directory for LINK_DIRECTORIES
## replace -L by ; because the separator seems to be lost otherwise (bug or
2006-07-21 23:43:19 +04:00
## feature?)
2004-04-21 23:09:07 +04:00
IF ( WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX )
STRING ( REGEX REPLACE "[-][L]" ";" WXWINDOWS_LINK_DIRECTORIES ${ WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX } )
2006-01-12 19:10:22 +03:00
# MESSAGE("DBG WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES}")
2004-04-21 23:09:07 +04:00
ENDIF ( WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX )
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## replace space separated string by semicolon separated vector to make it
## work with LINK_DIRECTORIES
2004-04-21 23:09:07 +04:00
SEPARATE_ARGUMENTS ( WXWINDOWS_LINK_DIRECTORIES )
2006-07-21 23:43:19 +04:00
2004-04-21 23:09:07 +04:00
MARK_AS_ADVANCED (
C M A K E _ W X W I N D O W S _ C X X _ F L A G S
W X W I N D O W S _ I N C L U D E _ D I R
W X W I N D O W S _ L I B R A R I E S
C M A K E _ W X W I N D O W S _ W X C O N F I G _ E X E C U T A B L E
)
2006-07-21 23:43:19 +04:00
2006-01-12 19:10:22 +03:00
## we really need wx-config...
2006-07-21 23:43:19 +04:00
ELSE ( CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE )
2006-01-12 19:10:22 +03:00
MESSAGE ( STATUS "Cannot find wx-config anywhere on the system. Please put the file into your path or specify it in CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE." )
2004-04-21 23:09:07 +04:00
MARK_AS_ADVANCED ( CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE )
ENDIF ( CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE )
2006-07-21 23:43:19 +04:00
2004-04-21 23:09:07 +04:00
ELSE ( UNIX_STYLE_FIND )
2006-01-12 19:10:22 +03:00
MESSAGE ( STATUS "FindwxWindows.cmake: Platform unknown/unsupported by FindwxWindows.cmake. It's neither WIN32 nor UNIX" )
2004-04-21 23:09:07 +04:00
ENDIF ( UNIX_STYLE_FIND )
ENDIF ( WIN32_STYLE_FIND )
IF ( WXWINDOWS_LIBRARIES )
IF ( WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS )
2006-01-12 19:10:22 +03:00
## found all we need.
2004-04-21 23:09:07 +04:00
SET ( WXWINDOWS_FOUND 1 )
2006-07-21 23:43:19 +04:00
## set deprecated variables for backward compatibility:
2004-04-21 23:09:07 +04:00
SET ( CMAKE_WX_CAN_COMPILE ${ WXWINDOWS_FOUND } )
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_LIBRARY ${ WXWINDOWS_LIBRARIES } )
2004-04-21 23:09:07 +04:00
SET ( WXWINDOWS_INCLUDE_PATH ${ WXWINDOWS_INCLUDE_DIR } )
2006-01-12 19:10:22 +03:00
SET ( WXWINDOWS_LINK_DIRECTORIES ${ WXWINDOWS_LINK_DIRECTORIES } )
2004-04-21 23:09:07 +04:00
SET ( CMAKE_WX_CXX_FLAGS ${ CMAKE_WXWINDOWS_CXX_FLAGS } )
2006-07-21 23:43:19 +04:00
2004-04-21 23:09:07 +04:00
ENDIF ( WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS )
ENDIF ( WXWINDOWS_LIBRARIES )