set(MISC_TARGET_NAME misc) set(MISC_FILE_LIST convert.cpp convert.h debug.h enums.h version.h) add_library(${MISC_TARGET_NAME} ${MISC_FILE_LIST}) set(FILE_LIST main.cpp AppXestiaAddrBk.cpp AppXestiaAddrBk.h frmAbout.cpp frmAbout.h frmConflictResolution.cpp frmConflictResolution.h frmContact.cpp frmContact.h frmEditAccount.cpp frmEditAccount.h frmInvalidSSLCertificate.cpp frmInvalidSSLCertificate.h frmMain.cpp frmMain.h frmNewAccount.cpp frmNewAccount.h frmNewAccount-CardDAV2.cpp frmPreferences.cpp frmPreferences.h frmSSLCertificate.cpp frmSSLCertificate.h frmUpdate.cpp frmUpdate.h) if(APPLE) list(APPEND FILE_LIST frmEditAccount.mm frmNewAccount.mm frmMain.mm os/osx/XestiaAddressBook.icns) endif() list(APPEND LIBRARIES ${wxWidgets_LIBRARIES} ${LIBXML2_LIBRARY} sfml-audio CURL::libcurl actmgr carddav2 common contacteditor export import misc search vcard widgets) if (MSVC) list(APPEND LIBRARIES wsock32 wininet 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=$/Contents/MacOS/xestiaab -D DST=$/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() 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}) if(IS_DIRECTORY "${ITEM}") list(APPEND DOCUMENTATION_DEPLOY_FILES "${ITEM}") else() list(APPEND DOCUMENTATION_DEPLOY_DIRECTORIES "${ITEM}") endif() endforeach()