| Summary: | Setting SDL_SHARED=OFF makes last install step fail in 2.0.3 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Fredrik Zetterman <fredrik.zetterman> |
| Component: | build | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.3 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 7 | ||
Ryan, is this the correct fix? |
I call the SDL CMakeLists.txt from one of our own CMakeLists.txt using the ExternalProject_Add function. If I set the following CMake args when building: -DSDL_STATIC=ON -DSDL_SHARED=OFF I get the following output: 1> -- Build Shared Library: OFF 1> -- Build Static Library: ON 1> -- 1> CMake Error at CMakeLists.txt:1308 (install): 1> install TARGETS given target "SDL2" which does not exist in this directory. It also makes sense, because the static lib target name is called SDL2-static. The following seems to fix the problem: @@ -1304,6 +1304,8 @@ if(NOT WINDOWS OR CYGWIN) # TODO: what about the .spec file? Is it only needed for RPM creation? install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal") else() - install(TARGETS SDL2 RUNTIME DESTINATION bin) + if(SDL_SHARED) + install(TARGETS SDL2 RUNTIME DESTINATION bin) + endif() endif()