Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fix broken Linux and Windows builds
[xestiaab/.git] / source / CMakeFunctions / Application.cmake
1 set(MISC_TARGET_NAME misc)
3 set(MISC_FILE_LIST convert.cpp
4                    convert.h
5                    debug.h
6                    enums.h
7                    version.h)
9 add_library(${MISC_TARGET_NAME}
10             ${MISC_FILE_LIST})
12 set(FILE_LIST main.cpp
13               AppXestiaAddrBk.cpp
14               AppXestiaAddrBk.h
15               frmAbout.cpp
16               frmAbout.h
17               frmConflictResolution.cpp
18               frmConflictResolution.h
19               frmContact.cpp
20               frmContact.h
21               frmEditAccount.cpp
22               frmEditAccount.h
23               frmInvalidSSLCertificate.cpp
24               frmInvalidSSLCertificate.h
25               frmMain.cpp
26               frmMain.h
27               frmNewAccount.cpp
28               frmNewAccount.h
29               frmNewAccount-CardDAV2.cpp
30               frmPreferences.cpp
31               frmPreferences.h
32               frmSSLCertificate.cpp
33               frmSSLCertificate.h
34               frmUpdate.cpp
35               frmUpdate.h)
37 if(APPLE)
38     list(APPEND FILE_LIST frmEditAccount.mm
39                           frmNewAccount.mm
40                           frmMain.mm
41                           os/osx/XestiaAddressBook.icns)
42 endif()
44 list(APPEND LIBRARIES ${wxWidgets_LIBRARIES}
45                       ${LIBXML2_LIBRARY}
46                       sfml-audio
47                       CURL::libcurl
48                       actmgr
49                       carddav2
50                       common
51                       contacteditor
52                       export
53                       import
54                       misc
55                       search
56                       vcard
57                       widgets)
59 if (MSVC)
60     list(APPEND LIBRARIES wsock32
61                           wininet
62                           security
63                           cryptui
64                           crypt32)
65     list(APPEND FILE_LIST os/msw/xestiaab.rc)
66                           
67     add_executable(xestiaab WIN32
68                    ${FILE_LIST})
69     target_link_libraries(xestiaab LINK_PUBLIC
70                           ${LIBRARIES})
71 elseif(APPLE)
72     # Main icons
73     set_source_files_properties(os/osx/XestiaAddressBook.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
74     set(MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/os/osx/Info.plist")
75     set(CMAKE_BUILD_PATH_USE_ORIGIN TRUE)
76     set(APPS "\${CMAKE_INSTALL_PREFIX}/xestiaab.app")
77     set(DIR ${CMAKE_BINARY_DIR})
78     
79     install(CODE "include(BundleUtilities)
80         fixup_bundle(\"${APPS}\" \"\" \"\")")
82     # Documentation
83     file(GLOB DocumentationFiles ${CMAKE_SOURCE_DIR}/../docs/*.fodt)
84     set_source_files_properties(${DocumentationFiles} 
85         PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
87     add_executable(xestiaab MACOSX_BUNDLE
88         ${FILE_LIST}
89         ${DocumentationFiles}
90         ${FrameworkFiles})
91     
92     install(TARGETS xestiaab
93         BUNDLE DESTINATION . COMPONENT Runtime
94         RUNTIME DESTINATION bin COMPONENT Runtime)
96     target_link_libraries(xestiaab LINK_PUBLIC
97                           stdc++
98                           objc
99                           ${COREFOUNDATION_FRAMEWORK}
100                           ${SECURITY_FRAMEWORK}
101                           ${SECURITYINTERFACE_FRAMEWORK}
102                           ${LIBRARIES})
104     set_target_properties(xestiaab PROPERTIES
105                           MACOSX_BUNDLE TRUE
106                           MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/os/osx/Info.plist)
107         
108     add_custom_command(
109         TARGET xestiaab
110         COMMAND ${CMAKE_COMMAND} -D SRC=$<TARGET_BUNDLE_DIR:xestiaab>/Contents/MacOS/xestiaab
111                                  -D DST=$<TARGET_BUNDLE_DIR:xestiaab>/Contents/Frameworks
112                                  -D SFML_FRAMEWORKS_LOCATION=${SFML_FRAMEWORKS_LOCATION}
113                                  -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeFunctions/CopyLibraries.cmake
114         POST_BUILD
115     )
116 else()
117     add_executable(xestiaab
118         ${FILE_LIST})
120     target_link_libraries(xestiaab LINK_PUBLIC
121                           ${LIBRARIES})
122 endif()
125 message("${RUNTIME_OUTPUT_NAME_bitmapcode}")
127 target_include_directories(xestiaab
128     PUBLIC
129     ".")
130     
131 add_dependencies(xestiaab bitmapcode)
133 file(GLOB DOCUMENTATION_INSTALL_FILES "${CMAKE_SOURCE_DIR}/../docs/*")
134 foreach(ITEM ${DOCUMENTATION_INSTALL_FILES})
135     if(IS_DIRECTORY "${ITEM}")
136         list(APPEND DOCUMENTATION_DEPLOY_FILES "${ITEM}")
137     else()
138         list(APPEND DOCUMENTATION_DEPLOY_DIRECTORIES "${ITEM}")
139     endif()
140 endforeach()
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy