|
@@ -102,67 +102,7 @@ FIND_LIBRARY(SDL2TTF_LIBRARY_TEMP
|
102
|
102
|
PATHS ${SDL2TTF_SEARCH_PATHS}
|
103
|
103
|
)
|
104
|
104
|
|
105
|
|
-IF(NOT SDL2TTF_BUILDING_LIBRARY)
|
106
|
|
- IF(NOT ${SDL2TTF_INCLUDE_DIR} MATCHES ".framework")
|
107
|
|
- # Non-OS X framework versions expect you to also dynamically link to
|
108
|
|
- # SDL2TTFmain. This is mainly for Windows and OS X. Other (Unix) platforms
|
109
|
|
- # seem to provide SDL2TTFmain for compatibility even though they don't
|
110
|
|
- # necessarily need it.
|
111
|
|
- FIND_LIBRARY(SDL2TTFMAIN_LIBRARY
|
112
|
|
- NAMES SDL2_ttf
|
113
|
|
- HINTS
|
114
|
|
- $ENV{SDL2TTFDIR}
|
115
|
|
- PATH_SUFFIXES lib64 lib
|
116
|
|
- PATHS ${SDL2TTF_SEARCH_PATHS}
|
117
|
|
- )
|
118
|
|
- ENDIF(NOT ${SDL2TTF_INCLUDE_DIR} MATCHES ".framework")
|
119
|
|
-ENDIF(NOT SDL2TTF_BUILDING_LIBRARY)
|
120
|
|
-
|
121
|
|
-# SDL2TTF may require threads on your system.
|
122
|
|
-# The Apple build may not need an explicit flag because one of the
|
123
|
|
-# frameworks may already provide it.
|
124
|
|
-# But for non-OSX systems, I will use the CMake Threads package.
|
125
|
|
-IF(NOT APPLE)
|
126
|
|
- FIND_PACKAGE(Threads)
|
127
|
|
-ENDIF(NOT APPLE)
|
128
|
|
-
|
129
|
|
-# MinGW needs an additional library, mwindows
|
130
|
|
-# It's total link flags should look like -lmingw32 -lSDL2TTFmain -lSDL2TTF -lmwindows
|
131
|
|
-# (Actually on second look, I think it only needs one of the m* libraries.)
|
132
|
|
-IF(MINGW)
|
133
|
|
- SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
|
134
|
|
-ENDIF(MINGW)
|
135
|
|
-
|
136
|
105
|
IF(SDL2TTF_LIBRARY_TEMP)
|
137
|
|
- # For SDL2TTFmain
|
138
|
|
- IF(NOT SDL2TTF_BUILDING_LIBRARY)
|
139
|
|
- IF(SDL2TTFMAIN_LIBRARY)
|
140
|
|
- SET(SDL2TTF_LIBRARY_TEMP ${SDL2TTFMAIN_LIBRARY} ${SDL2TTF_LIBRARY_TEMP})
|
141
|
|
- ENDIF(SDL2TTFMAIN_LIBRARY)
|
142
|
|
- ENDIF(NOT SDL2TTF_BUILDING_LIBRARY)
|
143
|
|
-
|
144
|
|
- # For OS X, SDL2TTF uses Cocoa as a backend so it must link to Cocoa.
|
145
|
|
- # CMake doesn't display the -framework Cocoa string in the UI even
|
146
|
|
- # though it actually is there if I modify a pre-used variable.
|
147
|
|
- # I think it has something to do with the CACHE STRING.
|
148
|
|
- # So I use a temporary variable until the end so I can set the
|
149
|
|
- # "real" variable in one-shot.
|
150
|
|
- IF(APPLE)
|
151
|
|
- SET(SDL2TTF_LIBRARY_TEMP ${SDL2TTF_LIBRARY_TEMP} "-framework Cocoa")
|
152
|
|
- ENDIF(APPLE)
|
153
|
|
-
|
154
|
|
- # For threads, as mentioned Apple doesn't need this.
|
155
|
|
- # In fact, there seems to be a problem if I used the Threads package
|
156
|
|
- # and try using this line, so I'm just skipping it entirely for OS X.
|
157
|
|
- IF(NOT APPLE)
|
158
|
|
- SET(SDL2TTF_LIBRARY_TEMP ${SDL2TTF_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
|
159
|
|
- ENDIF(NOT APPLE)
|
160
|
|
-
|
161
|
|
- # For MinGW library
|
162
|
|
- IF(MINGW)
|
163
|
|
- SET(SDL2TTF_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2TTF_LIBRARY_TEMP})
|
164
|
|
- ENDIF(MINGW)
|
165
|
|
-
|
166
|
106
|
# Set the final string here so the GUI reflects the final state.
|
167
|
107
|
SET(SDL2TTF_LIBRARY ${SDL2TTF_LIBRARY_TEMP} CACHE STRING "Where the SDL2TTF Library can be found")
|
168
|
108
|
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|