Compare commits

...
110 Commits
Author SHA1 Message Date
marc 55a16089c2 docker-compose + Dockerfile that work 2021-11-26 15:46:00 +01:00
marc 80ac5292b4 dockerfile 2021-11-26 15:41:27 +01:00
marc 5fb3a107ae docker-compose for using mongo with no dependencies by bind mouting the x11 server 2021-11-26 15:32:00 +01:00
Dj Walker-Morgan a715e33068 Update (C) date 2021-11-08 09:30:35 +00:00
Dj Walker-Morgan dbd03d410d Update README, remove survey 2021-11-08 09:22:56 +00:00
Gokhan Simsek e6ac9ec513 Changelog 2021-07-28 12:37:28 +03:00
Gokhan Simsek c58ed4a0d4 Minor fix 2021-07-28 12:09:17 +03:00
Gokhan Simsek 751c0b0ea8 Refactoring 2021-07-28 11:23:43 +03:00
Gokhan Simsek 526ae7065a Refactoring 2021-07-28 11:05:23 +03:00
Gokhan Simsek 860903cce8 Adding DefaultDB option support for From URI feature 2021-07-28 11:02:14 +03:00
Gokhan Simsek 1e1a7c84b5 Refactoring 2021-07-21 14:01:30 +03:00
Gokhan Simsek c7d97b23aa Adding AuthMechanism option support for From URI feature 2021-07-21 13:28:51 +03:00
Gokhan Simsek bf4cb999d7 Adding clearSslTab func. 2021-07-21 10:49:24 +03:00
Gokhan Simsek c6a4eb0494 Rename 2021-07-21 10:36:21 +03:00
Gokhan Simsek f94e7ce981 Adding TLS options support for From URI feature 2021-07-14 14:34:16 +03:00
Gokhan Simsek dd415d07af Adding feature auto-fill connection settings from standard URI (MongoDB Standard Connection String Format) 2021-07-14 10:02:46 +03:00
Gokhan Simsek 06b67b0adc Adding clear AuthTab func 2021-07-14 09:59:39 +03:00
Gokhan Simsek bd9a2e8227 Release 1.4.4 2021-06-29 13:11:14 +03:00
Gokhan Simsek ccd8299240 macOS, Windows: Fix Welcome Tab not loading the new content issue (disable/bypass HTTP cache) 2021-06-29 13:10:50 +03:00
kathrynvargas a288e5a3c6 Update README.md 2021-06-23 17:13:54 +02:00
Gökhan Şimşek 48f7dfde82 Update CHANGELOG 2021-01-14 11:04:25 +03:00
Gökhan Şimşek 0ee5fcfb6f Update CHANGELOG 2021-01-14 11:04:03 +03:00
Gokhan Simsek 9345ea05ea SSH should not be used when the SSL tab itself is disabled 2021-01-12 15:13:41 +03:00
Gökhan Şimşek c15e8932c6 Update CHANGELOG 2021-01-06 16:55:30 +03:00
Gokhan Simsek 10167d2d19 Minor change 2021-01-06 15:07:39 +03:00
Gokhan Simsek c260a63148 #1285 #1340: Disable SSH tab for existing replica set connections as well 2021-01-06 11:34:48 +03:00
Gokhan Simsek ea78a367ef AboutDialog: Minor change 2021-01-06 11:24:36 +03:00
Gokhan Simsek 74c644c933 #1285 #1340: Disable unsupported SSH tab for replica set connections 2021-01-06 11:04:23 +03:00
Gokhan Simsek 255a9bc2a9 Merge branch 'master' of https://github.com/Studio3T/robomongo 2021-01-06 11:00:25 +03:00
Gökhan Şimşek 968d9fcd5c Create README.md 2021-01-06 09:57:31 +03:00
Gokhan Simsek d76ea6668f Minor renaming 2021-01-06 09:52:01 +03:00
Gökhan Şimşek b789f817f9 Update README.md 2021-01-05 22:16:13 +03:00
Gökhan Şimşek 7ca8fe22d7 Update README.md 2021-01-05 17:21:57 +03:00
Gokhan Simsek 4ea4e1f569 Add set-mongo-warning-level-3.py 2021-01-05 17:18:36 +03:00
Gokhan Simsek e94bf825d3 Add rebuild script 2021-01-05 17:15:12 +03:00
Gokhan Simsek bdc9779df2 run-cppcheck.bat: Enable FILE or DIR argument passing 2021-01-04 17:57:10 +03:00
Gokhan Simsek 2291b09b58 Add more clang-tidy checks 2021-01-04 16:53:35 +03:00
Gokhan Simsek 32df0b7f34 AboutDialog: Add month and year 2021-01-04 13:02:03 +03:00
Gokhan Simsek 5e56af0b5a Enable Clang Tidy for Visual Studio 2019 2021-01-04 12:59:55 +03:00
Gokhan Simsek 6ec457de3d Update run-clang-tidy 2020-12-31 15:27:54 +03:00
Gokhan Simsek b4c58b1704 Update scan-build script 2020-12-30 12:34:30 +03:00
Gökhan Şimşek c3ea3488d2 Delete notes.txt 2020-12-30 11:09:54 +03:00
Gökhan Şimşek eb6f8a6cac Update README.md 2020-12-30 11:07:56 +03:00
Gökhan Şimşek e2d0456626 Rename HELP.md to readme.md 2020-12-30 11:05:56 +03:00
Gökhan Şimşek c183aa8b12 Update README.md 2020-12-30 10:58:55 +03:00
Gökhan Şimşek 9c5abff8cd Update README.md 2020-12-30 10:54:57 +03:00
Gokhan Simsek b794a7702d Minor changes 2020-12-30 10:53:28 +03:00
Gokhan Simsek 310a77e3a7 Merge branch 'master' of https://github.com/Studio3T/robomongo 2020-12-30 10:43:07 +03:00
Gokhan Simsek b37c92d9f9 Remove unused script 2020-12-30 10:42:17 +03:00
Gökhan Şimşek 665569ba82 Update README.md 2020-12-30 10:41:38 +03:00
Gökhan Şimşek 4bade27e12 Update CHANGELOG 2020-12-30 10:32:35 +03:00
Gokhan Simsek b010ab9525 Minor fix 2020-12-29 12:13:48 +03:00
Gökhan Şimşek 199a1864aa Update WelcomeTab.cpp 2020-12-29 11:26:20 +03:00
Gokhan Simsek 0272164072 Minor refactoring 2020-12-29 10:55:50 +03:00
Gokhan Simsek e24de27fd3 Import some keys 2020-12-29 10:53:44 +03:00
Gokhan Simsek e712897fea Minor change 2020-12-29 10:43:21 +03:00
Gokhan Simsek 660aaeb344 Refactoring 2020-12-29 09:59:53 +03:00
Gokhan Simsek 679a878b49 Update/merge main_window.jpg 2020-12-29 09:58:22 +03:00
Gokhan Simsek fa57ae5c3b Add default size for ExplorerWidget 2020-12-29 09:57:11 +03:00
Gokhan Simsek a613793d45 macOS: Prevent clang warning 2020-12-29 09:56:34 +03:00
Gokhan Simsek eaef3dde49 #1556: Remember left explorer widget size 2020-12-28 19:00:59 +03:00
Gokhan Simsek 545a39c522 Fix broken F2, F3, F4 shortcuts for tabbed result view 2020-12-28 11:49:26 +03:00
Gokhan Simsek a1042458b6 #1790: macOS: Set one re-order limit per new connections window workaround for Qt bug came in Qt 5.12.8 2020-12-24 15:17:12 +03:00
Gokhan Simsek 1415744f9b Fix a crash when new shell tab executed in server unreachable case 2020-12-22 17:07:21 +03:00
Gokhan Simsek 80c2e440db Refactoring visual studio code analysis script 2020-12-22 17:01:52 +03:00
Gökhan Şimşek 2809227838 Update README.md 2020-12-22 12:51:06 +03:00
Gökhan Şimşek 5233f2924d Update README.md 2020-12-22 12:50:39 +03:00
Gokhan Simsek a7e5589733 Refatoring clang-tidy script 2020-12-21 11:38:36 +03:00
Gokhan Simsek 3c7fff901a Refactoring static code analysis script 2020-12-21 10:10:53 +03:00
Gökhan Şimşek 821307f699 Update README.md 2020-12-18 18:25:51 +03:00
Gökhan Şimşek 3cf634cb75 Update README.md 2020-12-18 18:17:19 +03:00
Gokhan Simsek f7efb5af75 New WelcomeTab: Open links in external browser 2020-12-18 17:53:31 +03:00
Gökhan Şimşek aa11d3bd49 Update README.md 2020-12-18 15:31:32 +03:00
Gökhan Şimşek 16a61dc512 Update README.md 2020-12-18 15:27:24 +03:00
Gökhan Şimşek 4090a79450 Rename RuntimeDependencies.md to Debug.md 2020-12-18 15:21:22 +03:00
Gökhan Şimşek a619671277 Update README.md 2020-12-18 15:18:05 +03:00
Gokhan Simsek b92c1a1652 Minor change 2020-12-18 11:11:36 +03:00
Gokhan Simsek e97c74154b Update changelog for v1.4.3 2020-12-18 11:06:52 +03:00
Gokhan Simsek 138191cc22 Minor rename 2020-12-18 10:26:08 +03:00
Gokhan Simsek 58b214b16c Fix broken unit tests 2020-12-18 09:58:47 +03:00
Gökhan Şimşek 911acd7e4d Update BuildRobo3TOnMacAndLinux.md 2020-12-17 19:39:56 +03:00
Gokhan Simsek b745b575bc #1661: Attempt to fix a crash during paging used in tabbed result window 2020-12-16 15:58:57 +03:00
Gokhan Simsek 7a02188ac6 Removing unused code 2020-12-15 16:32:35 +03:00
Gokhan Simsek f41b340e79 Disable right click 2020-12-15 11:18:15 +03:00
Gokhan Simsek 901b6e86c7 Linux: Keeping old Welcome Tab due to run time QtWebEngine errors 2020-12-14 18:43:06 +03:00
Gokhan Simsek 583d43c054 macOS BigSur upgrade 2020-12-11 13:02:32 +03:00
Gökhan Şimşek 1fd2a061b0 Update BuildRobo3TOnMacAndLinux.md 2020-12-11 12:36:13 +03:00
Gökhan Şimşek 7c7ee58cd3 Update BuildRobo3TOnMacAndLinux.md 2020-12-10 12:34:06 +03:00
Gokhan Simsek cfa95fd3f5 macOS: New Welcome Tab using/adding QtWebEngine 2020-12-10 12:00:26 +03:00
Gokhan Simsek 89c9e78878 Minor cleaning 2020-12-10 11:53:23 +03:00
Gokhan Simsek bc074e446a Fix previously broken IPv6 setting 2020-12-10 10:05:45 +03:00
Gokhan Simsek baee06dcdd Minor update 2020-12-09 18:38:00 +03:00
Gokhan Simsek a6a6c8409a Windows: New Welcome Tab using/adding QtWebEngine 2020-12-09 14:58:21 +03:00
Gökhan Şimşek 11baf2bb9d Update README.md 2020-12-08 09:53:30 +03:00
Gökhan Şimşek 071d59c72a Update README.md 2020-12-08 09:51:28 +03:00
Gokhan Simsek 65ee72bda3 Starting v1.4.3 2020-12-01 10:46:13 +03:00
Gokhan Simsek 7800b65d1a Deleting unused trash folder 2020-12-01 10:23:21 +03:00
Gökhan Şimşek 56d260a65d Add files via upload
Add Qt build system png
2020-10-23 09:26:50 +03:00
Gokhan Simsek 6d0397a1d7 Minor change 2020-10-22 17:36:17 +03:00
Gokhan Simsek fdebb06059 Cmake: Start debug program with console window 2020-10-22 11:02:49 +03:00
Gokhan Simsek c6ef7bba81 Fix broken build number 2020-10-21 11:18:20 +03:00
Gokhan Simsek 86509495f3 Update changelog for v1.4.2 2020-10-20 16:58:18 +03:00
Gokhan Simsek 086e6b7d21 Update version to 1.4.2 2020-10-20 11:11:13 +03:00
Gokhan Simsek f47afbddc8 #1694: Attempt to fix broken paging in DocumentDB 2020-10-20 11:07:22 +03:00
Gokhan Simsek 14f545ff45 Adding trimmed results 2020-09-27 22:02:26 +03:00
Gökhan Şimşek bf09a3d9c6 Update build_scan-build 2020-09-27 18:55:55 +03:00
Gökhan Şimşek 93cadb5a6b Update configure_scan-build 2020-09-27 18:55:20 +03:00
Gökhan Şimşek 0dd68201f6 Update CHANGELOG 2020-09-15 15:38:43 +03:00
Gökhan Şimşek ba646c4ac0 Update README.md 2020-09-11 11:04:17 +03:00
Gökhan Şimşek 46c50d2aa7 Update README.md 2020-09-11 11:01:48 +03:00
348 changed files with 3826 additions and 164567 deletions
+34 -2
View File
@@ -2,7 +2,39 @@
Download latest version:
https://robomongo.org/download
Robo 3T 1.4.0 (Aug, 2020)
Robo 3T 1.4.4 (Aug/2021)
New Features:
- Support for Standard Connection String Format (Mongo URI)
Fixes:
- Fix Welcome Tab not loading the new content issue by disable/bypass HTTP cache
Robo 3T 1.4.3 (Jan/2021)
New Features:
- macOS Big Sur support
- New Welcome Tab - embeds Chromium using QtWebEngine (Windows, macOS only)
- Database explorer section has smaller default width (#1556)
- Remember size of database explorer section
- Import keys from old version: autoExpand, lineNumbers, debugMode and shellTimeoutSec
Fixes:
- Disable unsupported SSH tab for replica set connections (#1285 #1340)
- Fix crash when new shell tab executed in server unreachable case
- Fix crash when paging used in tabbed result window (#1661)
- Fix broken F2, F3, F4 shortcuts for tabbed result view
- One time re-order limit per new connections window to prevent data loss (macOS, #1790)
- Fix previously broken IPv6 support from command line: robo3t --ipv6
Robo 3T 1.4.2 (Oct/2020)
Fixes:
- Fix broken paging in DocumentDB (#1694)
Robo 3T 1.4.1 (Sep/2020)
Fixes:
- Force light mode on macOS (#1761, #1768, #1771)
- Fix broken macOS native theme/look (#1766)
- Fix broken Windows native theme/look
Robo 3T 1.4.0 (Aug/2020)
blog.robomongo.org/robo-3t-1-4/
New Features:
@@ -13,7 +45,7 @@ blog.robomongo.org/robo-3t-1-4/
Improvements:
- Qt Upgrade (v5.12.8 - Apr/2020, Windows & macOS only)
  - OpenSSL upgrade (v1.1.1f - Mar/2020, Windows & macOS only)
- OpenSSL upgrade (v1.1.1f - Mar/2020, Windows & macOS only)
- libssh2 upgrade (v1.9.0 - Jun/2019, Windows & macOS only)
Fixes:
+7 -5
View File
@@ -7,7 +7,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
# Project version
set(PROJECT_VERSION_MAJOR "1")
set(PROJECT_VERSION_MINOR "4")
set(PROJECT_VERSION_PATCH "1")
set(PROJECT_VERSION_PATCH "4")
set(PROJECT_VERSION_BUILD "")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${PROJECT_VERSION_BUILD}")
@@ -33,11 +33,14 @@ find_package(Qt5Widgets REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Xml REQUIRED)
if(NOT SYSTEM_LINUX)
find_package(Qt5WebEngineWidgets REQUIRED)
endif()
find_package(MongoDB REQUIRED)
find_package(OpenSSL REQUIRED)
if (SYSTEM_MACOSX)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14)
find_package(Qt5MacExtras REQUIRED)
endif()
@@ -62,8 +65,7 @@ add_subdirectory(${QJSON_DIR})
add_subdirectory(${QSCINTILLA_DIR})
add_subdirectory(${GOOGLE_TEST_DIR})
add_subdirectory(src/robomongo)
# todo: Enable unit tests
# add_subdirectory(src/robomongo-unit-tests) # Disabled in Robo 1.4 due to too many link errors
add_subdirectory(src/robomongo-unit-tests)
# Show configuration summary
include(RobomongoConfigurationSummary)
include(RobomongoConfigurationSummary)
+21
View File
@@ -0,0 +1,21 @@
FROM debian
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends --fix-missing\
libgl-dev \
qt5dxcb-plugin \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
ADD https://download-test.robomongo.org/linux/robo3t-1.3.1-linux-x86_64-7419c406.tar.gz /opt/robo3t.tar.gz
RUN cd /opt/ \
&& mkdir robo3t \
&& tar -C /opt/robo3t --strip-components 1 -xzf robo3t.tar.gz && rm robo3t.tar.gz \
&& ls /opt/robo3t
VOLUME /root/.3T
VOLUME /root/.config/3T
CMD /opt/robo3t/bin/robo3t
+65 -49
View File
@@ -1,3 +1,4 @@
About Robo 3T
===============
@@ -7,15 +8,16 @@ The latest stable release **Robo 3T 1.4** embeds **MongoDB 4.2** shell.
Blog: http://blog.robomongo.org/robo-3t-1-4/
Download: https://robomongo.org/download
Older Releases: https://github.com/Studio3T/robomongo/releases
All Releases: https://github.com/Studio3T/robomongo/releases
Watch: [Robo 3T Youtube channel](https://www.youtube.com/channel/UCM_7WAseRWeeiBikExppstA)
Follow: https://twitter.com/Robomongo
**MongoDB shell history:**
Robo 3T 1.3: MongoDB 4.0
Robo 3T 1.1: MongoDB 3.4
Robo 3T 0.9: MongoDB 3.2
Robo 3T 0.8.x: MongoDB 2.4.0
**Embedded MongoDB shell history:**
Robo 3T 1.4 -> MongoDB 4.2
Robo 3T 1.3 -> MongoDB 4.0
Robo 3T 1.1 -> MongoDB 3.4
Robo 3T 0.9 -> MongoDB 3.2
Robo 3T 0.8.x -> MongoDB 2.4.0
\* [Robomongo has been acquired by 3T](https://studio3t.com/press/3t-software-labs-acquires-robomongo-the-most-widely-used-mongodb-tool/)
@@ -24,21 +26,30 @@ What's new in latest Robo 3T 1.4?
New Features:
- Mongo shell 4.2 upgrade
- Support for Ubuntu 20.04 and macOS 10.15 (Catalina)
- Support for Ubuntu 20.04, macOS Big Sur and macOS 10.15 (Catalina)
- SSH: ECDSA and Ed25519 keys support on Windows & macOS (issues #1719, #1530, #1590)
- Manually specify visible databases (issues #1696, #1368, #389)
- New Welcome Tab - embeds Chromium using QtWebEngine (Windows, macOS only)
- Import keys from old version: autoExpand, lineNumbers, debugMode and shellTimeoutSec
Improvements:
- Qt Upgrade (v5.12.8 - Apr/2020, Windows & macOS only)
- OpenSSL upgrade (v1.1.1f - Mar/2020, Windows & macOS only)
- libssh2 upgrade (v1.9.0 - Jun/2019, Windows & macOS only)
- Database explorer section has smaller default width (#1556)
- Remember database explorer section size
Fixes:
- Fix previously broken IPv6 support from command line: robo3t --ipv6
- Fix crash when paging used in tabbed result window (#1661)
- Fix broken paging in DocumentDB (#1694)
- Authentication database option isn't used properly (#1696)
- Add/Edit index ops fixed (re-written) (#1692)
- Crash when expanding admin users (#1728)
- IPv6 support (previously broken) restored
- Unable to run query after shell timeout reached (#1529)
- Fix broken F2, F3, F4 shortcuts for tabbed result view
- One time re-order limit per new connections window to prevent data loss (macOS, #1790)
- Fix crash when new shell tab executed in server unreachable case
Supported Platforms
===============
@@ -54,13 +65,52 @@ Note: This sections is for Robo 3T and it directly depends on what MongoDB suppp
| Windows | Mac | Linux |
|:---------------------- | :--------------------------------| :---------------------------|
| Windows 64-bit 10 | Mac OS X 10.15 (Catalina) | Linux Ubuntu 20.04 64-bit* |
Windows 64-bit 8.1 | Mac OS X 10.14 (Mojave) | Linux Ubuntu 18.04 64-bit* |
| Windows 64-bit 7 | Mac OS X 10.13 (High Sierra) | Linux CentOS 7 64-bit* ** |
| | | Linux CentOS 6 64-bit* ** |
| Windows 64-bit 10 | Mac OS X 11 (Big Sur) | Linux Ubuntu 20.04 64-bit |
Windows 64-bit 8.1 | Mac OS X 10.15 (Catalina) | Linux Ubuntu 18.04 64-bit |
| Windows 64-bit 7 | Mac OS X 10.14 (Mojave) | |
Contribute!
===========
### Code Contributions
See all docs here: https://github.com/Studio3T/robomongo/wiki
**Some important docs:**
- [Build Diagram](https://github.com/Studio3T/robomongo/wiki/Robo-3T-Schematics:-Build,-Class-and-UI-Diagrams#1-build-diagram)
- [Static Code Analysis](https://github.com/Studio3T/robomongo/wiki/Static-Code-Analysis)
- [Robo 3T Feature Specisification](https://github.com/Studio3T/robomongo/wiki/Feature-Spec)
- [Debugging](https://github.com/Studio3T/robomongo/blob/master/docs/Debug.md)
- [Schematics](https://github.com/Studio3T/robomongo/tree/master/schematics)
Code contributions are always welcome! Just try to follow our pre-commit checks and coding style:
- [Robo 3T Code Quality](https://github.com/paralect/robomongo/wiki/Robomongo-Code-Quality)
- [Robo 3T C++11/14 Transition Guide](https://github.com/Studio3T/robomongo/wiki/Robomongo-Cplusplus-11,-14-Transition-Guide)
- [Robo 3T Coding Style](https://github.com/paralect/robomongo/wiki/Robomongo-Coding-Style)
If you plan to contribute, please create a Github issue (or comment on the relevant existing issue) so we can help coordinate with upcoming release plans.
Pull requests (PRs) should generally be for discrete issues (i.e. one issue per PR please) and be clean to merge against the current master branch. It would also be helpful if you can confirm what testing has been done (specific O/S targets and MongoDB versions if applicable).
A usual naming approach for feature branches is `issue-###`. Include the issue number in your commit message / pull request description to link the PR to the original issue.
For example:
```#248: updated QScintilla to 2.4.8 for retina display support".```
### Testing
- [Unit-Tests](https://github.com/Studio3T/robomongo/wiki/Unit-Tests)
- [Manual Tests](wiki/Tests)
- See all docs here: https://github.com/Studio3T/robomongo/wiki
### Suggest Features
New feature suggestions or UI improvements are always welcome.
[Create a new feature request on github](https://github.com/paralect/robomongo/issues/new)
This project is powered by open source volunteers, so we have a limited amount of development resource to address all requests. We will certainly make best efforts to progress (particularly for those with strong community upvotes).
\* Latest stable build
\** Support for CentOS temporarily dropped starting from version 1.1
Download
========
@@ -78,45 +128,11 @@ You can:
- [Join developer discussion on Gitter](https://gitter.im/paralect/robomongo)
Contribute!
===========
### Suggest Features
New feature suggestions or UI improvements are always welcome.
[Create a new feature request on github](https://github.com/paralect/robomongo/issues/new)
This project is powered by open source volunteers, so we have a limited amount of development resource to address all requests. We will certainly make best efforts to progress (particularly for those with strong community upvotes).
### Code Contributions
Code contributions are always welcome! Just try to follow our pre-commit checks and coding style:
- [Robo 3T Code Quality](https://github.com/paralect/robomongo/wiki/Robomongo-Code-Quality)
- [Robo 3T C++11/14 Transition Guide](https://github.com/Studio3T/robomongo/wiki/Robomongo-Cplusplus-11,-14-Transition-Guide)
- [Robo 3T Coding Style](https://github.com/paralect/robomongo/wiki/Robomongo-Coding-Style)
If you plan to contribute, please create a Github issue (or comment on the relevant existing issue) so we can help coordinate with upcoming release plans.
Pull requests (PRs) should generally be for discrete issues (i.e. one issue per PR please) and be clean to merge against the current master branch. It would also be helpful if you can confirm what testing has been done (specific O/S targets and MongoDB versions if applicable).
A usual naming approach for feature branches is `issue-###`. Include the issue number in your commit message / pull request description to link the PR to the original issue.
For example:
```#248: updated QScintilla to 2.4.8 for retina display support".```
### Design
There are some cosmetic issues we could use help with (designing images or UI). They are marked in the issue queue with a [`Cosmetic`](https://github.com/paralect/robomongo/labels/cosmetic) label. If you see an open issue that you'd like to contribute to, please feel free to volunteer by commenting on it.
### Testing
There are a number of issues we could use help with reproducing. They are marked in the issue queue with a [`Needs Repro`](https://github.com/paralect/robomongo/labels/needs%20repro) label. If you see an open issue that doesn't appear to be reproducible yet, please feel free to test and comment with your findings.
License
=======
Copyright 2014-2020 [3T Software Labs Ltd](https://studio3t.com/). All rights reserved.
Copyright 2014-2021 [3T Software Labs Ltd](https://studio3t.com/). All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
+11
View File
@@ -3,6 +3,8 @@ Bash fronted for CMake
If you want to use this scripts, you need to set single environment variable:
E.g.:
export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5/5.5/gcc_64;/path/to/robomongo-shell"
Build Robomongo:
@@ -14,7 +16,16 @@ Install Robomongo:
$ bin/install
Run Robomongo:
$ bin/run
Pack Robomongo:
$ bin/pack
More:
- [Build Robo 3T - Mac OS X and Linux](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnMacAndLinux.md)
- [Build Robo 3T - Windows](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnWindows.md)
- [Unit Tests](wiki/Unit-Tests)
- [Static Code Analysis](wiki/Static-Code-Analysis)
@@ -4,4 +4,4 @@ BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get director
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/build || exit $?
source $BIN_DIR/run_tests $1
source $BIN_DIR/run-tests $1
@@ -11,5 +11,5 @@ call "%BIN_DIR%\build.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run tests
call "%BIN_DIR%\run_tests.bat" %*
call "%BIN_DIR%\run-tests.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
+1 -1
View File
@@ -16,5 +16,5 @@ cmake --build . --config %BUILD_TYPE%
rem Install debug *.dll files
if "%BUILD_TYPE%" == "Debug" (
call "%BIN_DIR%\install_debug_dlls.bat" %*
call "%BIN_DIR%\install-debug-dlls.bat" %*
)
-20
View File
@@ -1,20 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run build with Visual Studio with RunCodeAnalysis
cd "%BUILD_DIR%"
cmake --build . --config %BUILD_TYPE% -- "/p:RunCodeAnalysis=true" "/p:CodeAnalysisRuleSet=NativeRecommendedRules.ruleset"
rem Install debug *.dll files
if "%BUILD_TYPE%" == "Debug" (
call "%BIN_DIR%\install_debug_dlls.bat" %*
)
-11
View File
@@ -1,11 +0,0 @@
#!/usr/bin/env bash
echo "Building with scan-build in debug mode..."
echo "------------------------------------------------"
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup debug # release or debug
cd $BUILD_DIR
scan-build --use-analyzer /usr/local/opt/llvm/bin/clang++ cmake --build . "${@:2}" -- -j8
+10
View File
@@ -0,0 +1,10 @@
bugprone-*
cert-*
clang-analyzer-*
cppcoreguidelines-*
concurrency-*
hicpp-*
llvm-*
misc-*
performance-*
readability-*
+4
View File
@@ -0,0 +1,4 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<EnableClangTidyCodeAnalysis>true</EnableClangTidyCodeAnalysis>
<ClangTidyChecks></ClangTidyChecks>
</PropertyGroup>
+1 -20
View File
@@ -27,23 +27,4 @@ PACK_PREFIX=$BUILD_DIR/package
PREFIX_PATH=$ROBOMONGO_CMAKE_PREFIX_PATH
mkdir -p $BUILD_DIR
if [ "$(uname -s)" == "Darwin" ]; then
# On Mac OS we specify minimal OS version that we support.
#
# The following environment variable will set "-mmacosx-version-min=10.6" option
# for compiler. From documentation to GCC or Clang:
#
# -mmacosx-version-min=version
#
# The earliest version of MacOS X that this executable will run on is
# version. Typical values of version include 10.1, 10.2, and 10.3.9.
#
# This value can also be set with the MACOSX_DEPLOYMENT_TARGET environment
# variable. If both the command-line option is specified and the
# environment variable is set, the command-line option will take precedence.
#
export MACOSX_DEPLOYMENT_TARGET=10.13
fi
mkdir -p $BUILD_DIR
+6 -1
View File
@@ -13,4 +13,9 @@ if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run CMake configuration step
rem BUILD_TYPE: Release or Debug
cd "%BUILD_DIR%"
cmake -G "Visual Studio 15 2017 Win64" -D "CMAKE_PREFIX_PATH=%PREFIX_PATH%" -D "CMAKE_BUILD_TYPE=%BUILD_TYPE%" -D "CMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" %PROJECT_DIR%
cmake -G "Visual Studio 15 2017 Win64" -D "CMAKE_PREFIX_PATH=%PREFIX_PATH%" -D "CMAKE_BUILD_TYPE=%BUILD_TYPE%" -D "CMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" %PROJECT_DIR%
@REM echo ___________________________________________________________________
@REM rem Enable Clang Tidy for Visual Studio 2019 IDE ...
@REM set ROBO_PROJ_FILE=%BUILD_DIR%/src/robomongo/robomongo.vcxproj
@REM python %BIN_DIR%\enable-visual-studio-clang-tidy.py %ROBO_PROJ_FILE% %BIN_DIR%
-12
View File
@@ -1,12 +0,0 @@
#!/usr/bin/env bash
echo "Configuring with scan-build in debug mode..."
echo "------------------------------------------------"
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup debug # debug
cd $BUILD_DIR
BUILD_TYPE=Debug # $BUILD_TYPE: Release or Debug
scan-build -v --use-analyzer /usr/local/opt/llvm/bin/clang++ cmake -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
+44
View File
@@ -0,0 +1,44 @@
import sys
from lxml import etree
print('\nEnabling Clang Tidy for Visual Studio 2019')
robo_proj_xml = sys.argv[1]
clang_tidy_xml = sys.argv[2] + '/clang-tidy.xml'
clang_checks_txt = sys.argv[2] + '/clang-checks.txt'
print(sys.argv[0] + ":\nProcessing: " + sys.argv[1])
## Read clang checks
clang_checks = None
with open(clang_checks_txt, "r") as file:
clang_checks = file.read().replace('\n', ',')
##
tree = etree.parse(robo_proj_xml)
ns = {'ns':'http://schemas.microsoft.com/developer/msbuild/2003'}
if(tree.find('//ns:EnableClangTidyCodeAnalysis', namespaces=ns) is not None):
tree.find('//ns:ClangTidyChecks', namespaces=ns).text = clang_checks
tree.write(robo_proj_xml)
print('Finished')
sys.exit()
## Append clang_tidy_xml - Todo: refactor using etree
with open(robo_proj_xml, "r") as in_file:
buf = in_file.readlines()
with open(clang_tidy_xml, "r") as in_file:
clang_tidy_xml_buf = in_file.read()
appended = False
with open(robo_proj_xml, "w") as out_file:
for line in buf:
if "</ItemGroup>" in line and appended == False:
line = line + clang_tidy_xml_buf
appended = True
out_file.write(line)
## Add clang checks
tree = etree.parse(robo_proj_xml)
tree.find('//ns:ClangTidyChecks', namespaces=ns).text = clang_checks
tree.write(robo_proj_xml)
print('Finished')
@@ -31,6 +31,14 @@ for /d %%a in (
"%Qt_DIR%\bin\Qt5Guid.dll"
"%Qt_DIR%\bin\Qt5Networkd.dll"
"%Qt_DIR%\bin\Qt5Widgetsd.dll"
"%Qt_DIR%\bin\Qt5Positioningd.dll"
"%Qt_DIR%\bin\Qt5Qmld.dll"
"%Qt_DIR%\bin\Qt5Quickd.dll"
"%Qt_DIR%\bin\Qt5QuickWidgetsd.dll"
"%Qt_DIR%\bin\Qt5WebChanneld.dll"
"%Qt_DIR%\bin\Qt5WebEngineCored.dll"
"%Qt_DIR%\bin\Qt5WebEngineWidgetsd.dll"
"%Qt_DIR%\bin\Qt5PrintSupportd.dll"
) do (
if not exist !INSTALL_DIR!%%~NXa (
xcopy %%a !INSTALL_DIR! /d /y
+6
View File
@@ -0,0 +1,6 @@
@echo off
setlocal enableextensions enabledelayedexpansion
call "clean.bat" %*
call "configure.bat" %*
call "build.bat" %*
+4 -4
View File
@@ -4,11 +4,11 @@ BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get director
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
echo "Note: ./install must be executed before this script."
if [ "$(uname -s)" == "Darwin" ]; then
# On Mac OS we should run executable from bundle
"$BUILD_DIR/src/robomongo/Robo 3T.app/Contents/MacOS/Robo 3T"
echo "Starting $BUILD_DIR/install/Robo 3T.app/Contents/MacOS/Robo 3T"
"$BUILD_DIR/install/Robo 3T.app/Contents/MacOS/Robo 3T"
else
echo "Note: ./install must be executed before this script."
echo "Starting $BUILD_DIR/install/bin/robo3t..."
echo "Starting $BUILD_DIR/install/bin/robo3t"
"$BUILD_DIR/install/bin/robo3t"
fi
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
### Common Setup
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1 # $1: release or debug
### Setup
CLANG_TIDY_BUILD_DIR=$PROJECT_DIR/build/clang-tidy-$BUILD_TYPE
rm -rf $CLANG_TIDY_BUILD_DIR
mkdir -p $CLANG_TIDY_BUILD_DIR && cd $CLANG_TIDY_BUILD_DIR
### Configure cmake
# Info: $BUILD_TYPE == Release or Debug
cmake -D "CMAKE_EXPORT_COMPILE_COMMANDS=ON" -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
echo -e "\n------------------------------------------------"
echo "clang-tidy configured. Mode: $BUILD_TYPE"
echo -e "------------------------------------------------\n"
### Run clang-tidy
FILE_OR_PATH=/opt/robo/src/robomongo/ # or MainWindow.cpp
CHECKS=clang-analyzer-*,readability-implicit-bool-conversion
# All Checks: https://clang.llvm.org/extra/clang-tidy/checks/list.html
# e.g. $BIN_DIR/run-clang-tidy.py -checks=clang-analyzer-*,readability-implicit-bool-conversion /opt/robo/src/robomongo/
$BIN_DIR/run-clang-tidy.py -checks=$CHECKS $FILE_OR_PATH
echo -e "\n------------------------------------------------"
echo "clang-tidy finished"
echo "Mode : $BUILD_TYPE"
echo "CLANG_TIDY_BUILD_DIR: $CLANG_TIDY_BUILD_DIR"
echo "Command executed : $BIN_DIR/run-clang-tidy.py -checks=$CHECKS $FILE_OR_PATH"
echo -e "------------------------------------------------\n"
+326
View File
@@ -0,0 +1,326 @@
#!/usr/bin/env python
#
#===- run-clang-tidy.py - Parallel clang-tidy runner ---------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===------------------------------------------------------------------------===#
# FIXME: Integrate with clang-tidy-diff.py
"""
Parallel clang-tidy runner
==========================
Runs clang-tidy over all files in a compilation database. Requires clang-tidy
and clang-apply-replacements in $PATH.
Example invocations.
- Run clang-tidy on all files in the current working directory with a default
set of checks and show warnings in the cpp files and all project headers.
run-clang-tidy.py $PWD
- Fix all header guards.
run-clang-tidy.py -fix -checks=-*,llvm-header-guard
- Fix all header guards included from clang-tidy and header guards
for clang-tidy headers.
run-clang-tidy.py -fix -checks=-*,llvm-header-guard extra/clang-tidy \
-header-filter=extra/clang-tidy
Compilation database setup:
http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
"""
from __future__ import print_function
import argparse
import glob
import json
import multiprocessing
import os
import re
import shutil
import subprocess
import sys
import tempfile
import threading
import traceback
try:
import yaml
except ImportError:
yaml = None
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
import queue as queue
def find_compilation_database(path):
"""Adjusts the directory until a compilation database is found."""
result = './'
while not os.path.isfile(os.path.join(result, path)):
if os.path.realpath(result) == '/':
print('Error: could not find compilation database.')
sys.exit(1)
result += '../'
return os.path.realpath(result)
def make_absolute(f, directory):
if os.path.isabs(f):
return f
return os.path.normpath(os.path.join(directory, f))
def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
header_filter, extra_arg, extra_arg_before, quiet,
config):
"""Gets a command line for clang-tidy."""
start = [clang_tidy_binary]
if header_filter is not None:
start.append('-header-filter=' + header_filter)
if checks:
start.append('-checks=' + checks)
if tmpdir is not None:
start.append('-export-fixes')
# Get a temporary file. We immediately close the handle so clang-tidy can
# overwrite it.
(handle, name) = tempfile.mkstemp(suffix='.yaml', dir=tmpdir)
os.close(handle)
start.append(name)
for arg in extra_arg:
start.append('-extra-arg=%s' % arg)
for arg in extra_arg_before:
start.append('-extra-arg-before=%s' % arg)
start.append('-p=' + build_path)
if quiet:
start.append('-quiet')
if config:
start.append('-config=' + config)
start.append(f)
return start
def merge_replacement_files(tmpdir, mergefile):
"""Merge all replacement files in a directory into a single file"""
# The fixes suggested by clang-tidy >= 4.0.0 are given under
# the top level key 'Diagnostics' in the output yaml files
mergekey="Diagnostics"
merged=[]
for replacefile in glob.iglob(os.path.join(tmpdir, '*.yaml')):
content = yaml.safe_load(open(replacefile, 'r'))
if not content:
continue # Skip empty files.
merged.extend(content.get(mergekey, []))
if merged:
# MainSourceFile: The key is required by the definition inside
# include/clang/Tooling/ReplacementsYaml.h, but the value
# is actually never used inside clang-apply-replacements,
# so we set it to '' here.
output = { 'MainSourceFile': '', mergekey: merged }
with open(mergefile, 'w') as out:
yaml.safe_dump(output, out)
else:
# Empty the file:
open(mergefile, 'w').close()
def check_clang_apply_replacements_binary(args):
"""Checks if invoking supplied clang-apply-replacements binary works."""
try:
subprocess.check_call([args.clang_apply_replacements_binary, '--version'])
except:
print('Unable to run clang-apply-replacements. Is clang-apply-replacements '
'binary correctly specified?', file=sys.stderr)
traceback.print_exc()
sys.exit(1)
def apply_fixes(args, tmpdir):
"""Calls clang-apply-fixes on a given directory."""
invocation = [args.clang_apply_replacements_binary]
if args.format:
invocation.append('-format')
if args.style:
invocation.append('-style=' + args.style)
invocation.append(tmpdir)
subprocess.call(invocation)
def run_tidy(args, tmpdir, build_path, queue, lock, failed_files):
"""Takes filenames out of queue and runs clang-tidy on them."""
while True:
name = queue.get()
invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks,
tmpdir, build_path, args.header_filter,
args.extra_arg, args.extra_arg_before,
args.quiet, args.config)
proc = subprocess.Popen(invocation, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = proc.communicate()
if proc.returncode != 0:
failed_files.append(name)
with lock:
sys.stdout.write(' '.join(invocation) + '\n' + output.decode('utf-8'))
if len(err) > 0:
sys.stdout.flush()
sys.stderr.write(err.decode('utf-8'))
queue.task_done()
def main():
parser = argparse.ArgumentParser(description='Runs clang-tidy over all files '
'in a compilation database. Requires '
'clang-tidy and clang-apply-replacements in '
'$PATH.')
parser.add_argument('-clang-tidy-binary', metavar='PATH',
default='clang-tidy',
help='path to clang-tidy binary')
parser.add_argument('-clang-apply-replacements-binary', metavar='PATH',
default='clang-apply-replacements',
help='path to clang-apply-replacements binary')
parser.add_argument('-checks', default=None,
help='checks filter, when not specified, use clang-tidy '
'default')
parser.add_argument('-config', default=None,
help='Specifies a configuration in YAML/JSON format: '
' -config="{Checks: \'*\', '
' CheckOptions: [{key: x, '
' value: y}]}" '
'When the value is empty, clang-tidy will '
'attempt to find a file named .clang-tidy for '
'each source file in its parent directories.')
parser.add_argument('-header-filter', default=None,
help='regular expression matching the names of the '
'headers to output diagnostics from. Diagnostics from '
'the main file of each translation unit are always '
'displayed.')
if yaml:
parser.add_argument('-export-fixes', metavar='filename', dest='export_fixes',
help='Create a yaml file to store suggested fixes in, '
'which can be applied with clang-apply-replacements.')
parser.add_argument('-j', type=int, default=0,
help='number of tidy instances to be run in parallel.')
parser.add_argument('files', nargs='*', default=['.*'],
help='files to be processed (regex on path)')
parser.add_argument('-fix', action='store_true', help='apply fix-its')
parser.add_argument('-format', action='store_true', help='Reformat code '
'after applying fixes')
parser.add_argument('-style', default='file', help='The style of reformat '
'code after applying fixes')
parser.add_argument('-p', dest='build_path',
help='Path used to read a compile command database.')
parser.add_argument('-extra-arg', dest='extra_arg',
action='append', default=[],
help='Additional argument to append to the compiler '
'command line.')
parser.add_argument('-extra-arg-before', dest='extra_arg_before',
action='append', default=[],
help='Additional argument to prepend to the compiler '
'command line.')
parser.add_argument('-quiet', action='store_true',
help='Run clang-tidy in quiet mode')
args = parser.parse_args()
db_path = 'compile_commands.json'
if args.build_path is not None:
build_path = args.build_path
else:
# Find our database
build_path = find_compilation_database(db_path)
try:
invocation = [args.clang_tidy_binary, '-list-checks']
invocation.append('-p=' + build_path)
if args.checks:
invocation.append('-checks=' + args.checks)
invocation.append('-')
if args.quiet:
# Even with -quiet we still want to check if we can call clang-tidy.
with open(os.devnull, 'w') as dev_null:
subprocess.check_call(invocation, stdout=dev_null)
else:
subprocess.check_call(invocation)
except:
print("Unable to run clang-tidy.", file=sys.stderr)
sys.exit(1)
# Load the database and extract all files.
database = json.load(open(os.path.join(build_path, db_path)))
files = [make_absolute(entry['file'], entry['directory'])
for entry in database]
max_task = args.j
if max_task == 0:
max_task = multiprocessing.cpu_count()
tmpdir = None
if args.fix or (yaml and args.export_fixes):
check_clang_apply_replacements_binary(args)
tmpdir = tempfile.mkdtemp()
# Build up a big regexy filter from all command line arguments.
file_name_re = re.compile('|'.join(args.files))
return_code = 0
try:
# Spin up a bunch of tidy-launching threads.
task_queue = queue.Queue(max_task)
# List of files with a non-zero return code.
failed_files = []
lock = threading.Lock()
for _ in range(max_task):
t = threading.Thread(target=run_tidy,
args=(args, tmpdir, build_path, task_queue, lock, failed_files))
t.daemon = True
t.start()
# Fill the queue with files.
for name in files:
if file_name_re.search(name):
task_queue.put(name)
# Wait for all threads to be done.
task_queue.join()
if len(failed_files):
return_code = 1
except KeyboardInterrupt:
# This is a sad hack. Unfortunately subprocess goes
# bonkers with ctrl-c and we start forking merrily.
print('\nCtrl-C detected, goodbye.')
if tmpdir:
shutil.rmtree(tmpdir)
os.kill(0, 9)
if yaml and args.export_fixes:
print('Writing fixes to ' + args.export_fixes + ' ...')
try:
merge_replacement_files(tmpdir, args.export_fixes)
except:
print('Error exporting fixes.\n', file=sys.stderr)
traceback.print_exc()
return_code=1
if args.fix:
print('Applying fixes ...')
try:
apply_fixes(args, tmpdir)
except:
print('Error applying fixes.\n', file=sys.stderr)
traceback.print_exc()
return_code=1
if tmpdir:
shutil.rmtree(tmpdir)
sys.exit(return_code)
if __name__ == '__main__':
main()
+22
View File
@@ -0,0 +1,22 @@
@echo off
setlocal enableextensions enabledelayedexpansion
set CPP_VER=c++17
set FILE_OR_DIR=..\src\robomongo\
set PARAM_1=%1
if not "%PARAM_1%" == "" (
set FILE_OR_DIR=%PARAM_1%
)
rem Run analysis
echo.
echo ---------------------- Running cppcheck ----------------------
echo.
call cppcheck %FILE_OR_DIR% --enable=all --std=%CPP_VER%
echo.
echo ---------------------- End of cppcheck ----------------------
echo.
echo ---------------------- Info ----------------------
call cppcheck --version
echo Command called: cppcheck %FILE_OR_DIR% --enable=all --std=%CPP_VER%
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1 # $1: release or debug
mkdir -p ../scan-build && cd ../scan-build
# $BUILD_TYPE: Release or Debug
# Hint: Use "--use-analyzer /usr/local/opt/llvm/bin/clang++" after "-v"
scan-build -v cmake -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
echo -e "\n------------------------------------------------"
echo "Configured with scan-build in $BUILD_TYPE mode"
echo -e "------------------------------------------------\n"
scan-build cmake --build . "${@:2}" -- -j8
echo -e "\n------------------------------------------------"
echo "Built with scan-build in $BUILD_TYPE mode"
echo -e "------------------------------------------------\n"
View File
+20
View File
@@ -0,0 +1,20 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run tests
echo.
echo ******************* Running unit tests *******************
echo Mode: %BUILD_TYPE%
set TEST_EXE_DIR=%PROJECT_DIR%\\build\%BUILD_TYPE%\src\robomongo-unit-tests\%BUILD_TYPE%
echo Run : %TEST_EXE_DIR%\robo_unit_tests.exe
echo.
call "%TEST_EXE_DIR%\robo_unit_tests.exe" %*
+29
View File
@@ -0,0 +1,29 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run Visual Studio with RunCodeAnalysis
cd "%BUILD_DIR%"
set RULE_SET="/p:CodeAnalysisRuleSet=NativeRecommendedRules.ruleset"
set OUT_FILE=vs-code-analysis-%BUILD_TYPE%.txt
echo ------------- Running Visual Studio with RunCodeAnalysis -------------
echo Result will be written into file "%OUT_FILE%" in the end.
echo ...
cmake --build . --config %BUILD_TYPE% -- "/p:RunCodeAnalysis=true" %RULE_SET% > %BIN_DIR%\%OUT_FILE%
rem Rules: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets
rem https://docs.microsoft.com/en-us/visualstudio/code-quality/rule-set-reference?view=vs-2019
echo ------------- End of RunCodeAnalysis -------------
echo.
echo ------------- Info -------------
echo Mode : %BUILD_TYPE%
echo RULE_SET: %RULE_SET% (see the script comments for more info)
-15
View File
@@ -1,15 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run tests
echo.
echo ******************* Running unit tests for Release mode *******************
echo ** Note: Only Release mode is supported on Windows
echo.
echo "Running file: \build\Release\src\robomongo-unit-tests\Release\robo_unit_tests.exe"
call "%PROJECT_DIR%\\build\Release\src\robomongo-unit-tests\Release\robo_unit_tests.exe" %*
+42
View File
@@ -0,0 +1,42 @@
import os
from os.path import join
###
def force_warning_level_3(file):
with open(file, "r") as in_file:
buf = in_file.readlines()
push = '#pragma warning(push, 3)\n'
pop = '#pragma warning(pop)\n'
last_line_has_mongo = False
with open(file, "w") as out_file:
for line in buf:
if line.startswith(('#include <mongo', '#include "mongo')):
if last_line_has_mongo:
pass # line = line + pop
else:
line = push + line
last_line_has_mongo = True
else:
if last_line_has_mongo:
line = pop + line
last_line_has_mongo = False
out_file.write(line)
### main
root_dir = 'E:\\robo\\src\\robomongo\\'
# root_dir = 'E:\\robo\\src\\robomongo\\shell\\bson\\' # for testing
print('Processing all source files in root & sub directories...')
print('Root Dir:', root_dir)
print('---------------------------------------------------------')
for path, subdirs, files in os.walk(root_dir):
for name in files:
if name.endswith(('.h', '.cpp')):
file = os.path.join(path, name)
print(file)
force_warning_level_3(file)
+30 -10
View File
@@ -1,3 +1,9 @@
# Set MONGO_BUILD_FOLDER
set(MONGO_BUILD_FOLDER "build/opt") # Release
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(MONGO_BUILD_FOLDER "build/debug")
endif()
# Show configuration summary and build tip
message("")
message(" _______________[ Robo 3T configuration summary ]________________")
@@ -10,8 +16,11 @@ message("| Qt5 Widgets: ${Qt5Widgets_VERSION} ${Qt5Widgets_DIR}")
message("| Qt5 PrintSupport: ${Qt5Widgets_VERSION} ${Qt5PrintSupport_DIR}")
message("| Qt5 Network: ${Qt5Network_VERSION} ${Qt5Network_DIR}")
message("| Qt5 Xml: ${Qt5Xml_VERSION} ${Qt5Xml_DIR}")
message("| MongoDB: ${MongoDB_VERSION} ${MongoDB_BUILD_DIR}")
message("| MongoDB Objects: ${MongoDB_VERSION} ${MongoDB_OBJECTS_DIR}/build")
if(NOT SYSTEM_LINUX)
message("| Qt5 WebEng*Widgets: ${Qt5WebEngineWidgets_VERSION} ${Qt5WebEngineWidgets_DIR}")
endif()
message("| MongoDB: ${MongoDB_VERSION} ${MongoDB_DIR}")
message("| MongoDB Objects: ${MongoDB_VERSION} ${MongoDB_OBJECTS_DIR}/${MONGO_BUILD_FOLDER}")
message("| OpenSSL: ${OPENSSL_VERSION} ${OpenSSL_DIR}")
message("| libssh2: ${LIBSSH2_VERSION} ${LIBSSH2_DIR}")
message("| QJson: ${QJSON_VERSION} ${QJSON_DIR}")
@@ -21,13 +30,14 @@ message("| ESPRIMA: ${ESPRIMA_VERSION} ${ESPRIMA_DIR}")
message("|")
message("|-- Summary:")
message("|")
message("| System: ${CMAKE_SYSTEM_NAME}")
message("| Version: ${PROJECT_VERSION}")
message("| System: ${CMAKE_SYSTEM_NAME}")
if (SYSTEM_MACOSX)
message("| Target SDK: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
message("| Target SDK: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
message("| Build type: ${CMAKE_BUILD_TYPE}")
message("| Build number: ${BUILD_NUMBER}")
message("| Install path: ${CMAKE_INSTALL_PREFIX}")
message("| Build type: ${CMAKE_BUILD_TYPE}")
message("| Commit: ${BUILD_NUMBER}")
message("| Install path: ${CMAKE_INSTALL_PREFIX}")
message("|")
message("|-- Build, Run and Install:")
message("| ")
@@ -37,7 +47,17 @@ message("| $ bin/install")
message("|")
message("|-- Run Unit Tests:")
message("| ")
message("| $ bin/build_and_run_tests")
message("| $ bin/run_tests (without building)")
message("| $ bin/build-and-run-tests")
message("| $ bin/run-tests")
message("|")
message("|-- Run Static Code Analysis:")
message("|")
if (SYSTEM_WINDOWS)
message("| $ bin/run-cppcheck <FILE_PATH OR DIR> (Default: /src/robomongo/)")
message("| $ bin/run-vs-code-analysis")
else()
message("| $ bin/run-clang-tidy")
message("| $ bin/run-scan-build")
endif()
message("|__________________________________________________________________")
message("")
message("")
+18 -2
View File
@@ -40,7 +40,7 @@ elseif(SYSTEM_WINDOWS)
set(bin_dir .)
set(styles_dir ${bin_dir}/styles)
set(lib_dir .)
set(resources_dir .)
set(resources_dir ./resources)
set(license_dir .)
set(qt_plugins_dir ${lib_dir})
@@ -97,10 +97,17 @@ install(
DESTINATION ${license_dir})
# Install common dependencies
install_qt_lib(Core Gui Widgets PrintSupport Network Xml)
SET(QT_LIBS Core Gui Widgets PrintSupport Network Xml)
if(NOT SYSTEM_LINUX)
SET(QT_LIBS ${QT_LIBS} WebEngineWidgets WebEngineCore Quick
QuickWidgets WebChannel Qml Positioning)
endif()
install_qt_lib(${QT_LIBS})
install_qt_plugins(QGifPlugin QICOPlugin)
install_icu_libs()
set(QT_STYLES_DIR ${Qt5Core_DIR}/../../../plugins/styles/)
set(QT_BIN_DIR ${Qt5Core_DIR}/../../../bin/)
set(QT_RESOURCES_DIR ${Qt5Core_DIR}/../../../resources/)
if(SYSTEM_LINUX)
install_qt_lib(XcbQpa DBus)
@@ -132,6 +139,15 @@ elseif(SYSTEM_WINDOWS)
QMinimalIntegrationPlugin
QOffscreenIntegrationPlugin)
# Qt WebEngine dependencies
install(DIRECTORY ${QT_RESOURCES_DIR} DESTINATION ${resources_dir})
install(FILES
"${QT_BIN_DIR}/libEGL.dll"
"${QT_BIN_DIR}/libGLESv2.dll"
"${QT_BIN_DIR}/opengl32sw.dll"
"${QT_BIN_DIR}/QtWebEngineProcess.exe"
DESTINATION ${bin_dir})
# Install Styles
install(FILES "${QT_STYLES_DIR}/qwindowsvistastyle.dll" DESTINATION ${styles_dir})
+1
View File
@@ -28,6 +28,7 @@ function(install_qt_lib)
install(
DIRECTORY ${qt_lib_dir}/${module_name}.framework
DESTINATION ${lib_dir}
USE_SOURCE_PERMISSIONS
PATTERN "*_debug" EXCLUDE # Exclude debug libraries
PATTERN "Headers" EXCLUDE) # Exclude Headers folders
endif()
+8
View File
@@ -1,3 +1,11 @@
See these docs for the latest info about this topic:
-------------
- [Build Robo 3T - Mac OS X and Linux](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnMacAndLinux.md)
- [Build Robo 3T - Windows](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnWindows.md)
------------------------------------
What is this?
-------------
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
View File
+11
View File
@@ -0,0 +1,11 @@
version: "3.9"
services:
robo3t:
image: robo3t
restart: unless-stopped
build: .
network_mode: host
environment:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
+18 -10
View File
@@ -78,33 +78,41 @@ tar -xf openssl-1.1.1f.tar.gz
cd /opt/openssl-1.1.1f
(make clean)
./Configure darwin64-x86_64-cc shared no-ssl2 no-ssl3 no-comp
// Info: With openssl version 1.1.1, configure command with rpath stopped working
./Configure darwin64-x86_64-cc shared no-ssl2 no-ssl3 no-comp -mmacosx-version-min=xy.zt
// Notes:
// 1. Change -mmacosx-version same as CMAKE_OSX_DEPLOYMENT_TARGET in
// https://github.com/Studio3T/robomongo/blob/master/CMakeLists.txt
// 2. With openssl version 1.1.1, configure command with rpath stopped working
// Last working configure command with rpath was:
// ./Configure darwin64-x86_64-cc shared --openssldir="@rpath"
make (or sudo make)
// Verify libssl.dylib and libcrypto.dylib file are created
mkdir lib
cp lib*.dylib lib/
// Verify libssl.dylib and libcrypto.dylib files are created
ll lib*.dylib
// Due to broken './Configure' command with rpath above, these extra steps are also required:
install_name_tool -id "@rpath/lib/libssl.1.1.dylib" libssl.dylib
install_name_tool -change /usr/local/lib/libcrypto.1.1.dylib @rpath/lib/libcrypto.1.1.dylib libssl.dylib
install_name_tool -id "@rpath/lib/libcrypto.1.1.dylib" libcrypto.dylib
install_name_tool -id "@rpath/lib/libssl.1.1.dylib" libssl.1.1.dylib
install_name_tool -change /usr/local/lib/libcrypto.1.1.dylib @rpath/lib/libcrypto.1.1.dylib libssl.1.1.dylib
install_name_tool -id "@rpath/lib/libcrypto.1.1.dylib" libcrypto.1.1.dylib
// Finally, we should have this output using otool:
otool -L libssl.dylib
otool -L libssl.1.1.dylib
libssl.dylib:
@rpath/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
@rpath/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
otool -L libcrypto.dylib
otool -L libcrypto.1.1.dylib
libcrypto.dylib:
@rpath/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
// For robo-unit-test dependency:
mkdir lib/
cp lib*.dylib/lib/
```
**Linux:**
```sh
-11
View File
@@ -1,11 +0,0 @@
This is a logbook for notes about migration to MongoDB 3.2
DocumentTextEditor.cpp
----------------------
Commented error reporting.
Logger.cpp
----------
Commented Logger::print().
Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

+47 -25
View File
@@ -1,18 +1,21 @@
###
### Unit Testing with Google Test
###
#########################################
### Unit Testing with Google Test ###
#########################################
## !! Important Note: Currently unit testing is disabled for Linux due to MongoDB linking problem
### --- Important Note
if (SYSTEM_LINUX)
message("\n *Note: Currently unit testing is disabled for Linux due to MongoDB linking problem")
message("\n *Note: Currently unit testing is disabled for Linux "
"due to MongoDB linking problems")
return()
endif()
### --- Enable and setup gtest
enable_testing()
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
## New test & source file pairs MUST have the following format:
### --- Setup test source files
# New test & source file pairs MUST have the following format:
# Test file: /path/Foo_test.cpp
# Source file: /path/Foo.cpp or /path/Foo.h
set(ROBO_SRC_DIR ${CMAKE_HOME_DIRECTORY}/src/robomongo)
@@ -22,15 +25,18 @@ set(SOURCES_TEST
${ROBO_SRC_DIR}/core/HexUtils_test.cpp
)
### --- Setup robo_unit_tests exec. & link ROBO_OBJ_FILES
add_executable(robo_unit_tests ${SOURCES_TEST})
add_dependencies(robo_unit_tests robomongo)
target_include_directories(robo_unit_tests PRIVATE ${CMAKE_HOME_DIRECTORY}/src)
get_target_property(ROBO_SOURCES robomongo SOURCES)
list(FILTER ROBO_SOURCES INCLUDE REGEX "cpp")
list(FILTER ROBO_SOURCES EXCLUDE REGEX "main.cpp")
if(SYSTEM_WINDOWS) ############# Windows
if(SYSTEM_WINDOWS)
set(OBJ_DIR ${CMAKE_BINARY_DIR}/src/robomongo/robomongo.dir/${CMAKE_BUILD_TYPE}/)
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}mocs_compilation.obj;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}qrc_gui.obj;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}qrc_robo.obj;")
foreach(SRC_FILE ${ROBO_SOURCES})
@@ -38,7 +44,7 @@ if(SYSTEM_WINDOWS) ############# Windows
string(REPLACE ".cpp" ".obj" FILENAME ${FILENAME})
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}${FILENAME};")
endforeach()
elseif(SYSTEM_MACOSX) ############# MacOS
elseif(SYSTEM_MACOSX)
set(OBJ_DIR ${CMAKE_BINARY_DIR}/src/robomongo/CMakeFiles/robomongo.dir/)
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_autogen/mocs_compilation.cpp.o;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_autogen/YHP5W5E6RA/qrc_gui.cpp.o;")
@@ -51,11 +57,8 @@ elseif(SYSTEM_MACOSX) ############# MacOS
find_library(SECURITY NAMES Security)
find_library(CORE_FOUNDATION NAMES CoreFoundation)
set(SSL_LIBRARIES ${SECURITY} ${CORE_FOUNDATION})
target_link_libraries(robo_unit_tests
${SSL_LIBRARIES} -lresolv
)
# elseif(SYSTEM_LINUX) ############# LINUX
target_link_libraries(robo_unit_tests ${SSL_LIBRARIES} -lresolv)
# elseif(SYSTEM_LINUX)
# set(OBJ_DIR ${CMAKE_BINARY_DIR}/src/robomongo/CMakeFiles/robomongo.dir/)
# message("--- OBJ_DIR: " ${OBJ_DIR})
# set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_automoc.cpp.o;")
@@ -67,11 +70,19 @@ elseif(SYSTEM_MACOSX) ############# MacOS
# endforeach()
endif()
# Disable WebEngineWidgets for Linux
SET(WebEngineWidgets "Qt5::WebEngineWidgets")
if(SYSTEM_LINUX)
SET(WebEngineWidgets)
endif()
target_link_libraries(robo_unit_tests
gtest gtest_main
gtest
gtest_main
Qt5::Widgets
Qt5::Network
Qt5::Xml
${WebEngineWidgets}
qjson
qscintilla
mongodb
@@ -80,22 +91,33 @@ target_link_libraries(robo_unit_tests
${ROBO_OBJ_FILES}
)
target_include_directories(robo_unit_tests
PRIVATE
${CMAKE_HOME_DIRECTORY}/src)
### --- Install DLLs for Windows
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(D "d")
endif()
# For Windows we need to install Qt DLLs
if(SYSTEM_WINDOWS)
get_target_property(target_path Qt5::Core LOCATION)
get_filename_component(qt_bin_dir ${target_path} DIRECTORY)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Core${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Gui${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Network${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5PrintSupport${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Widgets${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Xml${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Core${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Gui${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Network${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5PrintSupport${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Widgets${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Xml${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Positioning${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Qml${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Quick${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5QuickWidgets${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5WebChannel${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5WebEngineCore${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5WebEngineWidgets${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5PrintSupport${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
get_target_property(TESTS_BIN_DIR robo_unit_tests BINARY_DIR)
file(COPY ${QT_BIN_FILES}
file(COPY ${QT_BIN_FILES} DESTINATION ${TESTS_BIN_DIR}/${CMAKE_BUILD_TYPE})
file(COPY
${OpenSSL_DIR}/libssl-1_1-x64.dll
${OpenSSL_DIR}/libcrypto-1_1-x64.dll
DESTINATION ${TESTS_BIN_DIR}/${CMAKE_BUILD_TYPE})
endif()
+14
View File
@@ -0,0 +1,14 @@
This is just a placeholder for `cmake`.
Test source files are located in the same directory alongside the tested file in `robomongo/src/robomongo/` dir and sub-dirs.
e.g.
```
...
RoboCrypt.cpp
RoboCrypt_test.cpp
...
StringOperations.cpp
StringOperations_test.cpp
...
```
+15 -6
View File
@@ -10,7 +10,6 @@ set(CMAKE_AUTOUIC ON)
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${sanitize}")
set(SOURCES
# Isolated Scope #1
core/utils/QtUtils.cpp
core/utils/StdUtils.cpp
@@ -145,11 +144,18 @@ set(SOURCES
# Robomongo target
add_executable(robomongo MACOSX_BUNDLE WIN32 app/main.cpp ${SOURCES})
# Disable WebEngineWidgets for Linux
SET(WebEngineWidgets "Qt5::WebEngineWidgets")
if(SYSTEM_LINUX)
SET(WebEngineWidgets)
endif()
target_link_libraries(robomongo
PRIVATE
Qt5::Widgets
Qt5::Network
Qt5::Xml
${WebEngineWidgets}
qjson
qscintilla
mongodb
@@ -174,11 +180,10 @@ target_include_directories(robomongo
# Get build number
find_package(Git)
if(GIT_FOUND)
MESSAGE( STATUS "Info: Git found" )
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE "BUILD_NUMBER"
OUTPUT_VARIABLE BUILD_NUMBER
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else(GIT_FOUND)
@@ -190,7 +195,7 @@ if(BUILD_NUMBER STREQUAL "")
MESSAGE( FATAL_ERROR "Failed to get BUILD_NUMBER" )
endif()
MESSAGE( STATUS "Info: BUILD_NUMBER set as " \"${BUILD_NUMBER}\" )
set(BUILD_NUMBER ${BUILD_NUMBER} CACHE INTERNAL "")
target_compile_definitions(robomongo
PRIVATE
@@ -234,21 +239,25 @@ if(SYSTEM_WINDOWS)
# Suppress "warning C4291: ...no matching operator delete found" from third_party\mozjs-60
set_target_properties(robomongo PROPERTIES COMPILE_FLAGS "/wd4477 /wd4291")
# Start debug program with console
set_target_properties(robomongo PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE")
# Seems that we do not need to do this with recent versions of Qt
target_link_libraries(robomongo PRIVATE Qt5::WinMain)
elseif(SYSTEM_MACOSX)
string(TIMESTAMP CURRENT_YEAR "%Y")
set_target_properties(robomongo PROPERTIES
INSTALL_RPATH "@executable_path/../Frameworks"
OUTPUT_NAME "Robo 3T"
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/install/macosx/Info.plist.in"
MACOSX_BUNDLE_BUNDLE_NAME "Robo 3T"
MACOSX_BUNDLE_GUI_IDENTIFIER "com.3tsoftwarelabs.robo3t"
MACOSX_BUNDLE_INFO_STRING "Robo 3T ${PROJECT_VERSION}. Copyright 3T Software Labs Ltd, 2014 - 2017"
MACOSX_BUNDLE_INFO_STRING "Robo 3T ${PROJECT_VERSION}. Copyright 3T Software Labs Ltd, 2014 - ${CURRENT_YEAR}"
MACOSX_BUNDLE_SHORT_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_LONG_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_COPYRIGHT "Copyright 3T Software Labs Ltd, 2014 - 2017"
MACOSX_BUNDLE_COPYRIGHT "Copyright 3T Software Labs Ltd, 2014 - ${CURRENT_YEAR}"
MACOSX_BUNDLE_ICON_FILE "robomongo")
elseif(SYSTEM_LINUX)
+2 -1
View File
@@ -48,7 +48,8 @@ int main(int argc, char *argv[], char** envp)
// Todo from mongo repo: This should use a TransportLayerManager or TransportLayerFactory
auto serviceContext = mongo::getGlobalServiceContext();
mongo::transport::TransportLayerASIO::Options opts;
opts.enableIPv6 = false; // Todo: When true, it breaks connection to localhost, github #1757
// When true, it breaks connection to localhost, github #1757
opts.enableIPv6 = mongo::shellGlobalParams.enableIPv6;
opts.mode = mongo::transport::TransportLayerASIO::Options::kEgress;
serviceContext->setTransportLayer(
std::make_unique<mongo::transport::TransportLayerASIO>(opts, nullptr)
+12 -8
View File
@@ -48,19 +48,21 @@ namespace Robomongo
}
std::unique_ptr<MongoServer>
App::continueOpenServer(int serverHandle, ConnectionSettings* connSettings, ConnectionType type,
int localport)
App::continueOpenServer(int serverHandle, ConnectionSettings* connSettings,
ConnectionType type, int localport)
{
ConnectionSettings* connSettingsClone = connSettings->clone();
// Modify connection settings when SSH tunnel is used
if ((type == ConnectionPrimary || type == ConnectionTest)
&& connSettingsClone->sshSettings()->enabled()) {
&& !connSettingsClone->isReplicaSet()
&& connSettingsClone->sshSettings()->enabled()
) {
connSettingsClone->setServerHost("127.0.0.1");
connSettingsClone->setServerPort(localport);
}
auto server{ std::make_unique<MongoServer>(serverHandle, connSettingsClone, type) };
auto server { std::make_unique<MongoServer>(serverHandle, connSettingsClone, type) };
server->runWorkerThread();
auto replicaSetStr = QString::fromStdString(connSettings->connectionName()) + " [Replica Set]";
@@ -90,9 +92,11 @@ namespace Robomongo
if (type == ConnectionPrimary)
_bus->publish(new ConnectingEvent(this));
// When connection is SECONDARY or do not have
// ssh settings enabled, continue without SSH Tunnel
if (type == ConnectionSecondary || !connSettings->sshSettings()->enabled()) {
// When connection is SECONDARY or SSH not enabled or replica set,
// then continue without SSH Tunnel
if (type == ConnectionSecondary || !connSettings->sshSettings()->enabled()
|| connSettings->isReplicaSet()
) {
return continueOpenServer(_lastServerHandle, connSettings, type);
}
@@ -111,7 +115,7 @@ namespace Robomongo
{
SshSettings *ssh = connection->sshSettings();
if (ssh->enabled() && ssh->askPassword() &&
if (!connection->isReplicaSet() && ssh->enabled() && ssh->askPassword() &&
(type == ConnectionPrimary || type == ConnectionTest)) {
bool ok = false;
+31 -6
View File
@@ -565,13 +565,35 @@ namespace Robomongo
void MongoWorker::handle(ExecuteQueryRequest *event)
{
try {
boost::scoped_ptr<MongoClient> client(getClient());
auto const executeQuery = [&]() {
boost::scoped_ptr<MongoClient> client { getClient() };
std::vector<MongoDocumentPtr> docs = client->query(event->queryInfo());
client->done();
reply(event->sender(),
new ExecuteQueryResponse(this, event->resultIndex(), event->queryInfo(), docs)
);
};
reply(event->sender(), new ExecuteQueryResponse(this, event->resultIndex(), event->queryInfo(), docs));
try {
executeQuery();
} catch(const std::exception &ex) {
QString const NTORETURN_ERROR { "unrecognized field: 'ntoreturn'" };
bool const ntoreturnError {
QString(ex.what()).compare(NTORETURN_ERROR, Qt::CaseInsensitive) == 0
};
// If we have this DocumentDB specific error, try again
if (ntoreturnError && _dbclient) {
sendLog(this, LogEvent::RBM_ERROR, std::string(ex.what()));
try {
_dbclient->tagAsDocDb(true);
executeQuery();
return;
}
catch (const std::exception &ex) {
sendLog(this, LogEvent::RBM_ERROR, "Re-try: " + std::string(ex.what()));
}
}
reply(event->sender(), new ExecuteQueryResponse(this, EventError(ex.what())));
sendLog(this, LogEvent::RBM_ERROR, std::string(ex.what()));
}
@@ -582,9 +604,12 @@ namespace Robomongo
*/
void MongoWorker::handle(ExecuteScriptRequest *event)
{
try {
if (!_scriptEngine) {
auto const error { EventError("MongoDB Shell was not initialized") };
try {
if(!_scriptEngine ||
(_connSettings->isReplicaSet() && !_dbclientRepSet)) {
auto const error{
EventError("MongoDB Shell was not initialized or connection failure")
};
reply(event->sender(), new ExecuteScriptResponse(this, error));
return;
}
+20 -73
View File
@@ -75,6 +75,9 @@ namespace Robomongo
// be defined and placed into the vector initializer list below in order.
std::vector<QString> const SettingsManager::_configFilesOfOldVersions
{
QString("%1/.3T/robo-3t/1.4.3/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_4_3
QString("%1/.3T/robo-3t/1.4.2/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_4_2
QString("%1/.3T/robo-3t/1.4.1/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_4_1
QString("%1/.3T/robo-3t/1.4.0/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_4_0
QString("%1/.3T/robo-3t/1.3.1/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_3_1
QString("%1/.3T/robo-3t/1.3.0/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_3_0_BETA
@@ -90,9 +93,6 @@ namespace Robomongo
std::vector<ConnectionSettings*> SettingsManager::_connections;
// Temporarily disabling Recent Connections feature
// std::vector<RecentConnection> SettingsManager::_recentConnections;
/**
* Creates SettingsManager for config file in default location
* ~/.config/robomongo/robomongo.json
@@ -293,16 +293,6 @@ namespace Robomongo
addConnection(connSettings);
}
/* Temporarily disabling Recent Connections feature
// Load recent connections
_recentConnections.clear();
QVariantList const& rlist = map.value("recentConnections").toList();
for (auto const& rconn : rlist) {
_recentConnections.push_back(RecentConnection(rconn.toMap().value("uuid").toString(),
rconn.toMap().value("name").toString().toStdString()));
}
*/
_toolbars = map.value("toolbars").toMap();
ToolbarSettingsContainerType::const_iterator it = _toolbars.find("connect");
if (_toolbars.end() == it)
@@ -327,7 +317,7 @@ namespace Robomongo
_cacheData = map.value("cacheData").toMap();
// Load connection settings from previous versions of Robomongo
importConnections();
importFromOldVersion();
}
/**
@@ -393,19 +383,6 @@ namespace Robomongo
list.append(conn->toVariant().toMap());
map.insert("connections", list);
/* Temporarily disabling Recent Connections feature
// 13. Save recent connections
QVariantList recentConnsList;
QVariantMap recentConnMap;
for (auto const& rconn : _recentConnections) {
recentConnMap.insert("uuid", rconn.uuid);
recentConnMap.insert("name", QString::fromStdString(rconn.name));
recentConnsList.append(recentConnMap);
}
map.insert("recentConnections", recentConnsList);
*/
map.insert("autoExec", _autoExec);
map.insert("minimizeToTray", _minimizeToTray);
map.insert("toolbars", _toolbars);
@@ -509,34 +486,6 @@ namespace Robomongo
}
}
/* Temporarily disabling Recent Connections feature
void SettingsManager::addRecentConnection(ConnectionSettings *connection)
{
_recentConnections.push_back(RecentConnection(connection->uuid(), connection->connectionName()));
}
void SettingsManager::deleteRecentConnection(ConnectionSettings *conn)
{
for (int i = 0; i < _recentConnections.size(); ++i) {
if (_recentConnections[i].uuid == conn->uuid())
_recentConnections.erase(_recentConnections.begin() + i);
}
}
void SettingsManager::setRecentConnections(std::vector<ConnectionSettings const*> const& recentConns)
{
_recentConnections.clear();
for(auto rconn : recentConns)
_recentConnections.push_back(RecentConnection(rconn->uuid(), rconn->connectionName()));
}
void SettingsManager::clearRecentConnections()
{
_recentConnections.clear();
}
*/
ConnectionSettings* SettingsManager::getConnectionSettingsByUuid(QString const& uuid) const
{
for (auto const connSettings : _connections){
@@ -577,17 +526,16 @@ namespace Robomongo
_toolbars[toolbarName] = visible;
}
void SettingsManager::importConnections()
void SettingsManager::importFromOldVersion()
{
// Do not import if already imported
if (_imported)
return;
// Find and import 'only' from the latest version to current version
// Import only from the latest version
for (auto const& configFile : _configFilesOfOldVersions) {
if (QFile::exists(configFile)) {
importConnectionsFromOldVersion(configFile);
setImported(true); // Mark as imported
importFromFile(configFile);
setImported(true);
return;
}
}
@@ -702,7 +650,7 @@ namespace Robomongo
return true;
}
bool SettingsManager::importConnectionsFromOldVersion(QString const& oldConfigFilePath)
bool SettingsManager::importFromFile(QString const& oldConfigFilePath)
{
if (oldConfigFilePath == CONFIG_FILE_0_8_5) {
importConnectionsFrom_0_8_5();
@@ -722,14 +670,18 @@ namespace Robomongo
if (!ok)
return false;
QVariantList const& vconns = vmap.value("connections").toList();
for (auto const& vcon : vconns)
{
//// Import keys
_autoExpand = vmap.value("autoExpand").toBool();
_lineNumbers = vmap.value("lineNumbers").toBool();
_debugMode = vmap.value("debugMode").toBool();
_shellTimeoutSec = vmap.value("shellTimeoutSec").toInt();
//// Import connections
for (auto const& vcon : vmap.value("connections").toList()) {
QVariantMap const& vconn = vcon.toMap();
auto connSettings = new ConnectionSettings(false);
connSettings->fromVariant(vconn);
connSettings->setImported(true);
addConnection(connSettings);
}
@@ -737,14 +689,9 @@ namespace Robomongo
}
int SettingsManager::importedConnectionsCount() {
int count = 0;
for (std::vector<ConnectionSettings*>::const_iterator it = _connections.begin(); it != _connections.end(); ++it) {
ConnectionSettings *conn = *it;
if (conn->imported())
++count;
}
return count;
return (std::count_if(_connections.cbegin(), _connections.cend(),
[](auto conn) { return conn->imported(); }
));
}
QString extractAnonymousIDFromZip(QString const& zipFile, QString const& propfile)
+2 -37
View File
@@ -24,24 +24,6 @@ namespace Robomongo
// Current config file directory
auto const ConfigDir = QString("%1/.3T/robo-3t/%2/").arg(QDir::homePath())
.arg(PROJECT_VERSION);
/* Temporarily disabling Recent Connections feature
struct RecentConnection
{
RecentConnection(QString const& uuid, std::string const& name)
: uuid(uuid), name(name) {}
// Not directly used but required by std::vector<T>::erase()
RecentConnection& operator=(const RecentConnection& other)
{
uuid = other.uuid;
name = other.name;
return *this;
}
QString uuid;
std::string name;
};
*/
/* ----------------------------- SettingsManager ------------------------------ */
@@ -95,15 +77,6 @@ namespace Robomongo
*/
void removeConnection(ConnectionSettings *connection);
/**
* @brief Functions of Recent Connections feature
*/
/* Temporarily disabling Recent Connections feature
static void addRecentConnection(ConnectionSettings *connection);
static void deleteRecentConnection(ConnectionSettings *connection);
static void setRecentConnections(std::vector<ConnectionSettings const*> const& recentConns);
static void clearRecentConnections();
*/
/**
* @brief Finds and returns original (non-clone) connection settings which is
@@ -123,9 +96,6 @@ namespace Robomongo
*/
ConnectionSettingsContainerType connections() const { return _connections; }
// Temporarily disabling Recent Connections feature
// std::vector<RecentConnection>& recentConnections() const { return _recentConnections; }
ToolbarSettingsContainerType toolbars() const { return _toolbars; }
void setUuidEncoding(UUIDEncoding encoding) { _uuidEncoding = encoding; }
@@ -226,10 +196,10 @@ namespace Robomongo
/**
* Load connection settings from previous versions of Robomongo
*/
void importConnections();
void importFromOldVersion();
// Imports connections from oldConfigFilePath into current config file
static bool importConnectionsFromOldVersion(QString const& oldConfigFilePath);
bool importFromFile(QString const& oldConfigFilePath);
static bool importConnectionsFrom_0_8_5();
@@ -280,11 +250,6 @@ namespace Robomongo
*/
static std::vector<ConnectionSettings*> _connections;
/* Temporarily disabling Recent Connections feature
// List of recent connections that are shown on Welcome Tab
static std::vector<RecentConnection> _recentConnections;
*/
ToolbarSettingsContainerType _toolbars;
// List of config. file absolute paths of old versions
+3 -49
View File
@@ -129,7 +129,6 @@ namespace Robomongo
_connectionsMenu(nullptr), _connectButton(nullptr), _viewMenu(nullptr), _toolbarsMenu(nullptr),
_connectAction(nullptr), _openAction(nullptr), _saveAction(nullptr), _saveAsAction(nullptr),
_executeAction(nullptr), _stopAction(nullptr), _orientationAction(nullptr), _execToolBar(nullptr),
//_exportAction(nullptr), _importAction(nullptr), // Temporarily disabling export/import feature
#if defined(Q_OS_WIN)
_trayIcon(nullptr),
#endif
@@ -610,28 +609,6 @@ namespace Robomongo
VERIFY(connect(_execToolBar->toggleViewAction(), SIGNAL(triggered(bool)),
this, SLOT(onExecToolbarVisibilityChanged(bool))));
/* --- Temporarily disabling export/import feature
// Export/Import Toolbar
auto expImpToolBar = new QToolBar(tr("Export/Import Toolbar"), this);
expImpToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
expImpToolBar->setMovable(false);
// Add export action
_exportAction = new QAction(this);
_exportAction->setData("Export");
_exportAction->setIcon(GuiRegistry::instance().exportIcon());
_exportAction->setDisabled(true);
VERIFY(connect(_exportAction, SIGNAL(triggered()), this, SLOT(openExportDialog())));
addToolBar(expImpToolBar);
expImpToolBar->addAction(_exportAction);
// Add import action
_importAction = new QAction(this);
_importAction->setData("Import");
_importAction->setIcon(GuiRegistry::instance().importIcon());
_importAction->setDisabled(true);
addToolBar(expImpToolBar);
expImpToolBar->addAction(_importAction);
*/
createTabs();
createStatusBar();
setWindowTitle("Robo 3T - " + QString(PROJECT_VERSION_SHORT));
@@ -665,6 +642,8 @@ namespace Robomongo
VERIFY(connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdates())));
timer->start(ONE_HOUR);
}
setUnifiedTitleAndToolBarOnMac(false); // https://bugreports.qt.io/browse/QTBUG-68946
}
void MainWindow::createStylesMenu()
@@ -1061,18 +1040,6 @@ namespace Robomongo
_workArea->openWelcomeTab();
}
/* --- Temporarily disabling export/import feature
void MainWindow::openExportDialog()
{
auto selectedItem = dynamic_cast<ExplorerCollectionTreeItem*>(_explorer->getSelectedTreeItem());
auto dbName = QString::fromStdString(selectedItem->collection()->database()->name());
auto collName = QString::fromStdString(selectedItem->collection()->name());
auto dialog = new ExportDialog(dbName, collName, this);
dialog->show(); // show it mode-less so that user can perform multiple simultaneous exports
}
*/
void MainWindow::setDefaultUuidEncoding()
{
AppRegistry::instance().settingsManager()->setUuidEncoding(DefaultEncoding);
@@ -1390,19 +1357,6 @@ namespace Robomongo
AppRegistry::instance().settingsManager()->save();
}
/* --- Temporarily disabling export/import feature
void MainWindow::onExplorerItemSelected(QTreeWidgetItem *selectedItem)
{
auto collectionItem = dynamic_cast<ExplorerCollectionTreeItem*>(selectedItem);
if (collectionItem) {
_exportAction->setEnabled(true);
}
else {
_exportAction->setDisabled(true);
}
}
*/
void MainWindow::on_tabChange()
{
auto activeTab = dynamic_cast<QueryWidget*>(_workArea->currentWidget());
@@ -1500,4 +1454,4 @@ namespace Robomongo
_networkAccessManager->get(QNetworkRequest(url));
}
}
}
-14
View File
@@ -97,17 +97,10 @@ namespace Robomongo
void openPreferences();
void openWelcomeTab();
// Temporarily disabling export/import feature
//void openExportDialog();
void onConnectToolbarVisibilityChanged(bool isVisisble);
void onOpenSaveToolbarVisibilityChanged(bool isVisisble);
void onExecToolbarVisibilityChanged(bool isVisisble);
void onExplorerVisibilityChanged(bool isVisisble);
// Temporarily disabling export/import feature
//void onExplorerItemSelected(QTreeWidgetItem *selectedItem);
void on_tabChange();
void toggleMinimize();
@@ -162,13 +155,6 @@ namespace Robomongo
QNetworkAccessManager *_networkAccessManager;
// Temporarily disabling export/import feature
/*
// Export/import tool bar
QAction *_exportAction;
QAction *_importAction;
*/
#if defined(Q_OS_WIN)
QSystemTrayIcon *_trayIcon;
#endif
+9 -4
View File
@@ -14,16 +14,21 @@
#include "robomongo/core/utils/QtUtils.h"
namespace
{
{
auto const YEAR { QString::number(QDate::currentDate().year()) };
auto const MONTH { QString::number(QDate::currentDate().month()) };
const QString description {
"<h3>" PROJECT_NAME_TITLE " " PROJECT_VERSION " (Build " BUILD_NUMBER ")</h3>"
"<h3>" PROJECT_NAME_TITLE " " PROJECT_VERSION
" (Build " BUILD_NUMBER + QString(" - ") + MONTH + "/" + YEAR + ")</h3>"
"Shell-centric MongoDB management tool.<br/>"
"<a href=\"https://" PROJECT_GITHUB_ISSUES "\">Submit</a> issues/proposals on GitHub.<br/>"
"<br/>"
"<a href=\"https://" PROJECT_DOMAIN "\">" PROJECT_DOMAIN "</a> <br/>"
"Copyright 2014-" + QString::number(QDate::currentDate().year()) +
" <a href= " PROJECT_COMPANYNAME_DOMAIN " >" PROJECT_COMPANYNAME "</a>. All rights reserved.<br/>"
"Copyright 2014-" + YEAR +
" <a href= " PROJECT_COMPANYNAME_DOMAIN " >" PROJECT_COMPANYNAME
"</a>. All rights reserved.<br/>"
"<br/>"
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
@@ -11,7 +11,6 @@
#include "robomongo/core/settings/CredentialSettings.h"
#include "robomongo/core/utils/QtUtils.h"
#include "robomongo/gui/GuiRegistry.h"
#include "robomongo/gui/utils/GuiConstants.h"
namespace Robomongo
{
@@ -141,12 +140,28 @@ namespace Robomongo
_settings->addCredential(credential);
}
void ConnectionAuthTab::setAuthTab(QString const db, QString const username, QString const pwd)
{
void ConnectionAuthTab::setAuthTab(
QString const db,
QString const username,
QString const pwd,
AuthMechanism authMech
) {
_useAuth->setChecked(true);
_databaseName->setText(db);
_userName->setText(username);
_userPassword->setText(pwd);
_mechanismComboBox->setCurrentIndex(int(authMech));
}
void ConnectionAuthTab::clearTab()
{
_useAuth->setChecked(false);
_databaseName->clear();
_userName->clear();
_userPassword->clear();
_mechanismComboBox->setCurrentIndex(0);
_useManuallyVisibleDbs->setChecked(false);
_manuallyVisibleDbs->clear();
}
void ConnectionAuthTab::toggleEchoMode()
+10 -1
View File
@@ -1,6 +1,9 @@
#pragma once
#include <QWidget>
#include "robomongo/gui/utils/GuiConstants.h"
QT_BEGIN_NAMESPACE
class QLineEdit;
class QLabel;
@@ -20,7 +23,13 @@ namespace Robomongo
public:
ConnectionAuthTab(ConnectionSettings *settings);
void accept();
void setAuthTab(QString const db, QString const username, QString const pwd);
void setAuthTab(
QString const db,
QString const username,
QString const pwd,
AuthMechanism authMech
);
void clearTab();
private Q_SLOTS:
void toggleEchoMode();
@@ -34,7 +34,9 @@ namespace Robomongo
_connectionType->addItem(tr("Direct Connection"));
_connectionType->addItem(tr("Replica Set"));
_connectionType->setCurrentIndex(static_cast<int>(_settings->isReplicaSet()));
VERIFY(connect(_connectionType, SIGNAL(currentIndexChanged(int)), this, SLOT(on_ConnectionTypeChange(int))));
VERIFY(connect(_connectionType, SIGNAL(currentIndexChanged(int)),
this, SLOT(on_ConnectionTypeChange(int)))
);
_nameLabel = new QLabel("Name:");
_connectionName = new QLineEdit(QtUtils::toQString(_settings->connectionName()));
@@ -109,17 +111,17 @@ namespace Robomongo
auto hline = new QFrame();
hline->setFrameShape(QFrame::HLine);
hline->setFrameShadow(QFrame::Sunken);
_srvEdit = new QLineEdit();
_srvEdit->setPlaceholderText("Import connection details from MongoDB SRV connection string");
_srvButton = new QPushButton("From SRV");
_uriEdit = new QLineEdit();
_uriEdit->setPlaceholderText("Import connection details from MongoDB URI connection string");
_uriButton = new QPushButton("From URI");
#ifdef _WIN32
_srvButton->setMaximumHeight(HighDpiConstants::WIN_HIGH_DPI_BUTTON_HEIGHT);
_srvButton->setMinimumWidth(60);
_uriButton->setMaximumHeight(HighDpiConstants::WIN_HIGH_DPI_BUTTON_HEIGHT);
_uriButton->setMinimumWidth(60);
#else // MacOS
_srvButton->setMaximumHeight(HighDpiConstants::MACOS_HIGH_DPI_BUTTON_HEIGHT);
_srvButton->setMaximumWidth(90);
_uriButton->setMaximumHeight(HighDpiConstants::MACOS_HIGH_DPI_BUTTON_HEIGHT);
_uriButton->setMaximumWidth(90);
#endif
VERIFY(connect(_srvButton, SIGNAL(clicked()), this, SLOT(on_srvButton_clicked())));
VERIFY(connect(_uriButton, SIGNAL(clicked()), this, SLOT(on_uriButton_clicked())));
auto connLayout = new QGridLayout;
connLayout->setVerticalSpacing(8);
@@ -140,8 +142,8 @@ namespace Robomongo
connLayout->addWidget(_setNameEdit, 9, 1, 1, 3, Qt::AlignTop);
connLayout->addWidget(fakeSpacer, 10, 0);
connLayout->addWidget(hline, 11, 0, 1, 4);
connLayout->addWidget(_srvButton, 13, 0);
connLayout->addWidget(_srvEdit, 13, 1, 1, 3);
connLayout->addWidget(_uriButton, 13, 0);
connLayout->addWidget(_uriEdit, 13, 1, 1, 3);
connLayout->setRowStretch(10, 1);
#ifdef __APPLE__
@@ -223,9 +225,21 @@ namespace Robomongo
return true;
}
void ConnectionBasicTab::clearTab()
{
_connectionType->setCurrentIndex(0);
_connectionName->setText("New Connection");
_serverAddress->clear();
_serverPort->clear();
_members->clear();
_setNameEdit->clear();
}
void ConnectionBasicTab::on_ConnectionTypeChange(int index)
{
bool const isReplica = static_cast<bool>(index);
_connectionDialog->toggleSshSupport(isReplica);
// Replica set
_membersLabel->setVisible(isReplica);
@@ -314,38 +328,71 @@ namespace Robomongo
item->setText(0, str);
}
void ConnectionBasicTab::on_srvButton_clicked()
void ConnectionBasicTab::on_uriButton_clicked()
{
QString srvStr = _srvEdit->text().simplified();
srvStr.replace(" ", "");
auto const statusWithMongoURI = mongo::MongoURI::parse(srvStr.toStdString());
if (!statusWithMongoURI.isOK()) {
// Parse Mongo URI
QString uriStr = _uriEdit->text().simplified();
uriStr.replace(" ", "");
auto const statusWithURI = mongo::MongoURI::parse(uriStr.toStdString());
if (!statusWithURI.isOK()) {
QMessageBox errorBox;
errorBox.critical(this, "Error", ("MongoDB SRV:\n" + statusWithMongoURI.getStatus().toString()).c_str());
errorBox.critical(
this, "Error", ("MongoDB URI:\n" + statusWithURI.getStatus().toString()).c_str()
);
errorBox.show();
return;
}
auto const mongoUri = statusWithMongoURI.getValue();
auto const db = QString::fromStdString(mongoUri.getDatabase());
auto const mongoUri = statusWithURI.getValue();
// Clear tabs
clearTab();
_connectionDialog->clearConnAuthTab();
_connectionDialog->clearSslTab();
// Set Basic (this) Tab
auto const isReplicaSet = mongoUri.type() == mongo::ConnectionString::ConnectionType::SET;
if(isReplicaSet) {
_connectionType->setCurrentIndex(1); // Switch to Replica Set
for (auto const& hostAndPort : mongoUri.getServers()) {
auto host = QString::fromStdString(hostAndPort.host());
host.endsWith('.') ? host.remove(host.size()-1, 1) : "no-op";
auto const newHostAndPort = host + ':' + QString::number(hostAndPort.port());
auto item = new QTreeWidgetItem;
item->setText(0, newHostAndPort);
item->setFlags(item->flags() | Qt::ItemIsEditable);
_members->addTopLevelItem(item);
}
_setNameEdit->setText(QString::fromStdString(mongoUri.getSetName()));
}
else { // Standalone
_connectionType->setCurrentIndex(0);
_serverAddress->setText(QString::fromStdString(mongoUri.getServers()[0].host()));
_serverPort->setText(QString::number(mongoUri.getServers()[0].port()));
}
// Set Auth Tab
auto const user = QString::fromStdString(mongoUri.getUser());
auto const pwd = QString::fromStdString(mongoUri.getPassword());
auto const authDb = QString::fromStdString(mongoUri.getAuthenticationDatabase());
auto const authMechanism = mongoUri.getOption("authMechanism").get_value_or("");
if(!user.isEmpty()) _connectionDialog->setAuthTab(
authDb, user, pwd, authMechanismFromStr(authMechanism)
);
// Set SSL Tab
if(mongoUri.getSSLMode() == mongo::transport::ConnectSSLMode::kEnableSSL) {
auto tlsAllowInvalidCertificates = mongoUri.getOption("tlsAllowInvalidCertificates");
int const authMethodIndex = tlsAllowInvalidCertificates.get_value_or("") == "true" ? 0 : 1;
auto const caFile = mongoUri.getOption("tlsCAFile").get_value_or("");
auto const certKeyFile = mongoUri.getOption("tlsCertificateKeyFile").get_value_or("");
auto const certKeyFilePwd =
mongoUri.getOption("tlsCertificateKeyFilePassword").get_value_or("");
auto const allowInvalidHostnames =
mongoUri.getOption("tlsAllowInvalidHostnames").get_value_or("") == "true";
// Basic (this) Tab
_members->clear();
_connectionType->setCurrentIndex(1); // Switch to Replica Set
for (auto const& hostAndPort : mongoUri.getServers()) {
auto host = QString::fromStdString(hostAndPort.host());
host.endsWith('.') ? host.remove(host.size()-1, 1) : "no-op";
auto const newHostAndPort = host + ':' + QString::number(hostAndPort.port());
auto item = new QTreeWidgetItem;
item->setText(0, newHostAndPort);
item->setFlags(item->flags() | Qt::ItemIsEditable);
_members->addTopLevelItem(item);
_connectionDialog->setSslTab(
authMethodIndex, allowInvalidHostnames, caFile, certKeyFile, certKeyFilePwd
);
}
_setNameEdit->setText(QString::fromStdString(mongoUri.getSetName()));
_connectionDialog->setAuthTab(authDb, user, pwd); // Auth Tab
_connectionDialog->enableSslBasic(); // TLS Tab
_connectionDialog->setDefaultDb(db); // Advanced Tab
// Advanced Tab
_connectionDialog->setDefaultDb(QString::fromStdString(mongoUri.getDatabase()));
}
}
}
@@ -24,6 +24,7 @@ namespace Robomongo
public:
ConnectionBasicTab(ConnectionSettings *settings, ConnectionDialog *connectionDialog);
bool accept();
void clearTab();
private Q_SLOTS:
void on_ConnectionTypeChange(int index);
@@ -31,7 +32,7 @@ namespace Robomongo
void on_addButton_clicked();
void on_removeButton_clicked();
void on_replicaMemberItemEdit(QTreeWidgetItem* item, int column);
void on_srvButton_clicked();
void on_uriButton_clicked();
private:
QLabel *_typeLabel;
@@ -51,8 +52,8 @@ namespace Robomongo
QDialogButtonBox *_minusPlusButtonBox;
QLabel *_setNameLabel;
QLineEdit *_setNameEdit;
QLineEdit *_srvEdit;
QPushButton *_srvButton;
QLineEdit *_uriEdit;
QPushButton *_uriButton;
QPushButton *_discoverButton;
QLabel *_readPrefLabel;
QComboBox *_readPreference;
+36 -8
View File
@@ -99,14 +99,13 @@ namespace Robomongo
QWidget::closeEvent(event);
}
void ConnectionDialog::setAuthTab(QString const& db, QString const& username, QString const& pwd)
{
_authTab->setAuthTab(db, username, pwd);
}
void ConnectionDialog::enableSslBasic()
{
_sslTab->enableSslBasic();
void ConnectionDialog::setAuthTab(
QString const& db,
QString const& username,
QString const& pwd,
AuthMechanism authMech
) {
_authTab->setAuthTab(db, username, pwd, authMech);
}
void ConnectionDialog::setDefaultDb(QString const& defaultDb)
@@ -114,6 +113,35 @@ namespace Robomongo
_advancedTab->setDefaultDb(defaultDb);
}
void ConnectionDialog::toggleSshSupport(bool isReplicaSet)
{
if (!_sshTab)
return;
_sshTab->setDisabled(isReplicaSet);
_sshTab->toggleSshCheckboxToolTip(isReplicaSet);
}
void ConnectionDialog::clearConnAuthTab()
{
_authTab->clearTab();
}
void ConnectionDialog::clearSslTab()
{
_sslTab->clearTab();
}
void ConnectionDialog::setSslTab(
int index,
bool allowInvalidHostnames,
std::string_view caFile,
std::string_view certPemFile,
std::string_view certPemFilePwd
) {
_sslTab->setSslOptions(index, allowInvalidHostnames, caFile, certPemFile, certPemFilePwd);
}
void ConnectionDialog::restoreWindowSettings()
{
QSettings settings("3T", "Robomongo");
+24 -7
View File
@@ -3,6 +3,7 @@
#include <QDialog>
#include "robomongo/core/Core.h"
#include "robomongo/gui/utils/GuiConstants.h"
namespace Robomongo
{
@@ -12,6 +13,7 @@ namespace Robomongo
class ConnectionAdvancedTab;
class SSLTab;
class SshTunnelTab;
/**
* @brief This Dialog allows to edit single connection
*/
@@ -26,9 +28,24 @@ namespace Robomongo
ConnectionDialog(ConnectionSettings *connection, QWidget *parent = nullptr);
ConnectionSettings *const connection() const { return _connection; }
void setAuthTab(QString const& db, QString const& username, QString const& pwd);
void enableSslBasic();
void setAuthTab(
QString const& db,
QString const& username,
QString const& pwd,
AuthMechanism authMech
);
void setDefaultDb(QString const& defaultDb);
void toggleSshSupport(bool isReplicaSet);
void clearConnAuthTab();
void clearSslTab();
void setSslTab(
int index,
bool allowInvalidHostnames,
std::string_view caFile,
std::string_view certPemFile,
std::string_view certPemFilePwd
);
public Q_SLOTS:
/**
@@ -49,11 +66,11 @@ namespace Robomongo
void saveWindowSettings() const;
bool validateAndApply();
ConnectionAuthTab *_authTab;
ConnectionBasicTab *_basicTab;
ConnectionAdvancedTab *_advancedTab;
SshTunnelTab *_sshTab;
SSLTab *_sslTab;
ConnectionAuthTab *_authTab = nullptr;
ConnectionBasicTab *_basicTab = nullptr;
ConnectionAdvancedTab *_advancedTab = nullptr;
SshTunnelTab *_sshTab = nullptr;
SSLTab *_sslTab = nullptr;
#ifdef SSH_SUPPORT_ENABLED
SshTunnelTab *_sshTab;
+23 -24
View File
@@ -22,15 +22,17 @@
#include "robomongo/core/settings/CredentialSettings.h"
#include "robomongo/core/settings/SettingsManager.h"
#include "robomongo/core/utils/QtUtils.h"
#include "robomongo/gui/GuiRegistry.h"
#include "robomongo/gui/dialogs/ConnectionDialog.h"
#include "robomongo/gui/MainWindow.h"
#include "robomongo/gui/widgets/workarea/WelcomeTab.h"
#include "robomongo/utils/common.h"
namespace Robomongo
{
/* ------------------------ ConnectionListWidgetItem ------------------------ */
/**
* @brief Simple ListWidgetItem that has several convenience methods.
*/
@@ -80,13 +82,15 @@ namespace Robomongo
if (_connection->sslSettings()->sslEnabled())
setText(2, text(2) + (text(2).isEmpty() ? "TLS" : ", TLS"));
if (_connection->sshSettings()->enabled())
if (!_connection->isReplicaSet() && _connection->sshSettings()->enabled())
setText(2, text(2) + (text(2).isEmpty() ? "SSH" : ", SSH"));
// Header "Auth. Database/User" (column[3])
if (_connection->hasEnabledPrimaryCredential()) {
auto authString = QString("%1 / %2").arg(QtUtils::toQString(_connection->primaryCredential()->databaseName()))
.arg(QtUtils::toQString(_connection->primaryCredential()->userName()));
auto primaryCredential { _connection->primaryCredential() };
auto const authString =
QString("%1 / %2").arg(QtUtils::toQString(primaryCredential->databaseName()))
.arg(QtUtils::toQString(primaryCredential->userName()));
setText(3, authString + " ");
setIcon(3, GuiRegistry::instance().keyIcon());
}
@@ -101,6 +105,10 @@ namespace Robomongo
ConnectionSettings *_connection;
};
/* ------------------------ ConnectionsDialog ------------------------ */
/**
* @brief Creates dialog
*/
@@ -215,8 +223,7 @@ namespace Robomongo
_listWidget->setCurrentItem(_listWidget->topLevelItem(_listWidget->topLevelItemCount()-1));
_listWidget->setFocus();
restoreWindowSettings();
resize(getSetting("ConnectionsDialog/size").toSize());
}
/**
@@ -231,21 +238,18 @@ namespace Robomongo
return;
_selectedConnection = currentItem->connection();
saveWindowSettings();
QDialog::accept();
}
void ConnectionsDialog::reject()
{
saveWindowSettings();
QDialog::reject();
}
void ConnectionsDialog::closeEvent(QCloseEvent *event)
ConnectionsDialog::~ConnectionsDialog()
{
saveWindowSettings();
QWidget::closeEvent(event);
saveSetting("ConnectionsDialog/size", size());
}
void ConnectionsDialog::linkActivated(const QString &link)
@@ -446,18 +450,6 @@ namespace Robomongo
QDialog::keyPressEvent(event);
}
void ConnectionsDialog::restoreWindowSettings()
{
QSettings settings("3T", "Robomongo");
resize(settings.value("ConnectionsDialog/size").toSize());
}
void ConnectionsDialog::saveWindowSettings() const
{
QSettings settings("3T", "Robomongo");
settings.setValue("ConnectionsDialog/size", size());
}
ConnectionsTreeWidget::ConnectionsTreeWidget()
{
setDragDropMode(QAbstractItemView::InternalMove);
@@ -468,7 +460,14 @@ namespace Robomongo
void ConnectionsTreeWidget::dropEvent(QDropEvent *event)
{
#ifdef __APPLE__
if(_dragDropCount > 0)
return;
#endif
QTreeWidget::dropEvent(event);
emit layoutChanged();
#ifdef __APPLE__
++_dragDropCount;
#endif
}
}
}
+11 -21
View File
@@ -20,10 +20,9 @@ namespace Robomongo
public:
typedef std::vector<ConnectionListWidgetItem *> ConnectionListItemContainerType;
/**
* @brief Creates dialog
*/
ConnectionsDialog(SettingsManager *manager, bool checkForImported, QWidget *parent = 0);
~ConnectionsDialog();
/**
* @brief ConnectionSettings, that was selected after pressing on
@@ -46,12 +45,6 @@ namespace Robomongo
* @brief Add connection to the list widget
*/
void add(ConnectionSettings *connection);
protected:
/**
* @brief Reimplementing closeEvent in order to do some pre-close actions.
*/
void closeEvent(QCloseEvent *event) override;
private Q_SLOTS:
void linkActivated(const QString &link);
@@ -87,17 +80,6 @@ namespace Robomongo
void keyPressEvent(QKeyEvent* event) override;
private:
/**
* @brief Restore window settings from system registry
*/
void restoreWindowSettings();
/**
* @brief Save windows settings into system registry
*/
void saveWindowSettings() const;
/**
* @brief ConnectionSettings, that was selected after pressing on
* "Connect" button
@@ -134,5 +116,13 @@ namespace Robomongo
protected:
void dropEvent(QDropEvent *event);
#ifdef __APPLE__
// macOS: Set one re-order limit per new connections window.
// Workaround for Qt bug came in Qt 5.12.8.
// https://github.com/Studio3T/robomongo/issues/1790
private:
int _dragDropCount = 0;
#endif
};
}
}
+13 -10
View File
@@ -35,9 +35,9 @@ namespace Robomongo
_settings(settings)
{
SshSettings *info = settings->sshSettings();
_sshSupport = new QCheckBox("Use SSH tunnel");
_sshSupport->setStyleSheet("margin-bottom: 7px");
_sshSupport->setChecked(info->enabled());
_useSsh = new QCheckBox("Use SSH tunnel");
_useSsh->setStyleSheet("margin-bottom: 7px");
_useSsh->setChecked(info->enabled());
_askForPassword = new QCheckBox(askPasswordText);
_askForPassword->setChecked(info->askPassword());
@@ -129,7 +129,7 @@ namespace Robomongo
connectionLayout->addWidget(_askForPassword, 9, 1, 1, 2);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(_sshSupport);
mainLayout->addWidget(_useSsh);
mainLayout->addLayout(connectionLayout);
setLayout(mainLayout);
@@ -142,8 +142,8 @@ namespace Robomongo
securityChange(_security->currentText());
VERIFY(connect(_selectPrivateFileButton, SIGNAL(clicked()), this, SLOT(setPrivateFile())));
sshSupportStateChange(_sshSupport->checkState());
VERIFY(connect(_sshSupport, SIGNAL(stateChanged(int)), this, SLOT(sshSupportStateChange(int))));
sshSupportStateChange(_useSsh->checkState());
VERIFY(connect(_useSsh, SIGNAL(stateChanged(int)), this, SLOT(sshSupportStateChange(int))));
_sshHostName->setFocus();
@@ -161,11 +161,14 @@ namespace Robomongo
_selectPrivateFileButton->setMaximumHeight(HighDpiConstants::WIN_HIGH_DPI_BUTTON_HEIGHT);
#endif
setDisabled(_settings->isReplicaSet());
toggleSshCheckboxToolTip(_settings->isReplicaSet());
}
bool SshTunnelTab::sshEnabled() const
void SshTunnelTab::toggleSshCheckboxToolTip(bool isReplicaSet)
{
return _sshSupport->isChecked();
_useSsh->setToolTip(!isReplicaSet ? "" :
"SSH is currently not supported for Replica Set connections");
}
void SshTunnelTab::setPasswordFieldsEnabled(bool enabled)
@@ -186,7 +189,7 @@ namespace Robomongo
_passwordBox->setText("");
}
setPasswordFieldsEnabled(!checked && _sshSupport->isChecked());
setPasswordFieldsEnabled(!checked && _useSsh->isChecked());
}
void SshTunnelTab::sshSupportStateChange(int state)
@@ -261,7 +264,7 @@ namespace Robomongo
bool SshTunnelTab::accept()
{
bool sshEnabled = _sshSupport->isChecked();
bool const sshEnabled = this->isEnabled() && _useSsh->isChecked();
QString authMethod = _security->currentText() == "Private Key" ? "publickey" : "password";
// Check for existence of the private key file name
+2 -6
View File
@@ -24,11 +24,7 @@ namespace Robomongo
public:
SshTunnelTab(ConnectionSettings *settings);
bool accept();
/**
* @return true if use SSH checkbox is checked, false otherwise
*/
bool sshEnabled() const;
void toggleSshCheckboxToolTip(bool isReplicaSet);
private Q_SLOTS:
void sshSupportStateChange(int checked);
@@ -42,7 +38,7 @@ namespace Robomongo
void setPasswordFieldsEnabled(bool enabled);
private:
QCheckBox *_sshSupport;
QCheckBox *_useSsh;
QCheckBox *_askForPassword;
QLineEdit *_sshHostName;
QLineEdit *_userName;
+27 -4
View File
@@ -207,10 +207,34 @@ namespace Robomongo
return _useSslCheckBox->isChecked();
}
void SSLTab::enableSslBasic()
void SSLTab::clearTab()
{
_authMethodComboBox->setCurrentIndex(1);
_caFilePathLineEdit->clear();
_usePemFileCheckBox->setChecked(false);
_pemFilePathLineEdit->clear();
_pemPassLineEdit->clear();
_useAdvancedOptionsCheckBox->setChecked(false);
_allowInvalidHostnamesComboBox->setCurrentIndex(0);
}
void SSLTab::setSslOptions(
int index,
bool allowInvalidHostnames,
std::string_view caFile,
std::string_view certPemFile,
std::string_view certPemFilePwd
) {
_useSslCheckBox->setChecked(true);
_authMethodComboBox->setCurrentIndex(0);
_authMethodComboBox->setCurrentIndex(index);
_caFilePathLineEdit->setText(QString::fromStdString(std::string(caFile)));
if(!certPemFile.empty()) _usePemFileCheckBox->setChecked(true);
_pemFilePathLineEdit->setText(QString::fromStdString(std::string(certPemFile)));
_pemPassLineEdit->setText(QString::fromStdString(std::string(certPemFilePwd)));
if (allowInvalidHostnames) _useAdvancedOptionsCheckBox->setChecked(true);
_allowInvalidHostnamesComboBox->setCurrentIndex(allowInvalidHostnames);
}
void SSLTab::useSslCheckBoxStateChange(int state)
@@ -399,5 +423,4 @@ namespace Robomongo
return QDir::toNativeSeparators(fileName);
}
}
}
+8 -1
View File
@@ -39,7 +39,14 @@ namespace Robomongo
*/
bool sslEnabled() const;
void enableSslBasic();
void clearTab();
void setSslOptions(
int index,
bool allowInvalidHostnames,
std::string_view caFile,
std::string_view certPemFile,
std::string_view certPemFilePwd
);
private Q_SLOTS :
+14 -1
View File
@@ -8,4 +8,17 @@ namespace Robomongo
int const MACOS_HIGH_DPI_BUTTON_HEIGHT = 34;
}
} /* end of Robomongo namespace */
enum AuthMechanism {
SCRAM_SHA_1,
SCRAM_SHA_256,
MONGODB_CR
};
inline AuthMechanism authMechanismFromStr(std::string_view str) {
if (str == "SCRAM-SHA-1") return SCRAM_SHA_1;
else if (str == "SCRAM-SHA-256") return SCRAM_SHA_256;
else if (str == "MONGODB-CR") return MONGODB_CR;
else return SCRAM_SHA_1;
}
} /* end of Robomongo namespace */
@@ -8,7 +8,6 @@
#include "robomongo/core/AppRegistry.h"
#include "robomongo/core/domain/App.h"
#include "robomongo/core/utils/QtUtils.h"
#include "robomongo/gui/MainWindow.h"
#include "robomongo/gui/widgets/explorer/ExplorerTreeWidget.h"
#include "robomongo/gui/widgets/explorer/ExplorerServerTreeItem.h"
@@ -18,6 +17,7 @@
#include "robomongo/gui/widgets/explorer/ExplorerReplicaSetTreeItem.h"
#include "robomongo/gui/widgets/explorer/ExplorerReplicaSetFolderItem.h"
#include "robomongo/gui/widgets/explorer/ExplorerUserTreeItem.h"
#include "robomongo/utils/common.h"
namespace Robomongo
{
@@ -35,10 +35,6 @@ namespace Robomongo
VERIFY(connect(_treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),
this, SLOT(ui_itemDoubleClicked(QTreeWidgetItem *, int))));
// Temporarily disabling export/import feature
//VERIFY(connect(_treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
// parentMainWindow, SLOT(onExplorerItemSelected(QTreeWidgetItem *))));
setLayout(vlaout);
QMovie *movie = new QMovie(":robomongo/icons/loading.gif", QByteArray(), this);
@@ -48,6 +44,11 @@ namespace Robomongo
movie->start();
}
ExplorerWidget::~ExplorerWidget()
{
saveSetting("ExplorerWidget/size", size());
}
QTreeWidgetItem* ExplorerWidget::getSelectedTreeItem() const
{
return _treeWidget->currentItem();
@@ -79,6 +80,15 @@ namespace Robomongo
BaseClass::keyPressEvent(event);
}
QSize ExplorerWidget::sizeHint() const
{
auto size { getSetting("ExplorerWidget/size").toSize() };
if(QSize(-1, -1) == size)
size = QSize(180, -1);
return(size);
}
void ExplorerWidget::increaseProgress()
{
++_progress;
@@ -23,6 +23,8 @@ namespace Robomongo
public:
typedef QWidget BaseClass;
ExplorerWidget(MainWindow *parent);
~ExplorerWidget();
QTreeWidgetItem* getSelectedTreeItem() const;
protected Q_SLOTS:
@@ -34,9 +36,11 @@ namespace Robomongo
void ui_itemDoubleClicked(QTreeWidgetItem *item, int column);
protected:
virtual void keyPressEvent(QKeyEvent *event);
void keyPressEvent(QKeyEvent *event) override;
private:
QSize sizeHint() const override;
int _progress;
void increaseProgress();
void decreaseProgress();
@@ -17,8 +17,7 @@
namespace Robomongo
{
OutputWidget::OutputWidget(QWidget *parent) :
QTabWidget(parent),
_splitter(new QSplitter)
QTabWidget(parent), _splitter(new QSplitter), _tabbedResults(false)
{
_splitter->setOrientation(Qt::Vertical);
_splitter->setHandleWidth(1);
@@ -51,8 +50,8 @@ namespace Robomongo
int const RESULTS_SIZE = _prevResultsCount = results.size();
bool const multipleResults = (RESULTS_SIZE > 1);
bool const tabbedResults = (RESULTS_SIZE > 2);
_splitter->setHidden(tabbedResults ? true : false);
_tabbedResults = (RESULTS_SIZE > 2);
_splitter->setHidden(_tabbedResults ? true : false);
_outputItemContentWidgets.clear();
while (count() > 0)
@@ -74,17 +73,17 @@ namespace Robomongo
if (shellResult.documents().size() > 0) {
item = new OutputItemContentWidget(viewMode, shell, QtUtils::toQString(shellResult.type()),
shellResult.documents(), shellResult.queryInfo(), secs,
multipleResults, tabbedResults, firstItem, lastItem,
multipleResults, _tabbedResults, firstItem, lastItem,
shellResult.aggrInfo(), this);
} else {
item = new OutputItemContentWidget(viewMode, shell, QtUtils::toQString(shellResult.response()),
secs, multipleResults, tabbedResults, firstItem, lastItem,
secs, multipleResults, _tabbedResults, firstItem, lastItem,
shellResult.aggrInfo(), this);
}
VERIFY(connect(item, SIGNAL(maximizedPart()), this, SLOT(maximizePart())));
VERIFY(connect(item, SIGNAL(restoredSize()), this, SLOT(restoreSize())));
if (tabbedResults) {
if (_tabbedResults) {
addTab(item, QString::fromStdString(shellResult.statementShort()));
setTabToolTip(i, QString::fromStdString(shellResult.statement()));
}
@@ -100,10 +99,15 @@ namespace Robomongo
void OutputWidget::updatePart(int partIndex, const MongoQueryInfo &queryInfo,
const std::vector<MongoDocumentPtr> &documents)
{
if (partIndex >= _splitter->count())
if (!_tabbedResults && partIndex >= _splitter->count())
return;
auto outputItemContentWidget = qobject_cast<OutputItemContentWidget*>(_splitter->widget(partIndex));
OutputItemContentWidget* outputItemContentWidget = nullptr;
if(_tabbedResults)
outputItemContentWidget = qobject_cast<OutputItemContentWidget*>(currentWidget());
else
outputItemContentWidget = qobject_cast<OutputItemContentWidget*>(_splitter->widget(partIndex));
outputItemContentWidget->updateWithInfo(queryInfo, documents);
outputItemContentWidget->refreshOutputItem();
}
@@ -132,40 +136,40 @@ namespace Robomongo
}
}
void OutputWidget::enterTreeMode()
void OutputWidget::switchMode(
std::function<void(OutputItemContentWidget*)> modeFunc
)
{
int count = _splitter->count();
for (int i = 0; i < count; i++) {
OutputItemContentWidget *widget = (OutputItemContentWidget *) _splitter->widget(i);
widget->showTree();
if (_tabbedResults) {
QWidget* currentTab { widget(currentIndex()) };
modeFunc(qobject_cast<OutputItemContentWidget*>(currentTab));
}
else {
for (int i = 0; i < _splitter->count(); i++) {
QWidget* widget { _splitter->widget(i) };
modeFunc(qobject_cast<OutputItemContentWidget*>(widget));
}
}
}
void OutputWidget::enterTextMode()
void OutputWidget::enterTreeMode()
{
int count = _splitter->count();
for (int i = 0; i < count; i++) {
OutputItemContentWidget *widget = (OutputItemContentWidget *) _splitter->widget(i);
widget->showText();
}
switchMode(&OutputItemContentWidget::showTree);
}
void OutputWidget::enterTextMode()
{
switchMode(&OutputItemContentWidget::showText);
}
void OutputWidget::enterTableMode()
{
int count = _splitter->count();
for (int i = 0; i < count; i++) {
OutputItemContentWidget *widget = (OutputItemContentWidget *) _splitter->widget(i);
widget->showTable();
}
switchMode(&OutputItemContentWidget::showTable);
}
void OutputWidget::enterCustomMode()
{
int count = _splitter->count();
for (int i = 0; i < count; i++) {
OutputItemContentWidget *widget = (OutputItemContentWidget *) _splitter->widget(i);
widget->showCustom();
}
switchMode(&OutputItemContentWidget::showCustom);
}
void OutputWidget::maximizePart()
@@ -28,6 +28,7 @@ namespace Robomongo
const std::vector<MongoDocumentPtr> &documents);
void toggleOrientation();
void switchMode(std::function<void(OutputItemContentWidget*)> modeFunc);
void enterTreeMode();
void enterTextMode();
void enterTableMode();
@@ -46,11 +47,14 @@ namespace Robomongo
void restoreSize();
void maximizePart();
void tabCloseRequested(int);
private:
void mouseReleaseEvent(QMouseEvent *event);
void clearAllParts();
QString buildStyleSheet();
void tryToMakeAllPartsEqualInSize();
bool _tabbedResults;
std::vector<ViewMode> _prevViewModes;
int _prevResultsCount;
QSplitter *_splitter;
@@ -259,7 +259,8 @@ namespace Robomongo
return;
}
_viewer->updatePart(event->resultIndex(), event->queryInfo(), event->documents()); // this should be in viewer, subscribed to ScriptExecutedEvent
// this should be in viewer, subscribed to ScriptExecutedEvent
_viewer->updatePart(event->resultIndex(), event->queryInfo(), event->documents());
}
void QueryWidget::handle(ScriptExecutedEvent *event)
+45 -320
View File
@@ -1,5 +1,48 @@
#include "robomongo/gui/widgets/workarea/WelcomeTab.h"
#ifndef __linux__ // --------------------- Windows, macOS impl --------------------------//
#include <QtWebEngineWidgets>
#include <QDesktopServices>
namespace Robomongo {
// ------------------ WelcomeTab
WelcomeTab::WelcomeTab(QScrollArea *parent) :
QWidget(parent), _parent(parent)
{
auto webView = new QWebEngineView(this);
QUrl const URL {
"http://files.studio3t.com/rm-feed_3t_io/1.4.3/index.html"
};
webView->setPage(new MyWebPage(this));
webView->page()->setUrl(URL);
webView->setContextMenuPolicy(Qt::NoContextMenu);
webView->page()->triggerAction(QWebEnginePage::WebAction::ReloadAndBypassCache);
webView->page()->profile()->setHttpCacheType(QWebEngineProfile::HttpCacheType::NoCache);
auto mainLayout = new QHBoxLayout;
mainLayout->setContentsMargins(-10, -10, -1, -1);
mainLayout->setSizeConstraint(QLayout::SetMinimumSize);
mainLayout->addWidget(webView);
setLayout(mainLayout);
}
// ------------------ MyWebPage
bool MyWebPage::acceptNavigationRequest(
QUrl const& url, NavigationType type, bool /*isMainFrame*/)
{
if (NavigationTypeLinkClicked == type) {
QDesktopServices::openUrl(url);
return false;
}
return true;
}
}
#else // -------------------------------- Linux impl. ------------------------------------//
#include <QObject>
#include <QPushButton>
#include <QApplication>
@@ -67,28 +110,6 @@ namespace Robomongo
: QLabel(args) {}
};
/* Temporarily disabling Recent Connections feature
// todo: brief: Special button to use on the right side of a recent connection label
struct CustomDeleteButton : public QPushButton
{
// todo: use ctor. instead of two funcs.
void setLabelOnLeft(QLabel* lab) { label = lab; }
void setParentLayout(QLayout* lay) { parentLayout = lay; }
QLabel* label = nullptr;
QLayout* parentLayout = nullptr;
};
// todo: brief
std::once_flag onceFlag1;
int CustomButtonHeight = -1;
QString const Recent_Connections_Header = "<p><h1><font color=\"#2d862d\">Recent Connections</h1></p>";
QString const connLabelTemplate = "<p><a style='font-size:14px; color: #106CD6; text-decoration: none;'"
"href='%1'>%2</a></p>";
*/
QString const WhatsNew = "<p><h1><font color=\"#2d862d\">%1</h1></p>";
QString const BlogsHeader = "<p><h1><font color=\"#2d862d\">Blog Posts</h1></p>";
QString const BlogLinkTemplate = "<a style = 'color: #106CD6; text-decoration: none;'"
@@ -126,56 +147,6 @@ namespace Robomongo
_text1_URL = "https://files.studio3t.com/rm-feed_3t_io/" + CONTENTS_PATH;
_rss_URL = "https://blog.robomongo.org/rss/";
/* Temporarily disabling Recent Connections feature
AppRegistry::instance().bus()->subscribe(this, ConnectionEstablishedEvent::Type);
_recentConnsLay = new QVBoxLayout;
auto recentConnHeader = new QLabel(Recent_Connections_Header);
//recentConnHeader->setMinimumWidth(_parent->width()*0.6);
auto _connectButton = new QToolButton;
_connectButton->setText("Connect");
_connectButton->setIcon(GuiRegistry::instance().connectIcon().pixmap(16, 16));
_connectButton->setFocusPolicy(Qt::NoFocus);
_connectButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
MainWindow* mainWindow;
for (auto wid : QApplication::topLevelWidgets()) {
if (qobject_cast<MainWindow*>(wid)) {
mainWindow = qobject_cast<MainWindow*>(wid);
break;
}
}
VERIFY(connect(_connectButton, SIGNAL(clicked()), mainWindow, SLOT(manageConnections())));
auto connectButtonMenu = new QMenu;
auto action = new QAction("Clear Recent Connections", this);
action->setIcon(GuiRegistry::instance().deleteIconRed().pixmap(14, 14));
VERIFY(connect(action, SIGNAL(triggered()), this, SLOT(on_clearButton_clicked())));
connectButtonMenu->addAction(action);
#if !defined(Q_OS_MAC)
_connectButton->setMenu(connectButtonMenu);
_connectButton->setPopupMode(QToolButton::MenuButtonPopup);
#endif
// Load and add recent connections from settings
auto const settingsManager = AppRegistry::instance().settingsManager();
auto const& recentConnections = settingsManager->recentConnections();
if (recentConnections.size() < 1)
action->setDisabled(true);
else {
for (auto const& rconn : recentConnections)
// check nullptr for settingsManager->getConnectionSettingsByUuid()
addRecentConnectionItem(settingsManager->getConnectionSettingsByUuid(rconn.uuid), false);
}
auto connectButtonLay = new QHBoxLayout;
connectButtonLay->addWidget(_connectButton);
connectButtonLay->addStretch();
*/
#ifdef __APPLE__
constexpr int HEADER_POINT_SIZE = 10;
#else
@@ -244,14 +215,6 @@ namespace Robomongo
rightLayout->addStretch();
auto leftLayout = new QVBoxLayout;
/* Temporarily disabling Recent Connections feature
leftLayout->addWidget(recentConnHeader, 0, Qt::AlignTop);
leftLayout->addLayout(_recentConnsLay);
leftLayout->addSpacing(10);
leftLayout->addLayout(connectButtonLay);
//leftLayout->addStretch();
leftLayout->addSpacing(20);
*/
leftLayout->addWidget(_whatsNewHeader, 0, Qt::AlignTop);
leftLayout->addWidget(_pic1, 0, Qt::AlignTop);
leftLayout->addWidget(_whatsNewText, 0, Qt::AlignTop);
@@ -481,204 +444,6 @@ namespace Robomongo
adjustSize();
}
/* Temporarily disabling Recent Connections feature
void WelcomeTab::on_clearButton_clicked()
{
// Ask user
int const answer = QMessageBox::question(this,
"Clear Recent Connections", "This will delete all recent connections, are you sure?",
QMessageBox::Yes, QMessageBox::No, QMessageBox::NoButton);
if (answer != QMessageBox::Yes)
return;
// Delete all recent connection entries
while (auto hlay = dynamic_cast<QHBoxLayout*>(_recentConnsLay->takeAt(0))) {
while (auto item = hlay->takeAt(0))
delete item->widget();
delete hlay;
}
// todo: disable clear all action
_parent->verticalScrollBar()->setValue(0);
// Clear recent connections in config. file
AppRegistry::instance().settingsManager()->clearRecentConnections();
AppRegistry::instance().settingsManager()->save();
}
void WelcomeTab::on_deleteButton_clicked()
{
//// Ask user
//int const answer = QMessageBox::question(this,
// "Delete Recent Connection", "This will delete this recent connection link, are you sure?",
// QMessageBox::Yes, QMessageBox::No, QMessageBox::NoButton);
//if (answer != QMessageBox::Yes)
// return;
auto button = dynamic_cast<CustomDeleteButton*>(sender());
if (!button)
return;
// Remove label and button from UI
_recentConnsLay->removeItem(button->parentLayout);
delete button->label;
delete button;
// todo: Refactor for clear all action
//// Disable "clear all" button conditionally
//if (_recentConnsLay->count() == 0) {
// _clearButton->setDisabled(true);
// _clearButton->setFocus();
// _clearButton->setStyleSheet("");
// _parent->verticalScrollBar()->setValue(0);
//}
// todo: Clear and rebuild recent connections vector and save into config. file
auto const settingsManager = AppRegistry::instance().settingsManager();
_recentConnections.clear();
for (int i = 0; i < _recentConnsLay->count(); ++i) {
auto hlay = dynamic_cast<QHBoxLayout*>(_recentConnsLay->itemAt(i));
for (int i = 0; i < hlay->count(); ++i) {
auto label = dynamic_cast<QLabel*>(hlay->itemAt(i)->widget());
if (label) {
// todo: "href='uuid'>%2</a></p>");
auto const uuid = label->text().split("href='")[1].split("'")[0];
// check nullptr for settingsManager->getConnectionSettingsByUuid()
_recentConnections.push_back(settingsManager->getConnectionSettingsByUuid(uuid));
}
}
}
settingsManager->setRecentConnections(_recentConnections);
settingsManager->save();
}
void WelcomeTab::on_recentConnectionLinkClicked(QString const& link)
{
for (auto const conn : AppRegistry::instance().settingsManager()->connections()) {
if (conn->uuid() == link) {
AppRegistry::instance().app()->openServer(conn, ConnectionPrimary);
return;
}
}
}
void WelcomeTab::handle(ConnectionEstablishedEvent *event)
{
// Do not make UI changes for non PRIMARY connections
if (event->connectionType != ConnectionPrimary)
return;
auto const settingsManager = AppRegistry::instance().settingsManager();
// check nullptr for settingsManager->getConnectionSettingsByUuid()
auto conn = settingsManager->getConnectionSettingsByUuid(event->connInfo._uuid);
if (!conn)
return;
// Remove duplicate label and it's button
for (int i = 0; i < _recentConnsLay->count(); ++i) {
auto hlay = dynamic_cast<QHBoxLayout*>(_recentConnsLay->itemAt(i));
for (int i = 0; i < hlay->count(); ++i) {
auto label = dynamic_cast<QLabel*>(hlay->itemAt(i)->widget());
if (label) {
// todo: "href='uuid'>%2</a></p>");
auto const uuid = label->text().split("href='")[1].split("'")[0];
if (uuid == conn->uuid()) {
while (auto item = hlay->takeAt(0)) // delete label and button
delete item->widget();
_recentConnsLay->removeItem(hlay);
}
}
}
}
addRecentConnectionItem(conn, true);
// todo: Clear and rebuild recent connections vector and save into config. file
_recentConnections.clear();
for (int i = 0; i < _recentConnsLay->count(); ++i) {
auto hlay = dynamic_cast<QHBoxLayout*>(_recentConnsLay->itemAt(i));
for (int i = 0; i < hlay->count(); ++i) {
auto label = dynamic_cast<QLabel*>(hlay->itemAt(i)->widget());
if (label) {
// todo: "href='uuid'>%2</a></p>");
auto const uuid = label->text().split("href='")[1].split("'")[0];
// check nullptr for settingsManager->getConnectionSettingsByUuid()
_recentConnections.push_back(settingsManager->getConnectionSettingsByUuid(uuid));
}
}
}
settingsManager->setRecentConnections(_recentConnections);
settingsManager->save();
}
void WelcomeTab::addRecentConnectionItem(ConnectionSettings const* conn, bool insertTop)
{
if (!conn)
return;
auto connLabel = new QLabel(connLabelTemplate.arg(conn->uuid(),
QString::fromStdString(conn->connectionName() + " (" + conn->hostAndPort().toString() + ')')));
connLabel->setMouseTracking(true);
connLabel->setAttribute(Qt::WA_Hover);
connLabel->installEventFilter(this);
VERIFY(connect(connLabel, SIGNAL(linkActivated(QString)), this, SLOT(on_recentConnectionLinkClicked(QString))));
auto button = new CustomDeleteButton;
std::call_once(onceFlag1, [&]{ CustomButtonHeight = button->iconSize().height()*0.7; });
button->setStyleSheet("border: none;");
button->installEventFilter(this);
VERIFY(connect(button, SIGNAL(clicked()), this, SLOT(on_deleteButton_clicked())));
connLabel->setBuddy(button);
button->setLabelOnLeft(connLabel);
auto hlay = new QHBoxLayout;
hlay->addWidget(connLabel);
hlay->addWidget(button);
hlay->setAlignment(Qt::AlignLeft);
hlay->setSpacing(0);
button->setParentLayout(hlay);
if (insertTop)
_recentConnsLay->insertLayout(0, hlay);
else
_recentConnsLay->addLayout(hlay);
// todo: refactor for clear all action
//_clearButton->setEnabled(true);
//_clearButton->setStyleSheet("color: #106CD6");
}
void WelcomeTab::removeRecentConnectionItem(ConnectionSettings const* conn)
{
// todo: to func.
for (int i = 0; i < _recentConnsLay->count(); ++i) {
auto hlay = dynamic_cast<QHBoxLayout*>(_recentConnsLay->itemAt(i));
for (int i = 0; i < hlay->count(); ++i) {
auto label = dynamic_cast<QLabel*>(hlay->itemAt(i)->widget());
if (label) {
// todo: "href='uuid'>%2</a></p>");
auto const uuid = label->text().split("href='")[1].split("'")[0];
if (uuid == conn->uuid()) {
// Remove label & button and their hlayout from UI
while (auto item = hlay->takeAt(0)) // delete label and button
delete item->widget();
_recentConnsLay->removeItem(hlay);
}
}
}
}
}
*/
void WelcomeTab::resize()
{
auto const tabWidth = _parent->width();
@@ -703,30 +468,7 @@ namespace Robomongo
bool WelcomeTab::eventFilter(QObject *target, QEvent *event)
{
/* Temporarily disabling Recent Connections feature
auto label = qobject_cast<QLabel*>(target); // todo: recentConnLabel
*/
auto blogLinkLabel = dynamic_cast<BlogLinkLabel*>(target);
/* Temporarily disabling Recent Connections feature
if (label && !blogLinkLabel) {
auto but = qobject_cast<QPushButton*>(label->buddy());
if (event->type() == QEvent::HoverEnter) {
label->setText(label->text().replace("text-decoration: none;", "text-decoration: ;"));
setCursor(Qt::PointingHandCursor);
but->setIcon(GuiRegistry::instance().deleteIcon());
but->setIconSize(QSize(but->iconSize().width(), CustomButtonHeight));
return true;
}
else if (event->type() == QEvent::HoverLeave) {
label->setText(label->text().replace("text-decoration: ;", "text-decoration: none;"));
setCursor(Qt::ArrowCursor);
but->setIcon(QIcon(""));
return true;
}
}
*/
// Make blog link underlined on mouse hover
if (blogLinkLabel) {
if (event->type() == QEvent::HoverEnter) {
@@ -740,25 +482,6 @@ namespace Robomongo
return true;
}
}
/* Temporarily disabling Recent Connections feature
// todo: refactor to delete recent conn button
auto but = qobject_cast<QPushButton*>(target);
if (but) {
if (event->type() == QEvent::HoverEnter) {
but->setIcon(GuiRegistry::instance().deleteIconMouseHovered());
but->setIconSize(QSize(but->iconSize().width(), CustomButtonHeight));
setCursor(Qt::PointingHandCursor);
return true;
}
else if (event->type() == QEvent::HoverLeave) {
but->setIcon(QIcon(""));
setCursor(Qt::ArrowCursor);
return true;
}
}
*/
return QWidget::eventFilter(target, event);
}
@@ -838,3 +561,5 @@ namespace Robomongo
}
}
#endif // -------------------------------- end of Linux impl. ------------------------------------//
+39 -16
View File
@@ -1,5 +1,42 @@
#pragma once
#ifndef __linux__ // ---------------------- Windows, macOS impl. --------------------------//
#include <QWidget>
#include <QWebEnginePage>
QT_BEGIN_NAMESPACE
class QScrollArea;
QT_END_NAMESPACE
namespace Robomongo
{
// ------------------ WelcomeTab
class WelcomeTab : public QWidget
{
Q_OBJECT
public:
WelcomeTab(QScrollArea* parent = nullptr);
QScrollArea* getParent() const { return _parent; }
void resize() { /* Not implemented for Windows and macOS */}
private:
QScrollArea* _parent;
};
// ------------------ MyWebPage
class MyWebPage : public QWebEnginePage
{
Q_OBJECT
public:
MyWebPage(QObject* parent = nullptr) : QWebEnginePage(parent) {}
bool acceptNavigationRequest(
QUrl const& url, NavigationType type, bool /*isMainFrame*/) override;
};
}
#else // -------------------------------- Linux impl. ------------------------------------//
#include <QWidget>
#include <QUrl>
@@ -25,8 +62,6 @@ namespace Robomongo
public:
WelcomeTab(QScrollArea *parent = nullptr);
~WelcomeTab();
// Temporarily disabling Recent Connections feature
// void removeRecentConnectionItem(ConnectionSettings const* conn);
QScrollArea* getParent() const { return _parent; }
void resize();
@@ -38,17 +73,8 @@ namespace Robomongo
void on_downloadPictureReply(QNetworkReply* reply);
void on_downloadRssReply(QNetworkReply* reply);
void on_allBlogsButton_clicked();
/* Temporarily disabling Recent Connections feature
void on_clearButton_clicked();
void on_deleteButton_clicked();
void on_recentConnectionLinkClicked(QString const& link);
void handle(ConnectionEstablishedEvent *event);
*/
private:
// Temporarily disabling Recent Connections feature
// void addRecentConnectionItem(ConnectionSettings const* conn, bool insertTop);
void setWhatsNewHeaderAndText(QString const& str);
QLabel* _pic1 = nullptr;
@@ -56,8 +82,6 @@ namespace Robomongo
QLabel* _blogsHeader;
QPushButton* _allBlogsButton = nullptr;
QVBoxLayout* _blogLinksLay;
// Temporarily disabling Recent Connections feature
// QVBoxLayout* _recentConnsLay;
QLabel* _whatsNewHeader;
QLabel* _whatsNewText;
QPushButton* _clearButton;
@@ -67,9 +91,8 @@ namespace Robomongo
QUrl _pic1_URL;
QUrl _text1_URL;
QUrl _rss_URL;
// Temporarily disabling Recent Connections feature
// std::vector<ConnectionSettings const*> _recentConnections;
};
}
#endif // -------------------------------- end of Linux ------------------------------------//
@@ -70,6 +70,7 @@ namespace Robomongo
_welcomeTab = new WelcomeTab(scrollArea);
scrollArea->setWidget(_welcomeTab);
scrollArea->setBackgroundRole(QPalette::Base);
scrollArea->setWidgetResizable(true);
if (!AppRegistry::instance().settingsManager()->disableHttpsFeatures()) {
#ifdef __APPLE__
+9
View File
@@ -1,6 +1,7 @@
#include "robomongo/utils/common.h"
#include <QFileInfo>
#include <QSettings>
#include "robomongo/core/events/MongoEvents.h"
#include "robomongo/core/utils/Logger.h"
@@ -35,4 +36,12 @@ namespace Robomongo
return find(vec.cbegin(), vec.cend(), value) != vec.cend();
}
QVariant getSetting(QString const& key) {
return QSettings("3T", "Robomongo").value(key).toSize();
}
void saveSetting(QString const& key, QVariant const& value) {
QSettings("3T", "Robomongo").setValue(key, value);
}
} // end of name space Robomongo
+3
View File
@@ -19,4 +19,7 @@ namespace Robomongo /* todo ::utils */
template<typename T>
bool vectorContains(std::vector<T> const& vec, T const& value);
QVariant getSetting(QString const& key);
void saveSetting(QString const& key, QVariant const& value);
}
@@ -0,0 +1,908 @@
Enabled checks:
clang-analyzer-apiModeling.StdCLibraryFunctions
clang-analyzer-apiModeling.TrustNonnull
clang-analyzer-apiModeling.google.GTest
clang-analyzer-apiModeling.llvm.CastValue
clang-analyzer-apiModeling.llvm.ReturnValue
clang-analyzer-core.CallAndMessage
clang-analyzer-core.DivideZero
clang-analyzer-core.DynamicTypePropagation
clang-analyzer-core.NonNullParamChecker
clang-analyzer-core.NonnilStringConstants
clang-analyzer-core.NullDereference
clang-analyzer-core.StackAddrEscapeBase
clang-analyzer-core.StackAddressEscape
clang-analyzer-core.UndefinedBinaryOperatorResult
clang-analyzer-core.VLASize
clang-analyzer-core.builtin.BuiltinFunctions
clang-analyzer-core.builtin.NoReturnFunctions
clang-analyzer-core.uninitialized.ArraySubscript
clang-analyzer-core.uninitialized.Assign
clang-analyzer-core.uninitialized.Branch
clang-analyzer-core.uninitialized.CapturedBlockVariable
clang-analyzer-core.uninitialized.UndefReturn
clang-analyzer-cplusplus.InnerPointer
clang-analyzer-cplusplus.Move
clang-analyzer-cplusplus.NewDelete
clang-analyzer-cplusplus.NewDeleteLeaks
clang-analyzer-cplusplus.PureVirtualCall
clang-analyzer-cplusplus.SelfAssignment
clang-analyzer-cplusplus.SmartPtr
clang-analyzer-cplusplus.VirtualCallModeling
clang-analyzer-deadcode.DeadStores
clang-analyzer-fuchsia.HandleChecker
clang-analyzer-nullability.NullPassedToNonnull
clang-analyzer-nullability.NullReturnedFromNonnull
clang-analyzer-nullability.NullabilityBase
clang-analyzer-nullability.NullableDereferenced
clang-analyzer-nullability.NullablePassedToNonnull
clang-analyzer-nullability.NullableReturnedFromNonnull
clang-analyzer-optin.cplusplus.UninitializedObject
clang-analyzer-optin.cplusplus.VirtualCall
clang-analyzer-optin.mpi.MPI-Checker
clang-analyzer-optin.osx.OSObjectCStyleCast
clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker
clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker
clang-analyzer-optin.performance.GCDAntipattern
clang-analyzer-optin.performance.Padding
clang-analyzer-optin.portability.UnixAPI
clang-analyzer-osx.API
clang-analyzer-osx.MIG
clang-analyzer-osx.NSOrCFErrorDerefChecker
clang-analyzer-osx.NumberObjectConversion
clang-analyzer-osx.OSObjectRetainCount
clang-analyzer-osx.ObjCProperty
clang-analyzer-osx.SecKeychainAPI
clang-analyzer-osx.cocoa.AtSync
clang-analyzer-osx.cocoa.AutoreleaseWrite
clang-analyzer-osx.cocoa.ClassRelease
clang-analyzer-osx.cocoa.Dealloc
clang-analyzer-osx.cocoa.IncompatibleMethodTypes
clang-analyzer-osx.cocoa.Loops
clang-analyzer-osx.cocoa.MissingSuperCall
clang-analyzer-osx.cocoa.NSAutoreleasePool
clang-analyzer-osx.cocoa.NSError
clang-analyzer-osx.cocoa.NilArg
clang-analyzer-osx.cocoa.NonNilReturnValue
clang-analyzer-osx.cocoa.ObjCGenerics
clang-analyzer-osx.cocoa.RetainCount
clang-analyzer-osx.cocoa.RetainCountBase
clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak
clang-analyzer-osx.cocoa.SelfInit
clang-analyzer-osx.cocoa.SuperDealloc
clang-analyzer-osx.cocoa.UnusedIvars
clang-analyzer-osx.cocoa.VariadicMethodTypes
clang-analyzer-osx.coreFoundation.CFError
clang-analyzer-osx.coreFoundation.CFNumber
clang-analyzer-osx.coreFoundation.CFRetainRelease
clang-analyzer-osx.coreFoundation.containers.OutOfBounds
clang-analyzer-osx.coreFoundation.containers.PointerSizedValues
clang-analyzer-security.FloatLoopCounter
clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling
clang-analyzer-security.insecureAPI.SecuritySyntaxChecker
clang-analyzer-security.insecureAPI.UncheckedReturn
clang-analyzer-security.insecureAPI.bcmp
clang-analyzer-security.insecureAPI.bcopy
clang-analyzer-security.insecureAPI.bzero
clang-analyzer-security.insecureAPI.decodeValueOfObjCType
clang-analyzer-security.insecureAPI.getpw
clang-analyzer-security.insecureAPI.gets
clang-analyzer-security.insecureAPI.mkstemp
clang-analyzer-security.insecureAPI.mktemp
clang-analyzer-security.insecureAPI.rand
clang-analyzer-security.insecureAPI.strcpy
clang-analyzer-security.insecureAPI.vfork
clang-analyzer-unix.API
clang-analyzer-unix.DynamicMemoryModeling
clang-analyzer-unix.Malloc
clang-analyzer-unix.MallocSizeof
clang-analyzer-unix.MismatchedDeallocator
clang-analyzer-unix.Vfork
clang-analyzer-unix.cstring.BadSizeArg
clang-analyzer-unix.cstring.CStringModeling
clang-analyzer-unix.cstring.NullArg
clang-analyzer-valist.CopyToSelf
clang-analyzer-valist.Uninitialized
clang-analyzer-valist.Unterminated
clang-analyzer-valist.ValistBase
...
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/ssh/test.c
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/ssh/server.c
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/ssh/ssh.c
/opt/robo/src/robomongo/ssh/ssh.c:111:16: warning: Potential leak of memory pointed to by 'session' [clang-analyzer-unix.Malloc]
return NULL;
^
/usr/local/Cellar/llvm/10.0.1/lib/clang/10.0.1/include/stddef.h:89:24: note: expanded from macro 'NULL'
# define NULL ((void*)0)
^
/opt/robo/src/robomongo/ssh/ssh.c:88:58: note: Memory is allocated
struct rbm_session *session = (struct rbm_session *) malloc(sizeof(struct rbm_session));
^
/opt/robo/src/robomongo/ssh/ssh.c:89:9: note: Assuming 'session' is non-null
if (!session)
^
/opt/robo/src/robomongo/ssh/ssh.c:89:5: note: Taking false branch
if (!session)
^
/opt/robo/src/robomongo/ssh/ssh.c:101:9: note: Assuming field 'loglevel' is equal to RBM_SSH_LOG_TYPE_ERROR
if (config->loglevel != RBM_SSH_LOG_TYPE_ERROR &&
^
/opt/robo/src/robomongo/ssh/ssh.c:101:52: note: Left side of '&&' is false
if (config->loglevel != RBM_SSH_LOG_TYPE_ERROR &&
^
/opt/robo/src/robomongo/ssh/ssh.c:110:9: note: Assuming 'publicsession' is null
if (!publicsession)
^
/opt/robo/src/robomongo/ssh/ssh.c:110:5: note: Taking true branch
if (!publicsession)
^
/opt/robo/src/robomongo/ssh/ssh.c:111:16: note: Potential leak of memory pointed to by 'session'
return NULL;
^
/usr/local/Cellar/llvm/10.0.1/lib/clang/10.0.1/include/stddef.h:89:24: note: expanded from macro 'NULL'
# define NULL ((void*)0)
^
/opt/robo/src/robomongo/ssh/ssh.c:196:16: warning: Potential leak of memory pointed to by 'channel' [clang-analyzer-unix.Malloc]
return NULL;
^
/usr/local/Cellar/llvm/10.0.1/lib/clang/10.0.1/include/stddef.h:89:24: note: expanded from macro 'NULL'
# define NULL ((void*)0)
^
/opt/robo/src/robomongo/ssh/ssh.c:142:5: note: Loop condition is true. Entering loop body
while (1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:143:14: note: Calling 'rbm_open_tunnel'
rc = rbm_open_tunnel(connection);
^
/opt/robo/src/robomongo/ssh/ssh.c:329:13: note: Assuming 'local_socket' is <= 'ssh_socket'
fdmax = local_socket > ssh_socket ? local_socket : ssh_socket;
^
/opt/robo/src/robomongo/ssh/ssh.c:329:13: note: '?' condition is false
/opt/robo/src/robomongo/ssh/ssh.c:331:5: note: Loop condition is true. Entering loop body
while (errors < maxerrors) {
^
/opt/robo/src/robomongo/ssh/ssh.c:337:13: note: Assuming the condition is false
if (!FD_ISSET(local_socket, &readset))
^
/opt/robo/src/robomongo/ssh/ssh.c:337:9: note: Taking false branch
if (!FD_ISSET(local_socket, &readset))
^
/opt/robo/src/robomongo/ssh/ssh.c:341:13: note: Assuming the condition is false
if (select(fdmax + 1, &readset, NULL, NULL, NULL) == -1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:341:9: note: Taking false branch
if (select(fdmax + 1, &readset, NULL, NULL, NULL) == -1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:348:26: note: Assuming 'isocket' is <= 'fdmax'
for(isocket = 0; isocket <= fdmax; isocket++) {
^
/opt/robo/src/robomongo/ssh/ssh.c:348:9: note: Loop condition is true. Entering loop body
for(isocket = 0; isocket <= fdmax; isocket++) {
^
/opt/robo/src/robomongo/ssh/ssh.c:351:17: note: Assuming the condition is false
if (!FD_ISSET(isocket, &readset))
^
/opt/robo/src/robomongo/ssh/ssh.c:351:13: note: Taking false branch
if (!FD_ISSET(isocket, &readset))
^
/opt/robo/src/robomongo/ssh/ssh.c:354:17: note: Assuming 'isocket' is equal to 'local_socket'
if (isocket == local_socket) {
^
/opt/robo/src/robomongo/ssh/ssh.c:354:13: note: Taking true branch
if (isocket == local_socket) {
^
/opt/robo/src/robomongo/ssh/ssh.c:355:22: note: Calling 'handle_new_client_connections'
rc = handle_new_client_connections(connection, &fdmax, &masterset);
^
/opt/robo/src/robomongo/ssh/ssh.c:408:9: note: Assuming the condition is false
if ((newfd = accept(local_socket, (struct sockaddr *) &remoteaddr, &slen)) == -1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:408:5: note: Taking false branch
if ((newfd = accept(local_socket, (struct sockaddr *) &remoteaddr, &slen)) == -1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:414:13: note: Assuming the condition is false
if (newfd > *fdmax) { // keep track of the maximum
^
/opt/robo/src/robomongo/ssh/ssh.c:414:9: note: Taking false branch
if (newfd > *fdmax) { // keep track of the maximum
^
/opt/robo/src/robomongo/ssh/ssh.c:424:5: note: Loop condition is true. Entering loop body
while (attempts < maxattempts) {
^
/opt/robo/src/robomongo/ssh/ssh.c:430:13: note: Assuming 'channel' is non-null
if (!channel) {
^
/opt/robo/src/robomongo/ssh/ssh.c:430:9: note: Taking false branch
if (!channel) {
^
/opt/robo/src/robomongo/ssh/ssh.c:446:9: note: Execution continues on line 449
break;
^
/opt/robo/src/robomongo/ssh/ssh.c:449:10: note: 'channel' is non-null
if (!channel) {
^
/opt/robo/src/robomongo/ssh/ssh.c:449:5: note: Taking false branch
if (!channel) {
^
/opt/robo/src/robomongo/ssh/ssh.c:454:9: note: Calling 'rbm_channel_create'
if (rbm_channel_create(connection, newfd, channel) == NULL) {
^
/opt/robo/src/robomongo/ssh/ssh.c:190:35: note: Memory is allocated
struct rbm_channel *channel = malloc(sizeof(struct rbm_channel));
^
/opt/robo/src/robomongo/ssh/ssh.c:191:9: note: Assuming 'channel' is non-null
if (!channel)
^
/opt/robo/src/robomongo/ssh/ssh.c:191:5: note: Taking false branch
if (!channel)
^
/opt/robo/src/robomongo/ssh/ssh.c:195:9: note: Assuming 'inbuf' is null
if (!inbuf)
^
/opt/robo/src/robomongo/ssh/ssh.c:195:5: note: Taking true branch
if (!inbuf)
^
/opt/robo/src/robomongo/ssh/ssh.c:196:16: note: Potential leak of memory pointed to by 'channel'
return NULL;
^
/usr/local/Cellar/llvm/10.0.1/lib/clang/10.0.1/include/stddef.h:89:24: note: expanded from macro 'NULL'
# define NULL ((void*)0)
^
/opt/robo/src/robomongo/ssh/ssh.c:200:16: warning: Potential leak of memory pointed to by 'inbuf' [clang-analyzer-unix.Malloc]
return NULL;
^
/usr/local/Cellar/llvm/10.0.1/lib/clang/10.0.1/include/stddef.h:89:24: note: expanded from macro 'NULL'
# define NULL ((void*)0)
^
/opt/robo/src/robomongo/ssh/ssh.c:142:5: note: Loop condition is true. Entering loop body
while (1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:143:14: note: Calling 'rbm_open_tunnel'
rc = rbm_open_tunnel(connection);
^
/opt/robo/src/robomongo/ssh/ssh.c:329:13: note: Assuming 'local_socket' is <= 'ssh_socket'
fdmax = local_socket > ssh_socket ? local_socket : ssh_socket;
^
/opt/robo/src/robomongo/ssh/ssh.c:329:13: note: '?' condition is false
/opt/robo/src/robomongo/ssh/ssh.c:331:5: note: Loop condition is true. Entering loop body
while (errors < maxerrors) {
^
/opt/robo/src/robomongo/ssh/ssh.c:337:13: note: Assuming the condition is false
if (!FD_ISSET(local_socket, &readset))
^
/opt/robo/src/robomongo/ssh/ssh.c:337:9: note: Taking false branch
if (!FD_ISSET(local_socket, &readset))
^
/opt/robo/src/robomongo/ssh/ssh.c:341:13: note: Assuming the condition is false
if (select(fdmax + 1, &readset, NULL, NULL, NULL) == -1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:341:9: note: Taking false branch
if (select(fdmax + 1, &readset, NULL, NULL, NULL) == -1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:348:26: note: Assuming 'isocket' is <= 'fdmax'
for(isocket = 0; isocket <= fdmax; isocket++) {
^
/opt/robo/src/robomongo/ssh/ssh.c:348:9: note: Loop condition is true. Entering loop body
for(isocket = 0; isocket <= fdmax; isocket++) {
^
/opt/robo/src/robomongo/ssh/ssh.c:351:17: note: Assuming the condition is false
if (!FD_ISSET(isocket, &readset))
^
/opt/robo/src/robomongo/ssh/ssh.c:351:13: note: Taking false branch
if (!FD_ISSET(isocket, &readset))
^
/opt/robo/src/robomongo/ssh/ssh.c:354:17: note: Assuming 'isocket' is equal to 'local_socket'
if (isocket == local_socket) {
^
/opt/robo/src/robomongo/ssh/ssh.c:354:13: note: Taking true branch
if (isocket == local_socket) {
^
/opt/robo/src/robomongo/ssh/ssh.c:355:22: note: Calling 'handle_new_client_connections'
rc = handle_new_client_connections(connection, &fdmax, &masterset);
^
/opt/robo/src/robomongo/ssh/ssh.c:408:9: note: Assuming the condition is false
if ((newfd = accept(local_socket, (struct sockaddr *) &remoteaddr, &slen)) == -1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:408:5: note: Taking false branch
if ((newfd = accept(local_socket, (struct sockaddr *) &remoteaddr, &slen)) == -1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:414:13: note: Assuming the condition is false
if (newfd > *fdmax) { // keep track of the maximum
^
/opt/robo/src/robomongo/ssh/ssh.c:414:9: note: Taking false branch
if (newfd > *fdmax) { // keep track of the maximum
^
/opt/robo/src/robomongo/ssh/ssh.c:424:5: note: Loop condition is true. Entering loop body
while (attempts < maxattempts) {
^
/opt/robo/src/robomongo/ssh/ssh.c:430:13: note: Assuming 'channel' is non-null
if (!channel) {
^
/opt/robo/src/robomongo/ssh/ssh.c:430:9: note: Taking false branch
if (!channel) {
^
/opt/robo/src/robomongo/ssh/ssh.c:446:9: note: Execution continues on line 449
break;
^
/opt/robo/src/robomongo/ssh/ssh.c:449:10: note: 'channel' is non-null
if (!channel) {
^
/opt/robo/src/robomongo/ssh/ssh.c:449:5: note: Taking false branch
if (!channel) {
^
/opt/robo/src/robomongo/ssh/ssh.c:454:9: note: Calling 'rbm_channel_create'
if (rbm_channel_create(connection, newfd, channel) == NULL) {
^
/opt/robo/src/robomongo/ssh/ssh.c:191:9: note: Assuming 'channel' is non-null
if (!channel)
^
/opt/robo/src/robomongo/ssh/ssh.c:191:5: note: Taking false branch
if (!channel)
^
/opt/robo/src/robomongo/ssh/ssh.c:194:19: note: Memory is allocated
char *inbuf = malloc(sizeof(char) * RBM_BUFSIZE);
^
/opt/robo/src/robomongo/ssh/ssh.c:195:9: note: Assuming 'inbuf' is non-null
if (!inbuf)
^
/opt/robo/src/robomongo/ssh/ssh.c:195:5: note: Taking false branch
if (!inbuf)
^
/opt/robo/src/robomongo/ssh/ssh.c:199:9: note: Assuming 'outbuf' is null
if (!outbuf)
^
/opt/robo/src/robomongo/ssh/ssh.c:199:5: note: Taking true branch
if (!outbuf)
^
/opt/robo/src/robomongo/ssh/ssh.c:200:16: note: Potential leak of memory pointed to by 'inbuf'
return NULL;
^
/usr/local/Cellar/llvm/10.0.1/lib/clang/10.0.1/include/stddef.h:89:24: note: expanded from macro 'NULL'
# define NULL ((void*)0)
^
/opt/robo/src/robomongo/ssh/ssh.c:291:9: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
rbm_channel_close(session->channels[0]);
^
/opt/robo/src/robomongo/ssh/ssh.c:142:5: note: Loop condition is true. Entering loop body
while (1) {
^
/opt/robo/src/robomongo/ssh/ssh.c:143:14: note: Calling 'rbm_open_tunnel'
rc = rbm_open_tunnel(connection);
^
/opt/robo/src/robomongo/ssh/ssh.c:329:13: note: Assuming 'local_socket' is <= 'ssh_socket'
fdmax = local_socket > ssh_socket ? local_socket : ssh_socket;
^
/opt/robo/src/robomongo/ssh/ssh.c:329:13: note: '?' condition is false
/opt/robo/src/robomongo/ssh/ssh.c:331:5: note: Loop condition is true. Entering loop body
while (errors < maxerrors) {
^
/opt/robo/src/robomongo/ssh/ssh.c:337:13: note: Assuming the condition is true
if (!FD_ISSET(local_socket, &readset))
^
/opt/robo/src/robomongo/ssh/ssh.c:337:9: note: Taking true branch
if (!FD_ISSET(local_socket, &readset))
^
/opt/robo/src/robomongo/ssh/ssh.c:338:13: note: Execution continues on line 385
break;
^
/opt/robo/src/robomongo/ssh/ssh.c:385:9: note: 'errors' is < 'maxerrors'
if (errors >= maxerrors) {
^
/opt/robo/src/robomongo/ssh/ssh.c:385:5: note: Taking false branch
if (errors >= maxerrors) {
^
/opt/robo/src/robomongo/ssh/ssh.c:390:5: note: Calling 'rbm_ssh_session_close'
rbm_ssh_session_close(connection->publicsession);
^
/opt/robo/src/robomongo/ssh/ssh.c:125:9: note: Assuming the condition is false
if (session->localsocket != rbm_socket_invalid) {
^
/opt/robo/src/robomongo/ssh/ssh.c:125:5: note: Taking false branch
if (session->localsocket != rbm_socket_invalid) {
^
/opt/robo/src/robomongo/ssh/ssh.c:131:5: note: Calling 'rbm_session_cleanup'
rbm_session_cleanup(session);
^
/opt/robo/src/robomongo/ssh/ssh.c:280:9: note: 'session' is not equal to NULL
if (session == NULL)
^
/opt/robo/src/robomongo/ssh/ssh.c:280:5: note: Taking false branch
if (session == NULL)
^
/opt/robo/src/robomongo/ssh/ssh.c:290:12: note: Assuming field 'channelssize' is > 0
while (session->channelssize > 0) {
^
/opt/robo/src/robomongo/ssh/ssh.c:290:5: note: Loop condition is true. Entering loop body
while (session->channelssize > 0) {
^
/opt/robo/src/robomongo/ssh/ssh.c:291:9: note: Calling 'rbm_channel_close'
rbm_channel_close(session->channels[0]);
^
/opt/robo/src/robomongo/ssh/ssh.c:217:9: note: Assuming the condition is false
if (rbm_array_remove((void ***)&session->channels, &session->channelssize, channel))
^
/opt/robo/src/robomongo/ssh/ssh.c:217:5: note: Taking false branch
if (rbm_array_remove((void ***)&session->channels, &session->channelssize, channel))
^
/opt/robo/src/robomongo/ssh/ssh.c:221:9: note: Assuming the condition is false
if (channel->socket != rbm_socket_invalid) {
^
/opt/robo/src/robomongo/ssh/ssh.c:221:5: note: Taking false branch
if (channel->socket != rbm_socket_invalid) {
^
/opt/robo/src/robomongo/ssh/ssh.c:227:9: note: Assuming field 'channel' is null
if (channel->channel) {
^
/opt/robo/src/robomongo/ssh/ssh.c:227:5: note: Taking false branch
if (channel->channel) {
^
/opt/robo/src/robomongo/ssh/ssh.c:239:5: note: Memory is released
free(channel);
^
/opt/robo/src/robomongo/ssh/ssh.c:291:9: note: Returning; memory was released via 1st parameter
rbm_channel_close(session->channels[0]);
^
/opt/robo/src/robomongo/ssh/ssh.c:290:21: note: Field 'channelssize' is > 0
while (session->channelssize > 0) {
^
/opt/robo/src/robomongo/ssh/ssh.c:290:5: note: Loop condition is true. Entering loop body
while (session->channelssize > 0) {
^
/opt/robo/src/robomongo/ssh/ssh.c:291:9: note: Use of memory after it is freed
rbm_channel_close(session->channels[0]);
^
/opt/robo/src/robomongo/ssh/ssh.c:322:5: warning: The bzero() function is obsoleted by memset() [clang-analyzer-security.insecureAPI.bzero]
FD_ZERO(&masterset);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_fd_zero.h:29:25: note: expanded from macro 'FD_ZERO'
#define FD_ZERO(p) __DARWIN_FD_ZERO(p)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_fd_def.h:108:33: note: expanded from macro '__DARWIN_FD_ZERO'
#define __DARWIN_FD_ZERO(p) __builtin_bzero(p, sizeof(*(p)))
^
/opt/robo/src/robomongo/ssh/ssh.c:322:5: note: The bzero() function is obsoleted by memset()
FD_ZERO(&masterset);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_fd_zero.h:29:25: note: expanded from macro 'FD_ZERO'
#define FD_ZERO(p) __DARWIN_FD_ZERO(p)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_fd_def.h:108:33: note: expanded from macro '__DARWIN_FD_ZERO'
#define __DARWIN_FD_ZERO(p) __builtin_bzero(p, sizeof(*(p)))
^
/opt/robo/src/robomongo/ssh/ssh.c:429:13: warning: Value stored to 'errsave' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
int errsave = errno;
^
/opt/robo/src/robomongo/ssh/ssh.c:429:13: note: Value stored to 'errsave' during its initialization is never read
/opt/robo/src/robomongo/ssh/ssh.c:510:17: warning: Value stored to 'result' is never read [clang-analyzer-deadcode.DeadStores]
result = RBM_ERROR;
^
/opt/robo/src/robomongo/ssh/ssh.c:510:17: note: Value stored to 'result' is never read
/opt/robo/src/robomongo/ssh/ssh.c:730:5: warning: Value stored to 'fingerprint' is never read [clang-analyzer-deadcode.DeadStores]
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
^
/opt/robo/src/robomongo/ssh/ssh.c:730:5: note: Value stored to 'fingerprint' is never read
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/ssh/log.c
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/ssh/array.c
...
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/utils/StdUtils.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/editors/JSLexer.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/utils/QtUtils.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/shell/shell/dbshell.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
/opt/robo/src/robomongo/shell/shell/dbshell.cpp:67:10: error: 'mongo/util/static_observer.h' file not found [clang-diagnostic-error]
#include "mongo/util/static_observer.h"
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/app/main.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/settings/CredentialSettings.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/utils/Logger.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/Enums.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/app/main_test.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/Event.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/EventBusSubscriber.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/EventError.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/HexUtils.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/utils/BsonUtils.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/MongoNamespace.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/EventBusDispatcher.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/KeyboardManager.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/EventWrapper.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/settings/ConnectionSettings.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/EventBus.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/CursorPosition.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/MongoFunction.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/MongoUtils.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/ScriptInfo.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/MongoCollectionInfo.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/MongoQueryInfo.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/third-party/qscintilla-2.8.4/sources/src/Document.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/MongoCollection.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/events/MongoEventsInfo.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/AppStyle.cpp
/opt/robo/src/robomongo/gui/AppStyle.cpp:19:17: warning: Potential memory leak [clang-analyzer-cplusplus.NewDeleteLeaks]
return;
^
/opt/robo/src/robomongo/gui/AppStyle.cpp:35:13: note: Calling 'applyStyle'
applyStyle(style);
^
/opt/robo/src/robomongo/gui/AppStyle.cpp:17:17: note: Assuming the condition is true
if (styleName == "Native") {
^
/opt/robo/src/robomongo/gui/AppStyle.cpp:17:13: note: Taking true branch
if (styleName == "Native") {
^
/opt/robo/src/robomongo/gui/AppStyle.cpp:18:40: note: Memory is allocated
QApplication::setStyle(new AppStyle);
^
/opt/robo/src/robomongo/gui/AppStyle.cpp:19:17: note: Potential memory leak
return;
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/MongoDocument.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/events/MongoEvents.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/engine/ScriptEngine.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/MongoServer.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/MongoShell.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/mongodb/ReplicaSet.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/MongoDatabase.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/mongodb/MongoClient.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/App.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/utils/StringOperations.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/mongodb/MongoWorker.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/utils/SimpleCrypt.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/settings/SettingsManager.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/GuiRegistry.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/AppRegistry.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/utils/common.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/AboutDialog.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/utils/RoboCrypt.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/shell/bson/json.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/ConnectionAdvancedTab.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/EulaDialog.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/ConnectionAuthTab.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
....
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/IndicatorLabel.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/ConnectionBasicTab.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/ConnectionDiagnosticDialog.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/CreateDatabaseDialog.cpp
/opt/robo/src/robomongo/gui/dialogs/CreateDatabaseDialog.cpp:51:14: warning: Potential leak of memory pointed to by 'serverIndicator' [clang-analyzer-cplusplus.NewDeleteLeaks]
if (!database.isEmpty())
^
/opt/robo/src/robomongo/gui/dialogs/CreateDatabaseDialog.cpp:27:38: note: Memory is allocated
Indicator *serverIndicator = new Indicator(GuiRegistry::instance().serverIcon(), serverName);
^
/opt/robo/src/robomongo/gui/dialogs/CreateDatabaseDialog.cpp:41:9: note: '?' condition is true
VERIFY(connect(_buttonBox, SIGNAL(accepted()), this, SLOT(accept())));
^
/opt/robo/src/robomongo/core/utils/QtUtils.h:14:19: note: expanded from macro 'VERIFY'
#define VERIFY(x) Q_ASSERT(x)
^
/opt/Qt5.12.8/5.12.8/clang_64/lib/QtCore.framework/Headers/qglobal.h:782:29: note: expanded from macro 'Q_ASSERT'
# define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
^
/opt/robo/src/robomongo/gui/dialogs/CreateDatabaseDialog.cpp:42:9: note: '?' condition is true
VERIFY(connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())));
^
/opt/robo/src/robomongo/core/utils/QtUtils.h:14:19: note: expanded from macro 'VERIFY'
#define VERIFY(x) Q_ASSERT(x)
^
/opt/Qt5.12.8/5.12.8/clang_64/lib/QtCore.framework/Headers/qglobal.h:782:29: note: expanded from macro 'Q_ASSERT'
# define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
^
/opt/robo/src/robomongo/gui/dialogs/CreateDatabaseDialog.cpp:49:13: note: Assuming the condition is false
if (!serverName.isEmpty())
^
/opt/robo/src/robomongo/gui/dialogs/CreateDatabaseDialog.cpp:49:9: note: Taking false branch
if (!serverName.isEmpty())
^
/opt/robo/src/robomongo/gui/dialogs/CreateDatabaseDialog.cpp:51:14: note: Potential leak of memory pointed to by 'serverIndicator'
if (!database.isEmpty())
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/utils/ComboBoxUtils.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/shell/db/ptimeutil.cpp
/opt/robo/src/robomongo/shell/db/ptimeutil.cpp:277:13: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcat(buf, utc_buff);
^
/opt/robo/src/robomongo/shell/db/ptimeutil.cpp:277:13: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/utils/DialogUtils.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/ConnectionDialog.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/CopyCollectionDialog.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/PreferencesDialog.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/CreateCollectionDialog.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/CreateUserDialog.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/editors/PlainJavaScriptEditor.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/editors/JSLexer.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/ConnectionsDialog.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/ExportDialog.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/editors/FindFrame.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/ChangeShellTimeoutDialog.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/AddEditIndexDialog.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/ScriptWidget.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerTreeItem.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerCollectionTreeItem.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerCollectionIndexesDir.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerCollectionIndexItem.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerReplicaSetFolderItem.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerReplicaSetTreeItem.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerDatabaseTreeItem.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerDatabaseCategoryTreeItem.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerUserTreeItem.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerFunctionTreeItem.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/FunctionTextEditor.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/DocumentTextEditor.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/BsonTableModel.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/BsonTableView.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerServerTreeItem.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerTreeWidget.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/explorer/ExplorerWidget.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/BsonTreeItem.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/CollectionStatsTreeWidget.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/BsonTreeModel.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/JsonPrepareThread.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/CollectionStatsTreeItem.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/PagingWidget.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/ProgressBarPopup.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/OutputItemHeaderWidget.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/domain/Notifier.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/WorkAreaTabBar.cpp
/opt/robo/src/robomongo/gui/widgets/workarea/WorkAreaTabBar.cpp:143:16: warning: Value stored to 'selectedBorder' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
QColor selectedBorder = background.darker(103);
^
/opt/robo/src/robomongo/gui/widgets/workarea/WorkAreaTabBar.cpp:143:16: note: Value stored to 'selectedBorder' during its initialization is never read
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/OutputItemContentWidget.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/BsonTreeView.cpp
/opt/robo/src/robomongo/gui/widgets/workarea/BsonTreeView.cpp:69:17: warning: Value stored to 'isSimple' is never read [clang-analyzer-deadcode.DeadStores]
isSimple = detail::isSimpleType(documentItem);
^
/opt/robo/src/robomongo/gui/widgets/workarea/BsonTreeView.cpp:69:17: note: Value stored to 'isSimple' is never read
/opt/robo/src/robomongo/gui/widgets/workarea/BsonTreeView.cpp:168:13: warning: Value stored to 'count' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
int count = indexes.count();
^
/opt/robo/src/robomongo/gui/widgets/workarea/BsonTreeView.cpp:168:13: note: Value stored to 'count' during its initialization is never read
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/OutputWidget.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/LogWidget.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/settings/SshSettings.cpp
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/QueryWidget.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/settings/SslSettings.cpp
....
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/WorkAreaTabWidget.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/widgets/workarea/WelcomeTab.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/SSHTunnelTab.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/MainWindow.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/gui/dialogs/SSLTab.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/settings/ReplicaSetSettings.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
clang-tidy -p=/opt/robo/build/debug /opt/robo/src/robomongo/core/mongodb/SshTunnelWorker.cpp
/opt/robo-shell/src/mongo/idl/basic_types.h:72:23: error: no member named 'has_value' in 'boost::optional<bool>' [clang-diagnostic-error]
return _value.has_value();
^
Error reading configuration from /opt/robo/build/debug/src/robomongo/robomongo_autogen/YHP5W5E6RA: directory doesn't exist.
Error reading configuration from /opt/robo/build/debug/src/robomongo/robomongo_autogen: directory doesn't exist.
Error reading configuration from /opt/robo/build/debug/src/robomongo/robomongo_autogen/YHP5W5E6RA: directory doesn't exist.
Error reading configuration from /opt/robo/build/debug/src/robomongo/robomongo_autogen: directory doesn't exist.
Error while processing /opt/robo/build/debug/src/robomongo/robomongo_autogen/YHP5W5E6RA/qrc_gui.cpp.
Found compiler error(s).
1 error generated.
Error while processing /opt/robo/src/robomongo/gui/widgets/workarea/WorkAreaTabWidget.cpp.
Found compiler error(s).
1 error generated.
Error while processing /opt/robo/src/robomongo/gui/widgets/workarea/WelcomeTab.cpp.
Found compiler error(s).
1 error generated.
Error while processing /opt/robo/src/robomongo/gui/dialogs/SSHTunnelTab.cpp.
Found compiler error(s).
1 error generated.
Error while processing /opt/robo/src/robomongo/gui/MainWindow.cpp.
Found compiler error(s).
1 error generated.
Error while processing /opt/robo/src/robomongo/gui/dialogs/SSLTab.cpp.
Found compiler error(s).
1 error generated.
Error while processing /opt/robo/src/robomongo/core/settings/ReplicaSetSettings.cpp.
Found compiler error(s).
1 error generated.
Error while processing /opt/robo/src/robomongo/core/mongodb/SshTunnelWorker.cpp.
Found compiler error(s).
File diff suppressed because it is too large Load Diff
-288
View File
@@ -1,288 +0,0 @@
cmake_minimum_required(VERSION 2.8.0)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
###
# Settings
#
set(PROJECT_NAME "Robo 3T" CACHE STRING "Project Name")
set(PROJECT_NAME_TITLE ${PROJECT_NAME})
set(PROJECT_DOMAIN "www.robomongo.org" CACHE STRING "Internet domain name for ${PROJECT_NAME}")
set(PROJECT_COMPANYNAME "3T Software Labs Ltd" CACHE STRING "Company name for ${PROJECT_NAME}")
set(PROJECT_COPYRIGHT "Copyright (C) 2014-2017 ${PROJECT_COMPANYNAME} All Rights Reserved.")
set(PROJECT_COMPANYNAME_DOMAIN "https://studio3t.com/" CACHE STRING "Internet domain name for ${PROJECT_NAME}")
set(PROJECT_GITHUB_FORK "www.github.com/paralect/robomongo" CACHE STRING "Git fork of ${PROJECT_NAME}")
set(PROJECT_GITHUB_ISSUES "www.github.com/paralect/robomongo/issues" CACHE STRING "Git issue link for ${PROJECT_NAME}")
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE)
set(MAJOR "0")
set(MINOR "8")
set(PATCH "6")
set(BUILD "dev")
set(SHORT_VERSION ${MAJOR}.${MINOR}.${PATCH} CACHE STRING "${PROJECT_NAME} short version")
set(PROJECT_VERSION "${SHORT_VERSION}${BUILD}" CACHE STRING "${PROJECT_NAME} version")
if(APPLE)
if(DEFINED ENV{MACOSX_DEPLOYMENT_TARGET})
set(MACOSX_DEPLOYMENT_TARGET $ENV{MACOSX_DEPLOYMENT_TARGET})
message("Setting MACOSX_DEPLOYMENT_TARGET to '${MACOSX_DEPLOYMENT_TARGET}'")
elseif(EXISTS "${CMAKE_OSX_SYSROOT}")
string(REGEX REPLACE ".*MacOSX([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_SDK_VERSION "${CMAKE_OSX_SYSROOT}")
string(REGEX REPLACE ".*MacOSX([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_SDK_VERSION "${CMAKE_OSX_SYSROOT}")
set(MACOSX_DEPLOYMENT_TARGET ${DARWIN_MAJOR_SDK_VERSION}.${DARWIN_MINOR_SDK_VERSION})
set(CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS}")
message("Setting MACOSX_DEPLOYMENT_TARGET to '${MACOSX_DEPLOYMENT_TARGET}'")
endif()
elseif(UNIX AND NOT APPLE)
set(PROJECT_NAME ${PROJECT_NAME_LOWERCASE})
endif()
###
# Configure project
PROJECT(${PROJECT_NAME})
###
# Options
IF(WIN32)
OPTION(MANIFEST_ENABLE "Enable Manifest" ON)
if(POLICY CMP0020)
cmake_policy(SET CMP0020 OLD)
endif()
if(POLICY CMP0026)
cmake_policy(SET CMP0026 OLD)
endif()
ENDIF(WIN32)
set(ROBOMONGO_QT_VERSION 5 CACHE STRING "Qt version to use when building Robomongo (can be 4 or 5)")
OPTION(BOOST_ENABLED "Enable boost system support" OFF)
OPTION(OPENSSL_ENABLED "Enable openssl support" ON)
OPTION(SSH_ENABLED "Enable ssh support" ON)
OPTION(CPACK_SUPPORT "Enable package support" ON)
OPTION(DEVELOPER_DYNAMIC_RUNTIME "Build with dynamic C++ runtime" ON)
OPTION(DEVELOPER_FEATURES "Use some debug tricks for developers" OFF)
OPTION(DEVELOPER_ENABLE_TESTS "Enable tests for ${PROJECT_NAME_TITLE} project" ON)
IF(MSVC)
IF(CMAKE_CL_64)
OPTION(BUILD_64X "Build 64bit project" ON)
ELSE()
OPTION(BUILD_64X "Build 64bit project" OFF)
ENDIF()
ELSE()
IF("${OS_ARC}" STREQUAL "64")
OPTION(BUILD_64X "Build 64bit project" ON)
ELSEIF("${OS_ARC}" STREQUAL "32")
OPTION(BUILD_64X "Build 64bit project" OFF)
ELSE()
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
OPTION(BUILD_64X "Build 64bit project" ON)
ELSE(CMAKE_SIZEOF_VOID_P MATCHES 8)
OPTION(BUILD_64X "Build 64bit project" OFF)
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)
ENDIF()
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE DEBUG)
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF()
ENDIF()
INCLUDE(../cmake/config.cmake)
DEFINE_DEFAULT_DEFINITIONS()
# Search libraries
# use Qt
DETECT_QT()
##################### Libraries search ###################
IF(DEVELOPER_QT5)
SET(QT_COMPONENTS_TO_USE Qt5Core Qt5Gui Qt5Widgets)
IF(UNIX AND NOT APPLE)
SET(QT_COMPONENTS_TO_USE ${QT_COMPONENTS_TO_USE} Qt5DBus) #for libqxcb
ENDIF(UNIX AND NOT APPLE)
IF(APPLE)
SET(QT_COMPONENTS_TO_USE ${QT_COMPONENTS_TO_USE} Qt5MacExtras)
ENDIF(APPLE)
ELSE()
SET(QT_COMPONENTS_TO_USE QtCore QtGui)
ENDIF()
INTEGRATE_QT(${QT_COMPONENTS_TO_USE})
##########################################################
IF(BUILD_64X)
SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS 1)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=gnu++0x -Wno-unused-local-typedefs -Wno-unused-parameter -Wno-literal-suffix -Wdeprecated-declarations")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m64")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m64")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -m64")
ELSEIF(MSVC)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /machine:x64")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /machine:x64")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /machine:x64")
ENDIF()
IF(APPLE)
SET(CMAKE_OSX_ARCHITECTURES x86_64)
ENDIF()
SET(ARCH_TEXT 64)
SET(ARCH_TEXT_PACKAGE x86_64)#amd64
ELSE()
SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS 0)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -m32")
ELSEIF(MSVC)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /machine:x86")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /machine:x86")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /machine:x86")
ENDIF()
IF(APPLE)
SET(CMAKE_OSX_ARCHITECTURES i386)
#-DCMAKE_OSX_ARCHITECTURES= ;i386
ENDIF()
SET(ARCH_TEXT 32)
SET(ARCH_TEXT_PACKAGE i386)
ENDIF()
##################################DEFAULT VALUES##########################################
IF(NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install")
ENDIF()
IF(".." STREQUAL "${PROJECT_BINARY_DIR}")
MESSAGE(SEND_ERROR "In-source builds are not allowed.")
ENDIF(".." STREQUAL "${PROJECT_BINARY_DIR}")
############################################################################
IF(WIN32)
SET(RESOURCE_OS "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/win.rc")
SET(RESOURCE_OS_IN "${CMAKE_SOURCE_DIR}/install/windows/winres.rc.in")
SET(ICON_FILE "${CMAKE_SOURCE_DIR}/src/robomongo/gui/resources/robo.ico")
SET(LIB_INSTALL_DESTINATION ..)
SET(TARGET_INSTALL_DESTINATION ..)
ELSEIF(APPLE)
SET(RESOURCE_OS "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/robomongo.desktop")
SET(RESOURCE_OS_IN "${CMAKE_SOURCE_DIR}/install/robomongo.desktop.in")
SET(ICON_FILE "${CMAKE_SOURCE_DIR}/install/osx/Robomongo.icns")
SET(LIB_INSTALL_DESTINATION ..)
SET(TARGET_INSTALL_DESTINATION ..)
ELSEIF(UNIX)
SET(RESOURCE_OS "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}.desktop")
SET(RESOURCE_OS_IN "${CMAKE_SOURCE_DIR}/install/robomongo.desktop.in")
SET(ICON_FILE "${CMAKE_SOURCE_DIR}/install/linux/robomongo.png")
SET(LIB_INSTALL_DESTINATION lib)
SET(TARGET_INSTALL_DESTINATION bin)
ENDIF()
# project sources
SET_PROPERTY( GLOBAL PROPERTY USE_FOLDERS ON)
ADD_SUBDIRECTORY(../src)
IF(CPACK_SUPPORT)
SET(CPACK_PACKAGE_DESCRIPTION "Shell-centric cross-platform MongoDB management tool.")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME_TITLE} shell-centric cross-platform MongoDB management tool.")#CPACK_DEBIAN_PACKAGE_DESCRIPTION CPACK_RPM_PACKAGE_SUMMARY
SET(CPACK_PACKAGE_DESCRIPTION_FILE "../DESCRIPTION")#CPACK_RPM_PACKAGE_DESCRIPTION
SET(CPACK_RESOURCE_FILE_LICENSE "../LICENSE")
SET(CPACK_RESOURCE_FILE_README "../README.md")
SET(CPACK_RESOURCE_FILE_WELCOME "../README.md")
SET(CPACK_PACKAGE_VENDOR ${PROJECT_COMPANYNAME})#CPACK_RPM_PACKAGE_VENDOR
SET(CPACK_PACKAGE_CONTACT "robo3t@3t.io")#CPACK_DEBIAN_PACKAGE_MAINTAINER
SET(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${SHORT_VERSION})
IF(BUILD)
STRING(REGEX REPLACE " " "" BUILD_ESCAPE ${BUILD})
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${BUILD_ESCAPE}")
ENDIF(BUILD)
SET(CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION_PATCH})#CPACK_DEBIAN_PACKAGE_VERSION CPACK_RPM_PACKAGE_VERSION
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})#CPACK_DEBIAN_PACKAGE_NAME CPACK_RPM_PACKAGE_NAME
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${ARCH_TEXT_PACKAGE}")#out package name
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME})
SET(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME_TITLE};${PROJECT_NAME}")
MESSAGE(STATUS "CPACK_PACKAGE_FILE_NAME: ${CPACK_PACKAGE_FILE_NAME}")
SET(CPACK_MONOLITHIC_INSTALL ON)
IF(WIN32)
IF(NOT CPACK_GENERATOR)
SET(CPACK_GENERATOR NSIS)
ENDIF(NOT CPACK_GENERATOR)
IF(CPACK_GENERATOR STREQUAL "NSIS")
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlasshes.
#SET(CPACK_NSIS_MODIFY_PATH ON)
SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/install/windows\\\\nsis-top-logo.bmp")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "\\\\${PROJECT_NAME}.exe")
SET(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}.exe")
SET(CPACK_NSIS_CREATE_ICONS "CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_NAME}.lnk\\\" \\\"$INSTDIR\\\\${PROJECT_NAME}.exe\\\"")
SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut \\\"$DESKTOP\\\\${PROJECT_NAME}.lnk\\\" \\\"$INSTDIR\\\\${PROJECT_NAME}.exe\\\"")
SET(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete \\\"$DESKTOP\\\\${PROJECT_NAME}.lnk\\\"")
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\${PROJECT_COMPANYNAME_DOMAIN}")
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\${PROJECT_DOMAIN}")
SET(SIDEBAR_IMAGE ${CMAKE_SOURCE_DIR}/install/windows\\\\database.bmp)
SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "!define MUI_WELCOMEFINISHPAGE_BITMAP \\\"${SIDEBAR_IMAGE}\\\"")
SET(CPACK_NSIS_CONTACT "me@my-personal-home-page.com")
SET(CPACK_NSIS_MUI_FINISHPAGE_RUN "..\\\\${PROJECT_NAME}.exe")
ENDIF(CPACK_GENERATOR STREQUAL "NSIS")
ELSEIF(APPLE)
IF(NOT CPACK_GENERATOR)
SET(CPACK_GENERATOR DragNDrop)
ENDIF(NOT CPACK_GENERATOR)
#SET(CPACK_OSX_PACKAGE_VERSION "10.5")
ELSEIF(UNIX)
SET(CPACK_STRIP_FILES ON)
#SET(UBUNTU_LP_BUG 300472)
#SET(CPACK_STRIP_FILES "bin/${PROJECT_NAME}")
#SET(CPACK_SOURCE_STRIP_FILES "")
IF(NOT CPACK_GENERATOR)
SET(CPACK_GENERATOR DEB)
ENDIF(NOT CPACK_GENERATOR)
IF(CPACK_GENERATOR STREQUAL "RPM" OR CPACK_GENERATOR STREQUAL "DEB")
SET(CPACK_PACKAGING_INSTALL_PREFIX "/opt/${PROJECT_NAME}")
ENDIF(CPACK_GENERATOR STREQUAL "RPM" OR CPACK_GENERATOR STREQUAL "DEB")
CONFIGURE_FILE("../install/linux/postinst.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/scripts/postinst" @ONLY IMMEDIATE)
FILE(COPY ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/scripts/postinst DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
CONFIGURE_FILE("../install/linux/prerm.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/scripts/prerm" @ONLY IMMEDIATE)
FILE(COPY ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/scripts/prerm DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
IF(CPACK_GENERATOR STREQUAL "RPM")
#CPACK_RPM_PACKAGE_ARCHITECTURE CPACK_RPM_PACKAGE_LICENSE CPACK_RPM_PACKAGE_DESCRIPTION CPACK_RPM_SPEC_INSTALL_POST
#SET(CPACK_PACKAGE_RELEASE 1)
SET(CPACK_RPM_PACKAGE_LICENSE "GPL v3")
#SET(CPACK_RPM_PACKAGE_AUTOREQPROV "yes")
SET(CPACK_RPM_PACKAGE_REQUIRES "libc.so.6 >= 2.12, libstdc++.so.6 >= 6.0.13, glibc, openssl, libgcc, mesa-libGL, libicu, gtk2, dbus, pango, libSM, libICE, liberation-sans-fonts")
SET(CPACK_RPM_PACKAGE_RELEASE 1)
SET(CPACK_RPM_PACKAGE_GROUP "Development/Libraries/${PROJECT_COMPANYNAME}")
SET(CPACK_RPM_PACKAGE_ARCHITECTURE ${ARCH_TEXT_PACKAGE})
SET(CPACK_RPM_PACKAGE_VERSION ${SHORT_VERSION})
SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/postinst")
SET(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/prerm")
ELSEIF(CPACK_GENERATOR STREQUAL "DEB")
CONFIGURE_FILE("../install/linux/fixup_deb.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/fixup_deb.sh" @ONLY IMMEDIATE)
IF(ARCH_TEXT_PACKAGE STREQUAL x86_64)
SET(ARCH_TEXT_PACKAGE amd64)
ENDIF()
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
#CPACK_DEBIAN_PACKAGE_HOMEPAGE The URL of the web site for this package
SET(CPACK_DEBIAN_PACKAGE_DEBUG ON)
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_SECTION "database")#input our section
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "Unknown")
SET(CPACK_DEBIAN_PACKAGE_SUGGESTS "Unknown")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARCH_TEXT_PACKAGE})#i386
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/postinst;${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/prerm")
ENDIF(CPACK_GENERATOR STREQUAL "RPM")
ENDIF(WIN32)
INCLUDE(CPack)
ENDIF(CPACK_SUPPORT)
-39
View File
@@ -1,39 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem -----------------------------------
rem - Configuration
rem -----------------------------------
rem arch_bit is a first arg
call :createPackage build_nsis NSIS
call :createPackage build_zip ZIP
goto :eof
:createPackage
setlocal
set dir_path=%1
set cpack_generator=%2
if exist %dir_path% rmdir %dir_path% /s /q
mkdir %dir_path%
cd %dir_path%
if exist "%programfiles%\Microsoft Visual Studio 11.0" (
cmake ../../ -G "Visual Studio 11" -DCPACK_GENERATOR=%cpack_generator%
) else (
if exist "%programfiles%\Microsoft Visual Studio 10.0" (
cmake ../../ -G "Visual Studio 10" -DCPACK_GENERATOR=%cpack_generator%
) else (
echo Error Visual Studio not founded.
cd ../
if exist %dir_path% rmdir %dir_path% /s /q
goto:eof
)
)
cmake --build . --target install --config Release
cpack
cd ../
endlocal
goto:eof
-31
View File
@@ -1,31 +0,0 @@
#!/bin/sh
set -e
createPackage() {
dir_path="$1"
cpack_generator="$2"
if [ -d "$dir_path" ]; then
rm -rf "$dir_path"
fi
mkdir "$dir_path"
cd "$dir_path"
cmake ../../ -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DCPACK_GENERATOR="$cpack_generator" -DOPENSSL_USE_STATIC=1
make install
cpack -G "$cpack_generator"
if [ "$cpack_generator" = 'DEB' ]; then
sh ./fixup_deb.sh
fi
cd ../
}
unamestr=`uname`
if [ "$unamestr" = 'Linux' ]; then
createPackage build_deb DEB
createPackage build_rpm RPM
createPackage build_tar TGZ
elif [ "$unamestr" = 'Darwin' ]; then
createPackage build_dmg DragNDrop
createPackage build_zip ZIP
fi
-38
View File
@@ -1,38 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem -----------------------------------
rem - Configuration
rem -----------------------------------
rem arch_bit is a first arg
set dir_path=build_releases
if exist %dir_path% rmdir %dir_path% /s /q
mkdir %dir_path%
cd %dir_path%
call :createPackage NSIS
call :createPackage ZIP
goto :eof
:createPackage
setlocal
set cpack_generator=%1
if exist "%programfiles%\Microsoft Visual Studio 11.0" (
cmake ../../ -G "Visual Studio 11" -DCPACK_GENERATOR=%cpack_generator%
) else (
if exist "%programfiles%\Microsoft Visual Studio 10.0" (
cmake ../../ -G "Visual Studio 10" -DCPACK_GENERATOR=%cpack_generator%
) else (
echo Error Visual Studio not founded.
cd ../
if exist %dir_path% rmdir %dir_path% /s /q
goto:eof
)
)
cmake --build . --target install --config Release
cpack
endlocal
goto:eof
-30
View File
@@ -1,30 +0,0 @@
#!/bin/sh
set -e
createPackage() {
cpack_generator="$1"
cmake ../../ -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DCPACK_GENERATOR="$cpack_generator" -DOPENSSL_USE_STATIC=1
# make install
cpack -G "$cpack_generator"
if [ "$cpack_generator" = 'DEB' ]; then
sh ./fixup_deb.sh
fi
}
unamestr=`uname`
dir_path=build_releases
if [ -d "$dir_path" ]; then
rm -rf "$dir_path"
fi
mkdir "$dir_path"
cd "$dir_path"
if [ "$unamestr" = 'Linux' ]; then
createPackage DEB
createPackage RPM
createPackage TGZ
elif [ "$unamestr" = 'Darwin' ]; then
createPackage DragNDrop
createPackage ZIP
fi
-24
View File
@@ -1,24 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem -----------------------------------
rem - Configuration
rem -----------------------------------
rem remove target folder
call :deleteDir build_nsis
call :deleteDir build_zip
goto :eof
:deleteDir
setlocal
set dir_path=%1
if exist %dir_path% rmdir %dir_path% /s /q
if %ERRORLEVEL% neq 0 (
echo.
echo Error when removing !TARGET!.
exit /b 1
pause
)
endlocal
goto:eof
-20
View File
@@ -1,20 +0,0 @@
#!/bin/sh
set -e
deleteDir() {
dir_path="$1"
if [ -d "$dir_path" ]; then
rm -rf "$dir_path"
fi
}
unamestr=`uname`
if [ "$unamestr"=='Linux' ]; then
deleteDir build_deb
deleteDir build_rpm
deleteDir build_tar
elif [ "$unamestr"=='Darwin' ]; then
deleteDir build_dmg
deleteDir build_zip
fi
-23
View File
@@ -1,23 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem -----------------------------------
rem - Configuration
rem -----------------------------------
rem remove target folder
call :deleteDir build_releases
goto :eof
:deleteDir
setlocal
set dir_path=%1
if exist %dir_path% rmdir %dir_path% /s /q
if %ERRORLEVEL% neq 0 (
echo.
echo Error when removing !TARGET!.
exit /b 1
pause
)
endlocal
goto:eof
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh
set -e
deleteDir() {
dir_path="$1"
if [ -d "$dir_path" ]; then
rm -rf "$dir_path"
fi
}
unamestr=`uname`
deleteDir build_releases
-9
View File
@@ -1,9 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem -----------------------------------
rem - Configuration
rem -----------------------------------
call clean.bat %arch_bit%
call build.bat %arch_bit%
-8
View File
@@ -1,8 +0,0 @@
# ****************
# Configuration
# ****************
# clean and build
./clean.sh $@
./build.sh $@
-362
View File
@@ -1,362 +0,0 @@
# - Try to find the OpenSSL encryption library
# Once done this will define
#
# OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
#
# Read-Only variables:
# OPENSSL_FOUND - system has the OpenSSL library
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
# OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if (UNIX)
find_package(PkgConfig QUIET)
pkg_check_modules(_OPENSSL QUIET openssl)
endif ()
if (WIN32)
# http://www.slproweb.com/products/Win32OpenSSL.html
set(_OPENSSL_ROOT_HINTS
${OPENSSL_ROOT_DIR}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
ENV OPENSSL_ROOT_DIR
)
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
set(_OPENSSL_ROOT_PATHS
"${_programfiles}/OpenSSL"
"${_programfiles}/OpenSSL-Win32"
"${_programfiles}/OpenSSL-Win64"
"C:/OpenSSL/"
"C:/OpenSSL-Win32/"
"C:/OpenSSL-Win64/"
)
unset(_programfiles)
set(_OPENSSL_ROOT_HINTS_AND_PATHS
HINTS ${_OPENSSL_ROOT_HINTS}
PATHS ${_OPENSSL_ROOT_PATHS}
)
else ()
set(_OPENSSL_ROOT_HINTS
${OPENSSL_ROOT_DIR}
ENV OPENSSL_ROOT_DIR
)
endif ()
find_path(OPENSSL_INCLUDE_DIR
NAMES
openssl/ssl.h
HINTS
${_OPENSSL_INCLUDEDIR}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
include
)
if(WIN32 AND NOT CYGWIN)
if(MSVC)
# /MD and /MDd are the standard values - if someone wants to use
# others, the libnames have to change here too
# use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
# TODO: handle /MT and static lib
# In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
# * MD for dynamic-release
# * MDd for dynamic-debug
# * MT for static-release
# * MTd for static-debug
# Implementation details:
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
# libeay32MD.lib is identical to ../libeay32.lib, and
# ssleay32MD.lib is identical to ../ssleay32.lib
find_library(LIB_EAY_DEBUG
NAMES
libeay32MDd
libeay32d
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"VC"
"lib/VC"
)
find_library(LIB_EAY_RELEASE
NAMES
libeay32MD
libeay32
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"VC"
"lib/VC"
)
find_library(SSL_EAY_DEBUG
NAMES
ssleay32MDd
ssleay32d
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"VC"
"lib/VC"
)
find_library(SSL_EAY_RELEASE
NAMES
ssleay32MD
ssleay32
ssl
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"VC"
"lib/VC"
)
set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")
set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}")
set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}")
set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}")
include(SelectLibraryConfigurations)
select_library_configurations(LIB_EAY)
select_library_configurations(SSL_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} )
elseif(MINGW)
# same player, for MinGW
set(LIB_EAY_NAMES libeay32)
set(SSL_EAY_NAMES ssleay32)
if(CMAKE_CROSS_COMPILING)
list(APPEND LIB_EAY_NAMES crypto)
list(APPEND SSL_EAY_NAMES ssl)
endif()
find_library(LIB_EAY
NAMES
${LIB_EAY_NAMES}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"lib/MinGW"
)
find_library(SSL_EAY
NAMES
${SSL_EAY_NAMES}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"lib/MinGW"
)
mark_as_advanced(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
unset(LIB_EAY_NAMES)
unset(SSL_EAY_NAMES)
else()
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
find_library(LIB_EAY
NAMES
libeay32
HINTS
${_OPENSSL_LIBDIR}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
lib
)
find_library(SSL_EAY
NAMES
ssleay32
HINTS
${_OPENSSL_LIBDIR}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
lib
)
mark_as_advanced(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
endif()
else()
if(OPENSSL_USE_STATIC)
find_library(OPENSSL_SSL_LIBRARY
NAMES
libssl.a
libssleay32.a
libssleay32MD.a
HINTS
${_OPENSSL_LIBDIR}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
lib
)
find_library(OPENSSL_CRYPTO_LIBRARY
NAMES
libcrypto.a
HINTS
${_OPENSSL_LIBDIR}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
lib
)
#zlib
set(STATIC_ZLIB_SEARCHES)
# Normal search.
set(STATIC_ZLIB_SEARCH_NORMAL
PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
"$ENV{PROGRAMFILES}/zlib"
)
list(APPEND STATIC_ZLIB_SEARCHES STATIC_ZLIB_SEARCH_NORMAL)
set(STATIC_ZLIB_NAMES libz.a libzlib.a libzdll.a libzlib1.a libzlibd.a libzlibd1.a)
# Try each search configuration.
foreach(search ${STATIC_ZLIB_SEARCHES})
find_library(STATIC_ZLIB_LIBRARY NAMES ${STATIC_ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
endforeach()
if(STATIC_ZLIB_LIBRARY)
set(OPENSSL_LIBRARIES ${STATIC_ZLIB_LIBRARY})
endif(STATIC_ZLIB_LIBRARY)
endif(OPENSSL_USE_STATIC)
find_library(OPENSSL_SSL_LIBRARY
NAMES
ssl
ssleay32
ssleay32MD
HINTS
${_OPENSSL_LIBDIR}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
lib
)
find_library(OPENSSL_CRYPTO_LIBRARY
NAMES
crypto
HINTS
${_OPENSSL_LIBDIR}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
lib
)
mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
# compat defines
set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
endif()
function(from_hex HEX DEC)
string(TOUPPER "${HEX}" HEX)
set(_res 0)
string(LENGTH "${HEX}" _strlen)
while (_strlen GREATER 0)
math(EXPR _res "${_res} * 16")
string(SUBSTRING "${HEX}" 0 1 NIBBLE)
string(SUBSTRING "${HEX}" 1 -1 HEX)
if (NIBBLE STREQUAL "A")
math(EXPR _res "${_res} + 10")
elseif (NIBBLE STREQUAL "B")
math(EXPR _res "${_res} + 11")
elseif (NIBBLE STREQUAL "C")
math(EXPR _res "${_res} + 12")
elseif (NIBBLE STREQUAL "D")
math(EXPR _res "${_res} + 13")
elseif (NIBBLE STREQUAL "E")
math(EXPR _res "${_res} + 14")
elseif (NIBBLE STREQUAL "F")
math(EXPR _res "${_res} + 15")
else()
math(EXPR _res "${_res} + ${NIBBLE}")
endif()
string(LENGTH "${HEX}" _strlen)
endwhile()
set(${DEC} ${_res} PARENT_SCOPE)
endfunction()
if (OPENSSL_INCLUDE_DIR)
if (_OPENSSL_VERSION)
set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
REGEX "^# *define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
# The version number is encoded as 0xMNNFFPPS: major minor fix patch status
# The status gives if this is a developer or prerelease and is ignored here.
# Major, minor, and fix directly translate into the version numbers shown in
# the string. The patch field translates to the single character suffix that
# indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
# on.
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
"\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
# 96 is the ASCII code of 'a' minus 1
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
unset(_tmp)
# Once anyone knows how OpenSSL would call the patch versions beyond 'z'
# this should be updated to handle that, too. This has not happened yet
# so it is simply ignored here for now.
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
endif ()
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
endif ()
endif ()
include(FindPackageHandleStandardArgs)
if (OPENSSL_VERSION)
find_package_handle_standard_args(OpenSSL
REQUIRED_VARS
OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR
VERSION_VAR
OPENSSL_VERSION
FAIL_MESSAGE
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
)
else ()
find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR
)
endif ()
mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
-94
View File
@@ -1,94 +0,0 @@
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
ADD_DEFINITIONS(-DOS_LINUX -DOS_POSIX)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ADD_DEFINITIONS(-DOS_MAC -DOS_POSIX)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
ADD_DEFINITIONS(-D_WIN32 -DOS_WIN)
ELSE()
MESSAGE(FATAL_ERROR "Not supported OS: ${CMAKE_SYSTEM_NAME}")
ENDIF()
MESSAGE(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
MESSAGE(STATUS "CMAKE_SYSTEM: ${CMAKE_SYSTEM}")
IF (CMAKE_BUILD_TYPE)
STRING(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_STABLE)
MESSAGE(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE_STABLE}")
ENDIF(CMAKE_BUILD_TYPE)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/")
IF(NOT CMAKE_DEBUG_POSTFIX)
SET(CMAKE_DEBUG_POSTFIX d)
ENDIF()
INCLUDE(cmake/projecthelper.cmake)
INCLUDE(cmake/utils.cmake)
IF(OPENSSL_ENABLED)
ADD_DEFINITIONS(-DOPENSSL_SUPPORT_ENABLED)
FIND_PACKAGE(OpenSSL REQUIRED)
IF(OPENSSL_FOUND)
#SET(OPENSSL_LIBS optimized ${LIB_EAY_RELEASE} debug ${LIB_EAY_DEBUG} optimized ${SSL_EAY_RELEASE} debug ${SSL_EAY_DEBUG})
GET_FILENAME_COMPONENT(OPENSSL_ROOT_DIR ${OPENSSL_INCLUDE_DIR} PATH)
ELSE(OPENSSL_FOUND)
IF(NOT OPENSSL_ROOT_DIR OR NOT EXISTS ${OPENSSL_ROOT_DIR})
MESSAGE(FATAL_ERROR "OPENSSL_ENABLED but not founded, please specify OPENSSL_ROOT_DIR variable." )
ENDIF()
FILE(GLOB OPENSSL_LIBS "${OPENSSL_ROOT_DIR}/*.lib")
ENDIF(OPENSSL_FOUND)
ENDIF(OPENSSL_ENABLED)
IF(SSH_ENABLED)
ADD_DEFINITIONS(-DSSH_SUPPORT_ENABLED)
IF(NOT OPENSSL_FOUND)
MESSAGE(FATAL_ERROR "OPENSSH_ENABLED but openssl not founded, please specify OPENSSL_ROOT_DIR variable and check the OPENSSL_ENABLED variable must be ON.")
ENDIF(NOT OPENSSL_FOUND)
ENDIF(SSH_ENABLED)
IF(BOOST_ENABLED)
ADD_DEFINITIONS(-DBOOST_SUPPORT_ENABLED)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/integrate-boost.cmake)
SET(Boost_USE_MULTITHREADED ON)
SET(Boost_USE_STATIC_LIBS ON)
ENDIF(BOOST_ENABLED)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/integrate-qt.cmake)
IF(DEVELOPER_ENABLE_TESTS)
INCLUDE(cmake/testing.cmake)
SETUP_TESTING()
ENDIF(DEVELOPER_ENABLE_TESTS)
MACRO(ADD_APP_EXECUTABLE_MSVC PROJECT_NAME SOURCES LIBS)
ADD_EXECUTABLE(${PROJECT_NAME} ${DESKTOP_TARGET} ${SOURCES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIBS})
ENDMACRO()
MACRO(ADD_APP_LIBRARY_MSVC PROJECT_NAME SOURCES LIBS)
ADD_LIBRARY(${PROJECT_NAME} STATIC ${SOURCES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIBS} )
ENDMACRO()
MACRO(ADD_APP_EXECUTABLE PROJECT_NAME SOURCES LIBS)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BUILD_TYPE}/build)
SET(TARGET ${PROJECT_NAME})
ADD_EXECUTABLE(${TARGET} ${DESKTOP_TARGET} ${SOURCES})
TARGET_LINK_LIBRARIES(${TARGET} ${LIBS})
IF ("${CMAKE_BUILD_TYPE_STABLE}" STREQUAL "RELEASE")
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}")
ELSE()
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}")
ENDIF()
ENDMACRO()
MACRO(ADD_APP_LIBRARY PROJECT_NAME SOURCES LIBS)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BUILD_TYPE}/build)
SET(TARGET ${PROJECT_NAME})
ADD_LIBRARY(${TARGET} STATIC ${SOURCES})
TARGET_LINK_LIBRARIES(${TARGET} ${LIBS})
IF ("${CMAKE_BUILD_TYPE_STABLE}" STREQUAL "RELEASE")
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}")
ELSE()
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}")
ENDIF()
ENDMACRO()
-37
View File
@@ -1,37 +0,0 @@
MACRO(INTEGRATE_BOOST)
SET(BOOST_COMPONENTS ${ARGV})
IF(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
FILE( TO_CMAKE_PATH $ENV{BOOST_ROOT} BOOST_ROOT )
IF( NOT EXISTS ${BOOST_ROOT} )
MESSAGE( STATUS ${BOOST_ROOT} " does not exist. Checking if BOOST_ROOT was a quoted string.." )
STRING( REPLACE "\"" "" BOOST_ROOT ${BOOST_ROOT} )
IF( EXISTS ${BOOST_ROOT} )
MESSAGE( STATUS "After removing the quotes " ${BOOST_ROOT} " was now found by CMake" )
ENDIF( EXISTS ${BOOST_ROOT})
ENDIF( NOT EXISTS ${BOOST_ROOT} )
# Save the BOOST_ROOT in the cache
IF( NOT EXISTS ${BOOST_ROOT} )
MESSAGE( WARNING "BOOST_ROOT does not exist." )
ELSE(NOT EXISTS ${BOOST_ROOT})
SET(BOOST_ROOT ${BOOST_ROOT} CACHE STRING "Set the value of BOOST_ROOT to point to the root folder of your boost install." FORCE)
ENDIF( NOT EXISTS ${BOOST_ROOT} )
ENDIF(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
# if(NOT BOOST_ROOT )
# MESSAGE( WARNING "Please set the BOOST_ROOT environment variable." )
# endif(NOT BOOST_ROOT )
SET(Boost_USE_STATIC_LIBS ON)
SET(Boost_USE_MULTITHREADED ON)
FIND_PACKAGE(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
IF( Boost_FOUND )
STRING(COMPARE LESS "${Boost_VERSION}" 1.50.0 VersionIncompatible)
IF(VersionIncompatible)
MESSAGE(FATAL_ERROR "Boost ${Boost_VERSION} not supported. Only 1.50.0 version and higher is supported.")
ELSE(VersionIncompatible)
MESSAGE (STATUS "Found Boost ${Boost_VERSION} -- ${Boost_LIBRARIES}")
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} )
LINK_LIBRARIES(${BOOST_LIBRARYDIR})
ENDIF(VersionIncompatible)
ENDIF()
ENDMACRO(INTEGRATE_BOOST)
-342
View File
@@ -1,342 +0,0 @@
FUNCTION(QUERY_QMAKE VAR RESULT)
GET_TARGET_PROPERTY(QMAKE_EXECUTABLE Qt5::qmake LOCATION)
EXEC_PROGRAM(${QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output )
IF(NOT return_code)
FILE(TO_CMAKE_PATH "${output}" output)
SET(${RESULT} ${output} PARENT_SCOPE)
ENDIF(NOT return_code)
ENDFUNCTION(QUERY_QMAKE)
FUNCTION(FIND_LIB PATH_WHERE_SEARCH _NAME RESULT)
STRING(REGEX REPLACE "[(0-9)]+$" "" CLEARNAME ${_NAME})
STRING(REGEX REPLACE ${CLEARNAME} "" VERSION ${_NAME})
SET(name_stable "${CMAKE_SHARED_LIBRARY_PREFIX}${_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
SET(PLUGIN "${PATH_WHERE_SEARCH}/${name_stable}")
#trying to search lib with suffix 5
IF(NOT EXISTS ${PLUGIN})
SET(PLUGIN "${PATH_WHERE_SEARCH}/${CMAKE_SHARED_LIBRARY_PREFIX}${CLEARNAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${VERSION}")
ENDIF()
IF(EXISTS ${PLUGIN})
SET(${RESULT} ${PLUGIN} PARENT_SCOPE)
ENDIF()
ENDFUNCTION(FIND_LIB)
MACRO(DEPLOY_QT_PLUGIN_HELPER _path PATH_WHERE_SEARCH LIB_DIST TYPE)
GET_FILENAME_COMPONENT(dir ${_path} PATH)
GET_FILENAME_COMPONENT(name ${_path} NAME_WE)
STRING(TOUPPER ${TYPE} _type)
IF(${_type} STREQUAL "DEBUG")# try to find debug version of library
SET(name_local "${name}${CMAKE_DEBUG_POSTFIX}")
FIND_LIB(${PATH_WHERE_SEARCH}/${dir} ${name_local} PLUGIN_${TYPE}_${name})
ENDIF()
IF(NOT PLUGIN_${TYPE}_${name})
FIND_LIB(${PATH_WHERE_SEARCH}/${dir} ${name} PLUGIN_${TYPE}_${name})
ENDIF()
IF(PLUGIN_${TYPE}_${name})
GET_FILENAME_COMPONENT(LibWithoutSymLink ${PLUGIN_${TYPE}_${name}} REALPATH)
GET_FILENAME_COMPONENT(PLUGIN_NAME ${PLUGIN_${TYPE}_${name}} NAME)
IF(NOT ${PLUGIN_${TYPE}_${name}} STREQUAL ${LibWithoutSymLink})
MESSAGE(STATUS "Deploying ${PLUGIN} plugin for ${TYPE}, realpath is ${LibWithoutSymLink}, name ${PLUGIN_NAME}")
INSTALL(FILES ${LibWithoutSymLink} DESTINATION "${LIB_DIST}/${dir}" CONFIGURATIONS ${TYPE} COMPONENT QTPLUGINS RENAME ${PLUGIN_NAME})
ELSE()
MESSAGE(STATUS "Deploying ${PLUGIN_${TYPE}_${name}} plugin for ${TYPE}")
INSTALL(FILES ${PLUGIN_${TYPE}_${name}} DESTINATION "${LIB_DIST}/${dir}" CONFIGURATIONS ${TYPE} COMPONENT QTPLUGINS)
ENDIF()
#SET(LIBS_TO_FIXUP ${LIB_DIST}/${dir} ${LIBS_TO_FIXUP})
#STRING(REPLACE "${QT_IMAGEFORMATS_PLUGINS_DIR}" "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/MacOS/imageformats"
# QT_IMAGEFORMATS_PLUGIN_LOCAL ${QT_${PLUGIN}_PLUGIN_DEBUG}
# )
#LIST(APPEND BUNDLE_LIBRARIES_MOVE ${QT_IMAGEFORMATS_PLUGIN_LOCAL})
ELSE()
MESSAGE(STATUS "Could not deploy ${PLUGIN_${name}}, required path: ${_path}, plugin for ${TYPE}")
ENDIF()
ENDMACRO(DEPLOY_QT_PLUGIN_HELPER)
MACRO(DEPLOY_QT_PLUGIN _path PATH_WHERE_SEARCH LIB_DIST)
IF(NOT CMAKE_BUILD_TYPE AND CMAKE_CONFIGURATION_TYPES)
FOREACH(buildconfig ${CMAKE_CONFIGURATION_TYPES})
DEPLOY_QT_PLUGIN_HELPER(${_path} ${PATH_WHERE_SEARCH} ${LIB_DIST} ${buildconfig})
ENDFOREACH(buildconfig ${CMAKE_CONFIGURATION_TYPES})
ELSEIF(CMAKE_BUILD_TYPE)
DEPLOY_QT_PLUGIN_HELPER(${_path} ${PATH_WHERE_SEARCH} ${LIB_DIST} ${CMAKE_BUILD_TYPE})
ENDIF(NOT CMAKE_BUILD_TYPE AND CMAKE_CONFIGURATION_TYPES)
ENDMACRO(DEPLOY_QT_PLUGIN)
macro(DETECT_QT)
if(ROBOMONGO_QT_VERSION STREQUAL 5)
find_package(Qt5Core REQUIRED)
message(STATUS "Qt5 found")
set(DEVELOPER_QT5 1)
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif()
else()
find_package(Qt4 REQUIRED)
message(STATUS "Qt4 found")
set(DEVELOPER_QT5 0)
endif()
endmacro()
MACRO(QTX_WRAP_CPP)
IF(DEVELOPER_QT5)
QT5_WRAP_CPP(${ARGN})
ELSE(DEVELOPER_QT5)
QT4_WRAP_CPP(${ARGN})
ENDIF(DEVELOPER_QT5)
ENDMACRO(QTX_WRAP_CPP)
MACRO(QTX_GENERATE_MOC)
IF(DEVELOPER_QT5)
QT5_GENERATE_MOC(${ARGN})
ELSE(DEVELOPER_QT5)
QT4_GENERATE_MOC(${ARGN})
ENDIF(DEVELOPER_QT5)
ENDMACRO(QTX_GENERATE_MOC)
MACRO(QTX_ADD_TRANSLATION)
IF(DEVELOPER_QT5)
QT5_ADD_TRANSLATION(${ARGN})
ELSE(DEVELOPER_QT5)
QT4_ADD_TRANSLATION(${ARGN})
ENDIF(DEVELOPER_QT5)
ENDMACRO(QTX_ADD_TRANSLATION)
MACRO(QTX_CREATE_TRANSLATION)
IF(DEVELOPER_QT5)
QT5_CREATE_TRANSLATION(${ARGN})
ELSE(DEVELOPER_QT5)
QT4_CREATE_TRANSLATION(${ARGN})
ENDIF(DEVELOPER_QT5)
ENDMACRO(QTX_CREATE_TRANSLATION)
MACRO(QTX_WRAP_UI)
IF(DEVELOPER_QT5)
QT5_WRAP_UI(${ARGN})
ELSE(DEVELOPER_QT5)
QT4_WRAP_UI(${ARGN})
ENDIF(DEVELOPER_QT5)
ENDMACRO(QTX_WRAP_UI)
MACRO(QTX_ADD_RESOURCES)
IF(DEVELOPER_QT5)
QT5_ADD_RESOURCES(${ARGN})
ELSE(DEVELOPER_QT5)
QT4_ADD_RESOURCES(${ARGN})
ENDIF(DEVELOPER_QT5)
ENDMACRO(QTX_ADD_RESOURCES)
MACRO(INTEGRATE_QT)
QUERY_QMAKE(QT_INSTALL_PLUGINS QT_PLUGINS_DIR)
QUERY_QMAKE(QT_INSTALL_BINS QT_BINS_DIR)
QUERY_QMAKE(QT_INSTALL_LIBS QT_LIBS_DIR)
IF(DEVELOPER_QT5)
SET(USE_QT_DYNAMIC ON)
SET(QT_COMPONENTS_TO_USE ${ARGV})
IF(DEVELOPER_BUILD_TESTS)
SET(QT_COMPONENTS_TO_USE ${QT_COMPONENTS_TO_USE} Qt5Test)
ENDIF(DEVELOPER_BUILD_TESTS)
FOREACH(qtComponent ${QT_COMPONENTS_TO_USE})
IF(NOT ${qtComponent} STREQUAL "Qt5ScriptTools")
FIND_PACKAGE(${qtComponent} REQUIRED)
ELSE()
FIND_PACKAGE(${qtComponent} QUIET)
ENDIF()
INCLUDE_DIRECTORIES( ${${qtComponent}_INCLUDE_DIRS} )
#STRING(REGEX REPLACE "Qt5" "" COMPONENT_SHORT_NAME ${qtComponent})
#set(QT_MODULES_TO_USE ${QT_MODULES_TO_USE} ${COMPONENT_SHORT_NAME})
IF(${${qtComponent}_FOUND} AND NOT(${qtComponent} STREQUAL "Qt5LinguistTools"))
STRING(REGEX REPLACE "Qt5" "" componentShortName ${qtComponent})
SET(QT_LIBRARIES ${QT_LIBRARIES} "Qt5::${componentShortName}")
ENDIF()
ENDFOREACH(qtComponent ${QT_COMPONENTS_TO_USE})
IF(NOT Qt5ScriptTools_FOUND)
ADD_DEFINITIONS(-DQT_NO_SCRIPTTOOLS)
ENDIF()
IF(DEVELOPER_OPENGL)
FIND_PACKAGE(Qt5OpenGL REQUIRED)
INCLUDE_DIRECTORIES( ${Qt5OpenGL_INCLUDE_DIRS})
ENDIF(DEVELOPER_OPENGL)
SETUP_COMPILER_SETTINGS(${USE_QT_DYNAMIC})
ELSE(DEVELOPER_QT5)
SET(QT_COMPONENTS_TO_USE ${ARGV})
# repeat this for every debug/optional package
LIST(FIND QT_COMPONENTS_TO_USE "QtScriptTools" QT_SCRIPT_TOOLS_INDEX)
IF(NOT ${QT_SCRIPT_TOOLS_INDEX} EQUAL -1)
LIST(REMOVE_ITEM QT_COMPONENTS_TO_USE "QtScriptTools")
SET(QT_DEBUG_COMPONENTS_TO_USE ${QT_DEBUG_COMPONENTS_TO_USE} "QtScriptTools")
ENDIF()
IF(DEVELOPER_BUILD_TESTS)
SET(QT_COMPONENTS_TO_USE ${QT_COMPONENTS_TO_USE} QtTest)
ENDIF(DEVELOPER_BUILD_TESTS)
FIND_PACKAGE(Qt4 COMPONENTS ${QT_COMPONENTS_TO_USE} REQUIRED)
FIND_PACKAGE(Qt4 COMPONENTS ${QT_DEBUG_COMPONENTS_TO_USE} QUIET)
IF(NOT QT_QTSCRIPTTOOLS_FOUND)
ADD_DEFINITIONS(-DQT_NO_SCRIPTTOOLS)
ENDIF()
INCLUDE(${QT_USE_FILE})
SET(QT_3RDPARTY_DIR ${QT_BINARY_DIR}/../src/3rdparty)
#checking is Qt dynamic or statis version will be used
GET_FILENAME_COMPONENT(QTCORE_DLL_NAME_WE ${QT_QTCORE_LIBRARY_RELEASE} NAME_WE)
GET_FILENAME_COMPONENT(QT_LIB_PATH ${QT_QTCORE_LIBRARY_RELEASE} PATH)
IF(WIN32)
SET(DLL_EXT dll)
# message("searching ${QTCORE_DLL_NAME_WE}.${DLL_EXT} in " ${QT_LIB_PATH} ${QT_LIB_PATH}/../bin)
FIND_FILE(QTCORE_DLL_FOUND_PATH ${QTCORE_DLL_NAME_WE}.${DLL_EXT} PATHS ${QT_LIB_PATH} ${QT_LIB_PATH}/../bin
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_CMAKE_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH
)
MESSAGE("QTCORE_DLL_FOUND_PATH=" ${QTCORE_DLL_FOUND_PATH})
IF(EXISTS ${QTCORE_DLL_FOUND_PATH})
SET(USE_QT_DYNAMIC ON)
ELSE(EXISTS ${QTCORE_DLL_FOUND_PATH})
SET(USE_QT_DYNAMIC OFF)
ENDIF(EXISTS ${QTCORE_DLL_FOUND_PATH})
ELSE()
SET(USE_QT_DYNAMIC ON)
ENDIF(WIN32)
SETUP_COMPILER_SETTINGS(${USE_QT_DYNAMIC})
# use jscore
IF(MSVC AND NOT USE_QT_DYNAMIC)
FIND_LIBRARY(JSCORE_LIB_RELEASE jscore
PATHS
${QT_3RDPARTY_DIR}/webkit/Source/JavaScriptCore/release
${QT_3RDPARTY_DIR}/webkit/JavaScriptCore/release
)
FIND_LIBRARY(JSCORE_LIB_DEBUG NAMES jscored jscore
PATHS
${QT_3RDPARTY_DIR}/webkit/Source/JavaScriptCore/debug
${QT_3RDPARTY_DIR}/webkit/JavaScriptCore/debug
)
SET(JSCORE_LIBS optimized ${JSCORE_LIB_RELEASE} debug ${JSCORE_LIB_DEBUG} )
ENDIF(MSVC AND NOT USE_QT_DYNAMIC)
# end of use jscore
ENDIF(DEVELOPER_QT5)
ENDMACRO(INTEGRATE_QT)
##############################################################################
MACRO(INSTALL_QT TARGET_NAME LIB_DIST)
IF(NOT DEVELOPER_QT5)
IF(WIN32 OR APPLE)
SET(QT_COMPONENTS_TO_USE ${ARGV})
LIST(REMOVE_ITEM QT_COMPONENTS_TO_USE ${TARGET_NAME})
FIND_PACKAGE(Qt4 COMPONENTS ${QT_COMPONENTS_TO_USE} REQUIRED)
FIND_PACKAGE(Qt4 COMPONENTS ${QT_DEBUG_COMPONENTS_TO_USE} QUIET)
INCLUDE(${QT_USE_FILE})
GET_TARGET_PROPERTY(targetLocation ${TARGET_NAME} LOCATION)
GET_FILENAME_COMPONENT(targetDir ${targetLocation} PATH)
IF(WIN32)
SET(REPLACE_IN_LIB ".lib" ".dll")
SET(REPLACE_IN_LIB2 "/lib/([^/]+)$" "/bin/\\1")
ELSEIF(APPLE)
SET(REPLACE_IN_LIB ".a" ".dylib")
SET(REPLACE_IN_LIB2 "" "")
ENDIF()
FOREACH(qtComponent ${QT_COMPONENTS_TO_USE} ${QT_DEBUG_COMPONENTS_TO_USE})
STRING(TOUPPER "${qtComponent}" QtComCap)
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${QT_${QtComCap}_LIBRARY})
IF(NOT ${qtComponent} STREQUAL "QtMain")
STRING(REPLACE ${REPLACE_IN_LIB} dllNameDeb "${QT_${QtComCap}_LIBRARY_DEBUG}")
IF(WIN32)
STRING(REGEX REPLACE ${REPLACE_IN_LIB2} dllNameDeb ${dllNameDeb})
ENDIF()
SET(DLIBS_TO_COPY_DEBUG ${DLIBS_TO_COPY_DEBUG} ${dllNameDeb})
IF(NOT ${qtComponent} STREQUAL "QtScriptTools")
STRING(REPLACE ${REPLACE_IN_LIB} dllNameRel "${QT_${QtComCap}_LIBRARY_RELEASE}")
IF(WIN32)
STRING(REGEX REPLACE ${REPLACE_IN_LIB2} dllNameRel ${dllNameRel})
ENDIF()
SET(DLIBS_TO_COPY_RELEASE ${DLIBS_TO_COPY_RELEASE} ${dllNameRel})
ENDIF()
# TODO: check this code @ MAC and *ux
ADD_CUSTOM_COMMAND(TARGET ${TARGET_NAME} POST_BUILD COMMAND
${CMAKE_COMMAND} -E copy $<$<CONFIG:Debug>:
${dllNameDeb}> $<$<NOT:$<CONFIG:Debug>>:
${dllNameRel}> $<TARGET_FILE_DIR:${TARGET_NAME}>
)
ENDIF(NOT ${qtComponent} STREQUAL "QtMain")
ENDFOREACH(qtComponent ${QT_COMPONENTS_TO_USE})
ENDIF(WIN32 OR APPLE)
ELSE()# Qt5
LIST(FIND QT_COMPONENTS_TO_USE "Qt5Xml" QT_XML_INDEX)
IF(NOT ${QT_XML_INDEX} EQUAL -1)
GET_TARGET_PROPERTY(libLocation ${Qt5Xml_LIBRARIES} LOCATION)
STRING(REGEX REPLACE "Xml" "XmlPatterns" libLocation ${libLocation})
QT_ADD_TO_INSTALL(${TARGET_NAME} ${libLocation} "")
ENDIF()
FOREACH(qtComponent ${QT_COMPONENTS_TO_USE} ${QT_DEBUG_COMPONENTS_TO_USE})
IF(NOT ${qtComponent} STREQUAL "Qt5LinguistTools")
IF(NOT "${${qtComponent}_LIBRARIES}" STREQUAL "")
GET_TARGET_PROPERTY(libLocation ${${qtComponent}_LIBRARIES} LOCATION)
QT_ADD_TO_INSTALL(${TARGET_NAME} ${libLocation} "")
ELSE(NOT "${${qtComponent}_LIBRARIES}" STREQUAL "")
MESSAGE("Canont find library ${qtComponent}_LIBRARIES")
ENDIF(NOT "${${qtComponent}_LIBRARIES}" STREQUAL "")
ENDIF()
ENDFOREACH(qtComponent ${QT_COMPONENTS_TO_USE} ${QT_DEBUG_COMPONENTS_TO_USE})
ENDIF(NOT DEVELOPER_QT5)
MESSAGE(STATUS "Qt libs to install ${DLIBS_TO_COPY_RELEASE}")
IF(MSVC OR APPLE)
# Visual studio install
FOREACH(buildconfig ${CMAKE_CONFIGURATION_TYPES})
IF(${buildconfig} STREQUAL "Debug")
SET(DLIBS_TO_COPY ${DLIBS_TO_COPY_ALL} ${DLIBS_TO_COPY_DEBUG})
ELSE()
SET(DLIBS_TO_COPY ${DLIBS_TO_COPY_ALL} ${DLIBS_TO_COPY_RELEASE})
ENDIF()
INSTALL(FILES ${DLIBS_TO_COPY} DESTINATION ${LIB_DIST} CONFIGURATIONS ${buildconfig} COMPONENT QTLIBS )
ENDFOREACH(buildconfig ${CMAKE_CONFIGURATION_TYPES})
ELSEIF(UNIX)
# Make install
STRING(TOUPPER ${CMAKE_BUILD_TYPE} TYPE)
IF(${TYPE} STREQUAL "DEBUG")
SET(DLIBS_TO_COPY ${DLIBS_TO_COPY_ALL} ${DLIBS_TO_COPY_DEBUG})
ELSE()
SET(DLIBS_TO_COPY ${DLIBS_TO_COPY_ALL} ${DLIBS_TO_COPY_RELEASE})
ENDIF()
IF(WIN32 OR APPLE)
INSTALL(FILES ${DLIBS_TO_COPY} DESTINATION ${LIB_DIST})
ELSE()
#eliminate symlinks
FOREACH(dllsToCopy ${DLIBS_TO_COPY})
GET_FILENAME_COMPONENT(name ${dllsToCopy} NAME)
STRING(REGEX REPLACE "[^5]+$" "" lnname ${name})
INSTALL(FILES ${dllsToCopy} DESTINATION ${LIB_DIST} CONFIGURATIONS ${TYPE} COMPONENT QTLIBS RENAME ${lnname})
ENDFOREACH(dllsToCopy ${DLIBS_TO_COPY})
ENDIF()
ENDIF(MSVC OR APPLE)
ENDMACRO(INSTALL_QT)
MACRO(QT_ADD_TO_INSTALL TARGET_NAME libLocation copyToSubdirectory)
SET(libLocation_release ${libLocation})
SET(REPLACE_PATTERN "/lib/([^/]+)$" "/bin/\\1") # from lib to bin
IF(NOT EXISTS "${libLocation_release}")
STRING(REGEX REPLACE ${REPLACE_PATTERN} libLocation_release ${libLocation_release})
ENDIF()
IF(EXISTS "${libLocation_release}")
SET(DLIBS_TO_COPY_RELEASE ${DLIBS_TO_COPY_RELEASE} ${libLocation_release})
STRING(REGEX REPLACE ${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_DEBUG_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX} libLocation_debug ${libLocation_release})
IF(EXISTS "${libLocation_debug}")
SET(DLIBS_TO_COPY_DEBUG ${DLIBS_TO_COPY_DEBUG} ${libLocation_debug})
ELSE()
SET(DLIBS_TO_COPY_DEBUG ${DLIBS_TO_COPY_DEBUG} ${libLocation_release})
ENDIF()
ENDIF()
ENDMACRO(QT_ADD_TO_INSTALL)
-244
View File
@@ -1,244 +0,0 @@
MACRO(SET_DESKTOP_TARGET)
# Set default target to build (under win32 its allows console debug)
IF(WIN32)
OPTION(DEVELOPER_WINCONSOLE "Enable windows console windows for debug" OFF)
IF(DEVELOPER_FEATURES AND DEVELOPER_WINCONSOLE)
SET(DESKTOP_TARGET "")
ELSE(DEVELOPER_FEATURES AND DEVELOPER_WINCONSOLE)
SET(DESKTOP_TARGET WIN32)
ENDIF(DEVELOPER_FEATURES AND DEVELOPER_WINCONSOLE)
ELSEIF(APPLE)
SET(DESKTOP_TARGET MACOSX_BUNDLE)
ENDIF(WIN32)
ENDMACRO(SET_DESKTOP_TARGET)
MACRO(DEFINE_DEFAULT_DEFINITIONS)
IF(WIN32)
ADD_DEFINITIONS(
-DNOMINMAX # do not define min() and max()
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_NONSTDC_NO_WARNINGS
-D_CRT_SECURE_NO_WARNINGS
#-D__STDC_CONSTANT_MACROS
#-DWIN32_LEAN_AND_MEAN # remove obsolete things from windows headers
)
ENDIF(WIN32)
ADD_DEFINITIONS(
-DPROJECT_NAME="${PROJECT_NAME}"
-DPROJECT_NAME_TITLE="${PROJECT_NAME_TITLE}"
-DPROJECT_COPYRIGHT="${PROJECT_COPYRIGHT}"
-DPROJECT_DOMAIN="${PROJECT_DOMAIN}"
-DPROJECT_COMPANYNAME="${PROJECT_COMPANYNAME}"
-DPROJECT_COMPANYNAME_DOMAIN="${PROJECT_COMPANYNAME_DOMAIN}"
-DPROJECT_GITHUB_FORK="${PROJECT_GITHUB_FORK}"
-DPROJECT_GITHUB_ISSUES="${PROJECT_GITHUB_ISSUES}"
-DPROJECT_VERSION="${PROJECT_VERSION}"
-DPROJECT_NAME_LOWERCASE="${PROJECT_NAME_LOWERCASE}"
)
IF(DEVELOPER_FEATURES)
ADD_DEFINITIONS(-DDEVELOPER_FEATURES)
IF(WIN32)
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
ENDIF(WIN32)
ENDIF(DEVELOPER_FEATURES)
IF(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zi")
ENDIF(WIN32)
ENDMACRO(DEFINE_DEFAULT_DEFINITIONS)
MACRO(SETUP_COMPILER_SETTINGS IS_DYNAMIC)
IF(MSVC)
SET(ADDITIONAL_CL_OPTIMIZATION_OPTIONS
#/Gr # fastcall
/Gy # function level linking
/GF # string pooling
/GL # whole program optimization
#/FR # disable browserable info
/Oi # intrinsic functions
/Ot # fast code
/Ob2 # inline expansion
/Ox # full optimization
#/arch:SSE2
/fp:except- /fp:fast
)
SET(ADDITIONAL_CL_OPTIMIZATION_OPTIONS_PROJECTNAME
#/Gd # cdecl
/Os # small code
/Og # Turn on loop, common subexpression and register optimizations
/Ob0 # do not inline
/O2 # maximize speed
/fp:precise
)
SET(ADDITIONAL_LINKER_OPTIMIZATION_OPTIONS
/INCREMENTAL:NO
/LTCG
/DEBUG
)
ENDIF()
SET(IS_DYNAMIC ${IS_DYNAMIC})
STRING(REPLACE ";" " " cmake_cl_release_init_str "${ADDITIONAL_CL_OPTIMIZATION_OPTIONS} /D NDEBUG")
STRING(REPLACE ";" " " cmake_linker_release_init_str "${ADDITIONAL_LINKER_OPTIMIZATION_OPTIONS}")
IF(IS_DYNAMIC)
SET(makeRulesOwerrideContent "
IF(MSVC)
SET(CMAKE_C_FLAGS_DEBUG_INIT \"/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1\")
SET(CMAKE_C_FLAGS_MINSIZEREL_INIT \"/MD /O1 /Ob1 /D NDEBUG\")
SET(CMAKE_C_FLAGS_RELEASE_INIT \"/MD /O2 /Ob2 /D NDEBUG\")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT \"/MD /Zi /O2 /Ob1 /D NDEBUG\")
SET(CMAKE_CXX_FLAGS_DEBUG_INIT \"/D_DEBUG /MDd /Zi /Ob0 /Od /EHsc /RTC1\")
SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT \"/MD /O1 ${cmake_cl_release_init_str}\")
SET(CMAKE_CXX_FLAGS_RELEASE_INIT \"/MD /O2 ${cmake_cl_release_init_str}\")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT \"/MD /Zi /O2 /Ob1 /D NDEBUG /EHsc\")
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT \"${cmake_linker_release_init_str}\")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT \"${cmake_linker_release_init_str}\")
SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT \"${cmake_linker_release_init_str}\")
ENDIF(MSVC)
")
IF(MSVC)
SET(CMAKE_CXX_FLAGS_DEBUG "/MDd /D_DEBUG /Zi /Ob0 /Od /RTC1")
SET(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 ${cmake_cl_release_init_str}")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MD /O1 ${cmake_cl_release_init_str}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /Zi ${cmake_cl_release_init_str}")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${cmake_linker_release_init_str}")
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${cmake_linker_release_init_str}")
SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${cmake_linker_release_init_str}")
ENDIF(MSVC)
MESSAGE("Using setting for DYNAMIC run-time")
else(IS_DYNAMIC)
SET(makeRulesOwerrideContent "
IF(MSVC)
SET(CMAKE_C_FLAGS_INIT \"/MT\")
SET(CMAKE_CXX_FLAGS_INIT \"/MT /EHsc\")
SET(CMAKE_C_FLAGS_DEBUG_INIT \"/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1\")
SET(CMAKE_C_FLAGS_MINSIZEREL_INIT \"/MT /O1 /Ob1 /D NDEBUG\")
SET(CMAKE_C_FLAGS_RELEASE_INIT \"/MT /O2 /Ob2 /D NDEBUG\")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT \"/MT /Zi /O2 /Ob1 /D NDEBUG\")
SET(CMAKE_CXX_FLAGS_DEBUG_INIT \"/D_DEBUG /MTd /Zi /Ob0 /Od /EHsc /RTC1\")
SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT \"/MT /O1 ${cmake_cl_release_init_str}\")
SET(CMAKE_CXX_FLAGS_RELEASE_INIT \"/MT /O2 ${cmake_cl_release_init_str}\")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT \"/MT /Zi /O2 /Ob1 /D NDEBUG /EHsc\")
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT \"${cmake_linker_release_init_str}\")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT \"${cmake_linker_release_init_str}\")
SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT \"${cmake_linker_release_init_str}\")
ENDIF(MSVC)
")
IF(MSVC)
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /D_DEBUG /Zi /Ob0 /Od /RTC1")
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 ${cmake_cl_release_init_str}")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 ${cmake_cl_release_init_str}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /O2 /Zi ${cmake_cl_release_init_str}")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${cmake_linker_release_init_str}")
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${cmake_linker_release_init_str}")
SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${cmake_linker_release_init_str}")
ENDIF(MSVC)
MESSAGE("Using setting for STATIC run-time")
ADD_DEFINITIONS(-DQT_STATICPLUGINS)
ENDIF(IS_DYNAMIC)
FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/makeRulesOwerride.cmake" "${makeRulesOwerrideContent}")
SET(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_BINARY_DIR}/makeRulesOwerride.cmake)
IF(APPLE)
#set(LIBCXX_DIR ${CMAKE_CURRENT_SOURCE_DIR}/imports/libc++10.7)
#set(CMAKE_OSX_ARCHITECTURES i386)
#set(CMAKE_OSX_ARCHITECTURES_DEBUG i368)
#set(CMAKE_CXX_FLAGS "-arch i386")
#set(LINK_FLAGS "-arch i386")
#set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
#set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
#set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -nostdinc++ -I${LIBCXX_DIR}/include -g -Wall")
#set(LINK_FLAGS "${LINK_FLAGS} -L${LIBCXX_DIR}/lib -arch i386")
# Detection target arch automaticly
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")
#set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
#set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
#set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
ELSEIF(UNIX)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
ENDIF()
ENDMACRO(SETUP_COMPILER_SETTINGS IS_DYNAMIC)
MACRO(INSTALL_RUNTIME_LIBRARIES)
# Install CRT
IF(WIN32)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
include (InstallRequiredSystemLibraries)
ENDIF(WIN32)
# TODO: add code for other platforms here
ENDMACRO(INSTALL_RUNTIME_LIBRARIES)
MACRO(ADD_DLIB_TO_POSTBUILD_STEP TARGET_NAME DLIB_NAME)
IF(MSVC OR APPLE)
GET_TARGET_PROPERTY(dlib_location ${DLIB_NAME} LOCATION)
GET_FILENAME_COMPONENT(dlib_targetdir ${dlib_location} PATH)
SET(DLIB_DEBUG ${dlib_targetdir}/${CMAKE_SHARED_LIBRARY_PREFIX}${DLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
SET(DLIB_RELEASE ${dlib_targetdir}/${CMAKE_SHARED_LIBRARY_PREFIX}${DLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
ADD_CUSTOM_COMMAND(TARGET ${TARGET_NAME} POST_BUILD COMMAND
${CMAKE_COMMAND} -E copy $<$<CONFIG:Debug>:${DLIB_DEBUG}> $<$<NOT:$<CONFIG:Debug>>:${DLIB_RELEASE}> $<TARGET_FILE_DIR:${TARGET_NAME}>
)
ENDIF(MSVC OR APPLE)
ENDMACRO(ADD_DLIB_TO_POSTBUILD_STEP)
MACRO(INSTALL_DEBUG_INFO_FILE)
IF(WIN32)
#install pbd files
FOREACH(buildCfg ${CMAKE_CONFIGURATION_TYPES})
INSTALL(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${buildCfg}/${PROJECT_NAME}.pdb
DESTINATION .
CONFIGURATIONS ${buildCfg})
ENDFOREACH(buildCfg ${CMAKE_CONFIGURATION_TYPES})
ENDIF(WIN32)
# TODO: add code for other platforms here
ENDMACRO(INSTALL_DEBUG_INFO_FILE)
MACRO(TARGET_BUNDLEFIX TARGET_NAME LIB_DIST)
IF(APPLE)
INSTALL(CODE "
FILE(GLOB_RECURSE QTPLUGINS_FIXUP
\"\${CMAKE_INSTALL_PREFIX}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
include(BundleUtilities)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}\" \"\${QTPLUGINS_FIXUP}\" \"\${CMAKE_INSTALL_PREFIX}/${LIB_DIST}\")
" COMPONENT Runtime)
ENDIF(APPLE)
ENDMACRO(TARGET_BUNDLEFIX TARGET_NAME)
if(APPLE)
write_file(${CMAKE_CURRENT_BINARY_DIR}/src/bundle_config.cmake "") # Stub for file
macro(APPEND_DYNAMIC_LIB LIBRARY)
get_filename_component(LIBRARY_PATH ${LIBRARY} PATH)
get_filename_component(LIBRARY_NAME ${LIBRARY} NAME)
get_target_property(projLocation ${PROJECT_NAME} LOCATION)
string(REPLACE "/Contents/MacOS/${PROJECT_NAME}" "" MACOSX_BUNDLE_LOCATION ${projLocation})
string(REPLACE "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" "$(CONFIGURATION)" APPS ${MACOSX_BUNDLE_LOCATION})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND cp \"${LIBRARY}\" \"${APPS}/Contents/MacOS/\")
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND install_name_tool -change \"${LIBRARY}\" \"@executable_path/../MacOS/${LIBRARY_NAME}\" \"${projLocation}\")
set(BUNDLE_LIBRARIES_MOVE "${BUNDLE_LIBRARIES_MOVE};${APPS}/Contents/MacOS/${LIBRARY_NAME}")
set(BUNDLE_DIRECTORY_MOVE "${BUNDLE_DIRECTORY_MOVE};${LIBRARY_PATH}")
# override fix_bundle config
write_file(${CMAKE_CURRENT_BINARY_DIR}/bundle_config.cmake "
set(BUNDLE_LIBRARIES_MOVE \"${BUNDLE_LIBRARIES_MOVE}\")
set(BUNDLE_DIRECTORY_MOVE \"${BUNDLE_DIRECTORY_MOVE}\")
")
endmacro(APPEND_DYNAMIC_LIB)
endif(APPLE)
-4
View File
@@ -1,4 +0,0 @@
MACRO(SETUP_TESTING)
enable_testing()
include(CTest)
ENDMACRO(SETUP_TESTING)
-37
View File
@@ -1,37 +0,0 @@
macro(VersionConf prjName from_file to_file iconname)
set(COMPANYNAME "\"${PROJECT_COMPANYNAME}\"")
set(filecontent "
SET(ICON_FILE ${ICON_FILE})
SET(MAJOR_VER ${MAJOR} )
SET(MINOR_VER1 ${MINOR})
SET(MINOR_VER2 ${PATCH})
SET(PRODUCTNAME ${prjName})
SET(COMPANYNAME ${COMPANYNAME})
SET(PRODUCTDOMAIN ${PROJECT_DOMAIN})
SET(SHORTPRODUCTNAME ${prjName})
SET(ICONNAME ${iconname})
SET(PRODUCTCOPYRIGHT ${PROJECT_COPYRIGHT})
CONFIGURE_FILE(${from_file} ${to_file})
")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/versionConfFile.cmake" "${filecontent}")
add_custom_target(VersionConf ALL DEPENDS ${to_file})
add_custom_command(
OUTPUT ${to_file}
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_BINARY_DIR}/versionConfFile.cmake)
set_source_files_properties(${to_file} PROPERTIES GENERATED TRUE)
add_dependencies(${prjName} VersionConf)
endmacro()
###
# Prints all CMake variables.
# Usefull only for debug needs.
#
macro(print_all_vars)
get_cmake_property(NAMES VARIABLES)
foreach (NAME ${NAMES})
message(STATUS "${NAME}=${${NAME}}")
endforeach()
endmacro()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

@@ -1,11 +0,0 @@
--- /home/dmitry/libs/mongo/src/mongo/scripting/bench.cpp 2013-02-17 22:49:18.252603371 +0300
+++ /home/dmitry/dev/robomongo/src/robomongo/shell/scripting/bench.cpp 2013-02-18 23:11:46.024268678 +0300
@@ -18,7 +18,7 @@
-#include "pch.h"
+#include "mongo/pch.h"
#include "mongo/scripting/bench.h"

Some files were not shown because too many files have changed in this diff Show More