Skip to content

Commit

Permalink
I wonder what will happen if...
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusGuy committed Aug 17, 2023
1 parent ee72b8c commit efa5f8a
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions mk/cmake/SuperTux/BuildVersion.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
## Find revision of WC
mark_as_advanced(GIT_EXECUTABLE)
find_program(GIT_EXECUTABLE git)
Expand All @@ -11,7 +11,7 @@ if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
endif()
endif()

get_filename_component(BASEDIR ${PROJECT_SOURCE_DIR} NAME)
get_filename_component(BASEDIR ${CMAKE_SOURCE_DIR} NAME)
if("${VERSION_LIST}" STREQUAL "")
if(${BASEDIR} MATCHES "supertux2-[0-9\\.]*")
string(REGEX REPLACE "(\\.|_|-)" ";" VERSION_LIST ${BASEDIR})
Expand All @@ -35,12 +35,12 @@ if(${VERSION_LIST_SIZE} GREATER 0)
set(VERSION_STRING_GIT "${MAJOR_VERSION_GIT}.${MINOR_VERSION_GIT}.${PATCH_VERSION_GIT}")
endif()

configure_file("${PROJECT_SOURCE_DIR}/version.cmake.in" "${PROJECT_SOURCE_DIR}/version.cmake")
configure_file("${CMAKE_SOURCE_DIR}/version.cmake.in" "${CMAKE_SOURCE_DIR}/version.cmake")
endif()
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/version.cmake")
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/version.cmake")
message( SEND_ERROR "Could not find GIT or valid version.cmake. Version information will be invalid." )
endif()
include("${PROJECT_SOURCE_DIR}/version.cmake")
include("${CMAKE_SOURCE_DIR}/version.cmake")

if(FORCE_VERSION_STRING)
set(SUPERTUX_VERSION_STRING "${FORCE_VERSION_STRING}")
Expand Down
2 changes: 1 addition & 1 deletion mk/cmake/SuperTux/ProvideDiscord.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ else()
set_target_properties(LibDiscord PROPERTIES
INTERFACE_LINK_LIBRARIES "discord-rpc"
# discord-rpc doesn't provide includes itself
INTERFACE_INCLUDE_DIRECTORIES "${PROJECT_SOURCE_DIR}/external/discord-sdk/include")
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/external/discord-sdk/include")
endif()

# EOF #
2 changes: 1 addition & 1 deletion mk/cmake/SuperTux/ProvideOpenAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(NOT EMSCRIPTEN)
else()
add_library(LibOpenAL INTERFACE IMPORTED)
set_target_properties(LibOpenAL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PROJECT_SOURCE_DIR}/mk/emscripten/AL"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/mk/emscripten/AL"
INTERFACE_LINK_LIBRARIES "-lopenal"
)
endif()
Expand Down
2 changes: 1 addition & 1 deletion mk/cmake/SuperTux/ProvidePartioZip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ else()
find_package(ZLIB REQUIRED)
endif()

add_library(LibPartioZip ${PROJECT_SOURCE_DIR}/external/partio_zip/zip_manager.cpp)
add_library(LibPartioZip ${CMAKE_CURRENT_SOURCE_DIR}/external/partio_zip/zip_manager.cpp)
target_link_libraries(LibPartioZip PUBLIC ${ZLIB_LIBRARIES})
target_include_directories(LibPartioZip SYSTEM PRIVATE ${ZLIB_INCLUDE_DIRS})
target_include_directories(LibPartioZip SYSTEM PUBLIC external/partio_zip)
Expand Down
6 changes: 3 additions & 3 deletions mk/cmake/SuperTux/ProvidePhysfs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ if(USE_SYSTEM_PHYSFS)
INTERFACE_LINK_LIBRARIES "${PHYSFS_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${PHYSFS_INCLUDE_DIR}")
else()
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/external/physfs/CMakeLists.txt)
message(FATAL_ERROR "physfs submodule is not checked out or ${PROJECT_SOURCE_DIR}/external/physfs/CMakeLists.txt is missing")
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/physfs/CMakeLists.txt)
message(FATAL_ERROR "physfs submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/physfs/CMakeLists.txt is missing")
endif()

if(WIN32)
Expand All @@ -35,7 +35,7 @@ else()

set(PHYSFS_PREFIX ${CMAKE_BINARY_DIR}/physfs)
ExternalProject_Add(physfs_project
SOURCE_DIR "${PROJECT_SOURCE_DIR}/external/physfs/"
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/physfs/"
BUILD_BYPRODUCTS
"${PHYSFS_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}physfs${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${PHYSFS_PREFIX}/lib${LIB_SUFFIX}/physfs${CMAKE_LINK_LIBRARY_SUFFIX}"
Expand Down
2 changes: 1 addition & 1 deletion mk/cmake/SuperTux/ProvideSDL2_ttf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ else()

set(SDL2_TTF_PREFIX ${CMAKE_BINARY_DIR}/SDL2_ttf)
ExternalProject_Add(SDL2_ttf_project
SOURCE_DIR "${PROJECT_SOURCE_DIR}/external/SDL_ttf/"
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/SDL_ttf/"
BUILD_BYPRODUCTS "${SDL2_TTF_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_ttf${CMAKE_STATIC_LIBRARY_SUFFIX}"
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
Expand Down
4 changes: 2 additions & 2 deletions mk/cmake/SuperTux/ProvideSexpcpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ else()
message(STATUS "Could NOT find sexp-cpp, using external/sexp-cpp fallback")
endif()

if(NOT EXISTS ${PROJECT_SOURCE_DIR}/external/sexp-cpp/CMakeLists.txt)
message(FATAL_ERROR "sexp-cpp submodule is not checked out or ${PROJECT_SOURCE_DIR}/external/sexp-cpp/CMakeLists.txt is missing")
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/sexp-cpp/CMakeLists.txt)
message(FATAL_ERROR "sexp-cpp submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/sexp-cpp/CMakeLists.txt is missing")
endif()

file(GLOB SEXP_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/sexp-cpp/src/*.cpp)
Expand Down
6 changes: 3 additions & 3 deletions mk/cmake/SuperTux/ProvideSquirrel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ else()
message(STATUS "Could NOT find squirrel, using external/squirrel fallback")
endif()

if(NOT EXISTS ${PROJECT_SOURCE_DIR}/external/squirrel/CMakeLists.txt)
message(FATAL_ERROR "squirrel submodule is not checked out or ${PROJECT_SOURCE_DIR}/external/squirrel/CMakeLists.txt is missing")
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/CMakeLists.txt)
message(FATAL_ERROR "squirrel submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/CMakeLists.txt is missing")
endif()

if(CMAKE_CROSSCOMPILING AND NOT EMSCRIPTEN)
Expand All @@ -36,7 +36,7 @@ else()

set(SQUIRREL_PREFIX ${CMAKE_BINARY_DIR}/squirrel/ex)
ExternalProject_Add(squirrel_project
SOURCE_DIR "${PROJECT_SOURCE_DIR}/external/squirrel/"
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/"
BUILD_BYPRODUCTS
"${SQUIRREL_PREFIX}/lib/${SQUIRREL_MULTIARCH_DIR}${CMAKE_STATIC_LIBRARY_PREFIX}sqstdlib_static${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${SQUIRREL_PREFIX}/lib/${SQUIRREL_MULTIARCH_DIR}${CMAKE_STATIC_LIBRARY_PREFIX}squirrel_static${CMAKE_STATIC_LIBRARY_SUFFIX}"
Expand Down
6 changes: 3 additions & 3 deletions mk/cmake/SuperTux/ProvideTinygettext.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ else()
message(STATUS "Could NOT find tinygettext, using external/tinygettext fallback")
endif()

if(NOT EXISTS ${CMAKE_SOURCE_DIR}/external/tinygettext/CMakeLists.txt)
message(FATAL_ERROR "tinygettext submodule is not checked out or ${CMAKE_SOURCE_DIR}/external/tinygettext/CMakeLists.txt is missing")
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/tinygettext/CMakeLists.txt)
message(FATAL_ERROR "tinygettext submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/tinygettext/CMakeLists.txt is missing")
endif()

# Include altivec wrapper on ppc
Expand All @@ -35,7 +35,7 @@ else()

set(TINYGETTEXT_PREFIX ${CMAKE_BINARY_DIR}/tinygettext)
ExternalProject_Add(tinygettext_project
SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/tinygettext/"
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/tinygettext/"
BUILD_BYPRODUCTS "${TINYGETTEXT_PREFIX}/lib${LIB_SUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}tinygettext${CMAKE_STATIC_LIBRARY_SUFFIX}"
LIST_SEPARATOR "|"
CMAKE_ARGS
Expand Down

0 comments on commit efa5f8a

Please sign in to comment.