games/SpaceCadetPinball: fix installation

PR:	265355
This commit is contained in:
Dmitry Marakasov 2022-11-06 10:15:08 -08:00 committed by Neel Chauhan
parent 3eaa50271e
commit 8037c83d39
2 changed files with 18 additions and 22 deletions

View File

@ -1,5 +1,6 @@
PORTNAME= SpaceCadetPinball
PORTVERSION= 2.0.1
PORTREVISION= 1
DISTVERSIONPREFIX= Release_
CATEGORIES= games

View File

@ -1,39 +1,34 @@
--- CMakeLists.txt.orig 2021-12-29 06:46:09 UTC
+++ CMakeLists.txt
@@ -24,8 +24,10 @@ set(SDL2_BUILDING_LIBRARY ON)
@@ -23,9 +23,10 @@ endif()
set(SDL2_BUILDING_LIBRARY ON)
find_package(SDL2 REQUIRED)
FIND_PACKAGE(SDL2_mixer REQUIRED)
+find_package(X11 REQUIRED)
+link_libraries(${X11_LIBRARIES})
FIND_PACKAGE(SDL2_mixer REQUIRED)
-include_directories(${SDL2_INCLUDE_DIR} ${SDL2_MIXER_INCLUDE_DIR})
+include_directories(${SDL2_INCLUDE_DIR} ${SDL2_MIXER_INCLUDE_DIR} ${X11_INCLUDE_DIR})
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "Include dir='${dir}'")
@@ -201,6 +203,8 @@ endif()
@@ -199,7 +200,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "3.16.0" OR ${CMAK
)
endif()
target_link_libraries(SpaceCadetPinball ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY})
-target_link_libraries(SpaceCadetPinball ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY})
+target_link_libraries(SpaceCadetPinball ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY} ${X11_LIBRARIES})
+install(TARGETS SpaceCadetPinball DESTINATION bin)
+
# On Windows, copy DLL to output
if(WIN32)
list(GET SDL2_LIBRARY -1 SDL2_DLL_PATH)
@@ -216,15 +220,4 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${SDL2_DLL_PATH}/SDL2.dll" $<TARGET_FILE_DIR:SpaceCadetPinball>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${SDL2_MIXER_DLL_PATH}/SDL2_mixer.dll" $<TARGET_FILE_DIR:SpaceCadetPinball>
)
-endif()
-
-if(UNIX AND NOT APPLE)
- include(GNUInstallDirs)
- install(TARGETS "${PROJECT_NAME}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
@@ -221,8 +222,8 @@ endif()
if(UNIX AND NOT APPLE)
include(GNUInstallDirs)
install(TARGETS "${PROJECT_NAME}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
- install(FILES "/Platform/Linux/${PROJECT_NAME}.desktop" DESTINATION "share/applications")
- install(FILES "/Platform/Linux/${PROJECT_NAME}.metainfo.xml" DESTINATION "share/metainfo")
- foreach(S 16 32 48 128 192)
- install(FILES "${PROJECT_NAME}/Icon_${S}x${S}.png" DESTINATION
- "share/icons/hicolor/${S}x${S}/apps" RENAME "${PROJECT_NAME}.png")
- endforeach(S)
endif()
+ install(FILES "Platform/Linux/${PROJECT_NAME}.desktop" DESTINATION "share/applications")
+ install(FILES "Platform/Linux/${PROJECT_NAME}.metainfo.xml" DESTINATION "share/metainfo")
foreach(S 16 32 48 128 192)
install(FILES "${PROJECT_NAME}/Icon_${S}x${S}.png" DESTINATION
"share/icons/hicolor/${S}x${S}/apps" RENAME "${PROJECT_NAME}.png")