2002-08-08 21:41:50 +04:00
|
|
|
#
|
|
|
|
# This module finds if wxWindows is installed and determines where the
|
|
|
|
# include files and libraries are. It also determines what the name of
|
|
|
|
# the library is. This code sets the following variables:
|
|
|
|
#
|
|
|
|
# WXWINDOWS_STATIC_LIBRARY = full path to the wxWindows static library
|
|
|
|
# WXWINDOWS_SHARED_LIBRARY = full path to the wxWindows shared import library
|
|
|
|
# WXWINDOWS_INCLUDE_PATH = path to wx.h
|
|
|
|
|
2002-08-09 16:33:04 +04:00
|
|
|
IF(WIN32)
|
|
|
|
|
2002-08-08 23:30:17 +04:00
|
|
|
SET (WXWINDOWS_POSSIBLE_LIB_PATHS
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWindows_is1;Inno Setup: App Path]/lib"
|
|
|
|
$ENV{WXWIN}/lib
|
|
|
|
)
|
2002-08-08 21:41:50 +04:00
|
|
|
|
2002-08-08 23:30:17 +04:00
|
|
|
FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY
|
|
|
|
NAMES wx
|
|
|
|
PATHS ${WXWINDOWS_POSSIBLE_LIB_PATHS}
|
|
|
|
)
|
2002-08-08 21:41:50 +04:00
|
|
|
|
2002-08-08 23:30:17 +04:00
|
|
|
FIND_LIBRARY(WXWINDOWS_SHARED_LIBRARY
|
|
|
|
NAMES wx23_2 wx22_9
|
|
|
|
PATHS ${WXWINDOWS_POSSIBLE_LIB_PATHS}
|
|
|
|
)
|
2002-08-08 21:41:50 +04:00
|
|
|
|
2002-08-08 23:30:17 +04:00
|
|
|
SET (WXWINDOWS_POSSIBLE_INCLUDE_PATHS
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWindows_is1;Inno Setup: App Path]/include/wx"
|
|
|
|
$ENV{WXWIN}/include/wx
|
|
|
|
)
|
2002-08-08 21:41:50 +04:00
|
|
|
|
2002-08-08 23:30:17 +04:00
|
|
|
FIND_PATH(WXWINDOWS_INCLUDE_PATH
|
|
|
|
wx.h
|
|
|
|
${WXWINDOWS_POSSIBLE_INCLUDE_PATHS}
|
|
|
|
)
|
2002-08-09 16:33:04 +04:00
|
|
|
|
2002-08-09 15:55:25 +04:00
|
|
|
IF(WXWINDOWS_SHARED_LIBRARY)
|
2002-08-09 16:33:04 +04:00
|
|
|
OPTION(WXWINDOWS_USE_SHARED_LIBS
|
|
|
|
"Use shared versions of wxWindows libraries" ON)
|
|
|
|
MARK_AS_ADVANCED(WXWINDOWS_USE_SHARED_LIBS)
|
|
|
|
ENDIF(WXWINDOWS_SHARED_LIBRARY)
|
|
|
|
|
2002-09-19 17:42:58 +04:00
|
|
|
SET(CMAKE_WX_LIBRARIES ${CMAKE_WX_LIBRARIES} comctl32 ctl3d32 wsock32 rpcrt4)
|
|
|
|
|
2002-08-09 16:33:04 +04:00
|
|
|
IF(WXWINDOWS_USE_SHARED_LIBS)
|
2002-09-19 17:42:58 +04:00
|
|
|
SET(WXWINDOWS_LIBRARY ${WXWINDOWS_SHARED_LIBRARY} ${CMAKE_WX_LIBRARIES})
|
2002-08-09 16:33:04 +04:00
|
|
|
ELSE(WXWINDOWS_USE_SHARED_LIBS)
|
2002-09-19 17:42:58 +04:00
|
|
|
SET(WXWINDOWS_LIBRARY ${WXWINDOWS_STATIC_LIBRARY} ${CMAKE_WX_LIBRARIES})
|
2002-08-09 16:33:04 +04:00
|
|
|
ENDIF(WXWINDOWS_USE_SHARED_LIBS)
|
|
|
|
|
2002-09-19 17:42:58 +04:00
|
|
|
MARK_AS_ADVANCED(
|
|
|
|
WXWINDOWS_STATIC_LIBRARY
|
|
|
|
WXWINDOWS_SHARED_LIBRARY
|
|
|
|
WXWINDOWS_INCLUDE_PATH
|
|
|
|
)
|
|
|
|
|
2002-08-09 16:33:04 +04:00
|
|
|
ELSE(WIN32)
|
2002-08-09 15:55:25 +04:00
|
|
|
|
2002-08-08 23:30:17 +04:00
|
|
|
FIND_PROGRAM(CMAKE_WX_CONFIG wx-config)
|
2002-09-19 17:42:58 +04:00
|
|
|
SET(CMAKE_WX_CXX_FLAGS "`${CMAKE_WX_CONFIG} --cflags`")
|
|
|
|
SET(WXWINDOWS_LIBRARY "`${CMAKE_WX_CONFIG} --libs`")
|
2002-08-09 16:33:04 +04:00
|
|
|
|
|
|
|
ENDIF(WIN32)
|
2002-08-08 21:41:50 +04:00
|
|
|
|
|
|
|
MARK_AS_ADVANCED(
|
2002-09-19 17:42:58 +04:00
|
|
|
CMAKE_WX_CXX_FLAGS
|
2002-08-08 21:41:50 +04:00
|
|
|
WXWINDOWS_INCLUDE_PATH
|
|
|
|
)
|
2002-09-19 17:42:58 +04:00
|
|
|
|
|
|
|
IF(WXWINDOWS_LIBRARY)
|
|
|
|
IF(WXWINDOWS_INCLUDE_PATH OR CMAKE_WX_CXX_FLAGS)
|
|
|
|
SET(CMAKE_WX_CAN_COMPILE 1)
|
|
|
|
ENDIF(WXWINDOWS_INCLUDE_PATH OR CMAKE_WX_CXX_FLAGS)
|
|
|
|
ENDIF(WXWINDOWS_LIBRARY)
|
|
|
|
|