set(FILE_LIST main.cpp AppXestiaCalendar.cpp AppXestiaCalendar.h version.h) if(APPLE) list(APPEND FILE_LIST os/osx/XestiaCalendar.icns) endif() list(APPEND LIBRARIES ${wxWidgets_LIBRARIES} ${LIBXML2_LIBRARY} CURL::libcurl SQLite::SQLite3 common forms CalendarDataStorage calendarevent calendarfreebusy calendarjournal calendarlist calendarobject calendartask calendartimezone widgets) if (MSVC) list(APPEND LIBRARIES wsock32 wininet security cryptui crypt32) list(APPEND FILE_LIST os/msw/xestiacalendar.rc) add_executable(xestiacalendar WIN32 ${FILE_LIST}) target_link_libraries(xestiacalendar LINK_PUBLIC ${LIBRARIES}) elseif(APPLE) # Main icons set_source_files_properties(os/osx/XestiaCalendar.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") set(MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/os/osx/Info.plist") set(CMAKE_BUILD_PATH_USE_ORIGIN TRUE) set(APPS "\${CMAKE_INSTALL_PREFIX}/xestiacalendar.app") set(DIR ${CMAKE_BINARY_DIR}) install(CODE "include(BundleUtilities) fixup_bundle(\"${APPS}\" \"\" \"\")") # Documentation file(GLOB DocumentationFiles ${CMAKE_SOURCE_DIR}/../docs/*.fodt) set_source_files_properties(${DocumentationFiles} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) add_executable(xestiacalendar MACOSX_BUNDLE ${FILE_LIST} ${DocumentationFiles} ${FrameworkFiles}) install(TARGETS xestiacalendar BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION bin COMPONENT Runtime) target_link_libraries(xestiacalendar LINK_PUBLIC stdc++ objc ${COREFOUNDATION_FRAMEWORK} ${SECURITY_FRAMEWORK} ${SECURITYINTERFACE_FRAMEWORK} ${LIBRARIES}) set_target_properties(xestiacalendar PROPERTIES MACOSX_BUNDLE TRUE MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/os/osx/Info.plist) add_custom_command( TARGET xestiacalendar COMMAND ${CMAKE_COMMAND} -D SRC=$/Contents/MacOS/xestiacalendar -D DST=$/Contents/Frameworks -D SFML_FRAMEWORKS_LOCATION=${SFML_FRAMEWORKS_LOCATION} -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeFunctions/CopyLibraries.cmake POST_BUILD ) else() add_executable(xestiacalendar ${FILE_LIST}) target_link_libraries(xestiacalendar LINK_PUBLIC ${LIBRARIES}) endif() message("${RUNTIME_OUTPUT_NAME_bitmapcode}") target_include_directories(xestiacalendar PUBLIC ".") add_dependencies(xestiacalendar bitmapcode) file(GLOB DOCUMENTATION_INSTALL_FILES "${CMAKE_SOURCE_DIR}/../docs/*") foreach(ITEM ${DOCUMENTATION_INSTALL_FILES}) if(IS_DIRECTORY "${ITEM}") list(APPEND DOCUMENTATION_DEPLOY_FILES "${ITEM}") else() list(APPEND DOCUMENTATION_DEPLOY_DIRECTORIES "${ITEM}") endif() endforeach()