On windows look for the 64-bit dependency package in dependencies-64bit.
This allows installation compiling 32 and 64-bit windows versions from the same repo without switching dependencies.
This commit is contained in:
parent
70d7fdd197
commit
5e5d86bc6d
@ -10,6 +10,13 @@ endif()
|
|||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
|
||||||
include(CMakeDependentOption)
|
include(CMakeDependentOption)
|
||||||
|
|
||||||
|
set(DEPENDENCIES "dependencies")
|
||||||
|
# In case of 64-bit windows, use a different path for dependencies
|
||||||
|
# so that both dependencies can be installed next to each other
|
||||||
|
if ( WIN32 AND (CMAKE_SIZEOF_VOID_P EQUAL 8 ) )
|
||||||
|
set(DEPENDENCIES "dependencies-64bit")
|
||||||
|
endif()
|
||||||
|
|
||||||
include(BuildTypeSTKRelease)
|
include(BuildTypeSTKRelease)
|
||||||
if (NOT CMAKE_BUILD_TYPE)
|
if (NOT CMAKE_BUILD_TYPE)
|
||||||
message(STATUS "No build type selected, default to STKRelease")
|
message(STATUS "No build type selected, default to STKRelease")
|
||||||
@ -66,9 +73,9 @@ set(STK_INSTALL_DATA_DIR "share/supertuxkart" CACHE
|
|||||||
|
|
||||||
# These variables enable MSVC to find libraries located in "dependencies"
|
# These variables enable MSVC to find libraries located in "dependencies"
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(ENV{PATH} "$ENV{PATH};${PROJECT_SOURCE_DIR}/dependencies/include")
|
set(ENV{PATH} "$ENV{PATH};${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/include")
|
||||||
set(ENV{LIB} ${PROJECT_SOURCE_DIR}/dependencies/lib)
|
set(ENV{LIB} ${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib)
|
||||||
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/dependencies)
|
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/${DEPENDENCIES})
|
||||||
add_definitions(-D_IRR_STATIC_LIB_)
|
add_definitions(-D_IRR_STATIC_LIB_)
|
||||||
add_definitions(-DNO_IRR_COMPILE_WITH_X11_)
|
add_definitions(-DNO_IRR_COMPILE_WITH_X11_)
|
||||||
endif()
|
endif()
|
||||||
@ -145,14 +152,14 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_RECORDER)
|
if(BUILD_RECORDER)
|
||||||
find_library(TURBOJPEG_LIBRARY NAMES turbojpeg libturbojpeg PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib")
|
find_library(TURBOJPEG_LIBRARY NAMES turbojpeg libturbojpeg PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
|
||||||
mark_as_advanced(TURBOJPEG_LIBRARY)
|
mark_as_advanced(TURBOJPEG_LIBRARY)
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
include(FindPkgConfig)
|
include(FindPkgConfig)
|
||||||
pkg_check_modules(VPX vpx)
|
pkg_check_modules(VPX vpx)
|
||||||
else()
|
else()
|
||||||
find_path(VPX_INCLUDEDIR NAMES vpx/vpx_codec.h PATHS "${PROJECT_SOURCE_DIR}/dependencies/include")
|
find_path(VPX_INCLUDEDIR NAMES vpx/vpx_codec.h PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/include")
|
||||||
find_library(VPX_LIBRARIES NAMES libvpx PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib")
|
find_library(VPX_LIBRARIES NAMES libvpx PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
|
||||||
endif()
|
endif()
|
||||||
include_directories(${VPX_INCLUDEDIR})
|
include_directories(${VPX_INCLUDEDIR})
|
||||||
if(BUILD_RECORDER_WITH_SOUND AND UNIX)
|
if(BUILD_RECORDER_WITH_SOUND AND UNIX)
|
||||||
@ -380,7 +387,7 @@ else()
|
|||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
set(PTHREAD_NAMES "winpthread-1" "libwinpthread-1" "pthreadGC2")
|
set(PTHREAD_NAMES "winpthread-1" "libwinpthread-1" "pthreadGC2")
|
||||||
endif()
|
endif()
|
||||||
find_library(PTHREAD_LIBRARY NAMES pthread ${PTHREAD_NAMES} PATHS ${PROJECT_SOURCE_DIR}/dependencies/lib)
|
find_library(PTHREAD_LIBRARY NAMES pthread ${PTHREAD_NAMES} PATHS ${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib)
|
||||||
mark_as_advanced(PTHREAD_LIBRARY)
|
mark_as_advanced(PTHREAD_LIBRARY)
|
||||||
|
|
||||||
# Set data dir (absolute or relative to CMAKE_INSTALL_PREFIX)
|
# Set data dir (absolute or relative to CMAKE_INSTALL_PREFIX)
|
||||||
@ -402,9 +409,9 @@ endif()
|
|||||||
|
|
||||||
# CURL
|
# CURL
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_link_libraries(supertuxkart ${PROJECT_SOURCE_DIR}/dependencies/lib/libcurl.lib)
|
target_link_libraries(supertuxkart ${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib/libcurl.lib)
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
target_link_libraries(supertuxkart ${PROJECT_SOURCE_DIR}/dependencies/lib/libcurldll.a)
|
target_link_libraries(supertuxkart ${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib/libcurldll.a)
|
||||||
else()
|
else()
|
||||||
find_package(CURL REQUIRED)
|
find_package(CURL REQUIRED)
|
||||||
include_directories(${CURL_INCLUDE_DIRS})
|
include_directories(${CURL_INCLUDE_DIRS})
|
||||||
@ -487,7 +494,7 @@ if(USE_WIIUSE)
|
|||||||
if(WIIUSE_BUILD)
|
if(WIIUSE_BUILD)
|
||||||
target_link_libraries(supertuxkart wiiuse)
|
target_link_libraries(supertuxkart wiiuse)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(supertuxkart ${PROJECT_SOURCE_DIR}/dependencies/lib/wiiuse.lib)
|
target_link_libraries(supertuxkart ${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib/wiiuse.lib)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
target_link_libraries(supertuxkart wiiuse bluetooth)
|
target_link_libraries(supertuxkart wiiuse bluetooth)
|
||||||
@ -500,7 +507,7 @@ if(MSVC OR MINGW)
|
|||||||
target_link_libraries(supertuxkart iphlpapi.lib)
|
target_link_libraries(supertuxkart iphlpapi.lib)
|
||||||
add_custom_command(TARGET supertuxkart POST_BUILD
|
add_custom_command(TARGET supertuxkart POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
"${PROJECT_SOURCE_DIR}/dependencies/dll"
|
"${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/dll"
|
||||||
$<TARGET_FILE_DIR:supertuxkart>)
|
$<TARGET_FILE_DIR:supertuxkart>)
|
||||||
add_custom_target(stkshaders SOURCES ${STK_SHADERS})
|
add_custom_target(stkshaders SOURCES ${STK_SHADERS})
|
||||||
endif()
|
endif()
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
# Freetype library list
|
# Freetype library list
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
find_path(FREETYPE_INCLUDE_DIRS NAMES freetype/freetype.h PATHS "${PROJECT_SOURCE_DIR}/dependencies/include")
|
find_path(FREETYPE_INCLUDE_DIRS NAMES freetype/freetype.h PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/include")
|
||||||
find_library(FREETYPE_LIBRARY NAMES freetype PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib")
|
find_library(FREETYPE_LIBRARY NAMES freetype PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
|
||||||
set(FREETYPE_FOUND 1)
|
set(FREETYPE_FOUND 1)
|
||||||
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
|
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
|
@ -24,8 +24,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT FRIBIDI_FOUND)
|
if(NOT FRIBIDI_FOUND)
|
||||||
find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h PATHS /Library/Frameworks/fribidi.framework/Headers "${PROJECT_SOURCE_DIR}/dependencies/include")
|
find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h PATHS /Library/Frameworks/fribidi.framework/Headers "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/include")
|
||||||
find_library(FRIBIDI_LIBRARY NAMES fribidi PATHS /Library/Frameworks/fribidi.framework "${PROJECT_SOURCE_DIR}/dependencies/lib")
|
find_library(FRIBIDI_LIBRARY NAMES fribidi PATHS /Library/Frameworks/fribidi.framework "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(Fribidi DEFAULT_MSG FRIBIDI_INCLUDE_DIR FRIBIDI_LIBRARY)
|
find_package_handle_standard_args(Fribidi DEFAULT_MSG FRIBIDI_INCLUDE_DIR FRIBIDI_LIBRARY)
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
# OggVorbis library list
|
# OggVorbis library list
|
||||||
|
|
||||||
|
|
||||||
find_path(OGGVORBIS_OGG_INCLUDE_DIR NAMES ogg/ogg.h PATHS "${PROJECT_SOURCE_DIR}/dependencies/include")
|
find_path(OGGVORBIS_OGG_INCLUDE_DIR NAMES ogg/ogg.h PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/include")
|
||||||
find_path(OGGVORBIS_VORBIS_INCLUDE_DIR NAMES vorbis/vorbisfile.h PATHS "${PROJECT_SOURCE_DIR}/dependencies/include")
|
find_path(OGGVORBIS_VORBIS_INCLUDE_DIR NAMES vorbis/vorbisfile.h PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/include")
|
||||||
find_library(OGGVORBIS_OGG_LIBRARY NAMES ogg Ogg libogg PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib")
|
find_library(OGGVORBIS_OGG_LIBRARY NAMES ogg Ogg libogg PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
|
||||||
find_library(OGGVORBIS_VORBIS_LIBRARY NAMES vorbis Vorbis libvorbis PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib")
|
find_library(OGGVORBIS_VORBIS_LIBRARY NAMES vorbis Vorbis libvorbis PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
|
||||||
find_library(OGGVORBIS_VORBISFILE_LIBRARY NAMES vorbisfile libvorbisfile PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib")
|
find_library(OGGVORBIS_VORBISFILE_LIBRARY NAMES vorbisfile libvorbisfile PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
|
||||||
find_library(OGGVORBIS_VORBISENC_LIBRARY NAMES vorbisenc libvorbisenc PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib")
|
find_library(OGGVORBIS_VORBISENC_LIBRARY NAMES vorbisenc libvorbisenc PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(OGGVORBIS_OGG_INCLUDE_DIR "/Library/Frameworks/Ogg.framework/Headers/")
|
set(OGGVORBIS_OGG_INCLUDE_DIR "/Library/Frameworks/Ogg.framework/Headers/")
|
||||||
|
@ -10,7 +10,7 @@ SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)
|
|||||||
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
||||||
|
|
||||||
# here is the target environment located
|
# here is the target environment located
|
||||||
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32/4.9-posix ${PROJECT_SOURCE_DIR}/dependencies)
|
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32/4.9-posix ${PROJECT_SOURCE_DIR}/${DEPENDENCIES})
|
||||||
|
|
||||||
# adjust the default behaviour of the FIND_XXX() commands:
|
# adjust the default behaviour of the FIND_XXX() commands:
|
||||||
# search headers and libraries in the target environment, search
|
# search headers and libraries in the target environment, search
|
||||||
|
@ -10,7 +10,7 @@ SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix)
|
|||||||
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
|
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
|
||||||
|
|
||||||
# here is the target environment located
|
# here is the target environment located
|
||||||
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 /usr/lib/gcc/i686-w64-mingw32/4.9-posix ${PROJECT_SOURCE_DIR}/dependencies)
|
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 /usr/lib/gcc/i686-w64-mingw32/4.9-posix ${PROJECT_SOURCE_DIR}/${DEPENDENCIES})
|
||||||
|
|
||||||
# adjust the default behaviour of the FIND_XXX() commands:
|
# adjust the default behaviour of the FIND_XXX() commands:
|
||||||
# search headers and libraries in the target environment, search
|
# search headers and libraries in the target environment, search
|
||||||
|
Loading…
Reference in New Issue
Block a user