Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.

CMake: Set macOS deployment options on ladybird to quiet Xcode #98

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,17 @@ set(SOURCES
qt_add_executable(ladybird ${SOURCES}
MANUAL_FINALIZATION
)
#target_link_libraries(ladybird PRIVATE Qt::Widgets Qt::Network LibWeb LibGUI LibWeb LibWebView LibGL LibSoftGPU LibMain)
target_link_libraries(ladybird PRIVATE Qt::Widgets Qt::Network LibWeb LibWebSocket LibGUI LibWebView LibGL LibSoftGPU LibMain)

target_include_directories(ladybird PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(ladybird PRIVATE ${SERENITY_SOURCE_DIR}/Userland/Services/)

set_target_properties(ladybird PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER org.serenityos.ladybird
MACOSX_BUNDLE_GUI_IDENTIFIER org.SerenityOS.Ladybird
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
)

if (ANDROID)
Expand All @@ -99,6 +97,14 @@ qt_finalize_executable(ladybird)
add_subdirectory(WebContent)
add_dependencies(ladybird WebContent)

if (APPLE)
set(app_dir "$<TARGET_FILE_DIR:ladybird>")
set(bundle_dir "$<TARGET_BUNDLE_DIR:ladybird>")
add_custom_command(TARGET ladybird POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:WebContent>" "${app_dir}"
)
endif()

if(NOT CMAKE_SKIP_INSTALL_RULES)
include(cmake/InstallRules.cmake)
endif()
4 changes: 4 additions & 0 deletions Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ void platform_init()
if (Core::File::is_directory(home_lagom))
return home_lagom;
auto app_dir = akstring_from_qstring(QCoreApplication::applicationDirPath());
# ifdef AK_OS_MACOS
return LexicalPath(app_dir).parent().append("Resources"sv).string();
# else
return LexicalPath(app_dir).parent().append("share"sv).string();
# endif
}();
#endif
}
4 changes: 2 additions & 2 deletions WebContent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ set(WEBCONTENT_SOURCES

qt_add_executable(WebContent ${WEBCONTENT_SOURCES})

target_include_directories(WebContent PRIVATE ${SERENITY_SOURCE_DIR}/Userland/Services/)
target_include_directories(WebContent PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..)
ADKaster marked this conversation as resolved.
Show resolved Hide resolved
target_include_directories(WebContent PRIVATE "${SERENITY_SOURCE_DIR}/Userland/Services")

target_link_libraries(WebContent PRIVATE Qt::Core Qt::Network Qt::Gui LibCore LibIPC LibGfx LibWebView LibWebSocket LibWeb LibMain)