2
${CMAKE_CURRENT_SOURCE_DIR}
10
set(PLUGIN_DIR org/nemomobile/folderlistmodel)
12
set(folderlistmodel_SRCS
15
diritemabstractlistmodel.h
52
locationitemdiriterator.cpp
53
locationitemdiriterator.h
62
disk/disklocationitemdiriterator.cpp
63
disk/disklocationitemdiriterator.h
64
disk/disklocationitemfile.cpp
65
disk/disklocationitemfile.h
66
disk/disklocationitemdir.cpp
67
disk/disklocationitemdir.h
70
trash/qtrashutilinfo.cpp
71
trash/qtrashutilinfo.h
72
trash/trashiteminfo.cpp
74
trash/trashlocation.cpp
76
smb/qsambaclient/src/smbutil.cpp
77
smb/qsambaclient/src/smbutil.h
78
smb/qsambaclient/src/smbiteminfo.cpp
79
smb/qsambaclient/src/smbiteminfo.h
80
smb/qsambaclient/src/smblocationdiriterator.cpp
81
smb/qsambaclient/src/smblocationdiriterator.h
82
smb/qsambaclient/src/smblocationitemfile.cpp
83
smb/qsambaclient/src/smblocationitemfile.h
84
smb/qsambaclient/src/smblocationitemdir.cpp
85
smb/qsambaclient/src/smblocationitemdir.h
86
smb/qsambaclient/src/smbobject.cpp
87
smb/qsambaclient/src/smbobject.h
90
smb/smblocationauthentication.cpp
91
smb/smblocationauthentication.h
92
smb/qsambaclient/src/smbplaces.cpp
93
smb/qsambaclient/src/smbplaces.h
94
smb/qsambaclient/src/smbusershare.cpp
95
smb/qsambaclient/src/smbusershare.h
96
net/netauthenticationdata.cpp
97
net/netauthenticationdata.h
102
add_library(nemofolderlistmodel MODULE
103
${folderlistmodel_SRCS}
106
qt5_use_modules(nemofolderlistmodel Gui Qml Quick Widgets)
108
## samba requires libsmbclient
109
find_path(SAMBA_INCLUDE_DIR
111
HINTS /usr/include/smbclient /usr/include/samba /usr/include/samba-3.0 /usr/include/samba-4.0
113
find_library(SAMBA_LIBRARIES NAMES smbclient )
114
message(STATUS "samba include=${SAMBA_INCLUDE_DIR}")
115
message(STATUS "samba lib=${SAMBA_LIBRARIES}=${SAMBA_LIBRARIES}")
117
if(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
118
message(STATUS "Found samba: include=${SAMBA_INCLUDE_DIR} library=${SAMBA_LIBRARIES}")
119
INCLUDE_DIRECTORIES(${SAMBA_INCLUDE_DIR})
120
TARGET_LINK_LIBRARIES(nemofolderlistmodel ${SAMBA_LIBRARIES})
121
else(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
122
message(FATAL_ERROR "Could not find Samba libsmbclient")
123
endif(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
124
mark_as_advanced(SAMBA_INCLUDE_DIR SAMBA_LIBRARIES)
125
## end samba confiuration
127
# Copy the plugin, the qmldir file and other assets to the build dir for running in QtCreator
128
if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
129
add_custom_command(TARGET nemofolderlistmodel POST_BUILD
130
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR}
131
COMMENT "Creating plugin directory layout in the build directory"
132
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/qmldir ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR}
133
COMMENT "Copying the qmldir file to the build directory"
134
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:nemofolderlistmodel> ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR}
135
COMMENT "Copying the plugin binary to the build directory"
137
endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
139
# Install plugin file
140
install(TARGETS nemofolderlistmodel DESTINATION ${QT_IMPORTS_DIR}/org/nemomobile/folderlistmodel/)
141
install(FILES qmldir DESTINATION ${QT_IMPORTS_DIR}/org/nemomobile/folderlistmodel/)