Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fix bitmapcode helper not building when it should be
[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 add_dependencies(${MISC_TARGET_NAME}
13                  bitmapcode)
15 set(FILE_LIST main.cpp
16               AppXestiaAddrBk.cpp
17               AppXestiaAddrBk.h
18               frmAbout.cpp
19               frmAbout.h
20               frmConflictResolution.cpp
21               frmConflictResolution.h
22               frmContact.cpp
23               frmContact.h
24               frmEditAccount.cpp
25               frmEditAccount.h
26               frmInvalidSSLCertificate.cpp
27               frmInvalidSSLCertificate.h
28               frmMain.cpp
29               frmMain.h
30               frmNewAccount.cpp
31               frmNewAccount.h
32               frmNewAccount-CardDAV2.cpp
33               frmPreferences.cpp
34               frmPreferences.h
35               frmSSLCertificate.cpp
36               frmSSLCertificate.h
37               frmUpdate.cpp
38               frmUpdate.h)
40 if(APPLE)
41     list(APPEND FILE_LIST frmEditAccount.mm
42                           frmNewAccount.mm
43                           frmMain.mm
44                           os/osx/XestiaAddressBook.icns)
45 endif()
47 list(APPEND LIBRARIES ${wxWidgets_LIBRARIES}
48                       ${LIBXML2_LIBRARY}
49                       sfml-audio
50                       CURL::libcurl
51                       actmgr
52                       carddav2
53                       common
54                       contacteditor
55                       export
56                       import
57                       misc
58                       search
59                       vcard
60                       widgets)
62 if (MSVC)
63     list(APPEND LIBRARIES wsock32
64                           wininet
65                           security
66                           cryptui
67                           crypt32)
68     list(APPEND FILE_LIST os/msw/xestiaab.rc)
69                           
70     add_executable(xestiaab WIN32
71                    ${FILE_LIST})
72     target_link_libraries(xestiaab LINK_PUBLIC
73                           ${LIBRARIES})
74 elseif(APPLE)
75     # Main icons
76     set_source_files_properties(os/osx/XestiaAddressBook.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
77     set(MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/os/osx/Info.plist")
78     set(CMAKE_BUILD_PATH_USE_ORIGIN TRUE)
79     set(APPS "\${CMAKE_INSTALL_PREFIX}/xestiaab.app")
80     set(DIR ${CMAKE_BINARY_DIR})
81     
82     install(CODE "include(BundleUtilities)
83         fixup_bundle(\"${APPS}\" \"\" \"\")")
85     # Documentation
86     file(GLOB DocumentationFiles ${CMAKE_SOURCE_DIR}/../docs/*.fodt)
87     set_source_files_properties(${DocumentationFiles} 
88         PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
90     add_executable(xestiaab MACOSX_BUNDLE
91         ${FILE_LIST}
92         ${DocumentationFiles}
93         ${FrameworkFiles})
94     
95     install(TARGETS xestiaab
96         BUNDLE DESTINATION . COMPONENT Runtime
97         RUNTIME DESTINATION bin COMPONENT Runtime)
99     target_link_libraries(xestiaab LINK_PUBLIC
100                           stdc++
101                           objc
102                           ${COREFOUNDATION_FRAMEWORK}
103                           ${SECURITY_FRAMEWORK}
104                           ${SECURITYINTERFACE_FRAMEWORK}
105                           ${LIBRARIES})
107     set_target_properties(xestiaab PROPERTIES
108                           MACOSX_BUNDLE TRUE
109                           MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/os/osx/Info.plist)
110         
111     add_custom_command(
112         TARGET xestiaab
113         COMMAND ${CMAKE_COMMAND} -D SRC=$<TARGET_BUNDLE_DIR:xestiaab>/Contents/MacOS/xestiaab
114                                  -D DST=$<TARGET_BUNDLE_DIR:xestiaab>/Contents/Frameworks
115                                  -D SFML_FRAMEWORKS_LOCATION=${SFML_FRAMEWORKS_LOCATION}
116                                  -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeFunctions/CopyLibraries.cmake
117         POST_BUILD
118     )
119 else()
120     add_executable(xestiaab
121         ${FILE_LIST})
123     target_link_libraries(xestiaab LINK_PUBLIC
124                           ${LIBRARIES})
125 endif()
128 message("${RUNTIME_OUTPUT_NAME_bitmapcode}")
130 target_include_directories(xestiaab
131     PUBLIC
132     ".")
133     
134 add_dependencies(xestiaab bitmapcode)
136 file(GLOB DOCUMENTATION_INSTALL_FILES "${CMAKE_SOURCE_DIR}/../docs/*")
137 foreach(ITEM ${DOCUMENTATION_INSTALL_FILES})
138     if(IS_DIRECTORY "${ITEM}")
139         list(APPEND DOCUMENTATION_DEPLOY_FILES "${ITEM}")
140     else()
141         list(APPEND DOCUMENTATION_DEPLOY_DIRECTORIES "${ITEM}")
142     endif()
143 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