File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 6565# (To distribute this file outside of CMake, substitute the full
6666# License text for the above reference.)
6767
68+ message ("<FindSDL2.cmake>" )
69+
6870SET (SDL2_SEARCH_PATHS
6971 ~/Library/Frameworks
7072 /Library/Frameworks
@@ -74,6 +76,7 @@ SET(SDL2_SEARCH_PATHS
7476 /opt/local # DarwinPorts
7577 /opt/csw # Blastwave
7678 /opt
79+ ${SDL2_PATH}
7780)
7881
7982FIND_PATH (SDL2_INCLUDE_DIR SDL.h
@@ -158,6 +161,8 @@ IF(SDL2_LIBRARY_TEMP)
158161 SET (SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP} " CACHE INTERNAL "" )
159162ENDIF (SDL2_LIBRARY_TEMP)
160163
164+ message ("</FindSDL2.cmake>" )
165+
161166INCLUDE (FindPackageHandleStandardArgs)
162167
163168FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ from the SDL website.
1313
1414##Usage
1515
16+ ###General
17+
1618In order to use these scripts, you first need to tell CMake where to find them, via
1719the ` CMAKE_MODULE_PATH ` variable. For example, if you put them in a
1820subdirectory called ` cmake ` , then in your root ` CMakeLists.txt ` add the line
@@ -40,6 +42,26 @@ target_link_libraries(target ${SDL2_LIBRARY}
4042
4143or whatever is appropriate for your project.
4244
45+ ###mingw32 / msys
46+
47+ This section supplements ``` Usage -> General ``` section. You still are required
48+ to incorporate ``` General ``` configuration settings in you CMakeLists.txt.
49+
50+ Because cmake binaries for windows aren't aware of * nix/win paths conversion,
51+ default paths FindSDL2 will look in won't do any good. For that you should set SDL2_PATH variable.
52+ For example:
53+ ``` cmake
54+ set(SDL2_PATH "D:\\apps\\SDL2\\i686-w64-mingw32")
55+ ```
56+
57+ ``` bash
58+ mkdir build
59+ cd build
60+ cmake .. -G" MSYS Makefiles"
61+ make
62+ ```
63+
64+
4365##Licence
4466
4567I am not the original author of these scripts. I found ` FindSDL2.cmake `
You can’t perform that action at this time.
0 commit comments