Skip to content
Snippets Groups Projects
Commit 4fccd15f authored by Eidolon's avatar Eidolon
Browse files

Merge branch 'cmake-mac-linkage' into 'next'

cmake: Various macOS build/package improvements

See merge request STJr/SRB2!1800
parents af8bc3af 0e5b5bf5
Branches
No related tags found
No related merge requests found
...@@ -87,21 +87,23 @@ if(${SDL2_FOUND}) ...@@ -87,21 +87,23 @@ if(${SDL2_FOUND})
endif() endif()
if(${CMAKE_SYSTEM} MATCHES Darwin) if(${CMAKE_SYSTEM} MATCHES Darwin)
find_library(CORE_LIB CoreFoundation) find_library(CORE_FOUNDATION_LIBRARY "CoreFoundation")
target_link_libraries(SRB2SDL2 PRIVATE target_link_libraries(SRB2SDL2 PRIVATE
${CORE_LIB} ${CORE_FOUNDATION_LIBRARY}
SDL2
SDL2_mixer
${GME_LIBRARIES}
${OPENMPT_LIBRARIES}
${MIXERX_LIBRARIES}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
${OPENGL_LIBRARIES}
${CURL_LIBRARIES}
) )
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
else()
# Configure the app bundle icon and plist properties
target_sources(SRB2SDL2 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/macosx/Srb2mac.icns")
set_target_properties(SRB2SDL2 PROPERTIES
MACOSX_BUNDLE_ICON_FILE "Srb2mac"
MACOSX_BUNDLE_BUNDLE_NAME "Sonic Robo Blast 2"
MACOSX_BUNDLE_BUNDLE_VERSION ${SRB2_VERSION}
RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/macosx/Srb2mac.icns"
)
endif()
target_link_libraries(SRB2SDL2 PRIVATE target_link_libraries(SRB2SDL2 PRIVATE
${SDL2_LIBRARIES} ${SDL2_LIBRARIES}
${SDL2_MIXER_LIBRARIES} ${SDL2_MIXER_LIBRARIES}
...@@ -120,7 +122,6 @@ if(${SDL2_FOUND}) ...@@ -120,7 +122,6 @@ if(${SDL2_FOUND})
rt rt
) )
endif() endif()
endif()
#target_link_libraries(SRB2SDL2 PRIVATE SRB2Core) #target_link_libraries(SRB2SDL2 PRIVATE SRB2Core)
...@@ -136,8 +137,6 @@ if(${SDL2_FOUND}) ...@@ -136,8 +137,6 @@ if(${SDL2_FOUND})
endif() endif()
endif() endif()
set_target_properties(SRB2SDL2 PROPERTIES VERSION ${SRB2_VERSION})
if(${CMAKE_SYSTEM} MATCHES Windows) if(${CMAKE_SYSTEM} MATCHES Windows)
target_link_libraries(SRB2SDL2 PRIVATE target_link_libraries(SRB2SDL2 PRIVATE
ws2_32 ws2_32
...@@ -188,6 +187,7 @@ if(${SDL2_FOUND}) ...@@ -188,6 +187,7 @@ if(${SDL2_FOUND})
install(TARGETS SRB2SDL2 install(TARGETS SRB2SDL2
BUNDLE DESTINATION . BUNDLE DESTINATION .
) )
set_property(TARGET SRB2SDL2 PROPERTY INSTALL_RPATH_USE_LINK_PATH ON)
else() else()
install(TARGETS SRB2SDL2 SRB2SDL2 install(TARGETS SRB2SDL2 SRB2SDL2
RUNTIME DESTINATION . RUNTIME DESTINATION .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment