build: don't add SDL3 subfolder to include path for external projects

main
Anonymous Maarten 2022-11-27 18:36:54 +01:00 committed by Sam Lantinga
parent 2af4f74e1c
commit 9f2ca87504
9 changed files with 16 additions and 20 deletions

View File

@ -3186,7 +3186,6 @@ if(NOT WINDOWS_STORE AND NOT SDL3_DISABLE_SDL3MAIN)
"$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include>"
"$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL3>"
)
if (WIN32)
target_link_libraries(SDL3main PRIVATE shell32)
@ -3272,7 +3271,6 @@ if(SDL_SHARED)
"$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include>"
"$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL3>"
)
# This picks up all the compiler options and such we've accumulated up to here.
target_link_libraries(SDL3 PRIVATE $<BUILD_INTERFACE:sdl-build-options>)
@ -3307,7 +3305,6 @@ if(SDL_STATIC)
"$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include>"
"$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL3>"
)
# This picks up all the compiler options and such we've accumulated up to here.
target_link_libraries(SDL3-static PRIVATE $<BUILD_INTERFACE:sdl-build-options>)
@ -3338,7 +3335,6 @@ if(SDL_TEST)
"$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include>"
"$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL3>"
)
target_link_libraries(SDL3_test PRIVATE ${EXTRA_TEST_LIBS})
endif()

View File

@ -47,8 +47,8 @@ endif()
set(SDL3_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
set(SDL3_EXEC_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
set(SDL3_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL3")
set(SDL3_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@;@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL3")
set(SDL3_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@")
set(SDL3_INCLUDE_DIRS "${SDL3_INCLUDE_DIR}")
set(SDL3_BINDIR "@PACKAGE_CMAKE_INSTALL_FULL_BINDIR@")
set(SDL3_LIBDIR "@PACKAGE_CMAKE_INSTALL_FULL_LIBDIR@")
set(SDL3_LIBRARIES SDL3::SDL3)

View File

@ -3,12 +3,12 @@
# SDL CMake version configuration file:
# This file is meant to be placed in a cmake subfolder of SDL3-devel-3.x.y-VC
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../include/SDL_version.h")
message(AUTHOR_WARNING "Could not find SDL_version.h. This script is meant to be placed in the root of SDL3-devel-3.x.y-VC")
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../include/SDL3/SDL_version.h")
message(AUTHOR_WARNING "Could not find SDL3/SDL_version.h. This script is meant to be placed in the root of SDL3-devel-3.x.y-VC")
return()
endif()
file(READ "${CMAKE_CURRENT_LIST_DIR}/../include/SDL_version.h" _sdl_version_h)
file(READ "${CMAKE_CURRENT_LIST_DIR}/../include/SDL3/SDL_version.h" _sdl_version_h)
string(REGEX MATCH "#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re "${_sdl_version_h}")
set(_sdl_major "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}")
@ -18,7 +18,7 @@ set(_sdl_patch "${CMAKE_MATCH_1}")
if(_sdl_major_re AND _sdl_minor_re AND _sdl_patch_re)
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_patch}")
else()
message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
message(AUTHOR_WARNING "Could not extract version from SDL3/SDL_version.h.")
return()
endif()

View File

@ -1,5 +1,5 @@
#define SDL_MAIN_HANDLED
#include "SDL.h"
#include <SDL3/SDL.h>
#include <stdio.h>
int main(int argc, char *argv[]) {

View File

@ -1,4 +1,4 @@
#include "SDL.h"
#include <SDL3/SDL.h>
#include <stdio.h>
int main(int argc, char *argv[]) {

View File

@ -1,4 +1,4 @@
#include "SDL.h"
#include <SDL3/SDL.h>
#include <stdio.h>
#include EXPORT_HEADER

View File

@ -1,10 +1,10 @@
# SDL3 CMake version configuration file:
# This file is meant to be placed in a cmake subfolder of SDL3-devel-2.x.y-mingw
# This file is meant to be placed in a cmake subfolder of SDL3-devel-3.x.y-mingw
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL3/sdl3-config-version.cmake")
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL3/SDL3ConfigVersion.cmake")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL3/sdl3-config-version.cmake")
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL3/SDL3ConfigVersion.cmake")
else()
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()

View File

@ -1,10 +1,10 @@
# SDL3 CMake configuration file:
# This file is meant to be placed in a cmake subfolder of SDL3-devel-2.x.y-mingw
# This file is meant to be placed in a cmake subfolder of SDL3-devel-3.x.y-mingw
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL3/sdl3-config.cmake")
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL3/SDL3Config.cmake")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL3/sdl3-config.cmake")
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL3/SDL3Config.cmake")
else()
set(SDL3_FOUND FALSE)
return()

View File

@ -11,4 +11,4 @@ Version: @SDL_VERSION@
Requires:
Conflicts:
Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @PKGCONFIG_LIBS_PRIV@ @SDL_STATIC_LIBS@
Cflags: -I${includedir} -I${includedir}/SDL3 @SDL_CFLAGS@
Cflags: -I${includedir} @SDL_CFLAGS@