Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[delimited text] Unlock static build support
- Loading branch information
Showing
11 changed files
with
128 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,97 @@ | ||
|
||
######################################################## | ||
# Files | ||
|
||
set (DTEXT_SRCS | ||
qgsdelimitedtextfeatureiterator.cpp | ||
qgsdelimitedtextprovider.cpp | ||
qgsdelimitedtextfile.cpp | ||
) | ||
|
||
if (WITH_GUI) | ||
set(DTEXT_SRCS ${DTEXT_SRCS} | ||
set(DTEXT_GUI_SRCS | ||
qgsdelimitedtextprovidergui.cpp | ||
qgsdelimitedtextsourceselect.cpp | ||
) | ||
endif() | ||
|
||
######################################################## | ||
# Build | ||
set(DTEXT_UIS qgsdelimitedtextsourceselectbase.ui) | ||
endif() | ||
|
||
include_directories( | ||
# static library | ||
add_library(provider_delimitedtext_a STATIC ${DTEXT_SRCS}) | ||
|
||
${CMAKE_BINARY_DIR}/src/ui | ||
target_include_directories(provider_delimitedtext_a PUBLIC | ||
${CMAKE_SOURCE_DIR}/src/providers/delimitedtext | ||
) | ||
|
||
add_library(provider_delimitedtext MODULE ${DTEXT_SRCS}) | ||
target_link_libraries(provider_delimitedtext_a | ||
qgis_core | ||
) | ||
|
||
# require c++17 | ||
target_compile_features(provider_delimitedtext PRIVATE cxx_std_17) | ||
target_compile_features(provider_delimitedtext_a PRIVATE cxx_std_17) | ||
|
||
target_link_libraries(provider_delimitedtext | ||
qgis_core | ||
) | ||
target_compile_definitions(provider_delimitedtext_a PRIVATE "-DQT_NO_FOREACH") | ||
|
||
if (WITH_GUI) | ||
target_link_libraries (provider_delimitedtext | ||
if (WITH_QT6) | ||
QT6_WRAP_UI(DTEXT_UIS_H ${DTEXT_UIS}) | ||
else() | ||
QT5_WRAP_UI(DTEXT_UIS_H ${DTEXT_UIS}) | ||
endif() | ||
|
||
add_library(provider_delimitedtext_gui_a STATIC ${DTEXT_GUI_SRCS} ${DTEXT_UIS_H}) | ||
|
||
target_include_directories(provider_delimitedtext_gui_a PUBLIC | ||
${CMAKE_BINARY_DIR}/src/providers/delimitedtext | ||
) | ||
|
||
target_link_libraries(provider_delimitedtext_gui_a | ||
qgis_gui | ||
) | ||
add_dependencies(provider_delimitedtext ui) | ||
endif() | ||
|
||
target_compile_definitions(provider_delimitedtext PRIVATE "-DQT_NO_FOREACH") | ||
# require c++17 | ||
target_compile_features(provider_delimitedtext_gui_a PRIVATE cxx_std_17) | ||
|
||
# clang-tidy | ||
if(CLANG_TIDY_EXE) | ||
set_target_properties( | ||
provider_delimitedtext PROPERTIES | ||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}" | ||
) | ||
target_compile_definitions(provider_delimitedtext_gui_a PRIVATE "-DQT_NO_FOREACH") | ||
|
||
add_dependencies(provider_delimitedtext_gui_a ui) | ||
endif() | ||
|
||
######################################################## | ||
# Install | ||
if (FORCE_STATIC_LIBS) | ||
# for (external) mobile apps to be able to pick up provider for linking | ||
install (TARGETS provider_delimitedtext_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR}) | ||
if (WITH_GUI) | ||
install (TARGETS provider_delimitedtext_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR}) | ||
endif() | ||
else() | ||
add_library(provider_delimitedtext MODULE ${DTEXT_SRCS} ${DTEXT_GUI_SRCS}) | ||
|
||
# require c++17 | ||
target_compile_features(provider_delimitedtext PRIVATE cxx_std_17) | ||
|
||
target_link_libraries(provider_delimitedtext | ||
qgis_core | ||
) | ||
|
||
if (WITH_GUI) | ||
target_link_libraries (provider_delimitedtext | ||
qgis_gui | ||
) | ||
add_dependencies(provider_delimitedtext ui) | ||
endif() | ||
|
||
# clang-tidy | ||
if(CLANG_TIDY_EXE) | ||
set_target_properties( | ||
provider_delimitedtext_a PROPERTIES | ||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}" | ||
) | ||
set_target_properties( | ||
provider_delimitedtext PROPERTIES | ||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}" | ||
) | ||
endif() | ||
|
||
install (TARGETS provider_delimitedtext | ||
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} | ||
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}) | ||
install (TARGETS provider_delimitedtext | ||
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} | ||
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}) | ||
|
||
target_compile_definitions(provider_delimitedtext PRIVATE "-DQT_NO_FOREACH") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/*************************************************************************** | ||
qgsdelimitedtextprovidergui.h | ||
-------------------------------------- | ||
Date : June 2019 | ||
Copyright : (C) 2019 by Martin Dobias | ||
Email : wonder dot sk at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsproviderguimetadata.h" | ||
#include "qgssourceselectprovider.h" | ||
#include "qgsdelimitedtextsourceselect.h" | ||
|
||
class QgsDelimitedTextProviderGuiMetadata: public QgsProviderGuiMetadata | ||
{ | ||
public: | ||
QgsDelimitedTextProviderGuiMetadata(); | ||
|
||
QList<QgsSourceSelectProvider *> sourceSelectProviders() override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters