Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eddf2b0339 | ||
|
|
f2226c92b3 | ||
|
|
466709df23 | ||
|
|
702459918b | ||
|
|
4efbd8b90a | ||
|
|
655bfcba0a | ||
|
|
041356ebac | ||
|
|
32e9ceb741 | ||
|
|
1aeb0e42dc | ||
|
|
9c419b1f2e | ||
|
|
0786489924 | ||
|
|
9cc34df185 | ||
|
|
d5adcdf988 | ||
|
|
837c0e1a17 | ||
|
|
d458f43b63 | ||
|
|
1cfb1b6287 | ||
|
|
6f5124616a | ||
|
|
3ba2f8ae93 | ||
|
|
b6d87141f2 | ||
|
|
993e9355bb | ||
|
|
be655902b4 | ||
|
|
f9332befb3 | ||
|
|
66728df978 | ||
|
|
60dc85c2fc | ||
|
|
4b4eb623b9 | ||
|
|
d2c98bf559 | ||
|
|
9a31503996 | ||
|
|
cb4622f61f | ||
|
|
1ce1091eca | ||
|
|
4546eef1e3 | ||
|
|
1d8f24ced2 | ||
|
|
19a61ba517 | ||
|
|
2b377e35f1 | ||
|
|
f5011630a3 | ||
|
|
8967a84f12 | ||
|
|
38bed5e4eb | ||
|
|
5370ecedd8 | ||
|
|
0e8cd5cefc | ||
|
|
e3c3649b0f | ||
|
|
19f953fa54 | ||
|
|
ad1b5e35c7 | ||
|
|
ff2eb0fef6 | ||
|
|
d356c14f87 | ||
|
|
829cbf890b | ||
|
|
5ae52d4b4f | ||
|
|
4608c6b7ee | ||
|
|
7c7a818ca0 | ||
|
|
08c6d44185 | ||
|
|
dc8495b147 | ||
|
|
e2f5765a87 | ||
|
|
7ebc059430 | ||
|
|
0d3fda185f | ||
|
|
38df06261b | ||
|
|
0086df54f0 | ||
|
|
ddc0c910c8 | ||
|
|
31f74baef7 | ||
|
|
8cd4f50304 | ||
|
|
48f6abb361 | ||
|
|
27626665a1 | ||
|
|
47039d8685 | ||
|
|
bc9aded3b7 | ||
|
|
f919544d1e | ||
|
|
ea49d0508a | ||
|
|
894f508f6c | ||
|
|
2f2d3d584e | ||
|
|
67ae8a614d | ||
|
|
cbba0e639d | ||
|
|
8f3fdf3d1d | ||
|
|
650fdd60cc | ||
|
|
8b114b5122 | ||
|
|
bc96addce5 | ||
|
|
bac2c9d5ec | ||
|
|
94e0c37cf8 | ||
|
|
42d6181724 | ||
|
|
4c5f2e99cb | ||
|
|
95e2fef4a6 | ||
|
|
4d8e3e61a1 | ||
|
|
c227798a4b | ||
|
|
fc5a6b9ac6 | ||
|
|
b820f17b3c | ||
|
|
079ec51dac | ||
|
|
88dee956f2 | ||
|
|
53945eb095 | ||
|
|
578447ecc3 | ||
|
|
0cecad49b3 | ||
|
|
652df93690 | ||
|
|
efa81c11c5 | ||
|
|
4af070b5b8 | ||
|
|
95faf9332e | ||
|
|
7e87befd3d | ||
|
|
d6155f4c35 | ||
|
|
33c89eac63 | ||
|
|
335adc6bdb | ||
|
|
a107084745 | ||
|
|
67f60b19ea | ||
|
|
734b17d0e7 | ||
|
|
7739c92064 | ||
|
|
0ae5f12024 | ||
|
|
e05dd9d1e9 | ||
|
|
ecbbeaeeca | ||
|
|
ea164e82a7 | ||
|
|
bfa1e68ce0 | ||
|
|
dc010092ab | ||
|
|
82c6bd6452 | ||
|
|
49a1251091 | ||
|
|
97ffad1178 | ||
|
|
592883af29 | ||
|
|
51a38c5607 | ||
|
|
5a645015a2 | ||
|
|
064094489f | ||
|
|
218310c23c | ||
|
|
7c48a9e28d | ||
|
|
8ecffcbddb | ||
|
|
c31f8d8275 | ||
|
|
6db3fe11b9 | ||
|
|
ae7735f6bd | ||
|
|
22dc364f7e | ||
|
|
f11f22f6bb | ||
|
|
2e07f1a9cb | ||
|
|
62bc7e5ff7 | ||
|
|
6b9dd95b26 | ||
|
|
0f3fd3ace1 | ||
|
|
10b9e91c8e | ||
|
|
f813bc42ed | ||
|
|
1c713c0e7e | ||
|
|
6b36671ad7 | ||
|
|
720ee7981b | ||
|
|
dbed9b88a4 | ||
|
|
d5afee08af | ||
|
|
5ae70fcf29 | ||
|
|
16621d9ce1 | ||
|
|
32bfb590a8 | ||
|
|
0e2f9b427f | ||
|
|
1f8abd1be7 | ||
|
|
f7e24ba46c | ||
|
|
d3b993d67e | ||
|
|
eddd6269e7 | ||
|
|
ad14cf6a94 | ||
|
|
53f92d91e7 | ||
|
|
58e8c708c4 | ||
|
|
3b7f1f9cce | ||
|
|
d921975e9f | ||
|
|
9db35b6597 | ||
|
|
c6c5bd179b | ||
|
|
dd1d3ebdc4 | ||
|
|
d5110c4ac8 | ||
|
|
e08775f18a | ||
|
|
a1e273a147 | ||
|
|
79a7d163c4 | ||
|
|
4fd1a633e7 | ||
|
|
ce126b0f1d | ||
|
|
1ccde63c31 | ||
|
|
713972aed0 | ||
|
|
a1abb11ec4 | ||
|
|
2f86b628f9 | ||
|
|
23994758dd | ||
|
|
1c5b6a722a | ||
|
|
a62d826005 | ||
|
|
c98d72f0cd | ||
|
|
55d59c1944 | ||
|
|
064b0b5ee1 | ||
|
|
ebf03afa75 | ||
|
|
116b2efd5f | ||
|
|
dfa66b8113 | ||
|
|
620b0ff59a | ||
|
|
bc01acfef0 | ||
|
|
f8199eaa79 | ||
|
|
bb7408979a | ||
|
|
93a42e752b | ||
|
|
8959bcb912 | ||
|
|
d533e3bf8e | ||
|
|
fbdd73ec58 | ||
|
|
3c5e570e04 | ||
|
|
263c02eaab | ||
|
|
44ad01b3ad | ||
|
|
a37736eed6 | ||
|
|
a3c09047e6 | ||
|
|
dc30c28c02 | ||
|
|
d17f2e6eb9 | ||
|
|
fdabd03924 | ||
|
|
a8a04186ed | ||
|
|
164dd1d7a5 | ||
|
|
4fc487348a | ||
|
|
0bb566869e | ||
|
|
9fb495d785 | ||
|
|
df86e7c8ec | ||
|
|
1e6f4d8052 | ||
|
|
bd470b1330 | ||
|
|
60b3494207 | ||
|
|
475a7fc44c | ||
|
|
f19c5a0dc0 | ||
|
|
3e35f1dea3 | ||
|
|
d8197dd00e | ||
|
|
3205248519 | ||
|
|
224801dcd9 | ||
|
|
e8c0de07de | ||
|
|
cf7e061c7a | ||
|
|
a75becd6c5 | ||
|
|
e411bbe3c4 | ||
|
|
c8ca4bc945 | ||
|
|
ffd9d13d79 | ||
|
|
4addeb5835 | ||
|
|
c086c9ab83 | ||
|
|
44e30e4520 | ||
|
|
8f93cd7dd6 | ||
|
|
a4390d348b | ||
|
|
bd72766414 | ||
|
|
866828c1ba | ||
|
|
8cedcc5d55 | ||
|
|
860cee5f12 | ||
|
|
a75972cf3b | ||
|
|
03e3592443 | ||
|
|
c113244319 | ||
|
|
3a64e1310b | ||
|
|
306b759b74 | ||
|
|
5976884b0f | ||
|
|
ee907c3321 | ||
|
|
86307a724f | ||
|
|
997aa44654 | ||
|
|
feb1d277e9 | ||
|
|
7e1dac26f1 | ||
|
|
a7b95d4caf | ||
|
|
bb042fe70b | ||
|
|
e50ee8fbee | ||
|
|
55d8a6ff76 | ||
|
|
576fc07b5b | ||
|
|
b4978269a5 | ||
|
|
24e9a74a6c | ||
|
|
61e79155b4 | ||
|
|
d23d9a2e7a | ||
|
|
ae13e30494 | ||
|
|
292c664941 | ||
|
|
c78845571e | ||
|
|
a0d5c67e48 | ||
|
|
059a3dcc37 | ||
|
|
d543bb4539 | ||
|
|
3e8f800682 | ||
|
|
368f2abe0d | ||
|
|
1e8af399e7 | ||
|
|
72f669e189 | ||
|
|
c787b54e7c | ||
|
|
3512be30cf | ||
|
|
0bb279eec8 | ||
|
|
75331d9025 | ||
|
|
99a46eafc8 | ||
|
|
ac9300f5be | ||
|
|
4e4e5154f4 | ||
|
|
b54c096762 | ||
|
|
5d409ec1de | ||
|
|
845315eeb5 | ||
|
|
803306eea5 | ||
|
|
94ef0d75d7 | ||
|
|
604d439d57 | ||
|
|
d37f8c7bab | ||
|
|
c7ab94a5a5 | ||
|
|
a6428ce968 | ||
|
|
8dd0cd3050 | ||
|
|
baede8d8bd | ||
|
|
2328ec7b31 | ||
|
|
719df7b241 | ||
|
|
dff7f0539a | ||
|
|
f03cf048d8 | ||
|
|
22ffc2ec15 | ||
|
|
09a0edb39a | ||
|
|
a0a8a7a13e | ||
|
|
8f97c06408 | ||
|
|
af9f8fc6a9 | ||
|
|
ef6feb2377 | ||
|
|
4e5ffae80c | ||
|
|
3597f438cd | ||
|
|
ad9cc86117 | ||
|
|
6656494fda | ||
|
|
06ac7dd8f1 | ||
|
|
76f4d19b42 | ||
|
|
d64a1f704b | ||
|
|
aa27148868 | ||
|
|
58c42df669 | ||
|
|
9c0761826b | ||
|
|
63f90dfeb3 | ||
|
|
10b31ef2a9 | ||
|
|
bb3fd81c4d | ||
|
|
2cd6ed2928 | ||
|
|
fde191f6aa | ||
|
|
1c76852b9c | ||
|
|
2491f417da | ||
|
|
443b8070f2 | ||
|
|
bb51c1395b | ||
|
|
3e03cf3d88 | ||
|
|
d6a6bf9719 | ||
|
|
3a2a9d1b7d | ||
|
|
dda68ff53f | ||
|
|
0ef17c6ad7 | ||
|
|
ac58d23713 | ||
|
|
5971972525 | ||
|
|
4cc6662837 | ||
|
|
226cbf48d8 | ||
|
|
7d9909c247 | ||
|
|
649c096e70 | ||
|
|
ce02d5f5c8 | ||
|
|
90c667011d | ||
|
|
0622e85e27 | ||
|
|
355f01f0a4 | ||
|
|
b0d6cf0842 | ||
|
|
16b15be81b | ||
|
|
2b7a8ca14e | ||
|
|
c338813d1c | ||
|
|
2f38d5b00d | ||
|
|
7c6738e32b | ||
|
|
86bfeba68a | ||
|
|
a94aa81c07 | ||
|
|
080c1ed865 | ||
|
|
c6f13e347c | ||
|
|
3cea361cc9 | ||
|
|
f6546fc336 | ||
|
|
8d12ab45c9 | ||
|
|
7dfd9184b7 | ||
|
|
0977bc00e3 | ||
|
|
2ea847ce0b | ||
|
|
fb2b5e0487 | ||
|
|
cce30bb55b | ||
|
|
98af4fc747 | ||
|
|
2c04edb1b3 | ||
|
|
e4500e0c5c | ||
|
|
820c4a86f0 | ||
|
|
d6253ca194 | ||
|
|
33e27917ee | ||
|
|
cea04368a9 | ||
|
|
fe9eed7322 | ||
|
|
33304e2e7a | ||
|
|
4cd51a7de6 | ||
|
|
5ffd65b1a2 | ||
|
|
82b96f4f63 | ||
|
|
e0ea15adb9 | ||
|
|
209ce0c0a9 | ||
|
|
620488c318 | ||
|
|
a270926397 | ||
|
|
8c830b6f1a | ||
|
|
33d58189c4 | ||
|
|
5d8370a970 | ||
|
|
fb3d37e641 | ||
|
|
b27f747ff2 | ||
|
|
2854783aeb | ||
|
|
4b8aa3deaf | ||
|
|
f5397b7c68 | ||
|
|
047620492c | ||
|
|
bf51f5d6c9 | ||
|
|
d7f27e16fe | ||
|
|
cfb30c69c0 | ||
|
|
8ed0335b7b | ||
|
|
313179dfbe | ||
|
|
97503f2e81 | ||
|
|
156bda2600 | ||
|
|
6a5ad25bde | ||
|
|
6d06a3c83c | ||
|
|
76cb03b523 | ||
|
|
6a2f8c655e | ||
|
|
4f3bf50acd | ||
|
|
84c1679e14 | ||
|
|
5ce457b6f6 | ||
|
|
071d79b7f7 | ||
|
|
c4ccae3ef8 | ||
|
|
3e67fa00d4 | ||
|
|
e34ebdf0de | ||
|
|
c6bdd3a455 | ||
|
|
81f22b68d7 | ||
|
|
888084b19b | ||
|
|
e2ec2a2f0d | ||
|
|
e80245ba15 | ||
|
|
3ef94811eb | ||
|
|
d78ff306e4 | ||
|
|
06285eb556 | ||
|
|
0a4378b9fc | ||
|
|
8472201a36 | ||
|
|
554d3f4950 | ||
|
|
300713d1ad | ||
|
|
0c06122b36 | ||
|
|
08bf485229 | ||
|
|
0b3bc255e6 | ||
|
|
c8f0acf144 | ||
|
|
6152d64d6a | ||
|
|
916daa76c9 | ||
|
|
9636f5f0f5 | ||
|
|
bda503d3c9 | ||
|
|
d39a79b121 | ||
|
|
68cd7ecc70 | ||
|
|
3e82292cfc | ||
|
|
f825309d6e | ||
|
|
852c7041d2 | ||
|
|
a9e24caf67 | ||
|
|
f006547b37 | ||
|
|
fb796ce1c4 | ||
|
|
20301dd0dd | ||
|
|
8178aa91d2 | ||
|
|
47f963f7dc | ||
|
|
dade11a029 | ||
|
|
4225dda194 | ||
|
|
e1fdff1db7 | ||
|
|
369a79b110 | ||
|
|
a692d66106 | ||
|
|
5957ad03ab | ||
|
|
7dbba28a18 | ||
|
|
0c260945b1 | ||
|
|
9aaf94fb06 | ||
|
|
2ffc14a778 | ||
|
|
8910b2f0cb | ||
|
|
e2323967e8 | ||
|
|
d6fdffd59b | ||
|
|
fd08b27857 | ||
|
|
a6babd6e0e | ||
|
|
7f371314ce | ||
|
|
75e82917aa | ||
|
|
1befc7e7c5 | ||
|
|
ce86901784 | ||
|
|
1e40dfa2c0 | ||
|
|
aa12fbe1c2 | ||
|
|
510e699bbe | ||
|
|
5956997e94 | ||
|
|
6cd40d17fe | ||
|
|
e48fae561b | ||
|
|
b814924352 | ||
|
|
dc674d1991 | ||
|
|
f3ecf42f9f | ||
|
|
c5f6f68225 | ||
|
|
7aaaf6abb6 | ||
|
|
63c942bd20 | ||
|
|
ebbef08258 | ||
|
|
1aff489efe | ||
|
|
83e088870e | ||
|
|
173a4e7912 | ||
|
|
9ba567752a | ||
|
|
f0f0d448ae | ||
|
|
63f63c4142 | ||
|
|
0a135a08b0 | ||
|
|
802b15228c | ||
|
|
2459a92a23 | ||
|
|
34fc597cc8 | ||
|
|
13483d3ea2 | ||
|
|
2776da3660 | ||
|
|
d819ab361a | ||
|
|
85cbe8e9cd | ||
|
|
519fea6f66 | ||
|
|
f35aba90ab | ||
|
|
567c2cc2ad | ||
|
|
47576ae8c0 | ||
|
|
b25b33a3a1 | ||
|
|
745bc86275 | ||
|
|
128ef1e6fc | ||
|
|
b550bb287a | ||
|
|
0beb3c886a | ||
|
|
b472e90849 | ||
|
|
16e09e7e82 | ||
|
|
0eafa778b0 | ||
|
|
f8f6f08de9 | ||
|
|
226ebe0c75 | ||
|
|
8c59a8bebb | ||
|
|
08c72911c5 | ||
|
|
71ba8cf9e5 | ||
|
|
81c27fe5dc | ||
|
|
a04773ccf3 | ||
|
|
7273f790d6 | ||
|
|
b69647d881 | ||
|
|
7226577fcb | ||
|
|
f323fa8b88 | ||
|
|
875094a359 | ||
|
|
38e7d29a8f | ||
|
|
c716ea4b30 | ||
|
|
a2c398540b | ||
|
|
4d821f1261 | ||
|
|
baaac575c1 | ||
|
|
ba78c201b8 | ||
|
|
0ec8d76220 | ||
|
|
968a83c380 | ||
|
|
b6a2db169e | ||
|
|
4e615fbce4 | ||
|
|
57251327ae | ||
|
|
9a0becd470 | ||
|
|
974cc4b561 | ||
|
|
165f23753f | ||
|
|
8ac6426d91 | ||
|
|
97c1cf55c8 | ||
|
|
c43ea0e690 | ||
|
|
09d84aedb3 | ||
|
|
40585da9a4 | ||
|
|
5abd6029d5 | ||
|
|
d766cf5c56 | ||
|
|
91246d6c26 | ||
|
|
7f54a7ec2c | ||
|
|
f96ec0a1c2 | ||
|
|
e3af2978e1 | ||
|
|
3298c06577 | ||
|
|
6a06ed57d2 | ||
|
|
1204c5ddca | ||
|
|
28deda2425 | ||
|
|
5446ecf43e | ||
|
|
3170d5dec1 | ||
|
|
092ba3e06d | ||
|
|
025295a330 | ||
|
|
d0980f215a |
@@ -7,6 +7,7 @@ CMakeLists.txt.user*
|
||||
.scons
|
||||
|
||||
*.kate-swp
|
||||
*.swp
|
||||
|
||||
target/
|
||||
target-debug/
|
||||
@@ -18,7 +19,7 @@ libs/
|
||||
|
||||
/src/robomongo/robomongo.pro.user.1.3
|
||||
|
||||
/src/third-party/mongodb/src/third_party/js-1.7/jswgen
|
||||
.idea/
|
||||
|
||||
# Created by http://www.gitignore.io
|
||||
|
||||
@@ -31,6 +32,7 @@ libs/
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
@@ -77,15 +79,11 @@ libs/
|
||||
*.pro.user
|
||||
*.pro.user.*
|
||||
*.moc
|
||||
moc_*.cpp
|
||||
qrc_*.cpp
|
||||
ui_*.h
|
||||
Makefile*
|
||||
*-build-*
|
||||
|
||||
# QtCreator
|
||||
|
||||
*.autosave
|
||||
*.creator.user
|
||||
|
||||
|
||||
### Windows ###
|
||||
|
||||
@@ -0,0 +1,444 @@
|
||||
|
||||
Latest Release:
|
||||
Robomongo 0.9.0 RC10 (Aug 8, 2016)
|
||||
http://blog.robomongo.org/robomongo-rc10/
|
||||
|
||||
Highlights from Robomongo 0.9.0 RCs:
|
||||
Major Features:
|
||||
- Support for MongoDB 3.x and WiredTiger engine. Robomongo now embeds MongoDB 3.2 shell.
|
||||
(Ability to use the latest shell functionality)
|
||||
- SSH tunnel support for connections added.
|
||||
- Support for SSL connections added.
|
||||
- MongoDB Atlas (Cloud MongoDB) support added.
|
||||
- Both MONGODB-CR and SCRAM-SHA-1 authentication mechanisms are supported.
|
||||
- Allow direct connections to Replica Set members and support IPv6 protocol.
|
||||
- Loading of huge list of collections is now faster.
|
||||
- Create Collection dialog is now expandable to support all advanced options.
|
||||
(Supporting all major mongoDB versions 3.2, 3.0, 2.6 and all storage engine types (WiredTiger
|
||||
and MMAPV1) is added.)
|
||||
- Windows High DPI support.
|
||||
|
||||
Fixed:
|
||||
- Incorrect representation of floating-point numbers (fixed since RC3). This bug was a reason of a big number of issues:
|
||||
#910, #748, #697, #699, #760, #815, #870, #892,
|
||||
#894, #905, #945, #974, #978, #990, #831, #842
|
||||
- SSH connection failure to servers on Ubuntu and OS X with the following error:
|
||||
"Resource temporarily unavailable. Error when starting up SSH session: -8" (#1090)
|
||||
|
||||
What's new in RC10 (Aug 8, 2016)
|
||||
http://blog.robomongo.org/robomongo-rc10/
|
||||
|
||||
New Features:
|
||||
- SSL connections with advanced options are now supported.
|
||||
- MongoDB Atlas (Cloud MongoDB) is supported.
|
||||
- Cross Platform High DPI enhancements.
|
||||
|
||||
Enhancements:
|
||||
- For better security, OpenSSL has been upgraded to OpenSSL 1.0.1p.
|
||||
- Qt has been updated from Qt 5.5 to latest Qt 5.7. With this update there are many
|
||||
enhancements including cross platform High DPI support.
|
||||
|
||||
What's new in RC9 (May 30, 2016)
|
||||
http://blog.robomongo.org/robomongo-rc9/
|
||||
|
||||
New Features:
|
||||
- Create Collection dialog with advanced options.
|
||||
- New feature has been added to save/restore window sizes. (#1102)
|
||||
- Connection settings from previous versions of Robomongo are
|
||||
now automatically imported starting from Robomongo 0.9.0 RC9. (#1086)
|
||||
- Support for querying documents by UUIDs is added, both in legacy and new encoding. (#432)
|
||||
|
||||
Fixed:
|
||||
- SSH connection failure to servers on Ubuntu and OS X with the following error:
|
||||
"Resource temporarily unavailable. Error when starting up SSH session: -8" (#1090)
|
||||
- Correct handling of create/drop of databases and collections. (#1083)
|
||||
|
||||
What's new in RC8 (April 14, 2016)
|
||||
http://blog.robomongo.org/robomongo-rc8/
|
||||
|
||||
What's new in RC7 (March 4, 2016)
|
||||
http://blog.robomongo.org/robomongo-rc7
|
||||
|
||||
What's new in RC6 (February 13, 2016)
|
||||
http://blog.robomongo.org/ipv6-protocol
|
||||
|
||||
What's new in RC5 (February 8, 2016)
|
||||
http://blog.robomongo.org/campaign-is-over-robomongo-is-not/
|
||||
|
||||
What's new in RC4 (February 1, 2016)
|
||||
http://blog.robomongo.org/robomongo-rc4
|
||||
|
||||
What's new in RC3 (January 29, 2016)
|
||||
http://blog.robomongo.org/robomongo-0-9-0-rc3-released
|
||||
|
||||
What's new in RC2 (January 26, 2016)
|
||||
http://blog.robomongo.org/robomongo-rc2-for-windows-mac-os-x-and-linux
|
||||
|
||||
What's new in RC1 (January 17, 2016)
|
||||
http://blog.robomongo.org/robomongo-rc1-with-full-support-for-mongodb-3
|
||||
|
||||
|
||||
0.8.5 / March 10, 2015
|
||||
|
||||
Release 0.8.5 is now deprecated because of a critical bug, that is
|
||||
described here: http://blog.robomongo.org/robomongo-0-9-0-rc3-released
|
||||
|
||||
We recommend to use Robomongo 0.9.0 or newer.
|
||||
|
||||
* [Stephen Steneker]
|
||||
- OS X build fixes for XCode 5 / libc++ (#524)
|
||||
- OS X specific keyboard shortcut tips (#505)
|
||||
- View documents fail if collection name is "group" (#414)
|
||||
- Problem with slash in collection names (#404)
|
||||
- Add shortcut to open JS file (#408)
|
||||
- Fullscreen mode not working on OS X (#519)
|
||||
- Usability request - add initial curly braces to command bar (#506)
|
||||
- TTL index should allow expiry of 0 seconds (#500)
|
||||
- Add line numbers to JSON editing windows on OS X (#449)
|
||||
- Add user preference to have line numbers displayed by default (#564)
|
||||
- Space after document causes validation error (#544)
|
||||
- Expand current server as soon as you connect to it (#405)
|
||||
- Switching tabs using standard keys on OS X (#87)
|
||||
- Cannot make the Edit Document Window smaller (#548)
|
||||
- Consistent numbering for tree/table/text view items (#421)
|
||||
- Reload Query with keyboard shortcut doesn't work (#551)
|
||||
- Rename "Reload" to "Re-execute query" (#447)
|
||||
- Add "Copy Timestamp from ObjectId" to context menu for ObjectId fields (#559)
|
||||
- Bug: Type of Double changed to Int32 on save document (#622)
|
||||
- "Duplicate Query In New Tab": add to Window menu with keyboard shortcut (#631)
|
||||
- No errors logged if settings directory cannot be created or settings file cannot be written to (#636)
|
||||
- Show execution time for operations that don't return results (#455)
|
||||
- Disable broken "Copy Collection to Database" misfeature (#398)
|
||||
* [Vladimir Belozyorov]
|
||||
- View mode reset to default after no results (#509)
|
||||
- Comment / uncomment selected code in the shell (#467)
|
||||
- Passphrase and password should be hidden in authentication tab (#433)
|
||||
- Cursor initialization - place between curly brackets for default find({}) query (#592)
|
||||
- Include full date/time for log entries (#596)
|
||||
- Option to disable selected code autoexecution when opening a new tab (#514)
|
||||
- Tooltip fixes to match current keyboard shortcuts (#598)
|
||||
- Expand/collapse multiple selections (#591)
|
||||
- Changes in toolbars visibility are saved in config file (#457)
|
||||
- Include connection name under shell tabs (#47)
|
||||
* [Sergey Gavruk]
|
||||
- SettingsManager typo (#558)
|
||||
- Ability to disable autocompletion (#512)
|
||||
* [Kanstantsin Kamkou]
|
||||
- Increase display width for limit & offset input fields (#458)
|
||||
* [volans-]
|
||||
- CreateUserDialog.cpp: fixed typo in warning message
|
||||
* [Andres Kievsky]
|
||||
- Added new app icon in a variety of png and iDraw formats (#693)
|
||||
* [Michael Steinacher]
|
||||
- Retina text display support (#724)
|
||||
|
||||
0.8.4 / November 27, 2013
|
||||
|
||||
Read about updates in this version here:
|
||||
http://robomongo.org/whats-new-in/robomongo-0.8.4.html
|
||||
|
||||
RC1:
|
||||
|
||||
* SSH support (#117)
|
||||
* SSL support (first steps) (#100)
|
||||
* Create or edit index problem (#341)
|
||||
* Regexp error (with non-latin symbols) (#351)
|
||||
* Support for latin characters in edit document console (#347)
|
||||
* Robomongo fails to execute shell "comments" if the comment contains a non-latin character! (#334)
|
||||
* Crash when add ISODate field (#350)
|
||||
* Crash at executing several disconnections in a row (#290)
|
||||
* Deleting multiple documents prompts for each document (#386)
|
||||
* Connection context menu appears independently of position of Robomongo instance.
|
||||
* Crash at pressing "Ctrl+T" without any connection.
|
||||
|
||||
RC2:
|
||||
|
||||
* SSH now works on Mac OS X Mavericks (#401)
|
||||
* Fixed crash when parsing date (#356)
|
||||
|
||||
Final:
|
||||
|
||||
* Selected view mode of result panels now preserved between executions. Implemented by Vladimir Belozyorov (github.com/VBelozyorov) (#402)
|
||||
|
||||
|
||||
0.8.3 / October 1, 2013
|
||||
|
||||
Read about updates in this version here:
|
||||
http://robomongo.org/whats-new-in/robomongo-0.8.3.html
|
||||
|
||||
* Enable query logging (#108)
|
||||
* Inserting multiple documents from UI (#173)
|
||||
* Removing multiple documents from UI (#174)
|
||||
* Retain current view mode when running search (#93, #79)
|
||||
* Left panel collections/functions/users navigation doesn't work when authenticating against the DB (#282)
|
||||
* A way to disable Alt + number shortcut (#192)
|
||||
* Support mongodb 2.4.x style users (#139)
|
||||
* Add "Copy JSON" menu item to context menu (#298)
|
||||
* JSON list validation (#246)
|
||||
* Crash creating new Database (#291)
|
||||
* Incorrect handling of TTL Indexes (#313)
|
||||
* Add the document _id in the tree view (#142)
|
||||
* BSON Undefined type doesn't rendered to string correctly (#306)
|
||||
* Entering incorrect symbols as database name isn't handled properly (#262)
|
||||
* Ability to select UI theme
|
||||
* We now show number of fields (inside objects) and number of items (inside arrays) in Tree View.
|
||||
* Support for Mac OS X 10.6 (#287)
|
||||
* Support for Mac OS X 10.9 (#254)
|
||||
|
||||
|
||||
0.8.2 / September 13, 2013
|
||||
|
||||
Read about updates in this version here:
|
||||
http://robomongo.org/whats-new-in/robomongo-0.8.2.html
|
||||
|
||||
|
||||
0.8.1 / September 6, 2013
|
||||
|
||||
Read about updates in this version here:
|
||||
http://robomongo.org/whats-new-in/robomongo-0.8.1.html
|
||||
|
||||
* Table Mode (in this version, only for the first-level fields in documents) (#72)
|
||||
* Paging Widget tweaks (#247, #203, #244, #243)
|
||||
* ~/.robomongorc.js file is loaded automatically when new shell is opened
|
||||
(c:\Users\Name\.robomongorc.js for Windows)
|
||||
* "Load .mongorc.js" menu item in "Options" top-level now allow to enable/disable loading
|
||||
of ~/.mongorc.js file. By default it will not load this file.
|
||||
* Batch Size now configurable (in this version only manually via ~/.config/robomongo.json)
|
||||
* JSON parser doesn't correctly parse numbers when locale isn't en_EN (#246, #253)
|
||||
* "Display Dates In" options doesn't saved/loaded correctly (#261)
|
||||
* [Linux] Support for CentOS
|
||||
* [Linux] Linux packages now takes 2x less space (10mb instead of 20mb)
|
||||
* [Windows] Desktop icon isn't created despite corresponding checkbox was checked at installation. (#260)
|
||||
* [Windows] Invalid symbols in installer for Windows if display language of system isn't English (#259)
|
||||
|
||||
|
||||
0.8.0 / August 23, 2013
|
||||
|
||||
Read about updates in this version here:
|
||||
http://robomongo.org/whats-new-in/robomongo-0.8.0.html
|
||||
|
||||
* Ability to save and load files for currently opened shell (#96)
|
||||
* MongoDB Index management (#74)
|
||||
* Expand all children recursively (#106)
|
||||
* Ability to toggle line numbers (press F11) for any editor in Robomongo (#112)
|
||||
* View Mode settings is persisted now (thanks, Luke Thompson!) (#114)
|
||||
* Search capability for any editor in Robomongo - press (Ctrl + F) (#32)
|
||||
* Timezone support: UTC or Local (#224)
|
||||
* Auto-complete on "Tab" (#95)
|
||||
* Fixed incorrect handling of Dates (#111)
|
||||
* Fixed incorrect handling of collections with leading underscore (_) symbol (#109)
|
||||
* Fixed incorrect rendering of float numbers (#115)
|
||||
* Fixed incorrect handling of Int64 numbers (#157)
|
||||
* Fixed incorrect parsing of DBRef sub-objects (#113)
|
||||
* New build system, based on CMake. Greatly simplified build and package process.
|
||||
* Qt updated to 5.1 version.
|
||||
* QScintilla updated to 2.7.2 version.
|
||||
|
||||
|
||||
0.7.1 / April 13, 2013
|
||||
|
||||
* Fixed crash when right-clicking on non-primitive elements in Tree View (#85)
|
||||
* Alt + Cmd + Arrow for switching tabs on Mac (#82)
|
||||
* Several minor bugs fixed (including #82)
|
||||
|
||||
|
||||
0.7.0 / April 4, 2013
|
||||
|
||||
* Support for UUIDs (read more: http://robomongo.org/articles/uuids.html)
|
||||
|
||||
|
||||
0.6.9 / April 3, 2013
|
||||
|
||||
* Password is hidden by default (#65)
|
||||
* Fixed incorrect rendering of large values for the db.stats() results (#70)
|
||||
* Collection names with invalid (for JS var name) characters now rendered correctly (#71)
|
||||
|
||||
|
||||
0.6.8 / April 1, 2013
|
||||
|
||||
* Support for '~/.mongorc.js'
|
||||
* Various Mac OS X UI fixes
|
||||
* Fixed crash when pressing Ctrl + W (#60)
|
||||
* "Copy Value" context menu item for documents in Tree View
|
||||
|
||||
|
||||
0.6.7 / March 26, 2013
|
||||
|
||||
* Fixed creation of new tabs based on the current one. Before this fix initial
|
||||
database for new tab wasn't identical to the "parent". (#56)
|
||||
* Support for collections that starts from digits (#54)
|
||||
* [Sergey Gavruk] Duplicate Collection feature (Collection -> Duplicate Collection
|
||||
* Collection -> Reindex will not run immediately, as before
|
||||
* Fixed incorrect disposing of tabs resources (connections etc.) (#42)
|
||||
* [Stephen Steneker] Fixed KeepAlive invalid commands, when not authorised (#41)
|
||||
* [Sergey Gavruk] Various Mac OS X UI fixes.
|
||||
|
||||
|
||||
0.6.6 / March 23, 2013
|
||||
|
||||
* Fixed possible crash when viewing results in text mode (#34)
|
||||
* Fixed possible crash when testing connection (Diagnostic window)
|
||||
* Memory leak in explorer's database tree fixed.
|
||||
|
||||
|
||||
0.6.5 / March 17, 2013
|
||||
|
||||
* Fixed "Dropped connection" issue (#28).
|
||||
* Windows Installer now be used to destribute Robomongo.
|
||||
|
||||
|
||||
0.6.4 / March 10, 2013
|
||||
|
||||
* Support for JS functions. Create/Edit/Remove/View.
|
||||
* Loading indicators (three dots for now) for Server, Collections, Functions and Users.
|
||||
* Count indicators for Server (number of databases), Collections, Functions and Users.
|
||||
* No need to type "functionName.toString()". You can output source of function
|
||||
by simply typing its name (like in the shell).
|
||||
* Support for RegEx, Code and CodeWScope bson elements. But you still cannot edit
|
||||
documents which contains Code or CodeWScope bson elements.
|
||||
* About dialog added.
|
||||
|
||||
|
||||
0.6.3 / March 5, 2013
|
||||
|
||||
* Script execution can be stopped (this works only for JS code in SpiderMonkey VM) (#23)
|
||||
* Toolbar buttons shown only if needed (#21, #20)
|
||||
* MongoDB Connections window opens when application starts.
|
||||
* Some changes in menu items locations (#25, #26)
|
||||
* View Mode buttons moved to Options menu.
|
||||
* Full Screen and Logs functionality hidden right now (postponed for versions after Robomongo 1.0)
|
||||
|
||||
|
||||
0.6.2 / March 4, 2013
|
||||
|
||||
* "Users" folder now shows list of users.
|
||||
* User can be added (Database -> Add User)
|
||||
* User can be edited (User -> Edit User)
|
||||
* User can be removed (User -> Remove Users)
|
||||
* Users can be refreshed (Users (folder) -> Refresh Users)
|
||||
* List of users can be viewed in the shell (Users (folder) -> View Users)
|
||||
|
||||
|
||||
0.6.1 / March 2, 2013
|
||||
|
||||
* Minor script editor and viewer tweaks
|
||||
|
||||
|
||||
0.6.0 / Feb 28, 2013
|
||||
|
||||
* Database can be created from UI (Server -> Create Database)
|
||||
* Database can be dropped from UI (Database -> Drop Database)
|
||||
* Collection can be created from UI (Database -> Create Collection)
|
||||
* Collection can be dropped from UI (Collection -> Drop Collection)
|
||||
* Collection can be renamed from UI (Collection -> Rename Collection)
|
||||
* All documents can be removed from UI (Collection -> Remove All Documents)
|
||||
* Minor tweaks in naming of context menu items.
|
||||
|
||||
|
||||
0.5.7 / Feb 27, 2013
|
||||
|
||||
* Support for Custom View Modes. First custom view implemented for "db.printCollectionStats()" query. You
|
||||
still can view multiple output results, even if one of them presented in custom mode.
|
||||
* "Show Log" context menu item for servers in Explorer.
|
||||
|
||||
|
||||
0.5.6 / Feb 26, 2013
|
||||
|
||||
* Support for one-line MongoDB commands ("show dbs", "show collection", "use somedb" etc.). This commands can
|
||||
be repearted (this will result in multiple output results) or they can be used together with ordinary JavaScript.
|
||||
The only rule: this command should be the only text on the line, starting from the very beginning of the line.
|
||||
* Refresh of databases and collections via "Refresh" context menu item.
|
||||
* This version of Robomongo is the first version compiled in release mode. It works much more faster and uses lower
|
||||
amount of memory.
|
||||
|
||||
|
||||
0.5.5 / Feb 22, 2013
|
||||
|
||||
* New document can be added in a more user friendly way. There are two ways to do it:
|
||||
1) Right-click on collection in Explorer and select "Insert Document"
|
||||
2) Right-click at any place of Tree View and select "Insert Document"
|
||||
* Better formatting of JSON with correct indention.
|
||||
* Support for ISODate(...) factory function in JSON parser and builder. Date in JSON mode now always
|
||||
displayed as ISODate(...), like in the shell. Document Editor accepts dates in two forms:
|
||||
as "new Date(<millisecs>)" and "ISODate(<iso_8601_date_string>)" (this behaviour identical to MongoDB shell behaviour)
|
||||
* Document editor implemented. Right-click on document in Tree View and select "Edit".
|
||||
* Document viwer implemented. Right-click on document in Tree View and select "View".
|
||||
* You can delete selected document in Tree View. (Right-click and select "Delete")
|
||||
* Validation of JSON in Document Editor/Viewer with error report, highlighting of errors and
|
||||
cursor positioning just where error is.
|
||||
* Fixed problem with "signed" dates (dates before Unix Epoch) (#5)
|
||||
* Fixed problem with UTF-8 (#17)
|
||||
* Fixed problem with loading indicator in Explorer (#18)
|
||||
|
||||
|
||||
0.5.2 / Jan 26, 2013
|
||||
|
||||
In this version autocompletion in Robomongo becomes mostly usable.
|
||||
|
||||
* AutoCompletion box now placed just near text you typed (in correct line and column)
|
||||
* AutoCompletion now works in the middle of the text (not only at the end of line, as before)
|
||||
* Ctrl + Space will trigger autocompletion for symbols under cursor.
|
||||
* If you select function in autocompletion box, their open parenthesis will overwrite existing in the text, if such available.
|
||||
|
||||
|
||||
0.5.1 / Jan 24, 2013
|
||||
|
||||
* Several autocompletion tweaks.
|
||||
|
||||
|
||||
0.5.0 / Jan 24, 2013
|
||||
|
||||
* AutoCompletion. First version.
|
||||
* Progress indicator for shells.
|
||||
* Shell result panels now have equal size, if this is possible.
|
||||
* Code cleanuped a bit.
|
||||
|
||||
|
||||
0.4.6 / Jan 11, 2013
|
||||
|
||||
* Tooltip for collections with count and size.
|
||||
|
||||
|
||||
0.4.5 / Jan 8, 2013
|
||||
|
||||
* WARNING: configuration file schema changed. Some properties will be
|
||||
empty in Connection Settings Dialog. Please fill them again.
|
||||
|
||||
* Connection test (diagnostic) implemented.
|
||||
* Indicators in the shell: current server, database and collection (if available)
|
||||
This indicators are "real" - they respect your actual query.
|
||||
* Execution time measurement. Displayed for each individual output result.
|
||||
* Paging for each output result with respect to filtering, ordering, fields,
|
||||
limit, skip etc. of actual text query (pilot version).
|
||||
* Connection cloning support in Connections Dialog.
|
||||
* Databases and collections now displayed in sorted order.
|
||||
* Batch size extended to 50 documents.
|
||||
* New shape of Shells.
|
||||
* New shape of Connection Settings Dialog
|
||||
* New shape of Connections Dialog.
|
||||
|
||||
|
||||
0.4.0 / Dec 26, 2012
|
||||
|
||||
* No more "type 'it' for more results" when we have more than 20 objects in collection.
|
||||
* Two global modes added - text and tree modes. Switch between them using F3 and F4.
|
||||
* Two local modes added - text and tree modes. Switch between them using small
|
||||
icons on Output panels for each resultset.
|
||||
* Improved performance of json creation (from list of documents).
|
||||
* Tooltips for tool buttons added.
|
||||
* Maximization of output panel implemented (via small icon at the top right of output panel)
|
||||
Click second time to restore back.
|
||||
* Fix for not working Ctrl-O key shortcut (that opens Connections menu).
|
||||
|
||||
|
||||
0.3.5 / Dec 25, 2012
|
||||
|
||||
* Context menu for server, database and collection.
|
||||
* Tab management (Ctrl+Tab, Ctrl+Shift+Tab, Ctrl+T, Ctrl+F4)
|
||||
* Context menu for tab
|
||||
* Submenu for Connect button with connections.
|
||||
* Hotkeys for first 9 connections (Alt+1, ..., Alt+9)
|
||||
* Connections reordering via drag'n'drop in Connections dialog.
|
||||
* Correct focus placement when opening new connection and switching tabs.
|
||||
* Bonus: F12 - opens connections menu from any place.
|
||||
* Memory leaks fix.
|
||||
@@ -1,285 +1,46 @@
|
||||
cmake_minimum_required(VERSION 2.8.0)
|
||||
if(POLICY CMP0048)
|
||||
cmake_policy(SET CMP0048 OLD)
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(Robomongo)
|
||||
|
||||
# Where to look first for CMake modules, before "${CMAKE_ROOT}/Modules" is checked
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
|
||||
# Project version
|
||||
set(PROJECT_VERSION_MAJOR "0")
|
||||
set(PROJECT_VERSION_MINOR "9")
|
||||
set(PROJECT_VERSION_PATCH "0")
|
||||
set(PROJECT_VERSION_BUILD "-RC10")
|
||||
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${PROJECT_VERSION_BUILD}")
|
||||
|
||||
# Modules
|
||||
include(RobomongoPrintUtils)
|
||||
include(RobomongoCMakeDefaults)
|
||||
include(RobomongoDefaults)
|
||||
include(RobomongoCommon)
|
||||
include(RobomongoTrashSymbols)
|
||||
include(RobomongoTargetArch)
|
||||
include(RobomongoInstallQt)
|
||||
include(RobomongoPackage)
|
||||
|
||||
# Search for dependencies
|
||||
find_package(Threading REQUIRED) # Wrapper arround CMake "Threads" module
|
||||
find_package(Qt5Core REQUIRED)
|
||||
find_package(Qt5Gui REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5PrintSupport REQUIRED)
|
||||
find_package(MongoDB REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
if (SYSTEM_MACOSX)
|
||||
find_package(Qt5MacExtras REQUIRED)
|
||||
endif()
|
||||
|
||||
###
|
||||
# Settings
|
||||
#
|
||||
set(PROJECT_NAME "Robomongo" 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 "Paralect" CACHE STRING "Company name for ${PROJECT_NAME}")
|
||||
set(PROJECT_COPYRIGHT "Copyright (C) 2013 ${PROJECT_COMPANYNAME} All Rights Reserved.")
|
||||
set(PROJECT_COMPANYNAME_DOMAIN "www.paralect.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}")
|
||||
# Projects
|
||||
add_subdirectory(src/third-party/libssh2)
|
||||
add_subdirectory(src/robomongo/ssh)
|
||||
add_subdirectory(src/third-party/qjson)
|
||||
add_subdirectory(src/third-party/qscintilla)
|
||||
add_subdirectory(src/robomongo)
|
||||
|
||||
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE)
|
||||
set(MAJOR "0")
|
||||
set(MINOR "8")
|
||||
set(PATCH "5")
|
||||
set(BUILD "")
|
||||
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 AND 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}")
|
||||
if(EXISTS "${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})
|
||||
# Show configuration summary
|
||||
include(RobomongoConfigurationSummary)
|
||||
|
||||
###
|
||||
# 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("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
|
||||
MESSAGE(SEND_ERROR "In-source builds are not allowed.")
|
||||
ENDIF("${PROJECT_SOURCE_DIR}" 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 "${CMAKE_CURRENT_SOURCE_DIR}/DESCRIPTION")#CPACK_RPM_PACKAGE_DESCRIPTION
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
||||
SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
|
||||
SET(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
|
||||
|
||||
SET(CPACK_PACKAGE_VENDOR ${PROJECT_COMPANYNAME})#CPACK_RPM_PACKAGE_VENDOR
|
||||
SET(CPACK_PACKAGE_CONTACT "Dmitry Schetnikovich <dima@paralect.com>")#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("${CMAKE_CURRENT_SOURCE_DIR}/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("${CMAKE_CURRENT_SOURCE_DIR}/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("${CMAKE_CURRENT_SOURCE_DIR}/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)
|
||||
|
||||
@@ -1,33 +1,134 @@
|
||||
About Robomongo
|
||||
===============
|
||||
|
||||
Robomongo — is a shell-centric crossplatform MongoDB management tool. <br />
|
||||
Visit our site: [www.robomongo.org](http://www.robomongo.org)
|
||||
[Robomongo](http://www.robomongo.org) is a shell-centric cross-platform MongoDB management tool. Unlike most other MongoDB admin UI tools, Robomongo embeds the actual `mongo` shell in a tabbed interface with access to a shell command line as well as GUI interaction.
|
||||
|
||||
Starting from version 0.9, Robomongo is compatibile with MongoDB 3.x (including SCRAM-SHA-1 auth and support for WiredTiger storage engine). Robomongo 0.9 embeds the **MongoDB 3.2** shell.
|
||||
|
||||
Robomongo 0.8.x embeds the **MongoDB 2.4.0** shell.
|
||||
|
||||
What's new in latest Robomongo 0.9.0 RC10?
|
||||
====================================
|
||||
Latest release of Robomongo 0.9.0 RC10 includes:
|
||||
- Support for SSL
|
||||
- MongoDB Atlas Support
|
||||
- HiDPI enhancements
|
||||
|
||||
Central feature of this release is full support for TSL/SSL protocol with advanced options. This version also brings support to MongoDB Atlas cloud service and includes enhancements for HiDPI displays.
|
||||
|
||||
Blog: http://blog.robomongo.org/robomongo-rc10
|
||||
Download: https://robomongo.org/download
|
||||
Follow: https://twitter.com/Robomongo
|
||||
|
||||
What's Planned for the Next Release?
|
||||
====================================
|
||||
|
||||
We are currently working towards [Robomongo 0.9.0 RC11 milestone](https://github.com/paralect/robomongo/milestone/16).
|
||||
|
||||
Currently in progress:
|
||||
- Replica Sets Support
|
||||
|
||||
Plans for Future:
|
||||
- User Roles
|
||||
- Support execution of multiple simultaneous queries [#1161](https://github.com/paralect/robomongo/issues/1161)
|
||||
- Enhancements for stability, running without crashes
|
||||
- More Documentation
|
||||
- Unit Tests
|
||||
- Refactoring Debug Log module
|
||||
|
||||
Supported Platforms
|
||||
===============
|
||||
|
||||
**Supported MongoDBs:**
|
||||
|
||||
| MongoDB Versions | MongoDB Cloud |
|
||||
| :-------------------- | :------------ |
|
||||
| 3.2 | MongoDB Atlas |
|
||||
| 3.0 | Compose |
|
||||
| 2.6 | mLab |
|
||||
| | ObjectRocket |
|
||||
|
||||
|
||||
|
||||
**Note**: Currently Robomongo supports connection to single server of a replica set. Support for connection to **Replica Sets** is one of the most important features of next Robomongo release plan.
|
||||
|
||||
**Supported OS Platforms:**
|
||||
|
||||
| Windows | Mac | Linux |
|
||||
|:---------------------- | :---------------| :---------------------------|
|
||||
| Windows 64-bit 10 | Mac OS X 10.11 | Linux Ubuntu 16.04 64-bit* |
|
||||
Windows 64-bit 8.1 | Mac OS X 10.10 | Linux Ubuntu 14.04 64-bit* |
|
||||
| Windows 64-bit 7 | | Linux CentOS 7 64-bit* |
|
||||
| | | Linux CentOS 6 64-bit* |
|
||||
|
||||
\* latest stable build
|
||||
|
||||
Download
|
||||
========
|
||||
|
||||
You can download compiled version (for Mac OS X, Windows and Linux) from our site:<br />
|
||||
[www.robomongo.org](http://www.robomongo.org)
|
||||
You can download tested install packages for OS X, Windows, and Linux from our site: [www.robomongo.org](http://www.robomongo.org).
|
||||
|
||||
Vote for the Feature
|
||||
====================
|
||||
Please view our [Magic Backlog](http://robomongo.org/backlog). Here we are all together
|
||||
building priorities for the next versions of Robomongo.
|
||||
The latest release candidate is currently **Robomongo 0.9.0 RC10**. (http://blog.robomongo.org/robomongo-rc10/).
|
||||
|
||||
Contribute
|
||||
==========
|
||||
Contributions are always welcome! Just try to follow our coding style: [Robomongo Coding Style](https://github.com/paralect/robomongo/wiki/Robomongo-Coding-Style)
|
||||
The latest stable release is currently **Robomongo 0.8.5**. (http://blog.robomongo.org/whats-new-in-robomongo-0-8-5/)
|
||||
|
||||
Support
|
||||
=======
|
||||
|
||||
Robomongo is an open source project driven by volunteers. We'll try to get to your questions as soon as we can, but please be patient :).
|
||||
|
||||
You can:
|
||||
|
||||
- [Create a new issue in the Github issue queue](https://github.com/paralect/robomongo/issues)
|
||||
|
||||
- [Join developer discussion on Gitter](https://gitter.im/paralect/robomongo) [](https://gitter.im/paralect/robomongo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
Build
|
||||
=====
|
||||
|
||||
Build documentation: [Build Robomongo](https://github.com/paralect/robomongo/wiki/Build-Robomongo)
|
||||
The wiki contains prerequisites and instructions to [Build Robomongo](https://github.com/paralect/robomongo/wiki).
|
||||
|
||||
If you want to compile from source yourself, you should be able to do so cleanly from a [release branch](https://github.com/paralect/robomongo/releases).
|
||||
|
||||
Contribute!
|
||||
===========
|
||||
|
||||
### Suggest Features
|
||||
|
||||
New feature suggestions or UI improvements are always welcome.
|
||||
|
||||
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:
|
||||
- [Robomongo Code Quality](https://github.com/paralect/robomongo/wiki/Robomongo-Code-Quality)
|
||||
- [Robomongo 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.
|
||||
|
||||
For a general workflow, see Github's guide to [Fork a Repo](https://help.github.com/articles/fork-a-repo/).
|
||||
|
||||
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 (C) 2013 Paralect, Inc (http://www.paralect.com)
|
||||
Copyright (C) 2013-2016 [Paralect, Inc](http://www.paralect.com)
|
||||
|
||||
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
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
Bash fronted for CMake
|
||||
======================
|
||||
|
||||
If you want to use this scripts, you need to set single environment variable:
|
||||
|
||||
export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5/5.5/gcc_64;/path/to/robomongo-shell"
|
||||
|
||||
Build Robomongo:
|
||||
|
||||
$ bin/configure
|
||||
$ bin/build
|
||||
|
||||
Install Robomongo:
|
||||
|
||||
$ bin/install
|
||||
|
||||
Pack Robomongo:
|
||||
|
||||
$ bin/pack
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/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
|
||||
|
||||
cd $BUILD_DIR
|
||||
cmake --build . "${@:2}" -- -j8
|
||||
@@ -0,0 +1,15 @@
|
||||
@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
|
||||
cd "%BUILD_DIR%"
|
||||
cmake --build . --config %BUILD_TYPE%
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/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
|
||||
|
||||
cd $VARIANT_DIR && rm -rf $BUILD_DIR_NAME
|
||||
@@ -0,0 +1,15 @@
|
||||
@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 Clear build directory
|
||||
cd "%VARIANT_DIR%"
|
||||
rmdir /s /q "%BUILD_DIR_NAME%"
|
||||
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$1" == "debug" ]; then
|
||||
BUILD_TYPE=Debug
|
||||
else
|
||||
BUILD_TYPE=Release
|
||||
|
||||
# Prepend "release" in front of $@
|
||||
set -- release "$@"
|
||||
fi
|
||||
|
||||
# Build dir name is a lowercase of BUILD_TYPE
|
||||
# i.e. debug
|
||||
BUILD_DIR_NAME="$(echo $BUILD_TYPE | tr '[A-Z]' '[a-z]')"
|
||||
|
||||
# i.e. /path/to/robomongo/build
|
||||
VARIANT_DIR=$PROJECT_DIR/build
|
||||
|
||||
# i.e. /path/to/robomongo/build/debug
|
||||
BUILD_DIR=$VARIANT_DIR/$BUILD_DIR_NAME
|
||||
|
||||
# i.e. /path/to/robomongo/build/debug/install
|
||||
INSTALL_PREFIX=$BUILD_DIR/install
|
||||
|
||||
# i.e. /path/to/robomongo/build/debug/package
|
||||
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.9
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
rem Check that ROBOMONGO_CMAKE_PREFIX_PATH is set
|
||||
if not defined ROBOMONGO_CMAKE_PREFIX_PATH (
|
||||
echo Set environment variable ROBOMONGO_CMAKE_PREFIX_PATH in order to use this script
|
||||
echo.
|
||||
echo For example, execute the following command:
|
||||
echo setx ROBOMONGO_CMAKE_PREFIX_PATH "c:\Qt-5\5.5\msvc2013_64;c:\robomongo-shell"
|
||||
echo.
|
||||
echo You also need to reopen your Windows Command Prompt.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
rem Check for debug build type
|
||||
if %1. == debug. (
|
||||
set BUILD_TYPE=Debug
|
||||
) else (
|
||||
rem If build type wasn't specified - Release mode assumed
|
||||
if %1. ==. (
|
||||
set BUILD_TYPE=Release
|
||||
) else (
|
||||
echo Invalid build type "%1". Supported build types: debug or release.
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
rem Build dir name (i.e. Release)
|
||||
set BUILD_DIR_NAME=%BUILD_TYPE%
|
||||
|
||||
rem i.e. /path/to/robomongo/build
|
||||
set VARIANT_DIR=%PROJECT_DIR%\build
|
||||
|
||||
rem i.e. /path/to/robomongo/build/debug
|
||||
set BUILD_DIR=%VARIANT_DIR%\%BUILD_DIR_NAME%
|
||||
|
||||
rem i.e. /path/to/robomongo/build/debug/install
|
||||
set INSTALL_PREFIX=%BUILD_DIR%\install
|
||||
|
||||
rem i.e. /path/to/robomongo/build/debug/package
|
||||
set PACK_PREFIX=%BUILD_DIR%/package
|
||||
|
||||
rem Get value from environment variable
|
||||
set PREFIX_PATH=%ROBOMONGO_CMAKE_PREFIX_PATH%
|
||||
|
||||
rem Create BUILD_DIR if it is not exists already
|
||||
if not exist "%BUILD_DIR%" (
|
||||
md "%BUILD_DIR%"
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/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
|
||||
|
||||
cd $BUILD_DIR
|
||||
cmake -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
|
||||
@@ -0,0 +1,15 @@
|
||||
@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 CMake configuration step
|
||||
cd "%BUILD_DIR%"
|
||||
cmake -G "Visual Studio 12 2013 Win64" -D "CMAKE_PREFIX_PATH=%PREFIX_PATH%" -D "CMAKE_BUILD_TYPE=%BUILD_TYPE%" -D "CMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" %PROJECT_DIR%
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/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
|
||||
|
||||
cd $BUILD_DIR
|
||||
cmake --build . --target install/strip "${@:2}"
|
||||
@@ -0,0 +1,15 @@
|
||||
@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 install
|
||||
cd "%BUILD_DIR%"
|
||||
cmake --build . --config %BUILD_TYPE% --target install
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/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
|
||||
|
||||
cd $BUILD_DIR
|
||||
cmake --build . --target package "${@:2}"
|
||||
@@ -0,0 +1,15 @@
|
||||
@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 install
|
||||
cd "%BUILD_DIR%"
|
||||
cmake --build . --config %BUILD_TYPE% --target package
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/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
|
||||
|
||||
if [ "$(uname -s)" == "Darwin" ]; then
|
||||
# On Mac OS we should run executable from bundle
|
||||
"$BUILD_DIR/src/robomongo/Robomongo.app/Contents/MacOS/Robomongo"
|
||||
else
|
||||
"$BUILD_DIR/src/robomongo/robomongo"
|
||||
fi
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/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
|
||||
|
||||
VERSION="$(echo $1 | tr '[A-Z]' '[a-z]')"
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Usage: tag <name>"
|
||||
echo "Example: tag 0.9.0-rc9"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
|
||||
echo "Error: You are not on master branch"
|
||||
exit
|
||||
fi
|
||||
|
||||
cd $PROJECT_DIR
|
||||
git tag -a "v${VERSION}" -m "${VERSION}"
|
||||
git push --tags
|
||||
@@ -0,0 +1,142 @@
|
||||
#
|
||||
# Find the MongoDB libraries
|
||||
#
|
||||
# This module defines the following variables:
|
||||
# MongoDB_FOUND
|
||||
# MongoDB_LIBS
|
||||
# MongoDB_INCLUDE_DIRS
|
||||
# MongoDB_DEFINITIONS
|
||||
#
|
||||
# Imported target "mongodb" is created
|
||||
#
|
||||
# We assume, that at least "mongo" target was build by the following command:
|
||||
# $ scons mongo
|
||||
#
|
||||
#
|
||||
|
||||
# Try to find MongoDB directory (uses CMAKE_PREFIX_PATH locations)
|
||||
find_path(
|
||||
MongoDB_DIR src/mongo/config.h.in
|
||||
DOC "Path to MongoDB (github.com/robomongo-shell) root directory"
|
||||
)
|
||||
|
||||
# Find relative path to build directory
|
||||
if(BUILD_RELEASE OR BUILD_RELWITHDEBINFO OR BUILD_MINSIZEREL)
|
||||
set(MongoDB_RELATIVE_BUILD_DIR build/opt)
|
||||
set(MongoDB_OBJECT_LIST_BUILD_TYPE_PART release)
|
||||
elseif(BUILD_DEBUG)
|
||||
set(MongoDB_RELATIVE_BUILD_DIR build/debug)
|
||||
set(MongoDB_OBJECT_LIST_BUILD_TYPE_PART debug)
|
||||
endif()
|
||||
|
||||
# Set absolute path to build directory
|
||||
set(MongoDB_BUILD_DIR ${MongoDB_DIR}/${MongoDB_RELATIVE_BUILD_DIR})
|
||||
|
||||
# Set commong compiler definitons
|
||||
set(MongoDB_DEFINITIONS
|
||||
PCRE_STATIC
|
||||
BOOST_THREAD_VERSION=4
|
||||
BOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD
|
||||
BOOST_THREAD_NO_DEPRECATED
|
||||
BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
|
||||
BOOST_THREAD_HAS_BUG
|
||||
MONGO_CONFIG_HAVE_HEADER_UNISTD_H
|
||||
)
|
||||
|
||||
# Set common compiler include directories
|
||||
set(MongoDB_INCLUDE_DIRS
|
||||
${MongoDB_DIR}/src
|
||||
${MongoDB_DIR}/src/third_party/boost-1.56.0
|
||||
${MongoDB_DIR}/src/third_party/mozjs-38/include
|
||||
${MongoDB_DIR}/src/third_party/mozjs-38/mongo_sources
|
||||
${MongoDB_DIR}/src/third_party/pcre-8.37
|
||||
${MongoDB_BUILD_DIR}
|
||||
)
|
||||
|
||||
if(SYSTEM_LINUX)
|
||||
set(MongoDB_OBJECT_LIST_PLATFORM_PART linux)
|
||||
list(APPEND MongoDB_INCLUDE_DIRS
|
||||
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/linux/include)
|
||||
elseif(SYSTEM_WINDOWS)
|
||||
set(MongoDB_OBJECT_LIST_PLATFORM_PART windows)
|
||||
list(APPEND MongoDB_INCLUDE_DIRS
|
||||
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/windows/include)
|
||||
elseif(SYSTEM_MACOSX)
|
||||
set(MongoDB_OBJECT_LIST_PLATFORM_PART macosx)
|
||||
list(APPEND MongoDB_INCLUDE_DIRS
|
||||
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/osx/include)
|
||||
elseif(SYSTEM_FREEBSD)
|
||||
set(MongoDB_OBJECT_LIST_PLATFORM_PART freebsd)
|
||||
list(APPEND MongoDB_INCLUDE_DIRS
|
||||
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/freebsd/include)
|
||||
elseif(SYSTEM_OPENBSD)
|
||||
set(MongoDB_OBJECT_LIST_PLATFORM_PART openbsd)
|
||||
list(APPEND MongoDB_INCLUDE_DIRS
|
||||
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/openbsd/include)
|
||||
endif()
|
||||
|
||||
# Read list of object files
|
||||
# See "mongodb/README.md" file (relative to the current folder) for more information.
|
||||
file(READ
|
||||
${CMAKE_CURRENT_LIST_DIR}/mongodb/${MongoDB_OBJECT_LIST_PLATFORM_PART}-${MongoDB_OBJECT_LIST_BUILD_TYPE_PART}.objects
|
||||
MongoDB_RELATIVE_LIBS)
|
||||
|
||||
string(STRIP "${MongoDB_RELATIVE_LIBS}" MongoDB_RELATIVE_LIBS)
|
||||
|
||||
# Convert string to list
|
||||
string(REPLACE " " ";" MongoDB_RELATIVE_LIBS ${MongoDB_RELATIVE_LIBS})
|
||||
|
||||
# Convert to absolute path
|
||||
foreach(lib ${MongoDB_RELATIVE_LIBS})
|
||||
list(APPEND MongoDB_LIBS ${MongoDB_DIR}/${lib})
|
||||
endforeach()
|
||||
|
||||
# Get MongoDB repository recent tag
|
||||
execute_process(
|
||||
COMMAND git describe --abbrev=0 --tags
|
||||
WORKING_DIRECTORY ${MongoDB_DIR}
|
||||
OUTPUT_VARIABLE MongoDB_RECENT_TAG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MongoDB
|
||||
FOUND_VAR MongoDB_FOUND # When using CMake 3.0 MONGODB_FOUND variable will be created.
|
||||
# Make it explicit that variable name is MongoDB_FOUND.
|
||||
REQUIRED_VARS MongoDB_DIR MongoDB_BUILD_DIR
|
||||
VERSION_VAR MongoDB_RECENT_TAG
|
||||
FAIL_MESSAGE "Could not find Robomongo Shell (MongoDB fork). Make sure that CMAKE_PREFIX_PATH points to Robomongo Shell project root.\n")
|
||||
|
||||
if(MongoDB_FOUND)
|
||||
set(MongoDB_VERSION ${MongoDB_RECENT_TAG})
|
||||
|
||||
# Original MongoDB link command has the following in the end: m rt dl
|
||||
set(MongoDB_LIBS
|
||||
${LINK_WHOLE_ARCHIVE_START} # Linux: -Wl,--whole-archive
|
||||
${LINK_LIBGROUP_START} # Linux: -Wl,--start-group
|
||||
${MongoDB_LIBS}
|
||||
${LINK_LIBGROUP_END} # Linux: -Wl,--end-group
|
||||
${LINK_WHOLE_ARCHIVE_END} # Linux: -Wl,--no-whole-archive
|
||||
${CMAKE_DL_LIBS} # Linux: dl
|
||||
)
|
||||
|
||||
# Add imported target
|
||||
add_library(mongodb INTERFACE IMPORTED)
|
||||
|
||||
# Specify INTERFACE properties for this target
|
||||
set_target_properties(mongodb PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "${MongoDB_LIBS}"
|
||||
INTERFACE_COMPILE_DEFINITIONS "${MongoDB_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${MongoDB_INCLUDE_DIRS}"
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
# Cleanup
|
||||
unset(MongoDB_OBJECT_LIST_BUILD_TYPE_PART)
|
||||
unset(MongoDB_OBJECT_LIST_PLATFORM_PART)
|
||||
unset(MongoDB_RELATIVE_BUILD_DIR)
|
||||
unset(MongoDB_RELATIVE_LIBS)
|
||||
unset(MongoDB_RECENT_TAG)
|
||||
@@ -1,274 +1,32 @@
|
||||
# - Try to find the OpenSSL encryption library
|
||||
# Once done this will define
|
||||
##################################################
|
||||
# Find and Add OpenSSL shared (dynamic) library
|
||||
#
|
||||
# - This module defines the following variables:
|
||||
# OpenSSL_DIR
|
||||
# OPENSSL_VERSION
|
||||
#
|
||||
# OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
|
||||
# - Imported shared(dynamic) libraries "ssl" and "crypto" are created.
|
||||
#
|
||||
# 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>
|
||||
# - It is assumed that OpenSSL has been built and path to OpenSSL build directory is
|
||||
# added into system(environment) variable ROBOMONGO_CMAKE_PREFIX_PATH.
|
||||
#
|
||||
# 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 ()
|
||||
# Try to find OpenSSL directory (uses CMAKE_PREFIX_PATH locations)
|
||||
#-------------------------------------------
|
||||
|
||||
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
|
||||
find_path(
|
||||
OpenSSL_DIR include/openssl/ssl.h
|
||||
DOC "Path to OpenSSL (github.com/openssl/openssl) root directory"
|
||||
)
|
||||
|
||||
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
|
||||
# Find OpenSSL version
|
||||
#-------------------------------------------
|
||||
|
||||
# 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()
|
||||
if(SYSTEM_WINDOWS)
|
||||
set (OPENSSL_INCLUDE_DIR "${OpenSSL_DIR}/inc32")
|
||||
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})
|
||||
set (OPENSSL_INCLUDE_DIR "${OpenSSL_DIR}/include")
|
||||
endif()
|
||||
|
||||
function(from_hex HEX DEC)
|
||||
@@ -303,11 +61,9 @@ function(from_hex HEX DEC)
|
||||
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")
|
||||
if(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])+.*")
|
||||
REGEX "^#[\t ]*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.
|
||||
@@ -340,23 +96,43 @@ if (OPENSSL_INCLUDE_DIR)
|
||||
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 ()
|
||||
# Add imported ssl and crypto libraries
|
||||
#-------------------------------------------
|
||||
|
||||
# Add imported target ssl (ssleay32)
|
||||
add_library(ssl SHARED IMPORTED)
|
||||
|
||||
mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
|
||||
# Add imported target for crypto (libeay32)
|
||||
add_library(crypto SHARED IMPORTED)
|
||||
|
||||
if(SYSTEM_WINDOWS)
|
||||
set_target_properties(ssl PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/inc32"
|
||||
IMPORTED_IMPLIB "${OpenSSL_DIR}/out32dll/ssleay32.lib"
|
||||
)
|
||||
set_target_properties(crypto PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/inc32"
|
||||
IMPORTED_IMPLIB "${OpenSSL_DIR}/out32dll/libeay32.lib"
|
||||
)
|
||||
elseif(SYSTEM_MACOSX)
|
||||
set_target_properties(ssl PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
|
||||
IMPORTED_LOCATION "${OpenSSL_DIR}/libssl.dylib"
|
||||
)
|
||||
set_target_properties(crypto PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
|
||||
IMPORTED_LOCATION "${OpenSSL_DIR}/libcrypto.dylib"
|
||||
)
|
||||
elseif(SYSTEM_LINUX)
|
||||
set_target_properties(ssl PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
|
||||
IMPORTED_LOCATION "${OpenSSL_DIR}/libssl.so"
|
||||
)
|
||||
set_target_properties(crypto PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
|
||||
IMPORTED_LOCATION "${OpenSSL_DIR}/libcrypto.so"
|
||||
)
|
||||
endif()
|
||||
|
||||
# End of file
|
||||
@@ -0,0 +1,21 @@
|
||||
# This wrapper is created in order to support CMake 3.0
|
||||
# Only starting from CMake 3.1 "Threads" module exports
|
||||
# "Threads::Threads" target.
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# Support for CMake 3.0
|
||||
# Export "Threads::Threads" imported target if it wasn't exported.
|
||||
# This lines are taken from the "FindThreads.cmake" of CMake 3.1:
|
||||
# https://github.com/Kitware/CMake/blob/v3.1.0/Modules/FindThreads.cmake
|
||||
if(THREADS_FOUND AND NOT TARGET Threads::Threads)
|
||||
add_library(Threads::Threads INTERFACE IMPORTED)
|
||||
|
||||
if(THREADS_HAVE_PTHREAD_ARG)
|
||||
set_property(TARGET Threads::Threads PROPERTY INTERFACE_COMPILE_OPTIONS "-pthread")
|
||||
endif()
|
||||
|
||||
if(CMAKE_THREAD_LIBS_INIT)
|
||||
set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,20 @@
|
||||
Quick reference to CMake
|
||||
========================
|
||||
|
||||
if(<constant>)
|
||||
|
||||
True if the constant is `1`, `ON`, `YES`, `TRUE`, `Y`, or a non-zero number.
|
||||
False if the constant is `0`, `OFF`, `NO`, `FALSE`, `N`, `IGNORE`, `NOTFOUND`,
|
||||
the empty string, or ends in the suffix `-NOTFOUND`. Named boolean constants
|
||||
are case-insensitive. If the argument is not one of these constants, it is
|
||||
treated as a variable.
|
||||
|
||||
if(<variable>)
|
||||
|
||||
True if the variable is defined to a value that is not a false constant. False otherwise.
|
||||
(Note macro arguments are not variables.)
|
||||
|
||||
if(DEFINED <variable>)
|
||||
|
||||
True if the given variable is defined. It does not matter if the variable is
|
||||
true or false just if it has been set. (Note macro arguments are not variables.)
|
||||
@@ -0,0 +1,32 @@
|
||||
# Put the include dirs which are in the source or build tree
|
||||
# before all other include dirs, so the headers in the sources
|
||||
# are prefered over the already installed ones
|
||||
# Since cmake 2.4.1
|
||||
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
|
||||
|
||||
# Use colored output
|
||||
# Since cmake 2.4.0
|
||||
set(CMAKE_COLOR_MAKEFILE ON)
|
||||
|
||||
# MongoDB compiled with this option
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# This variable is used by CMake "FindThreads" module
|
||||
# From documentation to FindThreads module:
|
||||
# > Please note that the compiler flag can only be
|
||||
# > used with the imported target. Use of both the imported
|
||||
# > target as well as this switch is highly recommended for new code.
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
|
||||
# Set the default build type to release with debug info
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo
|
||||
CACHE STRING "Choose the type of build, options are: Debug, Release, RelWithDebInfo, MinSizeRel and None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)"
|
||||
FORCE)
|
||||
endif()
|
||||
|
||||
# Do not use Qt moc, uic and rcc by default
|
||||
# Since CMake 2.8.6
|
||||
set(CMAKE_AUTOMOC OFF)
|
||||
set(CMAKE_AUTORCC OFF)
|
||||
set(CMAKE_AUTOUIC OFF)
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
set(ROBOMONGO_DISPLAY_NAME "Robomongo")
|
||||
set(ROBOMONGO_DISPLAY_FULL_NAME "Robomongo ${PROJECT_VERSION}")
|
||||
@@ -0,0 +1,31 @@
|
||||
# Show configuration summary and build tip
|
||||
message("")
|
||||
message(" _______________[ Robomongo configuration summary ]________________")
|
||||
message("| ")
|
||||
message("|-- Dependencies:")
|
||||
message("| ")
|
||||
message("| Qt5 Core: ${Qt5Core_VERSION} ${Qt5Core_DIR}")
|
||||
message("| Qt5 Gui: ${Qt5Gui_VERSION} ${Qt5Gui_DIR}")
|
||||
message("| Qt5 Widgets: ${Qt5Widgets_VERSION} ${Qt5Widgets_DIR}")
|
||||
message("| Qt5 PrintSupport: ${Qt5Widgets_VERSION} ${Qt5PrintSupport_DIR}")
|
||||
message("| MongoDB: ${MongoDB_VERSION} ${MongoDB_BUILD_DIR}")
|
||||
message("| OpenSSL: ${OPENSSL_VERSION} ${OpenSSL_DIR}")
|
||||
message("|")
|
||||
message("|-- Summary:")
|
||||
message("|")
|
||||
message("| System: ${CMAKE_SYSTEM_NAME}")
|
||||
if (SYSTEM_MACOSX)
|
||||
message("| Target SDK: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
message("| Build type: ${CMAKE_BUILD_TYPE}")
|
||||
message("| Install path: ${CMAKE_INSTALL_PREFIX}")
|
||||
message("|")
|
||||
message("|-- Building and installing:")
|
||||
message("| ")
|
||||
message("| Now you can build Robomongo with the following command:")
|
||||
message("| $ cmake --build .")
|
||||
message("|")
|
||||
message("| And install it to ${CMAKE_INSTALL_PREFIX}:")
|
||||
message("| $ cmake --build . --target install")
|
||||
message("|__________________________________________________________________")
|
||||
message("")
|
||||
@@ -0,0 +1,78 @@
|
||||
# This files defines:
|
||||
#
|
||||
# 1) Platform checks
|
||||
#
|
||||
# SYSTEM_MACOSX
|
||||
# SYSTEM_WINDOWS
|
||||
# SYSTEM_LINUX
|
||||
# SYSTEM_FREEBSD
|
||||
# SYSTEM_OPENBSD
|
||||
# SYSTEM_NETBSD
|
||||
#
|
||||
# 2) Build types checks
|
||||
#
|
||||
# BUILD_DEBUG
|
||||
# BUILD_RELEASE
|
||||
# BUILD_RELWITHDEBINFO
|
||||
# BUILD_MINSIZEREL
|
||||
#
|
||||
# 3) Link "lib groups" and "whole-archive" options
|
||||
#
|
||||
# LINK_LIBGROUP_START
|
||||
# LINK_LIBGROUP_END
|
||||
# LINK_WHOLE_ARCHIVE_START
|
||||
# LINK_WHOLE_ARCHIVE_END
|
||||
|
||||
# Platform checks
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
set(SYSTEM_MACOSX TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(SYSTEM_WINDOWS TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(SYSTEM_LINUX TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
set(SYSTEM_FREEBSD TRUE)
|
||||
set(SYSTEM_BSD TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||
set(SYSTEM_OPENBSD TRUE)
|
||||
set(SYSTEM_BSD TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
||||
set(SYSTEM_NETBSD TRUE)
|
||||
set(SYSTEM_BSD TRUE)
|
||||
endif()
|
||||
|
||||
# Build types
|
||||
if("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
|
||||
set(BUILD_DEBUG TRUE)
|
||||
elseif("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
||||
set(BUILD_RELEASE TRUE)
|
||||
elseif("${CMAKE_BUILD_TYPE}" MATCHES "RelWithDebInfo")
|
||||
set(BUILD_RELWITHDEBINFO TRUE)
|
||||
elseif("${CMAKE_BUILD_TYPE}" MATCHES "MinSizeRel")
|
||||
set(BUILD_MINSIZEREL TRUE)
|
||||
endif()
|
||||
|
||||
# Compiler checks
|
||||
# We check Clang using MATCH instead of strict equality, because as of CMake 3.0.0 the
|
||||
# CMAKE_<LANG>_COMPILER_ID value for Apple-provided Clang is AppleClang. To test
|
||||
# for both the Apple-provided Clang and the regular Clang we use MATCH.
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(COMPILER_CLANG TRUE)
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "^GNU$")
|
||||
set(COMPILER_GCC TRUE)
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "^MSVC$")
|
||||
set(COMPILER_MSVC TRUE)
|
||||
endif()
|
||||
|
||||
# Link "groups" and "whole-archive" options
|
||||
if(SYSTEM_LINUX OR SYSTEM_FREEBSD OR SYSTEM_OPENBSD)
|
||||
set(LINK_LIBGROUP_START -Wl,--start-group)
|
||||
set(LINK_LIBGROUP_END -Wl,--end-group)
|
||||
set(LINK_WHOLE_ARCHIVE_START -Wl,--whole-archive)
|
||||
set(LINK_WHOLE_ARCHIVE_END -Wl,--no-whole-archive)
|
||||
elseif(SYSTEM_MACOSX)
|
||||
set(LINK_LIBGROUP_START "")
|
||||
set(LINK_LIBGROUP_END "")
|
||||
set(LINK_WHOLE_ARCHIVE_START -Wl,-all_load)
|
||||
set(LINK_WHOLE_ARCHIVE_END -Wl,-noall_load)
|
||||
endif()
|
||||
@@ -0,0 +1,127 @@
|
||||
# Note for maintainers
|
||||
# --------------------
|
||||
#
|
||||
# Do not use absolute paths in DESTINATION arguments for install() command.
|
||||
# Because the same install code will be executed again by CPack. And CPack will
|
||||
# change internally CMAKE_INSTALL_PREFIX to point to some temporary folder
|
||||
# for package content.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
# Temporary change
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install"
|
||||
CACHE STRING "Install path prefix, prepended onto install directories"
|
||||
FORCE)
|
||||
|
||||
if(SYSTEM_LINUX)
|
||||
set(bin_dir bin)
|
||||
set(lib_dir lib)
|
||||
set(resources_dir share)
|
||||
set(license_dir .)
|
||||
|
||||
set(qt_plugins_dir ${lib_dir})
|
||||
set(qt_conf_dir ${bin_dir})
|
||||
set(qt_conf_plugins "../lib")
|
||||
elseif(SYSTEM_MACOSX)
|
||||
set(bundle_name Robomongo.app)
|
||||
set(contents_path ${bundle_name}/Contents)
|
||||
|
||||
set(bin_dir ${contents_path}/MacOS)
|
||||
set(lib_dir ${contents_path}/Frameworks)
|
||||
set(resources_dir ${contents_path}/Resources)
|
||||
set(license_dir ${resources_dir})
|
||||
|
||||
set(qt_plugins_dir ${contents_path}/PlugIns/Qt)
|
||||
set(qt_conf_dir ${resources_dir})
|
||||
set(qt_conf_plugins "PlugIns/Qt")
|
||||
elseif(SYSTEM_WINDOWS)
|
||||
set(bin_dir .)
|
||||
set(lib_dir .)
|
||||
set(resources_dir .)
|
||||
set(license_dir .)
|
||||
|
||||
set(qt_plugins_dir ${lib_dir})
|
||||
set(qt_conf_dir ${bin_dir})
|
||||
set(qt_conf_plugins .)
|
||||
endif()
|
||||
|
||||
# Generate qt.conf file
|
||||
configure_file(
|
||||
"${CMAKE_SOURCE_DIR}/install/qt.conf.in"
|
||||
"${CMAKE_BINARY_DIR}/qt.conf")
|
||||
|
||||
# Install qt.conf file
|
||||
install(
|
||||
FILES "${CMAKE_BINARY_DIR}/qt.conf"
|
||||
DESTINATION "${qt_conf_dir}")
|
||||
|
||||
# Install OpenSSL dynamic lib files
|
||||
if(SYSTEM_WINDOWS)
|
||||
install(
|
||||
FILES
|
||||
"${OpenSSL_DIR}/out32dll/ssleay32.dll"
|
||||
"${OpenSSL_DIR}/out32dll/libeay32.dll"
|
||||
DESTINATION ${bin_dir})
|
||||
elseif(SYSTEM_MACOSX)
|
||||
install(
|
||||
FILES
|
||||
"${OpenSSL_DIR}/libssl.1.0.0.dylib"
|
||||
"${OpenSSL_DIR}/libcrypto.1.0.0.dylib"
|
||||
DESTINATION ${lib_dir}/lib)
|
||||
elseif(SYSTEM_LINUX)
|
||||
install(
|
||||
FILES
|
||||
"${OpenSSL_DIR}/libssl.so.1.0.0"
|
||||
"${OpenSSL_DIR}/libcrypto.so.1.0.0"
|
||||
DESTINATION ${lib_dir})
|
||||
endif()
|
||||
|
||||
# Install binary
|
||||
install(
|
||||
TARGETS robomongo
|
||||
RUNTIME DESTINATION ${bin_dir}
|
||||
BUNDLE DESTINATION .)
|
||||
|
||||
# Install license, copyright and changelogs files
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_SOURCE_DIR}/LICENSE
|
||||
${CMAKE_SOURCE_DIR}/COPYRIGHT
|
||||
${CMAKE_SOURCE_DIR}/CHANGELOG
|
||||
${CMAKE_SOURCE_DIR}/DESCRIPTION
|
||||
DESTINATION ${license_dir})
|
||||
|
||||
# Install common dependencies
|
||||
install_qt_lib(Core Gui Widgets PrintSupport)
|
||||
install_qt_plugins(QGifPlugin QICOPlugin)
|
||||
install_icu_libs()
|
||||
|
||||
if(SYSTEM_LINUX)
|
||||
install_qt_lib(XcbQpa DBus)
|
||||
install_qt_plugins(
|
||||
QXcbIntegrationPlugin)
|
||||
|
||||
elseif(SYSTEM_MACOSX)
|
||||
install_qt_lib(MacExtras DBus)
|
||||
install_qt_plugins(
|
||||
QCocoaIntegrationPlugin
|
||||
QMinimalIntegrationPlugin
|
||||
QOffscreenIntegrationPlugin)
|
||||
|
||||
# Install icon
|
||||
install(
|
||||
FILES "${CMAKE_SOURCE_DIR}/install/macosx/Robomongo.icns"
|
||||
DESTINATION "${resources_dir}")
|
||||
elseif(SYSTEM_WINDOWS)
|
||||
install_qt_plugins(
|
||||
QWindowsIntegrationPlugin
|
||||
QMinimalIntegrationPlugin
|
||||
QOffscreenIntegrationPlugin)
|
||||
|
||||
# Install runtime libraries:
|
||||
# msvcp120.dll
|
||||
# msvcr120.dll
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
endif()
|
||||
@@ -0,0 +1,105 @@
|
||||
function(install_qt_lib)
|
||||
foreach(module ${ARGV})
|
||||
set(target_name Qt5::${module})
|
||||
set(module_name Qt5${module})
|
||||
|
||||
# Get full path to some known Qt library (i.e. /path/to/lib/libQt5Widgets.so.5.5.1)
|
||||
get_target_property(target_path Qt5::Core LOCATION)
|
||||
|
||||
# Get folder path of library (i.e. /path/to/lib)
|
||||
get_filename_component(qt_lib_dir ${target_path} DIRECTORY)
|
||||
|
||||
if (SYSTEM_LINUX)
|
||||
# Not very good solution, but we simply take all files with *Qt5<module>* in names (including symlinks)
|
||||
file(GLOB module_libs ${qt_lib_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${module_name}*)
|
||||
|
||||
# Install to "lib" folder
|
||||
install(FILES ${module_libs}
|
||||
DESTINATION ${lib_dir})
|
||||
endif()
|
||||
|
||||
if(SYSTEM_MACOSX)
|
||||
set(module_name Qt${module})
|
||||
|
||||
# On Mac OS we are still located in .framework folder,
|
||||
# and we need to go one level up
|
||||
get_filename_component(qt_lib_dir ${qt_lib_dir} DIRECTORY)
|
||||
|
||||
install(
|
||||
DIRECTORY ${qt_lib_dir}/${module_name}.framework
|
||||
DESTINATION ${lib_dir}
|
||||
PATTERN "*_debug" EXCLUDE # Exclude debug libraries
|
||||
PATTERN "Headers" EXCLUDE) # Exclude Headers folders
|
||||
endif()
|
||||
|
||||
if (SYSTEM_WINDOWS)
|
||||
# Install single DLL to lib directory
|
||||
install(FILES ${qt_lib_dir}/${module_name}${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
DESTINATION ${lib_dir})
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function(install_icu_libs)
|
||||
# We are trying to get 'lib' folder of Qt installation.
|
||||
# For this we take some known target (Qt5::Core in this case)
|
||||
# and taking path to this library.
|
||||
|
||||
# Get full path to known library (i.e. /path/to/lib/libQt5Core.so.5.5.1)
|
||||
get_target_property(target_path Qt5::Core LOCATION)
|
||||
|
||||
# Get absolute path to 'lib' folder (which is a parent folder of 'known' library)
|
||||
get_filename_component(qt_lib_dir ${target_path} DIRECTORY)
|
||||
|
||||
# Not very good solution, but we simply take all files with *icu* in names (including symlinks)
|
||||
file(GLOB icu_libs ${qt_lib_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}icu*)
|
||||
|
||||
# Install to "lib" folder
|
||||
install(FILES ${icu_libs}
|
||||
DESTINATION ${lib_dir})
|
||||
endfunction()
|
||||
|
||||
# Installs Qt5 plugins. Uses value of global variable "qt_plugins_dir" as
|
||||
# absolute path to where install plugins.
|
||||
#
|
||||
# You can find list of plugin names by examing this variable: Qt5<Module>_PLUGINS
|
||||
# For example, Qt5Gui_PLUGINS.
|
||||
#
|
||||
# Debug plugins, running application in this way:
|
||||
# QT_DEBUG_PLUGINS=1 ./yourapp
|
||||
#
|
||||
# Some examples of plugin names:
|
||||
# QGifPlugin, QGtk2ThemePlugin, QIbusPlatformInputContextPlugin
|
||||
#
|
||||
# Sample:
|
||||
# install_qt_plugins(QGifPlugin QGtk2ThemePlugin QIbusPlatformInputContextPlugin)
|
||||
#
|
||||
function(install_qt_plugins)
|
||||
foreach(name ${ARGV})
|
||||
set(target_name Qt5::${name})
|
||||
|
||||
# We are trying to get 'plugins' folder of Qt installation.
|
||||
|
||||
# Get full path to plugin library (i.e. /path/to/plugins/imageformats/libqgif.so)
|
||||
get_target_property(target_path ${target_name} LOCATION)
|
||||
|
||||
# Get absolute path to parent folder (i.e. /path/to/plugins/imageformats for Qt5::QGifPlugin)
|
||||
get_filename_component(plugin_dir ${target_path} DIRECTORY)
|
||||
|
||||
# Get plugin parent directory (i.e. "imageformats" for Qt5::QGifPlugin)
|
||||
get_filename_component(plugin_dir_name ${plugin_dir} NAME)
|
||||
|
||||
# Get plugin file name (i.e. "libqgif.so" for Qt5::QGifPlugin)
|
||||
get_filename_component(plugin_file_name ${target_path} NAME)
|
||||
|
||||
# Get absolute path to plugins folder (i.e. /path/to/plugins)
|
||||
get_filename_component(plugins_dir ${plugin_dir} DIRECTORY)
|
||||
|
||||
# Install to "lib" folder
|
||||
install(
|
||||
FILES ${target_path}
|
||||
DESTINATION ${qt_plugins_dir}/${plugin_dir_name})
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
# Notes for maintainers.
|
||||
#
|
||||
# 1. Make sure that we use only lowercase letters in file name of outputed
|
||||
# package for all platforms and package types.
|
||||
#
|
||||
|
||||
# Get last commit hash
|
||||
execute_process(
|
||||
COMMAND git rev-parse --short HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE git_hash
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# Timestamp (not used for now)
|
||||
string(TIMESTAMP timestamp "%Y-%m-%d")
|
||||
|
||||
# Package name (as it should appear in UI)
|
||||
set(CPACK_PACKAGE_NAME Robomongo)
|
||||
|
||||
# Version of the package
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
||||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
|
||||
# Where to put generated package
|
||||
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}/package)
|
||||
|
||||
# Disables the component-based install process for installers
|
||||
# that support it (NSIS, for instance)
|
||||
set(CPACK_MONOLITHIC_INSTALL ON)
|
||||
|
||||
# Strip debug information on platforms that support it
|
||||
set(CPACK_STRIP_FILES ON)
|
||||
|
||||
# Additional information
|
||||
set(CPACK_PACKAGE_VENDOR Paralect)
|
||||
set(CPACK_PACKAGE_CONTACT robomongo@paralect.com)
|
||||
set(CPACK_PACKAGE_DESCRIPTION "Shell-centric cross-platform MongoDB management tool.")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Robomongo is a shell-centric cross-platform MongoDB management tool.")
|
||||
|
||||
# Use lowercase for system name and package file name
|
||||
string(TOLOWER ${CMAKE_SYSTEM_NAME} system_name)
|
||||
string(TOLOWER ${CPACK_PACKAGE_NAME} package_file_name)
|
||||
string(TOLOWER ${CPACK_PACKAGE_VERSION} package_file_version)
|
||||
|
||||
# We use function from TargetArch.cmake module
|
||||
# Returns string with target architecture value
|
||||
# Output for common architectures is: i386 or x86_64
|
||||
target_architecture(target_arch)
|
||||
|
||||
# Package file name
|
||||
set(CPACK_PACKAGE_FILE_NAME ${package_file_name}-${package_file_version}-${system_name}-${target_arch}-${git_hash})
|
||||
|
||||
if(SYSTEM_LINUX)
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
|
||||
|
||||
elseif(SYSTEM_MACOSX)
|
||||
set(CPACK_GENERATOR DragNDrop)
|
||||
set(CPACK_DMG_DS_STORE ${CMAKE_SOURCE_DIR}/install/macosx/DMG_DS_Store)
|
||||
|
||||
elseif(SYSTEM_WINDOWS)
|
||||
set(files_dir "${CMAKE_SOURCE_DIR}/install/windows")
|
||||
set(exe_name "Robomongo.exe")
|
||||
|
||||
set(CPACK_GENERATOR NSIS ZIP)
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/DESCRIPTION")
|
||||
|
||||
# License file will be shown in the installation wizard
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
|
||||
# Default installation directory (not full path), just the path after
|
||||
# default "c:\Program Files"
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${ROBOMONGO_DISPLAY_FULL_NAME}")
|
||||
|
||||
# A path to the executable inside installed package that contains icon
|
||||
# This icon is used in Windows "Add or remove programs" control panel
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "\\\\${exe_name}")
|
||||
|
||||
# Create shortcuts on desktop and start-up menu
|
||||
set(CPACK_NSIS_CREATE_ICONS_EXTRA "
|
||||
CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${ROBOMONGO_DISPLAY_FULL_NAME}.lnk' '$INSTDIR\\\\${exe_name}'
|
||||
CreateShortCut '$DESKTOP\\\\${ROBOMONGO_DISPLAY_FULL_NAME}.lnk' '$INSTDIR\\\\${exe_name}'
|
||||
")
|
||||
|
||||
# Cleanup during uninstallation. This cleanup is required because shortcuts
|
||||
# will not be deleted automatically.
|
||||
# Without line '!insertmacro...' shortcut in start menu will not be removed
|
||||
# (i.e. it doesn't work when we referece '$STARTMENU_FOLDER' that is used
|
||||
# when creating shortcuts). This solution was found somewhere in internet.
|
||||
set(CPACK_NSIS_DELETE_ICONS_EXTRA "
|
||||
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
|
||||
Delete '$DESKTOP\\\\${ROBOMONGO_DISPLAY_FULL_NAME}.lnk'
|
||||
Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\${ROBOMONGO_DISPLAY_FULL_NAME}.lnk'
|
||||
")
|
||||
|
||||
# The title displayed at the top of the installer
|
||||
set(CPACK_NSIS_PACKAGE_NAME "${ROBOMONGO_DISPLAY_FULL_NAME}")
|
||||
|
||||
# Installer images (for sidebar and topbar)
|
||||
set(CPACK_PACKAGE_ICON "${files_dir}\\\\nsis-topbar.bmp")
|
||||
set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "!define MUI_WELCOMEFINISHPAGE_BITMAP \\\"${files_dir}\\\\nsis-sidebar.bmp\\\"")
|
||||
|
||||
# URL to a web site providing more information about application
|
||||
# This url was noticed at least in "Add or remove programs" control
|
||||
# panel.
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "www.robomongo.org")
|
||||
|
||||
# Specify an executable to add an option to run on the finish
|
||||
# page of the NSIS installer. Without "..\\\\" it dowsn't work for NSIS 2.5
|
||||
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "..\\\\${exe_name}")
|
||||
|
||||
# Trying to set for installer and uninstaller, but this is
|
||||
# doesn't work and default icons are still used...
|
||||
set(CPACK_NSIS_MUI_ICON "${files_dir}\\\\robomongo.ico")
|
||||
set(CPACK_NSIS_MUI_UNIICON "${files_dir}\\\\robomongo.ico")
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
@@ -0,0 +1,123 @@
|
||||
###
|
||||
# Prints CMake variables.
|
||||
#
|
||||
# Print all variables in the current scope:
|
||||
#
|
||||
# print_vars()
|
||||
# print_vars("") # the same result, as previous line
|
||||
#
|
||||
# Print all variables with names, matching regex, case insensitive:
|
||||
#
|
||||
# print_vars("SOMEVAR")
|
||||
# print_vars("someVar") # the same result, as previous line
|
||||
# print_vars("^CMAKE") # print all variables, that starts from "CMAKE"
|
||||
# print_vars("VAR$") # ends by "VAR"
|
||||
# print_vars("^VAR$") # exact match
|
||||
#
|
||||
function(print_vars)
|
||||
if(ARGV0)
|
||||
set(regex ${ARGV0})
|
||||
endif()
|
||||
get_cmake_property(names VARIABLES)
|
||||
foreach(name ${names})
|
||||
# Make lowercase variants for case-insensitive comparing
|
||||
string(TOLOWER "${name}" lc_name)
|
||||
string(TOLOWER "${regex}" lc_regex)
|
||||
|
||||
if(lc_name MATCHES "${lc_regex}")
|
||||
message("${name}=${${name}}")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
||||
###
|
||||
# Print content of variable.
|
||||
#
|
||||
# print_var(PROJECT_NAME)
|
||||
# print_var("PROJECT_NAME") # the same result as previous line
|
||||
#
|
||||
function(print_var name)
|
||||
|
||||
# Show nice output for not defined or empty variables
|
||||
if(NOT DEFINED ${name})
|
||||
set(value " is not defined.")
|
||||
elseif("${${name}}" STREQUAL "")
|
||||
set(value " is defined but empty.")
|
||||
else()
|
||||
set(value "=${${name}}")
|
||||
endif()
|
||||
|
||||
message("${name}${value}")
|
||||
endfunction()
|
||||
|
||||
###
|
||||
# Prints included directories
|
||||
#
|
||||
function(print_include_dirs)
|
||||
get_property(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
|
||||
foreach(dir ${dirs})
|
||||
message("${dir}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
###
|
||||
# Prints link directories
|
||||
#
|
||||
function(print_link_dirs)
|
||||
get_property(dirs DIRECTORY PROPERTY LINK_DIRECTORIES)
|
||||
foreach(dir ${dirs})
|
||||
message("${dir}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
###
|
||||
# Prints compile definitions
|
||||
#
|
||||
function(print_compile_definitions)
|
||||
get_property(defs DIRECTORY PROPERTY COMPILE_DEFINITIONS)
|
||||
foreach(def ${defs})
|
||||
message("${def}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
||||
###
|
||||
# Prints target include directories
|
||||
#
|
||||
function(print_target_include_dirs target)
|
||||
get_property(dirs TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||
foreach(dir ${dirs})
|
||||
message("${dir}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
###
|
||||
# Prints target compile definitions
|
||||
#
|
||||
function(print_target_compile_definitions target)
|
||||
get_property(defs TARGET ${target} PROPERTY INTERFACE_COMPILE_DEFINITIONS)
|
||||
foreach(def ${defs})
|
||||
message("${def}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
###
|
||||
# Prints target link libraries
|
||||
#
|
||||
function(print_target_link_libraries target)
|
||||
get_property(defs TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES)
|
||||
foreach(def ${defs})
|
||||
message("${def}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
###
|
||||
# Prints Qt5 module plugins
|
||||
#
|
||||
function(print_qt_module_plugins module)
|
||||
foreach(plugin ${Qt5${module}_PLUGINS})
|
||||
get_target_property(loc ${plugin} LOCATION)
|
||||
message("Plugin ${plugin} is at location ${loc}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
@@ -0,0 +1,154 @@
|
||||
# Copyright (c) 2012 Petroules Corporation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
# following conditions are met:
|
||||
#
|
||||
# Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
# disclaimer.
|
||||
#
|
||||
# Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# Based on the Qt 5 processor detection code, so should be very accurate
|
||||
# https://qt.gitorious.org/qt/qtbase/blobs/master/src/corelib/global/qprocessordetection.h
|
||||
# Currently handles arm (v5, v6, v7), x86 (32/64), ia64, and ppc (32/64)
|
||||
|
||||
# Regarding POWER/PowerPC, just as is noted in the Qt source,
|
||||
# "There are many more known variants/revisions that we do not handle/detect."
|
||||
|
||||
set(archdetect_c_code "
|
||||
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
|
||||
#if defined(__ARM_ARCH_7__) \\
|
||||
|| defined(__ARM_ARCH_7A__) \\
|
||||
|| defined(__ARM_ARCH_7R__) \\
|
||||
|| defined(__ARM_ARCH_7M__) \\
|
||||
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7)
|
||||
#error cmake_ARCH armv7
|
||||
#elif defined(__ARM_ARCH_6__) \\
|
||||
|| defined(__ARM_ARCH_6J__) \\
|
||||
|| defined(__ARM_ARCH_6T2__) \\
|
||||
|| defined(__ARM_ARCH_6Z__) \\
|
||||
|| defined(__ARM_ARCH_6K__) \\
|
||||
|| defined(__ARM_ARCH_6ZK__) \\
|
||||
|| defined(__ARM_ARCH_6M__) \\
|
||||
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
|
||||
#error cmake_ARCH armv6
|
||||
#elif defined(__ARM_ARCH_5TEJ__) \\
|
||||
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5)
|
||||
#error cmake_ARCH armv5
|
||||
#else
|
||||
#error cmake_ARCH arm
|
||||
#endif
|
||||
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
|
||||
#error cmake_ARCH i386
|
||||
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
|
||||
#error cmake_ARCH x86_64
|
||||
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
|
||||
#error cmake_ARCH ia64
|
||||
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\
|
||||
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\
|
||||
|| defined(_M_MPPC) || defined(_M_PPC)
|
||||
#if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
|
||||
#error cmake_ARCH ppc64
|
||||
#else
|
||||
#error cmake_ARCH ppc
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#error cmake_ARCH unknown
|
||||
")
|
||||
|
||||
# Set ppc_support to TRUE before including this file or ppc and ppc64
|
||||
# will be treated as invalid architectures since they are no longer supported by Apple
|
||||
|
||||
function(target_architecture output_var)
|
||||
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
# On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set
|
||||
# First let's normalize the order of the values
|
||||
|
||||
# Note that it's not possible to compile PowerPC applications if you are using
|
||||
# the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we
|
||||
# disable it by default
|
||||
# See this page for more information:
|
||||
# http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4
|
||||
|
||||
# Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime.
|
||||
# On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise.
|
||||
|
||||
foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES})
|
||||
if("${osx_arch}" STREQUAL "ppc" AND ppc_support)
|
||||
set(osx_arch_ppc TRUE)
|
||||
elseif("${osx_arch}" STREQUAL "i386")
|
||||
set(osx_arch_i386 TRUE)
|
||||
elseif("${osx_arch}" STREQUAL "x86_64")
|
||||
set(osx_arch_x86_64 TRUE)
|
||||
elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support)
|
||||
set(osx_arch_ppc64 TRUE)
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Now add all the architectures in our normalized order
|
||||
if(osx_arch_ppc)
|
||||
list(APPEND ARCH ppc)
|
||||
endif()
|
||||
|
||||
if(osx_arch_i386)
|
||||
list(APPEND ARCH i386)
|
||||
endif()
|
||||
|
||||
if(osx_arch_x86_64)
|
||||
list(APPEND ARCH x86_64)
|
||||
endif()
|
||||
|
||||
if(osx_arch_ppc64)
|
||||
list(APPEND ARCH ppc64)
|
||||
endif()
|
||||
else()
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}")
|
||||
|
||||
enable_language(C)
|
||||
|
||||
# Detect the architecture in a rather creative way...
|
||||
# This compiles a small C program which is a series of ifdefs that selects a
|
||||
# particular #error preprocessor directive whose message string contains the
|
||||
# target architecture. The program will always fail to compile (both because
|
||||
# file is not a valid C program, and obviously because of the presence of the
|
||||
# #error preprocessor directives... but by exploiting the preprocessor in this
|
||||
# way, we can detect the correct target architecture even when cross-compiling,
|
||||
# since the program itself never needs to be run (only the compiler/preprocessor)
|
||||
try_run(
|
||||
run_result_unused
|
||||
compile_result_unused
|
||||
"${CMAKE_BINARY_DIR}"
|
||||
"${CMAKE_BINARY_DIR}/arch.c"
|
||||
COMPILE_OUTPUT_VARIABLE ARCH
|
||||
CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
|
||||
# Parse the architecture name from the compiler output
|
||||
string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}")
|
||||
|
||||
# Get rid of the value marker leaving just the architecture name
|
||||
string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}")
|
||||
|
||||
# If we are compiling with an unknown architecture this variable should
|
||||
# already be set to "unknown" but in the case that it's empty (i.e. due
|
||||
# to a typo in the code), then set it to unknown
|
||||
if (NOT ARCH)
|
||||
set(ARCH unknown)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(${output_var} "${ARCH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -0,0 +1,27 @@
|
||||
if(SYSTEM_LINUX OR SYSTEM_MACOSX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
elseif(SYSTEM_WINDOWS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS -DBOOST_ALL_NO_LIB")
|
||||
|
||||
# Do not show some warnings. We turned off the same warnings as MongoDB do
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4355 /wd4800 /wd4267 /wd4244 /wd4290 /wd4068 /wd4351")
|
||||
|
||||
# The /MP option can reduce the total time to compile the source files. This option
|
||||
# causes the compiler to create one or more copies of itself, each in a separate process.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} psapi.lib bcrypt.lib Iphlpapi.lib dbghelp.lib ws2_32.lib winmm.lib version.lib")
|
||||
endif()
|
||||
|
||||
set(PROJECT_NAME "Robomongo")
|
||||
set(PROJECT_NAME_TITLE ${PROJECT_NAME})
|
||||
set(PROJECT_DOMAIN "www.robomongo.org")
|
||||
set(PROJECT_COMPANYNAME "Paralect")
|
||||
set(PROJECT_COPYRIGHT "Copyright (C) 2013-2015 ${PROJECT_COMPANYNAME} All Rights Reserved.")
|
||||
set(PROJECT_COMPANYNAME_DOMAIN "www.paralect.com")
|
||||
set(PROJECT_GITHUB_FORK "www.github.com/paralect/robomongo")
|
||||
set(PROJECT_GITHUB_ISSUES "www.github.com/paralect/robomongo/issues")
|
||||
|
||||
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE)
|
||||
@@ -0,0 +1,55 @@
|
||||
What is this?
|
||||
-------------
|
||||
|
||||
Files in this folder are read by FindMongoDB.cmake script.
|
||||
|
||||
We link with MongoDB shell using objects instead of static libs, because:
|
||||
|
||||
> We require the use of the 'object' mode for release builds because it is the only linking
|
||||
> model that works across all of our platforms. We would like to ensure that all of our
|
||||
> released artifacts are built with the same known-good-everywhere model.
|
||||
|
||||
This is a quote from root SConstruct file in MongoDB repository.
|
||||
|
||||
It is possible to build MongoDB shell in the following way:
|
||||
|
||||
$ scons mongo --link-model=static
|
||||
|
||||
Than we will have produced static libs that we can link with. But in release mode MongoDB
|
||||
SConstruct file do not support static link mode by default. This command will *not* work:
|
||||
|
||||
$ scons mongo --release --link-model=static
|
||||
|
||||
We decided to use object link mode even for debug builds, in order to use single mode across
|
||||
all platforms and configurations.
|
||||
|
||||
How did you receive content for this files?
|
||||
-------------------------------------------
|
||||
|
||||
First we build MongoDB shell with the following command:
|
||||
|
||||
$ scons mongo -j8 --release
|
||||
|
||||
Than we remove compiled `mongo` and run the same command again to see only final link command:
|
||||
|
||||
$ rm build/opt/mongo/mongo
|
||||
$ scons mongo -j8 --release > release-link-command.txt
|
||||
|
||||
And finally we manually copy/paste list of objects to `<platform>-release.objects` file. Make sure
|
||||
that they are single-line files.
|
||||
|
||||
Almost the same steps we are doing for debug builds:
|
||||
|
||||
$ scons mongo -j8 --dbg
|
||||
$ rm build/debug/mongo/mongo
|
||||
$ scons mongo -j8 --dbg > debug-link-command.txt
|
||||
|
||||
And list of objects is copied to `<platform>-debug.objects` file.
|
||||
|
||||
We found, that on Linux (Ubuntu 14.10), list of debug objects differ from list of release objects only
|
||||
by two files. File `debugallocation.o` is linked in debug mode, but not in release.
|
||||
File `debugallocation.o` is linked in release mode, but not in debug. Both are located
|
||||
in `third_party/gperftools-2.2/src` folder. In any way, we keep separate lists of object files
|
||||
for both configurations. Still we need to test that objects are the same even across different
|
||||
versions of Linux.
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
Building Robomongo Shell
|
||||
========================
|
||||
|
||||
Robomongo uses [modified version](https://github.com/paralect/robomongo-shell/tree/roboshell-v3.2) of MongoDB that we call Robomongo Shell. Before you can build Robomongo, you have to build Robomongo Shell. The following instructions are applicable only for Mac OS X and Linux. For Windows instructions please check [Building Robomongo on Windows](BuildingRobomongoOnWindows.md).
|
||||
|
||||
Build for Mac OS X or Linux
|
||||
---------------------------
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
1. Install [Scons](http://scons.org/tag/releases.html) (2.4 or later)
|
||||
|
||||
|
||||
2. Clone Robomongo Shell and checkout to `roboshell-v3.2` branch:
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/paralect/robomongo-shell.git
|
||||
$ cd robomongo-shell
|
||||
$ git checkout roboshell-v3.2
|
||||
```
|
||||
|
||||
3. Build Robomongo Shell:
|
||||
|
||||
```sh
|
||||
$ bin/build
|
||||
```
|
||||
|
||||
Done! Now you can continue with [Step 2](BuildingRobomongo.md#step-2) and build Robomongo
|
||||
with embedded MongoDB 3.2 shell (that you've just built).
|
||||
|
||||
|
||||
<br/>
|
||||
#### Advanced helper commands
|
||||
|
||||
The following commands are needed only if you are planning to develop or deeper understand
|
||||
Robomongo or Robomongo Shell build processes.
|
||||
|
||||
Clean build files for release mode (folder `build/opt` will be removed):
|
||||
|
||||
$ bin/clean
|
||||
|
||||
Here is a command that is executed by `bin/build` script:
|
||||
|
||||
$ scons mongo -j8 --release --osx-version-min=10.9
|
||||
|
||||
Argument `--osx-version-min` is required only for Mac OS.
|
||||
|
||||
Build MongoDB shell in debug mode:
|
||||
|
||||
$ scons mongo -j8 --dbg
|
||||
|
||||
Clear builds:
|
||||
|
||||
$ scons -c mongo # clears release build
|
||||
$ scons -c --dbg mongo # clears debug build
|
||||
@@ -0,0 +1,128 @@
|
||||
Building Robomongo (Mac OS X and Linux)
|
||||
==================
|
||||
|
||||
A. Prerequisites
|
||||
-------------
|
||||
|
||||
1. Install CMake (3.2 or later)
|
||||
2. Install [Scons](http://scons.org/tag/releases.html) (2.4 or later)
|
||||
3. Install Qt 5.7
|
||||
|
||||
```sh
|
||||
Example installation for MAC OSX and Ubuntu:
|
||||
Go to http://download.qt.io/archive/qt/5.7/5.7.0/
|
||||
Download, run and install
|
||||
qt-opensource-mac-x64-clang-5.7.0.dmg (for MAC OSX)
|
||||
qt-opensource-linux-x64-5.7.0.run (for Linux)
|
||||
After successful installation you should have
|
||||
/path/to/qt-5.7.0/5.7/clang_64 (for MAC OSX)
|
||||
/path/to/qt-5.7.0/5.7/gcc_64 (for Linux)
|
||||
|
||||
More information for installing on Ubuntu:
|
||||
https://wiki.qt.io/Install_Qt_5_on_Ubuntu
|
||||
```
|
||||
|
||||
4. Download and Build OpenSSL (1.0.1p) - (explained below in section B)
|
||||
|
||||
B. Building Robomongo and Dependencies
|
||||
-------------
|
||||
|
||||
#### Step 1. Build OpenSSL (1.0.1p)
|
||||
|
||||
Steps to build OpenSSL on MAC:
|
||||
|
||||
```sh
|
||||
Download openssl-1.0.1p (ftp://ftp.openssl.org/source/old/1.0.1/openssl-1.0.1p.tar.gz)
|
||||
tar -xvzf openssl-1.0.1p.tar.gz
|
||||
cd /Users/<user>/Downloads/openssl-1.0.1p
|
||||
./Configure darwin64-x86_64-cc shared --openssldir="@rpath"
|
||||
make (or sudo make)
|
||||
mkdir lib
|
||||
cp libssl.1.0.0.dylib libcrypto.1.0.0.dylib lib/
|
||||
```
|
||||
Helper Commands
|
||||
```sh
|
||||
// to start fresh build
|
||||
make clean
|
||||
```
|
||||
|
||||
|
||||
Steps to build OpenSSL on Linux:
|
||||
|
||||
```sh
|
||||
Download openssl-1.0.1p (ftp://ftp.openssl.org/source/old/1.0.1/openssl-1.0.1p.tar.gz)
|
||||
tar -xvzf openssl-1.0.1p.tar.gz
|
||||
cd /home/<user>/Downloads/openssl-1.0.1p
|
||||
./config shared
|
||||
make
|
||||
mkdir lib
|
||||
cp libssl* libcrypto* lib/
|
||||
```
|
||||
|
||||
#### Step 2. Build Robomongo Shell (fork of MongoDB)
|
||||
|
||||
Clone Robomongo Shell and checkout to `roboshell-v3.2` branch:
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/paralect/robomongo-shell.git
|
||||
$ cd robomongo-shell
|
||||
$ git checkout roboshell-v3.2
|
||||
```
|
||||
|
||||
Set special environment variable `ROBOMONGO_CMAKE_PREFIX_PATH` to point to a set of
|
||||
directories:
|
||||
|
||||
1. Location of Qt 5 SDK
|
||||
2. Location of Robomongo Shell
|
||||
3. Location of OpenSSL
|
||||
|
||||
Separate directories by semicolon `;` (not colon):
|
||||
|
||||
// MAC OSX example:
|
||||
$ export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5.7.0/5.7/clang_64;/path/to/robomongo-shell;/path/to/openssl-1.0.1p"
|
||||
// Ubuntu example:
|
||||
$ export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5.7.0/5.7/gcc_64;/path/to/robomongo-shell;/path/to/openssl-1.0.1p"
|
||||
|
||||
|
||||
Build Robomongo Shell:
|
||||
|
||||
```sh
|
||||
$ bin/build
|
||||
```
|
||||
|
||||
For more information refer to [Building Robomongo Shell](BuildingMongoDB.md)
|
||||
|
||||
#### Step 3. Build Robomongo
|
||||
|
||||
Download Robomongo:
|
||||
|
||||
$ git clone https://github.com/paralect/robomongo
|
||||
$ cd robomongo
|
||||
|
||||
Run configuration step:
|
||||
|
||||
$ bin/configure
|
||||
|
||||
And finally, build Robomongo:
|
||||
|
||||
$ bin/build
|
||||
|
||||
To run robomongo:
|
||||
|
||||
$ bin/run
|
||||
|
||||
|
||||
**Helper commands**
|
||||
|
||||
Clean build files (in order to start build from scratch):
|
||||
|
||||
$ bin/clean
|
||||
|
||||
Install Robomongo to `build/release/install` folder:
|
||||
|
||||
$ bin/install
|
||||
|
||||
Create package for your OS in `build/release/package` folder:
|
||||
|
||||
$ bin/pack
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
Building Robomongo (Windows)
|
||||
==============================
|
||||
|
||||
A. Prerequisites
|
||||
-------------
|
||||
|
||||
#### 0. Git
|
||||
|
||||
Download Git installer from http://git-scm.com (we are using Git-2.7.0-64-bit).
|
||||
|
||||
When you'll see "Adjusting your PATH environment" wizard page, select
|
||||
"Use Git from the Windows Command Prompt" option. This will allow to
|
||||
execute Git from both Windows Command Prompt and Bash. This is required,
|
||||
because both MongoDB and Robomongo uses `git` command during build process
|
||||
which must be perfomed from Windows Command Prompt (not Bash).
|
||||
|
||||
On "Configuring the line ending conversion" wizard page, select "Checkout
|
||||
Windows-style, commit Unix-style line ending" option. This is a common mode
|
||||
for cross-platform projects and required by both MongoDB and Robomongo.
|
||||
|
||||
All other Git installer options are not important (use defaults).
|
||||
|
||||
If you are using SSH clone url, start SSH agent and add your private key
|
||||
with this commands in Git Bash:
|
||||
|
||||
$ eval `ssh-agent` # starts ssh agent
|
||||
$ ssh-add ~/.ssh/mykey # add your key (which can be in any folder)
|
||||
|
||||
#### 1. Visual Studio 2013 (i.e. MSVC12) Update 4 or newer
|
||||
|
||||
We use Visual Studio 2013 Update 5, and recommend to use this version to save
|
||||
time for Qt compilation. Currently prebuilt binaries for Qt are available
|
||||
from official Qt site. But you can use any newer version and compile Qt library
|
||||
yourself.
|
||||
|
||||
If you already have VS2013, you can download Update 5 here:
|
||||
https://www.microsoft.com/en-us/download/details.aspx?id=48129
|
||||
|
||||
Update 4 or newer version is required to compile MongoDB.
|
||||
|
||||
#### 2. ActivePython 2.7
|
||||
|
||||
Download ActivePython from http://www.activestate.com/activepython/downloads
|
||||
|
||||
Download MSI x64 version. Use default settings in installation wizard.
|
||||
This installer will add path to `python.exe` to your `PATH` variable.
|
||||
|
||||
#### 3. Scons 2.3.4
|
||||
|
||||
Download Scons from http://scons.org/tag/releases.html
|
||||
|
||||
Use ZIP archive, not MSI (we use scons-2.3.4.zip)
|
||||
|
||||
Open Command Prompt, navigate to Scons directory and run:
|
||||
|
||||
$ setup.py install
|
||||
|
||||
This command will make `scons` command accessible from Command Prompt
|
||||
|
||||
#### 4. CMake
|
||||
Download CMake from https://cmake.org/download (we use cmake-3.3.2-win32-x86.exe)
|
||||
|
||||
Use installer package, it will allow you to configure your PATH variable and `cmake`
|
||||
command will be available from Command Prompt. For this set "Add CMake to the system
|
||||
PATH for current user" in the installer wizard page.
|
||||
|
||||
#### 5. Qt 5.7
|
||||
|
||||
Download Qt from http://www.qt.io/download-open-source/ (we use Qt Online installer)
|
||||
|
||||
When installing Qt, only one component is required by Robomongo:
|
||||
|
||||
Qt 5.7
|
||||
[x] msvc2013 64-bit.
|
||||
|
||||
This components contains prebuilt 64-bit binaries for Visual Studio 2013.
|
||||
|
||||
You may uncheck all other components to download as little as possible.
|
||||
|
||||
#### 6. OpenSSL (1.0.1p)
|
||||
Download openssl-1.0.1p (ftp://ftp.openssl.org/source/old/1.0.1/openssl-1.0.1p.tar.gz)
|
||||
|
||||
|
||||
|
||||
B. Building Robomongo and Dependencies
|
||||
-------------
|
||||
|
||||
#### 1. Build OpenSSL (1.0.1p)
|
||||
|
||||
Steps to build OpenSSL on windows:
|
||||
```sh
|
||||
Open Visual Studio tool x64 Cross Tools Command prompt
|
||||
cd to the directory where you have openssl sources cd c:\myPath\openssl
|
||||
perl Configure VC-WIN64A
|
||||
ms\do_win64a
|
||||
nmake -f ms\ntdll.mak
|
||||
```
|
||||
|
||||
**Check Point:**
|
||||
After successful build, newly created sub directory out32dll should contain dynamic lib files libeay32.lib (and libeay32.dll) and ssleay32.lib (and ssleay32.dll); and associated include files will be in newly created folder "inc32".
|
||||
|
||||
Helper Commands:
|
||||
```sh
|
||||
// clean to start fresh build
|
||||
nmake -f ms\ntdll.mak clean
|
||||
```
|
||||
|
||||
Refer to OpenSSL documentation for more information:
|
||||
https://wiki.openssl.org/index.php/Compilation_and_Installation#W64
|
||||
|
||||
#### 2. Build Robomongo Shell (fork of MongoDB)
|
||||
|
||||
Clone Robomongo Shell and checkout to roboshell-v3.2 branch:
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/paralect/robomongo-shell.git
|
||||
$ cd robomongo-shell
|
||||
$ git checkout roboshell-v3.2
|
||||
```
|
||||
|
||||
Set environment variable `ROBOMONGO_CMAKE_PREFIX_PATH`, required by Robomongo-Shell and Robomongo build scripts, needs to be set according to the following directories:
|
||||
|
||||
1. Location of Qt SDK
|
||||
2. Location of Robomongo Shell
|
||||
3. Location of OpenSSL
|
||||
|
||||
Separate directories by semicolon `;` (not colon). You can do this in Command Prompt:
|
||||
|
||||
> setx ROBOMONGO_CMAKE_PREFIX_PATH "d:\Qt-5\5.7\msvc2013_64;d:\Projects\robomongo-shell;c:\myPath\openssl-1.0.1p"
|
||||
|
||||
|
||||
Open VS2013 x64 Native Tools Command Prompt and navigate to `robomongo-shell` folder.
|
||||
|
||||
Build shell:
|
||||
|
||||
> bin\build
|
||||
|
||||
Note that backslash is used (`\`), and not forward slash (`/`).
|
||||
|
||||
Clean build files:
|
||||
|
||||
> bin\clean
|
||||
|
||||
Refer to MongoDB documentation for additional information:
|
||||
https://docs.mongodb.org/manual/contributors/tutorial/build-mongodb-from-source/#windows-specific-instructions
|
||||
|
||||
|
||||
#### 3. Build Robomongo
|
||||
|
||||
Clone Robomongo:
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/paralect/robomongo.git
|
||||
```
|
||||
|
||||
Open VS2013 x64 Native Tools Command Prompt and navigate to `robomongo` folder.
|
||||
|
||||
Run configuration step:
|
||||
|
||||
> bin\configure
|
||||
|
||||
And finally, build Robomongo:
|
||||
|
||||
> bin\build
|
||||
|
||||
|
||||
**Run Robomongo**
|
||||
|
||||
Install Robomongo to `build\Release\install` folder:
|
||||
|
||||
> bin\install
|
||||
|
||||
And run Robomongo
|
||||
|
||||
> \robomongo\build\Release\install\Robomongo.exe
|
||||
|
||||
**Helper commands**
|
||||
|
||||
Clean build files (in order to start build from scratch):
|
||||
|
||||
> bin\clean
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
Runtime Dependencies
|
||||
====================
|
||||
|
||||
This information is for maintainers. If you want to just use Robomongo - download
|
||||
prebuild packages for your platform.
|
||||
|
||||
Runtime dependencies that are not privided by platforms but required by Robomongo are:
|
||||
|
||||
1. Qt libraries
|
||||
2. Qt plugins
|
||||
|
||||
Diagnostic of dependencies
|
||||
--------------------------
|
||||
|
||||
##### Linux
|
||||
|
||||
View dependencies of executable or shared library:
|
||||
|
||||
$ ldd robomongo
|
||||
|
||||
View RPATH or RUNPATH records of executable or shared library:
|
||||
|
||||
$ objdump -x bin/robomongo | grep "RPATH\|RUNPATH"
|
||||
|
||||
For Robomongo binary it should be `$ORIGIN/../lib`
|
||||
|
||||
##### Mac OS X
|
||||
|
||||
Show dependencies of executable or shared library:
|
||||
|
||||
$ otool -L robomongo
|
||||
|
||||
View LC_RPATH records of executable or shared library:
|
||||
|
||||
$ otool -l robomongo | grep -C2 RPATH
|
||||
|
||||
(option `-C2` asks grep to output 2 context lines before and after the match)
|
||||
|
||||
For Robomongo binary it should be `$executable_path/../Frameworks`
|
||||
|
||||
|
||||
Diagnostic of Qt plugins
|
||||
------------------------
|
||||
|
||||
Run Robomongo in the following way to see how plugins are resolved:
|
||||
|
||||
$ QT_DEBUG_PLUGINS=1 ./robomongo
|
||||
|
||||
|
||||
@@ -13,5 +13,6 @@ ROBO_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
export LD_LIBRARY_PATH="$ROBO_DIR/../lib:$LD_LIBRARY_PATH"
|
||||
export QT_PLUGIN_PATH="$ROBO_DIR/../lib:$QT_PLUGIN_PATH"
|
||||
export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb
|
||||
export XKB_DEFAULT_RULES=base
|
||||
|
||||
"$ROBO_DIR/robomongo"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
How to generate "icns" icon file
|
||||
================================
|
||||
|
||||
In this directory run:
|
||||
|
||||
$ iconutil -c icns Robomongo.iconset
|
||||
|
||||
File `Robomongo.icns` will be generated.
|
||||
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 827 B |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,2 @@
|
||||
[Paths]
|
||||
Plugins = PlugIns/Qt
|
||||
@@ -0,0 +1,2 @@
|
||||
[Paths]
|
||||
Plugins = @qt_conf_plugins@
|
||||
@@ -0,0 +1,46 @@
|
||||
How to generate ICO file from the set of PNGs
|
||||
=============================================
|
||||
|
||||
Install ImageMagick (http://www.imagemagick.org/). Make sure that you
|
||||
have added its utils to your PATH (installer will give you such an option)
|
||||
|
||||
In `icon-set` directory run:
|
||||
|
||||
> convert 256x256.png 128x128.png 64x64.png 48x48.png 40x40.png 32x32.png 24x24.png 20x20.png 16x16.png robomongo.ico
|
||||
|
||||
File `robomongo.ico` will be generated.
|
||||
|
||||
|
||||
Which icon sizes are used on Windows?
|
||||
=====================================
|
||||
|
||||
The most important sizes are the one that is small. Robomongo should include
|
||||
16, 20, 24, 40, 48. The bigger sizes are usually scaled well, without notable
|
||||
degrading in quality.
|
||||
|
||||
The following statistic was provided in this answer:
|
||||
http://stackoverflow.com/a/12283978/407599
|
||||
|
||||
> After some testing with an icon with 8, 16, 20, 24, 32, 40, 48, 64, 96, 128
|
||||
> and 256 pixels (256 in PNG) in Windows 7:
|
||||
>
|
||||
> At 100% resolution:
|
||||
> Explorer uses 16, 40, 48, and 256. Windows Photo Viewer uses 96. Paint uses 256.
|
||||
>
|
||||
> At 125% resolution:
|
||||
> Explorer uses 20, 40, and 256. Windows Photo Viewer uses 96. Paint uses 256.
|
||||
>
|
||||
> At 150% resolution:
|
||||
> Explorer uses 24, 48, and 256. Windows Photo Viewer uses 96. Paint uses 256.
|
||||
>
|
||||
> At 200% resolution:
|
||||
> Explorer uses 40, 64, 96, and 256. Windows Photo Viewer uses 128. Paint uses 256.
|
||||
>
|
||||
> So 8, 32 were never used (it's strange to me for 32) and 128 only by Windows Photo
|
||||
> Viewer with a very high dpi screen, i.e. almost never used.
|
||||
>
|
||||
> It means your icon should at least provide 16, 48 and 256 for Windows 7. For supporting
|
||||
> newer screens with high resolutions, you should provide 16, 20, 24, 40, 48, 64, 96, and 256.
|
||||
> For Windows 7, all pictures can be compressed using PNG but for backward compatibility with
|
||||
> Windows XP, 16 to 48 should not be compressed.
|
||||
|
||||
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 717 B |
|
After Width: | Height: | Size: 996 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 217 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 129 KiB |
@@ -1,13 +1,13 @@
|
||||
#include "verrsrc.h"
|
||||
|
||||
IDI_ICON1 ICON "@ICON_FILE@"
|
||||
IDI_ICON1 ICON "@windows_icon@"
|
||||
|
||||
|
||||
#define VER_FILEVERSION @MAJOR_VER@,@MINOR_VER1@,@MINOR_VER2@
|
||||
#define VER_FILEVERSION_STR "@MAJOR_VER@.@MINOR_VER1@.@MINOR_VER2@\0"
|
||||
#define VER_FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@
|
||||
#define VER_FILEVERSION_STR "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@\0"
|
||||
|
||||
#define VER_PRODUCTVERSION @MAJOR_VER@,@MINOR_VER1@,@MINOR_VER2@
|
||||
#define VER_PRODUCTVERSION_STR "@MAJOR_VER@.@MINOR_VER1@.@MINOR_VER2@\0"
|
||||
#define VER_PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@
|
||||
#define VER_PRODUCTVERSION_STR "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@\0"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION VER_FILEVERSION
|
||||
@@ -26,14 +26,14 @@ IDI_ICON1 ICON "@ICON_FILE@"
|
||||
BEGIN
|
||||
BLOCK "040904e4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "@COMPANYNAME@\0"
|
||||
VALUE "FileDescription", "@PRODUCTNAME@\0"
|
||||
VALUE "CompanyName", "Paralect, Inc\0"
|
||||
VALUE "FileDescription", "Robomongo, MongoDB management tool\0"
|
||||
VALUE "FileVersion", VER_FILEVERSION_STR
|
||||
VALUE "LegalCopyright", "@PRODUCTCOPYRIGHT@\0"
|
||||
VALUE "ProductName", "@PRODUCTNAME@\0"
|
||||
VALUE "LegalCopyright", "Copyright Paralect, 2013 - 2016\0"
|
||||
VALUE "ProductName", "Robomongo\0"
|
||||
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
||||
VALUE "OriginalFilename", "@SHORTPRODUCTNAME@.exe\0"
|
||||
VALUE "InternalName", "@SHORTPRODUCTNAME@\0"
|
||||
VALUE "OriginalFilename", "Robomongo.exe\0"
|
||||
VALUE "InternalName", "Robomongo\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
This is a logbook for notes about migration to MongoDB 3.2
|
||||
|
||||
DocumentTextEditor.cpp
|
||||
----------------------
|
||||
|
||||
Commented error reporting.
|
||||
|
||||
Logger.cpp
|
||||
----------
|
||||
|
||||
Commented Logger::print().
|
||||
@@ -0,0 +1,61 @@
|
||||
# BasedOnStyle: Google
|
||||
AccessModifierOffset: -4
|
||||
AlignOperands: false
|
||||
AlignAfterOpenBracket: true
|
||||
AlignEscapedNewlinesLeft: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: false
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
ColumnLimit: 100
|
||||
CommentPragmas: ''
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
IndentCaseLabels: true
|
||||
IndentFunctionDeclarationAfterType: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
Language: Cpp
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: None
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: false
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 200
|
||||
PointerAlignment: Left
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
@@ -0,0 +1,225 @@
|
||||
|
||||
# Automatically generate code for Qt moc, uic and rcc files
|
||||
# Since CMake 2.8.6
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
#set(sanitize "-fsanitize=address")
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${sanitize}")
|
||||
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${sanitize}")
|
||||
|
||||
set(SOURCES
|
||||
|
||||
# Isolated Scope #1
|
||||
core/utils/QtUtils.cpp
|
||||
core/utils/StdUtils.cpp
|
||||
core/utils/Logger.cpp
|
||||
core/HexUtils.cpp
|
||||
core/utils/BsonUtils.cpp
|
||||
core/settings/CredentialSettings.cpp
|
||||
core/settings/ConnectionSettings.cpp
|
||||
core/Event.cpp
|
||||
core/Enums.cpp
|
||||
core/EventError.cpp
|
||||
core/EventBusSubscriber.cpp
|
||||
core/EventBusDispatcher.cpp
|
||||
core/EventWrapper.cpp
|
||||
core/EventBus.cpp
|
||||
core/KeyboardManager.cpp
|
||||
core/domain/MongoNamespace.cpp
|
||||
core/domain/MongoUser.cpp
|
||||
core/domain/MongoUser.cpp
|
||||
core/domain/MongoFunction.cpp
|
||||
core/domain/MongoUtils.cpp
|
||||
core/domain/MongoCollection.cpp
|
||||
core/domain/MongoCollectionInfo.cpp
|
||||
core/domain/MongoQueryInfo.cpp
|
||||
core/domain/MongoShellResult.cpp
|
||||
core/domain/CursorPosition.cpp
|
||||
core/domain/ScriptInfo.cpp
|
||||
core/events/MongoEventsInfo.cpp
|
||||
shell/db/ptimeutil.cpp
|
||||
shell/bson/json.cpp
|
||||
|
||||
# Isolated Scope #2
|
||||
core/engine/ScriptEngine.cpp
|
||||
core/events/MongoEvents.cpp
|
||||
core/domain/MongoDocument.cpp
|
||||
gui/AppStyle.cpp
|
||||
core/domain/MongoServer.cpp
|
||||
core/domain/MongoShell.cpp
|
||||
core/domain/MongoDatabase.cpp
|
||||
core/domain/App.cpp
|
||||
core/mongodb/MongoClient.cpp
|
||||
core/mongodb/MongoWorker.cpp
|
||||
core/settings/SettingsManager.cpp
|
||||
core/AppRegistry.cpp
|
||||
|
||||
# Isolated Scope #3
|
||||
gui/GuiRegistry.cpp
|
||||
gui/dialogs/AboutDialog.cpp
|
||||
gui/dialogs/ConnectionAdvancedTab.cpp
|
||||
gui/dialogs/ConnectionAuthTab.cpp
|
||||
gui/dialogs/ConnectionBasicTab.cpp
|
||||
gui/dialogs/ConnectionDiagnosticDialog.cpp
|
||||
gui/dialogs/ConnectionDialog.cpp
|
||||
gui/dialogs/CopyCollectionDialog.cpp
|
||||
gui/widgets/workarea/IndicatorLabel.cpp
|
||||
gui/dialogs/CreateCollectionDialog.cpp
|
||||
gui/dialogs/CreateDatabaseDialog.cpp
|
||||
gui/dialogs/CreateUserDialog.cpp
|
||||
gui/utils/ComboBoxUtils.cpp
|
||||
gui/utils/DialogUtils.cpp
|
||||
|
||||
# Isolated scope #4
|
||||
gui/dialogs/PreferencesDialog.cpp
|
||||
gui/dialogs/ConnectionsDialog.cpp
|
||||
gui/dialogs/ExportDialog.cpp
|
||||
|
||||
# Isolated scope #5
|
||||
gui/editors/PlainJavaScriptEditor.cpp
|
||||
gui/editors/JSLexer.cpp
|
||||
gui/editors/FindFrame.cpp
|
||||
gui/widgets/explorer/EditIndexDialog.cpp
|
||||
gui/widgets/workarea/ScriptWidget.cpp
|
||||
|
||||
# Isolated scope #6
|
||||
gui/widgets/explorer/ExplorerCollectionTreeItem.cpp
|
||||
gui/widgets/explorer/ExplorerTreeItem.cpp
|
||||
gui/widgets/explorer/ExplorerReplicaSetTreeItem.cpp
|
||||
gui/widgets/explorer/ExplorerDatabaseTreeItem.cpp
|
||||
gui/widgets/explorer/ExplorerDatabaseCategoryTreeItem.cpp
|
||||
gui/widgets/explorer/ExplorerUserTreeItem.cpp
|
||||
gui/widgets/explorer/ExplorerFunctionTreeItem.cpp
|
||||
gui/dialogs/DocumentTextEditor.cpp
|
||||
gui/dialogs/FunctionTextEditor.cpp
|
||||
|
||||
# Isolated scope #7
|
||||
gui/widgets/explorer/ExplorerServerTreeItem.cpp
|
||||
gui/widgets/explorer/ExplorerTreeWidget.cpp
|
||||
gui/widgets/explorer/ExplorerWidget.cpp
|
||||
gui/widgets/workarea/BsonTableModel.cpp
|
||||
gui/widgets/workarea/BsonTableView.cpp
|
||||
gui/widgets/workarea/BsonTreeItem.cpp
|
||||
gui/widgets/workarea/BsonTreeModel.cpp
|
||||
gui/widgets/workarea/BsonTreeView.cpp
|
||||
core/domain/Notifier.cpp
|
||||
|
||||
# Isolated scope #8
|
||||
gui/widgets/workarea/CollectionStatsTreeItem.cpp
|
||||
gui/widgets/workarea/CollectionStatsTreeWidget.cpp
|
||||
gui/widgets/workarea/JsonPrepareThread.cpp
|
||||
gui/widgets/workarea/OutputItemContentWidget.cpp
|
||||
gui/widgets/workarea/OutputItemHeaderWidget.cpp
|
||||
gui/widgets/workarea/OutputWidget.cpp
|
||||
gui/widgets/workarea/PagingWidget.cpp
|
||||
gui/widgets/workarea/ProgressBarPopup.cpp
|
||||
gui/widgets/workarea/QueryWidget.cpp
|
||||
gui/widgets/workarea/WorkAreaTabBar.cpp
|
||||
gui/widgets/workarea/WorkAreaTabWidget.cpp
|
||||
|
||||
# Final scope
|
||||
gui/widgets/LogWidget.cpp
|
||||
gui/MainWindow.cpp
|
||||
|
||||
gui/dialogs/SSHTunnelTab.cpp
|
||||
gui/dialogs/SSLTab.cpp
|
||||
core/settings/SshSettings.cpp
|
||||
core/settings/SslSettings.cpp
|
||||
core/settings/ReplicaSetSettings.cpp
|
||||
core/mongodb/SshTunnelWorker.cpp
|
||||
|
||||
gui/resources/gui.qrc
|
||||
)
|
||||
|
||||
|
||||
# Robomongo target
|
||||
add_executable(robomongo MACOSX_BUNDLE WIN32 app/main.cpp ${SOURCES})
|
||||
|
||||
target_link_libraries(robomongo
|
||||
PRIVATE
|
||||
Qt5::Widgets
|
||||
qjson
|
||||
qscintilla
|
||||
mongodb
|
||||
ssh
|
||||
Threads::Threads) # Target from FindThreads CMake module
|
||||
|
||||
target_include_directories(robomongo
|
||||
PRIVATE
|
||||
${CMAKE_HOME_DIRECTORY}/src)
|
||||
|
||||
target_compile_definitions(robomongo
|
||||
PRIVATE
|
||||
PROJECT_NAME="${PROJECT_NAME}"
|
||||
PROJECT_NAME_TITLE="${PROJECT_NAME_TITLE}"
|
||||
PROJECT_COPYRIGHT="${PROJECT_COPYRIGHT}"
|
||||
PROJECT_DOMAIN="${PROJECT_DOMAIN}"
|
||||
PROJECT_COMPANYNAME="${PROJECT_COMPANYNAME}"
|
||||
PROJECT_COMPANYNAME_DOMAIN="${PROJECT_COMPANYNAME_DOMAIN}"
|
||||
PROJECT_GITHUB_FORK="${PROJECT_GITHUB_FORK}"
|
||||
PROJECT_GITHUB_ISSUES="${PROJECT_GITHUB_ISSUES}"
|
||||
PROJECT_VERSION="${PROJECT_VERSION}"
|
||||
PROJECT_NAME_LOWERCASE="${PROJECT_NAME_LOWERCASE}")
|
||||
|
||||
if(SYSTEM_WINDOWS)
|
||||
# Create Windows Resource file
|
||||
set(windows_icon "${CMAKE_SOURCE_DIR}/install/windows/robomongo.ico")
|
||||
configure_file(
|
||||
"${CMAKE_SOURCE_DIR}/install/windows/winres.rc.in"
|
||||
"${CMAKE_BINARY_DIR}/winres.rc")
|
||||
unset(windows_icon)
|
||||
|
||||
# Add additional source file to "robomongo" target
|
||||
target_sources(robomongo
|
||||
PRIVATE
|
||||
"${CMAKE_BINARY_DIR}/winres.rc")
|
||||
|
||||
# Rename output name for Windows
|
||||
set_target_properties(robomongo PROPERTIES
|
||||
OUTPUT_NAME "Robomongo")
|
||||
|
||||
# Seems that we do not need to do this with recent versions of Qt
|
||||
target_link_libraries(robomongo
|
||||
PRIVATE
|
||||
Qt5::WinMain)
|
||||
|
||||
elseif(SYSTEM_MACOSX)
|
||||
set_target_properties(robomongo PROPERTIES
|
||||
INSTALL_RPATH "@executable_path/../Frameworks"
|
||||
OUTPUT_NAME "Robomongo"
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/install/macosx/Info.plist.in"
|
||||
MACOSX_BUNDLE_BUNDLE_NAME "Robomongo"
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER "com.paralect.Robomongo"
|
||||
MACOSX_BUNDLE_INFO_STRING "Robomongo ${PROJECT_VERSION}. Copyright Paralect, 2013 - 2016"
|
||||
MACOSX_BUNDLE_SHORT_VERSION "${PROJECT_VERSION}"
|
||||
MACOSX_BUNDLE_LONG_VERSION "${PROJECT_VERSION}"
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
|
||||
MACOSX_BUNDLE_COPYRIGHT "Copyright Paralect, 2013 - 2016"
|
||||
MACOSX_BUNDLE_ICON_FILE "Robomongo")
|
||||
|
||||
elseif(SYSTEM_LINUX)
|
||||
set_target_properties(robomongo PROPERTIES
|
||||
INSTALL_RPATH "$ORIGIN/../lib")
|
||||
endif()
|
||||
|
||||
# Install
|
||||
include(RobomongoInstall)
|
||||
|
||||
|
||||
#
|
||||
# Tests targets (code below should be moved to separate file)
|
||||
#
|
||||
add_executable(tests WIN32 EXCLUDE_FROM_ALL app/main_test.cpp gui/editors/JSLexer.cpp)
|
||||
target_link_libraries(tests Qt5::Widgets qjson qscintilla mongodb Threads::Threads)
|
||||
target_include_directories(tests
|
||||
PRIVATE
|
||||
${CMAKE_HOME_DIRECTORY}/src)
|
||||
|
||||
# Target that creates original MongoDB shell
|
||||
# Used to test compilation and linking
|
||||
add_executable(shell EXCLUDE_FROM_ALL shell/shell/dbshell.cpp)
|
||||
target_link_libraries(shell
|
||||
mongodb
|
||||
Threads::Threads) # Target from FindThreads CMake module
|
||||
@@ -3,27 +3,65 @@
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
// Header "mongo/util/net/sock" is needed for mongo::enableIPv6()
|
||||
// Header "mongo/platform/basic" is required by "sock.h" under Windows
|
||||
#include <mongo/platform/basic.h>
|
||||
#include <mongo/util/net/sock.h>
|
||||
#include <mongo/base/initializer.h>
|
||||
#include <mongo/util/net/ssl_options.h>
|
||||
|
||||
#include "robomongo/gui/MainWindow.h"
|
||||
#include "robomongo/gui/AppStyle.h"
|
||||
#include "robomongo/ssh/ssh.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
int main(int argc, char *argv[], char** envp)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
Robomongo::detail::initStyle();
|
||||
setlocale(LC_NUMERIC,"C"); // do not move this line!!!
|
||||
if (rbm_ssh_init()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
QRect screenGeometry = QApplication::desktop()->availableGeometry();
|
||||
QSize size(screenGeometry.width() - 450, screenGeometry.height() - 165);
|
||||
|
||||
Robomongo::MainWindow win;
|
||||
win.resize(size);
|
||||
#if defined(Q_OS_MAC)
|
||||
win.setUnifiedTitleAndToolBarOnMac(true);
|
||||
// Please check, do we really need envp for other OSes?
|
||||
#ifdef Q_OS_WIN
|
||||
envp = NULL;
|
||||
#endif
|
||||
int x = (screenGeometry.width() - win.width()) / 2;
|
||||
int y = (screenGeometry.height() - win.height()) / 2;
|
||||
win.move(x, y);
|
||||
|
||||
// Support for IPv6 is disabled by default. Enable it.
|
||||
mongo::enableIPv6(true);
|
||||
|
||||
// Perform SSL-enabled mongo initialization
|
||||
mongo::sslGlobalParams.sslMode.store(mongo::SSLParams::SSLMode_allowSSL);
|
||||
|
||||
// Cross Platform High DPI support - Qt 5.7
|
||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
|
||||
// Initialization routine for MongoDB shell
|
||||
mongo::runGlobalInitializersOrDie(argc, argv, envp);
|
||||
|
||||
// Initialize Qt application
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// On Unix/Linux Qt is configured to use the system locale settings by default.
|
||||
// This can cause a conflict when using POSIX functions, for instance, when
|
||||
// converting between data types such as floats and strings, since the notation
|
||||
// may differ between locales. To get around this problem, call the POSIX
|
||||
// function setlocale(LC_NUMERIC, "C") right after initializing QApplication or
|
||||
// QCoreApplication to reset the locale that is used for number formatting to "C"-locale.
|
||||
// (http://doc.qt.io/qt-5/qcoreapplication.html#locale-settings)
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
#endif
|
||||
|
||||
// Init GUI style
|
||||
Robomongo::AppStyleUtils::initStyle();
|
||||
|
||||
// Application main window
|
||||
Robomongo::MainWindow win;
|
||||
win.show();
|
||||
|
||||
return app.exec();
|
||||
int rc = app.exec();
|
||||
rbm_ssh_cleanup();
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QDebug>
|
||||
|
||||
#include <locale.h>
|
||||
#include <mongo/bson/bsonobjbuilder.h>
|
||||
#include <robomongo/core/utils/BsonUtils.h>
|
||||
|
||||
using namespace Robomongo;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
mongo::BSONObjBuilder m;
|
||||
m.append("test", 56);
|
||||
const mongo::BSONObj &obj = m.obj();
|
||||
|
||||
std::string str = BsonUtils::jsonString(obj, mongo::TenGen, 1, DefaultEncoding, Utc);
|
||||
|
||||
qDebug() << "Hello!";
|
||||
qDebug() << QString::fromStdString(str);
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
#undef NDEBUG
|
||||
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <assert.h>
|
||||
#include <limits>
|
||||
#include <mongo/util/exit_code.h>
|
||||
#include <mongo/util/net/hostandport.h>
|
||||
|
||||
namespace mongo {
|
||||
extern bool isShell;
|
||||
void logProcessDetailsForLogRotate() {}
|
||||
void exitCleanly(ExitCode code) {}
|
||||
}
|
||||
|
||||
void testHostAndPort() {
|
||||
mongo::HostAndPort hp = mongo::HostAndPort("127.0.0.1", 20017);
|
||||
assert(hp.toString() == "127.0.0.1:20017");
|
||||
|
||||
hp = mongo::HostAndPort("2a03:b0c0:3:d0::f3:1001", 20017);
|
||||
assert(hp.toString() == "[2a03:b0c0:3:d0::f3:1001]:20017");
|
||||
|
||||
// toString() will wrap IPv6 address in brackets even if they
|
||||
// are already exist. This is true at least for MongoDB 3.2
|
||||
hp = mongo::HostAndPort("[2a03:b0c0:3:d0::f3:1001]", 20017);
|
||||
assert(hp.toString() == "[[2a03:b0c0:3:d0::f3:1001]]:20017");
|
||||
|
||||
hp = mongo::HostAndPort("[2a03:b0c0:3:d0::f3:1001", 20017);
|
||||
assert(hp.toString() == "[[2a03:b0c0:3:d0::f3:1001]:20017");
|
||||
}
|
||||
|
||||
void precisionAssert(const std::string &text, double d) {
|
||||
std::stringstream s;
|
||||
s.precision(std::numeric_limits<double>::digits10);
|
||||
s << d;
|
||||
if (d == (long long)d)
|
||||
s << ".0";
|
||||
std::cout << "Checking " << text << " - ";
|
||||
assert(text == s.str());
|
||||
std::cout << "Correct. " << std::endl;
|
||||
}
|
||||
|
||||
void testPrecision() {
|
||||
precisionAssert("-9.987654321", -9.987654321);
|
||||
precisionAssert("-1.0", -1.0);
|
||||
precisionAssert("-0.0", -0.0);
|
||||
precisionAssert("0.0", 0.0);
|
||||
precisionAssert("9.0", 9.0);
|
||||
precisionAssert("9.8", 9.8);
|
||||
precisionAssert("9.9", 9.9);
|
||||
precisionAssert("9.98", 9.98);
|
||||
precisionAssert("9.987", 9.987);
|
||||
precisionAssert("9.9876", 9.9876);
|
||||
precisionAssert("9.98765", 9.98765);
|
||||
precisionAssert("9.987654", 9.987654);
|
||||
precisionAssert("9.9876543", 9.9876543);
|
||||
precisionAssert("9.98765432", 9.98765432);
|
||||
precisionAssert("9.987654321", 9.987654321);
|
||||
precisionAssert("9.987654321", 9.9876543210);
|
||||
precisionAssert("9.98765432109", 9.98765432109);
|
||||
precisionAssert("9.987654321098", 9.987654321098);
|
||||
precisionAssert("9.9876543210987", 9.9876543210987);
|
||||
precisionAssert("9.98765432109876", 9.98765432109876);
|
||||
precisionAssert("9.98765432109876", 9.987654321098765);
|
||||
precisionAssert("9.98765432109877", 9.9876543210987654);
|
||||
precisionAssert("3.1415", 3.1415);
|
||||
precisionAssert("1.1", 1.1);
|
||||
precisionAssert("9.7", 9.7);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[], char** envp)
|
||||
{
|
||||
testHostAndPort();
|
||||
testPrecision();
|
||||
return 0;
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace Robomongo
|
||||
|
||||
private:
|
||||
AppRegistry();
|
||||
~AppRegistry();
|
||||
~AppRegistry();
|
||||
|
||||
const EventBusScopedPtr _bus;
|
||||
const SettingsManagerScopedPtr _settingsManager;
|
||||
|
||||
@@ -30,4 +30,18 @@ namespace Robomongo
|
||||
|
||||
class MongoDocument;
|
||||
typedef boost::shared_ptr<MongoDocument> MongoDocumentPtr;
|
||||
|
||||
enum ConnectionType {
|
||||
// This type of connection is shown in Explorer and also
|
||||
// opens SSH tunnel for Secondary connections (if needed)
|
||||
ConnectionPrimary = 0,
|
||||
|
||||
// Never shown in Explorer and uses SSH tunnel from
|
||||
// Primary connection (if needed)
|
||||
ConnectionSecondary = 1,
|
||||
|
||||
// The same as Primary, but is specifically for testing
|
||||
// connections.
|
||||
ConnectionTest = 2
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace
|
||||
template<typename type, int size>
|
||||
inline type findTypeInArray(const char *(&arr)[size], const char *text)
|
||||
{
|
||||
for (int i=0; i < size;++i )
|
||||
for (int i = 0; i < size; ++i )
|
||||
{
|
||||
if (strcmp(text,arr[i])==0)
|
||||
if (strcmp(text, arr[i]) == 0)
|
||||
{
|
||||
return static_cast<type>(i);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,18 @@
|
||||
|
||||
namespace Robomongo
|
||||
{
|
||||
EventError::EventError() {}
|
||||
EventError::EventError() :
|
||||
_isNull(true) {}
|
||||
|
||||
EventError::EventError(const std::string &errorMessage) :
|
||||
_errorMessage(errorMessage) {}
|
||||
_errorMessage(errorMessage),
|
||||
_isNull(false) {}
|
||||
|
||||
bool EventError::isNull() const { return _errorMessage.empty(); }
|
||||
bool EventError::isNull() const {
|
||||
return _isNull;
|
||||
}
|
||||
|
||||
const std::string &EventError::errorMessage() const { return _errorMessage; }
|
||||
const std::string &EventError::errorMessage() const {
|
||||
return _errorMessage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,5 +41,7 @@ namespace Robomongo
|
||||
* @brief Error message
|
||||
*/
|
||||
const std::string _errorMessage;
|
||||
|
||||
bool _isNull;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Robomongo
|
||||
char *data = new char[bytes];
|
||||
|
||||
const char *p = s.c_str();
|
||||
for( size_t i = 0; i < bytes; i++ ) {
|
||||
for (size_t i = 0; i < bytes; i++) {
|
||||
data[i] = mongo::fromHex(p);
|
||||
p += 2;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ namespace Robomongo
|
||||
mongo::BinDataType binType = element.binDataType();
|
||||
|
||||
if (binType != mongo::newUUID && binType != mongo::bdtUUID)
|
||||
throw new std::invalid_argument("Binary subtype should be 3 (bdtUUID) or 4 (newUUID)");
|
||||
throw std::invalid_argument("Binary subtype should be 3 (bdtUUID) or 4 (newUUID)");
|
||||
|
||||
int len;
|
||||
const char *data = element.binData(len);
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#include "robomongo/core/domain/App.h"
|
||||
#include <QHash>
|
||||
#include <QInputDialog>
|
||||
|
||||
#include "robomongo/core/domain/MongoServer.h"
|
||||
#include "robomongo/core/domain/MongoShell.h"
|
||||
#include "robomongo/core/domain/MongoCollection.h"
|
||||
#include "robomongo/core/settings/ConnectionSettings.h"
|
||||
#include "robomongo/core/settings/SshSettings.h"
|
||||
#include "robomongo/core/settings/SslSettings.h"
|
||||
#include "robomongo/core/mongodb/SshTunnelWorker.h"
|
||||
#include "robomongo/core/EventBus.h"
|
||||
#include "robomongo/core/utils/QtUtils.h"
|
||||
#include "robomongo/core/utils/StdUtils.h"
|
||||
@@ -31,7 +35,11 @@ namespace Robomongo
|
||||
}
|
||||
|
||||
App::App(EventBus *const bus) : QObject(),
|
||||
_bus(bus) { }
|
||||
_bus(bus), _lastServerHandle(0) {
|
||||
_bus->subscribe(this, EstablishSshConnectionResponse::Type);
|
||||
_bus->subscribe(this, ListenSshConnectionResponse::Type);
|
||||
_bus->subscribe(this, LogEvent::Type);
|
||||
}
|
||||
|
||||
App::~App()
|
||||
{
|
||||
@@ -39,23 +47,85 @@ namespace Robomongo
|
||||
std::for_each(_servers.begin(), _servers.end(), stdutils::default_delete<MongoServer*>());
|
||||
}
|
||||
|
||||
bool App::openServer(ConnectionSettings *connection, ConnectionType type) {
|
||||
|
||||
SshSettings *ssh = connection->sshSettings();
|
||||
|
||||
if (ssh->enabled() && ssh->askPassword() &&
|
||||
(type == ConnectionPrimary || type == ConnectionTest)) {
|
||||
bool ok = false;
|
||||
|
||||
bool isByKey = ssh->authMethod() == "publickey";
|
||||
std::string passText = isByKey ? "passphrase" : "password";
|
||||
|
||||
std::stringstream s;
|
||||
s << "In order to continue, please provide the " << passText;
|
||||
|
||||
if (isByKey)
|
||||
s << " for the key file";
|
||||
|
||||
s << "." << std::endl << std::endl;
|
||||
|
||||
if (ssh->authMethod() == "publickey")
|
||||
s << "Private Key: " << ssh->privateKeyFile() << std::endl;
|
||||
|
||||
s << "Server: " << ssh->host() << std::endl;
|
||||
s << "User: " << ssh->userName() << std::endl;
|
||||
|
||||
|
||||
s << std::endl << "Enter your " << passText << " that will never be stored:";
|
||||
|
||||
QString userInput = QInputDialog::getText(NULL, tr("SSH Authentication"),
|
||||
QtUtils::toQString(s.str()),
|
||||
QLineEdit::Password, "", &ok);
|
||||
|
||||
if (!ok)
|
||||
return false;
|
||||
|
||||
ssh->setAskedPassword(QtUtils::toStdString(userInput));
|
||||
}
|
||||
|
||||
SslSettings *sslSettings = connection->sslSettings();
|
||||
|
||||
if (sslSettings->sslEnabled() && sslSettings->usePemFile() && sslSettings->askPassphrase()
|
||||
&& (type == ConnectionPrimary || type == ConnectionTest))
|
||||
{
|
||||
if (!askSslPassphrasePromptDialog(connection))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
openServerInternal(connection, type);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates and opens new server connection.
|
||||
* Creates and opens new server connection.
|
||||
* @param connection: ConnectionSettings, that will be owned by MongoServer.
|
||||
* @param visible: should this server be visible in UI (explorer) or not.
|
||||
*/
|
||||
MongoServer *App::openServer(ConnectionSettings *connection,
|
||||
bool visible)
|
||||
{
|
||||
MongoServer *server = new MongoServer(connection, visible);
|
||||
_servers.push_back(server);
|
||||
MongoServer *App::openServerInternal(ConnectionSettings const* connection, ConnectionType type) {
|
||||
++_lastServerHandle;
|
||||
|
||||
if (visible)
|
||||
_bus->publish(new ConnectingEvent(this, server));
|
||||
if (type == ConnectionPrimary)
|
||||
_bus->publish(new ConnectingEvent(this));
|
||||
|
||||
LOG_MSG(QString("Connecting to %1...").arg(QtUtils::toQString(server->connectionRecord()->getFullAddress())), mongo::LL_INFO);
|
||||
server->tryConnect();
|
||||
return server;
|
||||
// When connection is SECONDARY or do not have
|
||||
// ssh settings enabled, continue without SSH Tunnel
|
||||
if (type == ConnectionSecondary || !connection->sshSettings()->enabled()) {
|
||||
return continueOpenServer(_lastServerHandle, connection, type);
|
||||
}
|
||||
|
||||
// Open SSH channel and only after that open connection
|
||||
LOG_MSG(QString("Creating SSH tunnel to %1:%2...")
|
||||
.arg(QtUtils::toQString(connection->sshSettings()->host()))
|
||||
.arg(connection->sshSettings()->port()), mongo::logger::LogSeverity::Info());
|
||||
|
||||
ConnectionSettings* settingsCopy = connection->clone();
|
||||
SshTunnelWorker* sshWorker = new SshTunnelWorker(settingsCopy);
|
||||
_bus->send(sshWorker, new EstablishSshConnectionRequest(this, _lastServerHandle, sshWorker, settingsCopy, type));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,44 +137,46 @@ namespace Robomongo
|
||||
_servers.erase(std::remove_if(_servers.begin(), _servers.end(), stdutils::RemoveIfFound<MongoServer*>(server)), _servers.end());
|
||||
}
|
||||
|
||||
MongoShell *App::openShell(MongoCollection *collection,const QString &filePathToSave)
|
||||
void App::openShell(MongoCollection *collection, const QString &filePathToSave)
|
||||
{
|
||||
ConnectionSettings *connection = collection->database()->server()->connectionRecord();
|
||||
connection->setDefaultDatabase(collection->database()->name());
|
||||
QString script = detail::buildCollectionQuery(collection->name(), "find({})");
|
||||
return openShell(connection, ScriptInfo(script, true, CursorPosition(0, -2), QtUtils::toQString(collection->database()->name()),filePathToSave));
|
||||
openShell(connection, ScriptInfo(script, true, CursorPosition(0, -2), QtUtils::toQString(collection->database()->name()), filePathToSave));
|
||||
}
|
||||
|
||||
MongoShell *App::openShell(MongoServer *server,const QString &script, const std::string &dbName,
|
||||
void App::openShell(MongoServer *server, const QString &script, const std::string &dbName,
|
||||
bool execute, const QString &shellName,
|
||||
const CursorPosition &cursorPosition,const QString &filePathToSave)
|
||||
const CursorPosition &cursorPosition, const QString &filePathToSave)
|
||||
{
|
||||
ConnectionSettings *connection = server->connectionRecord();
|
||||
|
||||
if (!dbName.empty())
|
||||
connection->setDefaultDatabase(dbName);
|
||||
|
||||
return openShell(connection, ScriptInfo(script, execute, cursorPosition, shellName,filePathToSave));
|
||||
openShell(connection, ScriptInfo(script, execute, cursorPosition, shellName, filePathToSave));
|
||||
}
|
||||
|
||||
MongoShell *App::openShell(MongoDatabase *database, const QString &script,
|
||||
void App::openShell(MongoDatabase *database, const QString &script,
|
||||
bool execute, const QString &shellName,
|
||||
const CursorPosition &cursorPosition,const QString &filePathToSave)
|
||||
const CursorPosition &cursorPosition, const QString &filePathToSave)
|
||||
{
|
||||
ConnectionSettings *connection = database->server()->connectionRecord();
|
||||
connection->setDefaultDatabase(database->name());
|
||||
return openShell(connection, ScriptInfo(script, execute, cursorPosition, shellName,filePathToSave));
|
||||
openShell(connection, ScriptInfo(script, execute, cursorPosition, shellName, filePathToSave));
|
||||
}
|
||||
|
||||
MongoShell *App::openShell(ConnectionSettings *connection, const ScriptInfo &scriptInfo)
|
||||
void App::openShell(ConnectionSettings const* connection, const ScriptInfo &scriptInfo)
|
||||
{
|
||||
MongoServer *server = openServer(connection, false);
|
||||
MongoShell *shell = new MongoShell(server,scriptInfo);
|
||||
MongoServer *server = openServerInternal(connection, ConnectionSecondary);
|
||||
if (!server)
|
||||
return;
|
||||
|
||||
MongoShell *shell = new MongoShell(server, scriptInfo);
|
||||
_shells.push_back(shell);
|
||||
_bus->publish(new OpeningShellEvent(this, shell));
|
||||
LOG_MSG("Opening shell...", mongo::LL_INFO);
|
||||
shell->execute();
|
||||
return shell;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +186,7 @@ namespace Robomongo
|
||||
void App::closeShell(MongoShell *shell)
|
||||
{
|
||||
// Do nothing, if this shell not owned by this App.
|
||||
MongoShellsContainerType::iterator it = std::find_if(_shells.begin(),_shells.end(),std::bind1st(std::equal_to<MongoShell *>(),shell));
|
||||
MongoShellsContainerType::iterator it = std::find_if(_shells.begin(), _shells.end(), std::bind1st(std::equal_to<MongoShell *>(), shell));
|
||||
if (it == _shells.end())
|
||||
return;
|
||||
|
||||
@@ -122,4 +194,94 @@ namespace Robomongo
|
||||
closeServer(shell->server());
|
||||
delete shell;
|
||||
}
|
||||
|
||||
MongoServer *App::continueOpenServer(int serverHandle, ConnectionSettings const* connection, ConnectionType type, int localport) {
|
||||
ConnectionSettings* settings = connection->clone();
|
||||
|
||||
// Modify connection settings when SSH tunnel is used
|
||||
if ((type == ConnectionPrimary || type == ConnectionTest)
|
||||
&& settings->sshSettings()->enabled()) {
|
||||
settings->setServerHost("127.0.0.1");
|
||||
settings->setServerPort(localport);
|
||||
}
|
||||
|
||||
MongoServer *server = new MongoServer(serverHandle, settings, type);
|
||||
_servers.push_back(server);
|
||||
|
||||
server->runWorkerThread();
|
||||
|
||||
LOG_MSG(QString("Connecting to %1...").arg(QtUtils::toQString(server->connectionRecord()->getFullAddress())), mongo::logger::LogSeverity::Info());
|
||||
server->tryConnect();
|
||||
return server;
|
||||
}
|
||||
|
||||
void App::handle(EstablishSshConnectionResponse *event) {
|
||||
if (event->isError()) {
|
||||
_bus->publish(new ConnectionFailedEvent(
|
||||
this, event->serverHandle, event->connectionType, event->error().errorMessage(),
|
||||
ConnectionFailedEvent::SshConnection));
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_MSG(QString("SSH tunnel created successfully"), mongo::logger::LogSeverity::Info());
|
||||
|
||||
continueOpenServer(event->serverHandle, event->settings, event->connectionType, event->localport);
|
||||
_bus->send(event->worker, new ListenSshConnectionRequest(this, event->serverHandle, event->connectionType));
|
||||
}
|
||||
|
||||
void App::handle(LogEvent *event) {
|
||||
if (event->level == LogEvent::RBM_ERROR) {
|
||||
LOG_MSG(event->message, mongo::logger::LogSeverity::Error());
|
||||
} else if (event->level == LogEvent::RBM_WARN) {
|
||||
LOG_MSG(event->message, mongo::logger::LogSeverity::Warning());
|
||||
} else if (event->level == LogEvent::RBM_INFO) {
|
||||
LOG_MSG(event->message, mongo::logger::LogSeverity::Info());
|
||||
} else if (event->level == LogEvent::RBM_DEBUG) {
|
||||
LOG_MSG(event->message, mongo::logger::LogSeverity::Log());
|
||||
}
|
||||
}
|
||||
|
||||
void App::handle(ListenSshConnectionResponse *event) {
|
||||
if (event->isError()) {
|
||||
_bus->publish(new ConnectionFailedEvent(this, event->serverHandle, event->connectionType, event->error().errorMessage(),
|
||||
ConnectionFailedEvent::SshChannel));
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_MSG(QString("SSH tunnel closed."), mongo::logger::LogSeverity::Error());
|
||||
}
|
||||
|
||||
void App::fireConnectionFailedEvent(int serverHandle, ConnectionType type, std::string errormsg,
|
||||
ConnectionFailedEvent::Reason reason) {
|
||||
_bus->publish(new ConnectionFailedEvent(this, serverHandle, type, errormsg, reason));
|
||||
}
|
||||
|
||||
|
||||
bool App::askSslPassphrasePromptDialog(ConnectionSettings *connSettings) const
|
||||
{
|
||||
auto sslSettings = connSettings->sslSettings();
|
||||
bool ok = false;
|
||||
|
||||
std::stringstream s;
|
||||
s << "In order to continue, please provide the passphrase";
|
||||
s << "." << std::endl << std::endl;
|
||||
|
||||
s << "Server: " << connSettings->serverHost() << ":" << connSettings->serverPort() << std::endl;
|
||||
s << "PEM file: " << sslSettings->pemKeyFile() << std::endl;
|
||||
|
||||
s << std::endl << "Enter your PEM key passphrase (will never be stored):";
|
||||
|
||||
QString userInput = QInputDialog::getText(NULL, tr("SSL Authentication"),
|
||||
QtUtils::toQString(s.str()),
|
||||
QLineEdit::Password, "", &ok);
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
sslSettings->setPemPassPhrase(QtUtils::toStdString(userInput));
|
||||
return ok;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
#include <vector>
|
||||
#include <robomongo/core/events/MongoEvents.h>
|
||||
|
||||
#include "robomongo/core/domain/ScriptInfo.h"
|
||||
|
||||
@@ -12,9 +13,12 @@ namespace Robomongo
|
||||
class MongoCollection;
|
||||
class MongoShell;
|
||||
class MongoDatabase;
|
||||
class EstablishSshConnectionResponse;
|
||||
class LogEvent;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* @brief Builds single collection query (i.e. db.my_col.find()) from
|
||||
* string that doesn't contain "db.my_col." prefix.
|
||||
*
|
||||
@@ -43,8 +47,9 @@ namespace Robomongo
|
||||
* @brief Creates and opens new server connection.
|
||||
* @param connection: ConnectionSettings, that will be owned by MongoServer.
|
||||
* @param visible: should this server be visible in UI (explorer) or not.
|
||||
* @return Succeeded or not
|
||||
*/
|
||||
MongoServer *openServer(ConnectionSettings *connection, bool visible);
|
||||
bool openServer(ConnectionSettings *connection, ConnectionType type);
|
||||
|
||||
/**
|
||||
* @brief Closes MongoServer connection and frees all resources, owned
|
||||
@@ -55,18 +60,18 @@ namespace Robomongo
|
||||
/**
|
||||
* @brief Open new shell based on specified collection
|
||||
*/
|
||||
MongoShell *openShell(MongoCollection *collection,const QString &filePathToSave=QString());
|
||||
void openShell(MongoCollection *collection, const QString &filePathToSave = QString());
|
||||
|
||||
MongoShell *openShell(MongoServer *server, const QString &script, const std::string &dbName = std::string(),
|
||||
void openShell(MongoServer *server, const QString &script, const std::string &dbName = std::string(),
|
||||
bool execute = true, const QString &shellName = QString(),
|
||||
const CursorPosition &cursorPosition = CursorPosition(),const QString &file=QString());
|
||||
const CursorPosition &cursorPosition = CursorPosition(), const QString &file = QString());
|
||||
|
||||
MongoShell *openShell(MongoDatabase *database, const QString &script,
|
||||
void openShell(MongoDatabase *database, const QString &script,
|
||||
bool execute = true, const QString &shellName = QString(),
|
||||
const CursorPosition &cursorPosition = CursorPosition(),const QString &filePathToSave=QString());
|
||||
const CursorPosition &cursorPosition = CursorPosition(), const QString &filePathToSave = QString());
|
||||
|
||||
MongoShell *openShell(ConnectionSettings *connection, const ScriptInfo &scriptInfo);
|
||||
MongoServersContainerType getServers() const {return _servers; };
|
||||
void openShell(ConnectionSettings const* connection, const ScriptInfo &scriptInfo);
|
||||
MongoServersContainerType getServers() const { return _servers; };
|
||||
|
||||
/**
|
||||
* @brief Closes MongoShell and frees all resources, owned by specified MongoShell.
|
||||
@@ -74,20 +79,40 @@ namespace Robomongo
|
||||
*/
|
||||
void closeShell(MongoShell *shell);
|
||||
|
||||
void fireConnectionFailedEvent(int serverHandle, ConnectionType type, std::string errormsg, ConnectionFailedEvent::Reason reason);
|
||||
|
||||
int getLastServerHandle() const { return _lastServerHandle; };
|
||||
|
||||
public Q_SLOTS:
|
||||
void handle(EstablishSshConnectionResponse *event);
|
||||
void handle(ListenSshConnectionResponse *event);
|
||||
void handle(LogEvent *event);
|
||||
|
||||
private:
|
||||
MongoServer *openServerInternal(ConnectionSettings const* connection, ConnectionType type);
|
||||
MongoServer *continueOpenServer(int serverHandle, ConnectionSettings const *connection, ConnectionType type, int localport = 0);
|
||||
|
||||
/**
|
||||
* @brief MongoServers, owned by this App.
|
||||
* @brief Create prompt dialog to enter SSL PEM key passphrase and save passphrase into SSL settings
|
||||
* @param connection Pointer to active connection settings
|
||||
* @return true on success, false otherwise
|
||||
*/
|
||||
bool askSslPassphrasePromptDialog(ConnectionSettings *connSettings) const;
|
||||
|
||||
/**
|
||||
* MongoServers, owned by this App.
|
||||
*/
|
||||
MongoServersContainerType _servers;
|
||||
|
||||
/**
|
||||
* @brief MongoShells, owned by this App.
|
||||
* MongoShells, owned by this App.
|
||||
*/
|
||||
MongoShellsContainerType _shells;
|
||||
|
||||
/**
|
||||
* @brief EventBus
|
||||
*/
|
||||
EventBus *const _bus;
|
||||
|
||||
// Increase monotonically when new MongoServer is created
|
||||
// Never decreases.
|
||||
int _lastServerHandle;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Robomongo
|
||||
_system = true;
|
||||
}
|
||||
|
||||
std::string MongoCollection::sizeString() const
|
||||
/* std::string MongoCollection::sizeString() const
|
||||
{
|
||||
return MongoUtils::buildNiceSizeString(_info.sizeBytes()).toStdString();
|
||||
}
|
||||
@@ -26,5 +26,5 @@ namespace Robomongo
|
||||
QString MongoCollection::storageSizeString() const
|
||||
{
|
||||
return MongoUtils::buildNiceSizeString(_info.storageSizeBytes());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace Robomongo
|
||||
std::string fullName() const { return _ns.toString(); }
|
||||
MongoDatabase *database() const { return _database; }
|
||||
|
||||
std::string sizeString() const;
|
||||
QString storageSizeString() const;
|
||||
// std::string sizeString() const;
|
||||
// QString storageSizeString() const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
#include "MongoCollectionInfo.h"
|
||||
#include "robomongo/core/utils/BsonUtils.h"
|
||||
#include <mongo/client/dbclient.h>
|
||||
#include <mongo/client/dbclientinterface.h>
|
||||
|
||||
namespace Robomongo
|
||||
{
|
||||
MongoCollectionInfo::MongoCollectionInfo(mongo::BSONObj stats) : _ns(stats.getStringField("ns"))
|
||||
MongoCollectionInfo::MongoCollectionInfo(const std::string &ns) : _ns(ns) {}
|
||||
|
||||
/* MongoCollectionInfo::MongoCollectionInfo(mongo::BSONObj stats) : _ns(stats.getStringField("ns"))
|
||||
{
|
||||
// if "size" and "storageSize" are of type Int32 or Int64, they
|
||||
// will be converted to double by "numberDouble()" function.
|
||||
_sizeBytes = BsonUtils::getField<mongo::NumberDouble>(stats,"size");
|
||||
_storageSizeBytes = BsonUtils::getField<mongo::NumberDouble>(stats,"storageSize");
|
||||
|
||||
_count = BsonUtils::getField<mongo::NumberInt>(stats,"count");
|
||||
}
|
||||
// NumberLong because of mongodb can have very big collections
|
||||
_count = BsonUtils::getField<mongo::NumberLong>(stats,"count");
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ namespace Robomongo
|
||||
class MongoCollectionInfo
|
||||
{
|
||||
public:
|
||||
MongoCollectionInfo(mongo::BSONObj stats);
|
||||
MongoCollectionInfo() {}
|
||||
MongoCollectionInfo(const std::string &ns);
|
||||
// MongoCollectionInfo(mongo::BSONObj stats);
|
||||
|
||||
std::string name() const { return _ns.collectionName(); }
|
||||
std::string fullName() const { return _ns.toString(); }
|
||||
@@ -18,16 +20,16 @@ namespace Robomongo
|
||||
* It is double, because db.stats()'s "size" field may be double
|
||||
* for large values, while Int32 for small.
|
||||
*/
|
||||
double sizeBytes() const { return _sizeBytes; }
|
||||
// double sizeBytes() const { return _sizeBytes; }
|
||||
|
||||
/**
|
||||
* @brief Storage size in bytes
|
||||
* It is double, because db.stats()'s "storageSize" field may be double
|
||||
* for large values, while Int32 for small.
|
||||
*/
|
||||
double storageSizeBytes() const { return _storageSizeBytes; }
|
||||
// double storageSizeBytes() const { return _storageSizeBytes; }
|
||||
|
||||
int count() const { return _count; }
|
||||
// long long count() const { return _count; }
|
||||
|
||||
private:
|
||||
MongoNamespace _ns;
|
||||
@@ -46,7 +48,7 @@ namespace Robomongo
|
||||
*/
|
||||
double _storageSizeBytes;
|
||||
|
||||
int _count;
|
||||
long long _count;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
namespace Robomongo
|
||||
{
|
||||
|
||||
R_REGISTER_EVENT(MongoDatabaseCollectionListLoadedEvent)
|
||||
R_REGISTER_EVENT(MongoDatabaseUsersLoadedEvent)
|
||||
R_REGISTER_EVENT(MongoDatabaseFunctionsLoadedEvent)
|
||||
@@ -16,14 +15,19 @@ namespace Robomongo
|
||||
R_REGISTER_EVENT(MongoDatabaseFunctionsLoadingEvent)
|
||||
R_REGISTER_EVENT(MongoDatabaseCollectionsLoadingEvent)
|
||||
|
||||
const std::string MongoDatabase::StorageEngineType::WIRED_TIGER = "wiredTiger";
|
||||
const std::string MongoDatabase::StorageEngineType::MMAPV1 = "mmapv1";
|
||||
|
||||
const float MongoDatabase::DBVersion::MONGODB_2_6 = 2.6f;
|
||||
const float MongoDatabase::DBVersion::MONGODB_3_0 = 3.0f;
|
||||
const float MongoDatabase::DBVersion::MONGODB_3_2 = 3.2f;
|
||||
|
||||
MongoDatabase::MongoDatabase(MongoServer *server, const std::string &name) :
|
||||
QObject(),
|
||||
_system(name == "admin" || name == "local"),
|
||||
_server(server),
|
||||
_bus(AppRegistry::instance().bus()),
|
||||
_name(name)
|
||||
{
|
||||
}
|
||||
_name(name) {}
|
||||
|
||||
MongoDatabase::~MongoDatabase()
|
||||
{
|
||||
@@ -47,9 +51,11 @@ namespace Robomongo
|
||||
_bus->publish(new MongoDatabaseFunctionsLoadingEvent(this));
|
||||
_bus->send(_server->client(), new LoadFunctionsRequest(this, _name));
|
||||
}
|
||||
void MongoDatabase::createCollection(const std::string &collection)
|
||||
|
||||
void MongoDatabase::createCollection(const std::string &collection, long long size, bool capped, int maxDocNum, const mongo::BSONObj& extraOptions)
|
||||
{
|
||||
_bus->send(_server->client(), new CreateCollectionRequest(this, MongoNamespace(_name, collection)));
|
||||
_bus->send(_server->client(),
|
||||
new CreateCollectionRequest(this, MongoNamespace(_name, collection), extraOptions, size, capped, maxDocNum));
|
||||
}
|
||||
|
||||
void MongoDatabase::dropCollection(const std::string &collection)
|
||||
@@ -99,8 +105,10 @@ namespace Robomongo
|
||||
|
||||
void MongoDatabase::handle(LoadCollectionNamesResponse *loaded)
|
||||
{
|
||||
if (loaded->isError())
|
||||
if (loaded->isError()) {
|
||||
_bus->publish(new MongoDatabaseCollectionListLoadedEvent(this, loaded->error()));
|
||||
return;
|
||||
}
|
||||
|
||||
clearCollections();
|
||||
const std::vector<MongoCollectionInfo> &colectionsInfos = loaded->collectionInfos();
|
||||
@@ -122,17 +130,21 @@ namespace Robomongo
|
||||
|
||||
void MongoDatabase::handle(LoadUsersResponse *event)
|
||||
{
|
||||
if (event->isError())
|
||||
if (event->isError()) {
|
||||
_bus->publish(new MongoDatabaseUsersLoadedEvent(this, event->error()));
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
_bus->publish(new MongoDatabaseUsersLoadedEvent(this, this, event->users()));
|
||||
}
|
||||
|
||||
void MongoDatabase::handle(LoadFunctionsResponse *event)
|
||||
{
|
||||
if (event->isError())
|
||||
if (event->isError()) {
|
||||
_bus->publish(new MongoDatabaseFunctionsLoadedEvent(this, event->error()));
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
_bus->publish(new MongoDatabaseFunctionsLoadedEvent(this, this, event->functions()));
|
||||
}
|
||||
|
||||
@@ -146,4 +158,19 @@ namespace Robomongo
|
||||
{
|
||||
_collections.push_back(collection);
|
||||
}
|
||||
|
||||
void MongoDatabase::handle(CreateCollectionResponse *event) {
|
||||
genericResponseHandler(event, "Failed to create collection.");
|
||||
}
|
||||
|
||||
void MongoDatabase::handle(DropCollectionResponse *event) {
|
||||
genericResponseHandler(event, "Failed to drop collection.");
|
||||
}
|
||||
|
||||
void MongoDatabase::genericResponseHandler(Event *event, const std::string &userFriendlyMessage) {
|
||||
if (!event->isError())
|
||||
return;
|
||||
|
||||
_bus->publish(new OperationFailedEvent(this, event->error().errorMessage(), userFriendlyMessage));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,25 @@ namespace Robomongo
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Database storage engine type
|
||||
*/
|
||||
struct StorageEngineType
|
||||
{
|
||||
static const std::string WIRED_TIGER;
|
||||
static const std::string MMAPV1;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief MongoDB version
|
||||
*/
|
||||
struct DBVersion
|
||||
{
|
||||
static const float MONGODB_2_6;
|
||||
static const float MONGODB_3_0;
|
||||
static const float MONGODB_3_2;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief MongoDatabase
|
||||
* @param server: pointer to parent MongoServer
|
||||
@@ -37,7 +56,7 @@ namespace Robomongo
|
||||
|
||||
void loadFunctions();
|
||||
|
||||
void createCollection(const std::string &collection);
|
||||
void createCollection(const std::string &collection, long long size, bool capped, int maxDocNum, const mongo::BSONObj& extraOptions);
|
||||
void dropCollection(const std::string &collection);
|
||||
void renameCollection(const std::string &collection, const std::string &newCollection);
|
||||
void duplicateCollection(const std::string &collection, const std::string &newCollection);
|
||||
@@ -65,10 +84,13 @@ namespace Robomongo
|
||||
void handle(LoadUsersResponse *event);
|
||||
void handle(LoadFunctionsResponse *event);
|
||||
void handle(CreateUserResponse *event);
|
||||
void handle(CreateCollectionResponse *event);
|
||||
void handle(DropCollectionResponse *event);
|
||||
|
||||
private:
|
||||
void clearCollections();
|
||||
void addCollection(MongoCollection *collection);
|
||||
void genericResponseHandler(Event *event, const std::string &userFriendlyMessage);
|
||||
|
||||
private:
|
||||
MongoServer *_server;
|
||||
@@ -86,6 +108,9 @@ namespace Robomongo
|
||||
Event(sender),
|
||||
collections(list) { }
|
||||
|
||||
MongoDatabaseCollectionListLoadedEvent(QObject *sender, const EventError &error) :
|
||||
Event(sender, error) {}
|
||||
|
||||
std::vector<MongoCollection *> collections;
|
||||
};
|
||||
|
||||
@@ -98,6 +123,9 @@ namespace Robomongo
|
||||
_users(list),
|
||||
_database(database) {}
|
||||
|
||||
MongoDatabaseUsersLoadedEvent(QObject *sender, const EventError &error) :
|
||||
Event(sender, error) {}
|
||||
|
||||
std::vector<MongoUser> users() const { return _users; }
|
||||
MongoDatabase *database() const { return _database; }
|
||||
|
||||
@@ -115,6 +143,9 @@ namespace Robomongo
|
||||
_functions(list),
|
||||
_database(database) {}
|
||||
|
||||
MongoDatabaseFunctionsLoadedEvent(QObject *sender, const EventError &error) :
|
||||
Event(sender, error) {}
|
||||
|
||||
std::vector<MongoFunction> functions() const { return _functions; }
|
||||
MongoDatabase *database() const { return _database; }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "robomongo/core/domain/MongoDocument.h"
|
||||
|
||||
#include <mongo/client/dbclient.h>
|
||||
#include <mongo/client/dbclientinterface.h>
|
||||
#include "robomongo/core/settings/SettingsManager.h"
|
||||
#include "robomongo/core/AppRegistry.h"
|
||||
#include "robomongo/core/utils/BsonUtils.h"
|
||||
@@ -38,52 +38,10 @@ namespace Robomongo
|
||||
std::vector<MongoDocumentPtr> MongoDocument::fromBsonObj(const std::vector<mongo::BSONObj> &bsonObjs)
|
||||
{
|
||||
std::vector<MongoDocumentPtr> list;
|
||||
for (std::vector<mongo::BSONObj>::const_iterator it=bsonObjs.begin(); it!=bsonObjs.end(); ++it) {
|
||||
for (std::vector<mongo::BSONObj>::const_iterator it = bsonObjs.begin(); it != bsonObjs.end(); ++it) {
|
||||
list.push_back(fromBsonObj(*it));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/*
|
||||
** Convert to json string
|
||||
*/
|
||||
void MongoDocument::buildJsonString(std::string &con)
|
||||
{
|
||||
BsonUtils::buildJsonString(_bsonObj, con,
|
||||
AppRegistry::instance().settingsManager()->uuidEncoding(),
|
||||
AppRegistry::instance().settingsManager()->timeZone());
|
||||
}
|
||||
|
||||
/*
|
||||
** Build JsonString from list of documents
|
||||
*/
|
||||
std::string MongoDocument::buildJsonString(const QList<MongoDocumentPtr> &documents)
|
||||
{
|
||||
mongo::StringBuilder sb;
|
||||
|
||||
int position = 0;
|
||||
for (QList<MongoDocumentPtr>::const_iterator it = documents.begin(); it != documents.end(); ++it) {
|
||||
if (position == 0)
|
||||
sb << "/* 0 */\n";
|
||||
else
|
||||
sb << "\n\n/* " << position << " */\n";
|
||||
|
||||
std::string jsonString = (*it)->bsonObj().jsonString(mongo::TenGen, 1);
|
||||
|
||||
sb << jsonString;
|
||||
position++;
|
||||
}
|
||||
|
||||
std::string final = sb.str();
|
||||
return final;
|
||||
}
|
||||
|
||||
std::string MongoDocument::buildJsonString(const MongoDocumentPtr &doc)
|
||||
{
|
||||
//qt4 QTextCodec::setCodecForCStrings(codec);
|
||||
std::string jsonString = doc->bsonObj().jsonString(mongo::TenGen, 1);
|
||||
return jsonString;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,17 +42,5 @@ namespace Robomongo
|
||||
** Return "native" BSONObj
|
||||
*/
|
||||
mongo::BSONObj bsonObj() const { return _bsonObj; }
|
||||
|
||||
/*
|
||||
** Convert to json string
|
||||
*/
|
||||
void buildJsonString(std::string &con);
|
||||
|
||||
/*
|
||||
** Build JsonString from list of documents
|
||||
*/
|
||||
static std::string buildJsonString(const QList<MongoDocumentPtr> &documents);
|
||||
|
||||
static std::string buildJsonString(const MongoDocumentPtr &documents);
|
||||
};
|
||||
}
|
||||
|
||||