Skip to content

Commit a5dc3fe

Browse files
committed
Fix some Wine detection errors
1 parent eeec3f8 commit a5dc3fe

4 files changed

Lines changed: 11 additions & 18 deletions

File tree

cmake/modules/FindWine.cmake

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#
44
# WINE_FOUND - System has wine
55
# WINE_INCLUDE_DIRS - The wine include directories
6-
# WINE_LIBRARIES - The libraries needed to use wine
76
# WINE_DEFINITIONS - Compiler switches required for using wine
87
#
98

@@ -60,16 +59,16 @@ IF(WINE_CXX)
6059
# WineHQ (/opt/wine-stable, /opt/wine-devel, /opt/wine-staging)
6160
STRING(REGEX REPLACE "/lib64/wine/$" "/lib/wine/" WINE_32_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
6261
STRING(REGEX REPLACE "/lib/wine/$" "/lib64/wine/" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
63-
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib32/.*/wine/")
62+
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib32/")
6463
# Systems with old multilib layout
6564
STRING(REPLACE "/lib32/" "/lib/" WINE_64_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
66-
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib64/.*/wine/")
65+
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib64/")
6766
# We need to test if the corresponding 64bit library directory is lib or lib32
6867
STRING(REPLACE "/lib64/" "/lib32/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
6968
IF(NOT EXISTS "${WINE_32_LIBRARY_DIR}")
7069
STRING(REPLACE "/lib64/" "/lib/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
7170
ENDIF()
72-
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib/.*/wine/")
71+
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib/")
7372
# Test if this directory is for 32bit or 64bit
7473
STRING(REPLACE "/lib/" "/lib32/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
7574
IF(NOT EXISTS "${WINE_32_LIBRARY_DIR}")
@@ -89,18 +88,12 @@ FIND_PATH(WINE_INCLUDE_DIR wine/exception.h
8988

9089
SET(_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE})
9190

92-
FIND_LIBRARY(WINE_LIBRARY NAMES wine
93-
PATH_SUFFIXES wine i386-linux-gnu/wine
94-
HINTS "${WINE_32_LIBRARY_DIR}" "${WINE_64_LIBRARY_DIR}"
95-
)
96-
9791
SET(CMAKE_LIBRARY_ARCHITECTURE ${_ARCHITECTURE})
9892

9993
SET(WINE_INCLUDE_DIRS ${WINE_INCLUDE_DIR} )
100-
SET(WINE_LIBRARIES ${WINE_LIBRARY})
10194

10295
include(FindPackageHandleStandardArgs)
103-
find_package_handle_standard_args(Wine DEFAULT_MSG WINE_CXX WINE_LIBRARIES WINE_INCLUDE_DIRS)
96+
find_package_handle_standard_args(Wine DEFAULT_MSG WINE_CXX WINE_INCLUDE_DIRS)
10497

10598
mark_as_advanced(WINE_INCLUDE_DIR WINE_LIBRARY WINE_CXX WINE_BUILD)
10699

@@ -109,8 +102,8 @@ IF(WINE_32_LIBRARY_DIR)
109102
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}../")
110103
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}/..")
111104
ELSE()
112-
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR}")
113-
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}")
105+
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}wine/")
106+
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}wine/")
114107
ENDIF()
115108
ENDIF()
116109

@@ -119,8 +112,8 @@ IF(WINE_64_LIBRARY_DIR)
119112
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}../")
120113
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}/..")
121114
ELSE()
122-
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR}")
123-
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}")
115+
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}wine/")
116+
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}wine/")
124117
ENDIF()
125118
ENDIF()
126119

0 commit comments

Comments
 (0)