add_library(${MISC_TARGET_NAME}
${MISC_FILE_LIST})
+add_dependencies(${MISC_TARGET_NAME}
+ bitmapcode)
+
set(FILE_LIST main.cpp
AppXestiaAddrBk.cpp
AppXestiaAddrBk.h
frmUpdate.cpp
frmUpdate.h)
-if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+if(APPLE)
list(APPEND FILE_LIST frmEditAccount.mm
- frmNewAccount.mm)
-endif()
-
-if (MSVC)
- list(APPEND FILE_LIST os/msw/xestiaab.rc)
- add_executable(xestiaab WIN32
- ${FILE_LIST})
-else()
- add_executable(xestiaab
- ${FILE_LIST})
+ frmNewAccount.mm
+ frmMain.mm
+ os/osx/XestiaAddressBook.icns)
endif()
-
-message("${RUNTIME_OUTPUT_NAME_bitmapcode}")
-
-target_include_directories(xestiaab
- PUBLIC
- ".")
-
-add_dependencies(xestiaab bitmapcode)
-
list(APPEND LIBRARIES ${wxWidgets_LIBRARIES}
${LIBXML2_LIBRARY}
sfml-audio
security
cryptui
crypt32)
+ list(APPEND FILE_LIST os/msw/xestiaab.rc)
+
+ add_executable(xestiaab WIN32
+ ${FILE_LIST})
+ target_link_libraries(xestiaab LINK_PUBLIC
+ ${LIBRARIES})
+elseif(APPLE)
+ # Main icons
+ set_source_files_properties(os/osx/XestiaAddressBook.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}/xestiaab.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(xestiaab MACOSX_BUNDLE
+ ${FILE_LIST}
+ ${DocumentationFiles}
+ ${FrameworkFiles})
+
+ install(TARGETS xestiaab
+ BUNDLE DESTINATION . COMPONENT Runtime
+ RUNTIME DESTINATION bin COMPONENT Runtime)
+
+ target_link_libraries(xestiaab LINK_PUBLIC
+ stdc++
+ objc
+ ${COREFOUNDATION_FRAMEWORK}
+ ${SECURITY_FRAMEWORK}
+ ${SECURITYINTERFACE_FRAMEWORK}
+ ${LIBRARIES})
+
+ set_target_properties(xestiaab PROPERTIES
+ MACOSX_BUNDLE TRUE
+ MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/os/osx/Info.plist)
+
+ add_custom_command(
+ TARGET xestiaab
+ COMMAND ${CMAKE_COMMAND} -D SRC=$<TARGET_BUNDLE_DIR:xestiaab>/Contents/MacOS/xestiaab
+ -D DST=$<TARGET_BUNDLE_DIR:xestiaab>/Contents/Frameworks
+ -D SFML_FRAMEWORKS_LOCATION=${SFML_FRAMEWORKS_LOCATION}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeFunctions/CopyLibraries.cmake
+ POST_BUILD
+ )
+else()
+ add_executable(xestiaab
+ ${FILE_LIST})
+
+ target_link_libraries(xestiaab LINK_PUBLIC
+ ${LIBRARIES})
endif()
-target_link_libraries(xestiaab
- LINK_PUBLIC
- ${LIBRARIES}
-)
+
+message("${RUNTIME_OUTPUT_NAME_bitmapcode}")
+
+target_include_directories(xestiaab
+ PUBLIC
+ ".")
+
+add_dependencies(xestiaab bitmapcode)
file(GLOB DOCUMENTATION_INSTALL_FILES "${CMAKE_SOURCE_DIR}/../docs/*")
foreach(ITEM ${DOCUMENTATION_INSTALL_FILES})
list(APPEND DOCUMENTATION_DEPLOY_DIRECTORIES "${ITEM}")
endif()
endforeach()
-
-install(TARGETS xestiaab RUNTIME DESTINATION bin)
-install(TARGETS odthelpbrowser RUNTIME DESTINATION bin)
-install(FILES ${CMAKE_SOURCE_DIR}/xestiaab.1 DESTINATION share/man/man1)
-install(FILES ${DOCUMENTATION_DEPLOY_FILES} DESTINATION share/doc/xestiaab)
-install(FILES ${DOCUMENTATION_DEPLOY_DIRECTORIES} DESTINATION share/doc/xestiaab)
\ No newline at end of file