Skip to content

Commit f0d82c1

Browse files
authored
Vcpkg manifest (#122)
* Fix win32u env, missing Poco::Mutex includes. * Added vcpkg manifest files - can now built FLINT and dependencies (VS2022 only for now) using FLINT\vcpkg\vcpkg_setup_vs2022_win_x64.bat. OpenSSL will occasionally fail to build on some machines - if this happens, keep re-running cmake until it gets through (could take several tries). * Cleanup. * Added VS2019 setup script, fixed 2022.
1 parent 2c65c58 commit f0d82c1

File tree

15 files changed

+413
-4
lines changed

15 files changed

+413
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,4 @@ ModelManifest.xml
219219
/Spatial Data/TestTile/TestTile_034_001.bil
220220
/Spatial Data/SLEEK_FSR/Spatial
221221
/Source/cmake/RCa11116
222+
/vcpkg/vcpkg

Source/moja.core/src/environment_win32u.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99

1010
namespace moja {
1111

12-
static std::string EnvironmentImpl::startProcessFolderImpl() {
13-
static wchar_t path[512] = "";
12+
std::string EnvironmentImpl::startProcessFolderImpl() {
13+
static wchar_t path[512] = L"";
1414
if (!path[0]) {
1515
// Get directory this executable was launched from.
16-
GetModuleFileNameW(NULL, path, sizeof(path) - 1);
16+
GetModuleFileNameW(NULL, path, sizeof(path) / 2 - 1);
1717
}
18+
19+
std::string result = "";
1820
Poco::UnicodeConverter::toUTF8(path, result);
19-
auto folder = Poco::Path(path).parent();
21+
auto folder = Poco::Path(result).parent();
22+
2023
return folder.toString();
2124
}
2225

Source/moja.flint/include/moja/flint/writesystemconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <moja/flint/modulebase.h>
55

66
#include <boost/iostreams/stream_buffer.hpp>
7+
#include <Poco/Mutex.h>
78

89
namespace moja {
910
namespace flint {

Source/moja.flint/include/moja/flint/writevariablegrid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "moja/flint/modulebase.h"
99

1010
#include <boost/algorithm/string.hpp>
11+
#include <Poco/Mutex.h>
1112

1213
#include <algorithm>
1314
#include <unordered_map>

Source/moja.modules.gdal/include/moja/modules/gdal/writevariablegeotiff.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <moja/flint/modulebase.h>
1010

1111
#include <unordered_map>
12+
#include <Poco/Mutex.h>
1213

1314
namespace moja {
1415

Source/vcpkg.json

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
{
2+
"name": "moja",
3+
"version": "1.0.6",
4+
"builtin-baseline": "14e7bb4ae24616ec54ff6b2f6ef4e8659434ea44",
5+
"vcpkg-configuration": {
6+
"registries": [
7+
{
8+
"kind": "filesystem",
9+
"path": "../vcpkg/registry",
10+
"baseline": "default",
11+
"packages": ["turtle", "zipper"]
12+
},
13+
{
14+
"kind": "git",
15+
"repository": "https://github.com/microsoft/vcpkg",
16+
"baseline": "501db0f17ef6df184fcdbfbe0f87cde2313b6ab1",
17+
"packages": ["openssl", "vcpkg-cmake-get-vars"]
18+
}
19+
]
20+
},
21+
"dependencies": [
22+
"boost-iostreams",
23+
"boost-log",
24+
"boost-math",
25+
"boost-program-options",
26+
"boost-test",
27+
"boost-ublas",
28+
"fmt",
29+
"gdal",
30+
{"name": "hdf5", "features": ["szip", "zlib", "cpp"]},
31+
"libpq",
32+
"libpqxx",
33+
{"name": "poco", "features": ["sqlite3"]},
34+
"proj",
35+
"proj4",
36+
"sqlite3",
37+
"turtle",
38+
"zipper"
39+
],
40+
"overrides": [
41+
{"name": "boost", "version": "1.77.0"},
42+
{"name": "boost-accumulators", "version": "1.77.0"},
43+
{"name": "boost-algorithm", "version": "1.77.0"},
44+
{"name": "boost-align", "version": "1.77.0"},
45+
{"name": "boost-any", "version": "1.77.0"},
46+
{"name": "boost-array", "version": "1.77.0"},
47+
{"name": "boost-asio", "version": "1.77.0"},
48+
{"name": "boost-assert", "version": "1.77.0"},
49+
{"name": "boost-assign", "version": "1.77.0"},
50+
{"name": "boost-atomic", "version": "1.77.0"},
51+
{"name": "boost-beast", "version": "1.77.0"},
52+
{"name": "boost-bimap", "version": "1.77.0"},
53+
{"name": "boost-bind", "version": "1.77.0"},
54+
{"name": "boost-build", "version": "1.77.0"},
55+
{"name": "boost-callable-traits", "version": "1.77.0"},
56+
{"name": "boost-chrono", "version": "1.77.0"},
57+
{"name": "boost-circular-buffer", "version": "1.77.0"},
58+
{"name": "boost-compatibility", "version": "1.77.0"},
59+
{"name": "boost-compute", "version": "1.77.0"},
60+
{"name": "boost-concept-check", "version": "1.77.0"},
61+
{"name": "boost-config", "version": "1.77.0"},
62+
{"name": "boost-container", "version": "1.77.0"},
63+
{"name": "boost-container-hash", "version": "1.77.0"},
64+
{"name": "boost-context", "version": "1.77.0"},
65+
{"name": "boost-contract", "version": "1.77.0"},
66+
{"name": "boost-conversion", "version": "1.77.0"},
67+
{"name": "boost-convert", "version": "1.77.0"},
68+
{"name": "boost-core", "version": "1.77.0"},
69+
{"name": "boost-coroutine", "version": "1.77.0"},
70+
{"name": "boost-coroutine2", "version": "1.77.0"},
71+
{"name": "boost-crc", "version": "1.77.0"},
72+
{"name": "boost-date-time", "version": "1.77.0"},
73+
{"name": "boost-describe", "version": "1.77.0"},
74+
{"name": "boost-detail", "version": "1.77.0"},
75+
{"name": "boost-di", "version": "1.2.0"},
76+
{"name": "boost-dll", "version": "1.77.0"},
77+
{"name": "boost-dynamic-bitset", "version": "1.77.0"},
78+
{"name": "boost-endian", "version": "1.77.0"},
79+
{"name": "boost-exception", "version": "1.77.0"},
80+
{"name": "boost-fiber", "version": "1.77.0"},
81+
{"name": "boost-filesystem", "version": "1.77.0"},
82+
{"name": "boost-flyweight", "version": "1.77.0"},
83+
{"name": "boost-foreach", "version": "1.77.0"},
84+
{"name": "boost-format", "version": "1.77.0"},
85+
{"name": "boost-function", "version": "1.77.0"},
86+
{"name": "boost-function-types", "version": "1.77.0"},
87+
{"name": "boost-functional", "version": "1.77.0"},
88+
{"name": "boost-fusion", "version": "1.77.0"},
89+
{"name": "boost-geometry", "version": "1.77.0"},
90+
{"name": "boost-gil", "version": "1.77.0"},
91+
{"name": "boost-graph", "version": "1.77.0"},
92+
{"name": "boost-graph-parallel", "version": "1.77.0"},
93+
{"name": "boost-hana", "version": "1.77.0"},
94+
{"name": "boost-heap", "version": "1.77.0"},
95+
{"name": "boost-histogram", "version": "1.77.0"},
96+
{"name": "boost-hof", "version": "1.77.0"},
97+
{"name": "boost-icl", "version": "1.77.0"},
98+
{"name": "boost-integer", "version": "1.77.0"},
99+
{"name": "boost-interprocess", "version": "1.77.0"},
100+
{"name": "boost-interval", "version": "1.77.0"},
101+
{"name": "boost-intrusive", "version": "1.77.0"},
102+
{"name": "boost-io", "version": "1.77.0"},
103+
{"name": "boost-iostreams", "version": "1.77.0"},
104+
{"name": "boost-iterator", "version": "1.77.0"},
105+
{"name": "boost-json", "version": "1.77.0"},
106+
{"name": "boost-lambda", "version": "1.77.0"},
107+
{"name": "boost-lambda2", "version": "1.77.0"},
108+
{"name": "boost-leaf", "version": "1.77.0"},
109+
{"name": "boost-lexical-cast", "version": "1.77.0"},
110+
{"name": "boost-local-function", "version": "1.77.0"},
111+
{"name": "boost-locale", "version": "1.77.0"},
112+
{"name": "boost-lockfree", "version": "1.77.0"},
113+
{"name": "boost-log", "version": "1.77.0"},
114+
{"name": "boost-logic", "version": "1.77.0"},
115+
{"name": "boost-math", "version": "1.77.0"},
116+
{"name": "boost-metaparse", "version": "1.77.0"},
117+
{"name": "boost-modular-build-helper", "version": "1.77.0"},
118+
{"name": "boost-move", "version": "1.77.0"},
119+
{"name": "boost-mp11", "version": "1.77.0"},
120+
{"name": "boost-mpi", "version": "1.77.0"},
121+
{"name": "boost-mpl", "version": "1.77.0"},
122+
{"name": "boost-msm", "version": "1.77.0"},
123+
{"name": "boost-multi-array", "version": "1.77.0"},
124+
{"name": "boost-multi-index", "version": "1.77.0"},
125+
{"name": "boost-multiprecision", "version": "1.77.0"},
126+
{"name": "boost-nowide", "version": "1.77.0"},
127+
{"name": "boost-numeric-conversion", "version": "1.77.0"},
128+
{"name": "boost-odeint", "version": "1.77.0"},
129+
{"name": "boost-optional", "version": "1.77.0"},
130+
{"name": "boost-outcome", "version": "1.77.0"},
131+
{"name": "boost-parameter", "version": "1.77.0"},
132+
{"name": "boost-parameter-python", "version": "1.77.0"},
133+
{"name": "boost-pfr", "version": "1.77.0"},
134+
{"name": "boost-phoenix", "version": "1.77.0"},
135+
{"name": "boost-poly-collection", "version": "1.77.0"},
136+
{"name": "boost-polygon", "version": "1.77.0"},
137+
{"name": "boost-pool", "version": "1.77.0"},
138+
{"name": "boost-predef", "version": "1.77.0"},
139+
{"name": "boost-preprocessor", "version": "1.77.0"},
140+
{"name": "boost-process", "version": "1.77.0"},
141+
{"name": "boost-program-options", "version": "1.77.0"},
142+
{"name": "boost-property-map", "version": "1.77.0"},
143+
{"name": "boost-property-map-parallel", "version": "1.77.0"},
144+
{"name": "boost-property-tree", "version": "1.77.0"},
145+
{"name": "boost-proto", "version": "1.77.0"},
146+
{"name": "boost-ptr-container", "version": "1.77.0"},
147+
{"name": "boost-python", "version": "1.77.0"},
148+
{"name": "boost-qvm", "version": "1.77.0"},
149+
{"name": "boost-random", "version": "1.77.0"},
150+
{"name": "boost-range", "version": "1.77.0"},
151+
{"name": "boost-ratio", "version": "1.77.0"},
152+
{"name": "boost-rational", "version": "1.77.0"},
153+
{"name": "boost-regex", "version": "1.77.0"},
154+
{"name": "boost-safe-numerics", "version": "1.77.0"},
155+
{"name": "boost-scope-exit", "version": "1.77.0"},
156+
{"name": "boost-serialization", "version": "1.77.0"},
157+
{"name": "boost-signals2", "version": "1.77.0"},
158+
{"name": "boost-smart-ptr", "version": "1.77.0"},
159+
{"name": "boost-sort", "version": "1.77.0"},
160+
{"name": "boost-spirit", "version": "1.77.0"},
161+
{"name": "boost-stacktrace", "version": "1.77.0"},
162+
{"name": "boost-statechart", "version": "1.77.0"},
163+
{"name": "boost-static-assert", "version": "1.77.0"},
164+
{"name": "boost-static-string", "version": "1.77.0"},
165+
{"name": "boost-stl-interfaces", "version": "1.77.0"},
166+
{"name": "boost-system", "version": "1.77.0"},
167+
{"name": "boost-test", "version": "1.77.0"},
168+
{"name": "boost-thread", "version": "1.77.0"},
169+
{"name": "boost-throw-exception", "version": "1.77.0"},
170+
{"name": "boost-timer", "version": "1.77.0"},
171+
{"name": "boost-tokenizer", "version": "1.77.0"},
172+
{"name": "boost-tti", "version": "1.77.0"},
173+
{"name": "boost-tuple", "version": "1.77.0"},
174+
{"name": "boost-type-erasure", "version": "1.77.0"},
175+
{"name": "boost-type-index", "version": "1.77.0"},
176+
{"name": "boost-type-traits", "version": "1.77.0"},
177+
{"name": "boost-typeof", "version": "1.77.0"},
178+
{"name": "boost-ublas", "version": "1.77.0"},
179+
{"name": "boost-uninstall", "version": "1.77.0"},
180+
{"name": "boost-units", "version": "1.77.0"},
181+
{"name": "boost-unordered", "version": "1.77.0"},
182+
{"name": "boost-utility", "version": "1.77.0"},
183+
{"name": "boost-uuid", "version": "1.77.0"},
184+
{"name": "boost-variant", "version": "1.77.0"},
185+
{"name": "boost-variant2", "version": "1.77.0"},
186+
{"name": "boost-vcpkg-helpers", "version": "1.77.0"},
187+
{"name": "boost-vmd", "version": "1.77.0"},
188+
{"name": "boost-wave", "version": "1.77.0"},
189+
{"name": "boost-winapi", "version": "1.77.0"},
190+
{"name": "boost-xpressive", "version": "1.77.0"},
191+
{"name": "boost-yap", "version": "1.77.0"},
192+
{"name": "gdal", "version": "3.4.3"},
193+
{"name": "openssl", "version-string": "3.0.2"}
194+
]
195+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Source: turtle
2+
Version: 1.3.1
3+
Description: Turtle is a C++ mock object library based on Boost with a focus on usability, simplicity and flexibility.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#header-only library
2+
include(vcpkg_common_functions)
3+
4+
vcpkg_from_github(
5+
OUT_SOURCE_PATH SOURCE_PATH
6+
REPO mat007/turtle
7+
REF 5c0f29012511339ba5cc2672f99a1356c5387b62
8+
SHA512 d452fe35f5f87c6a0d77d95039ab1615830b2c78cf640a3d5703250cd3b7ff041b4782953e206526688e786bbae09aeea7b9905ef1e116bd38abb5512c26707e
9+
HEAD_REF master
10+
)
11+
12+
# Put the licence file where vcpkg expects it
13+
file(INSTALL
14+
${SOURCE_PATH}/LICENSE_1_0.txt
15+
DESTINATION ${CURRENT_PACKAGES_DIR}/share/turtle RENAME copyright)
16+
17+
# Copy the turtle header files
18+
file(INSTALL
19+
${SOURCE_PATH}/include
20+
DESTINATION ${CURRENT_PACKAGES_DIR} FILES_MATCHING PATTERN "*.hpp")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Source: zipper
2+
Version: 1.0.1
3+
Build-Depends: zlib
4+
Description: C++ wrapper around minizip compression library
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Common Ambient Variables:
2+
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
3+
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
4+
# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
5+
# PORT = current port name (zlib, etc)
6+
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
7+
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
8+
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
9+
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
10+
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
11+
#
12+
13+
include(vcpkg_common_functions)
14+
15+
vcpkg_from_github(
16+
OUT_SOURCE_PATH SOURCE_PATH
17+
REPO sebastiandev/zipper
18+
REF 11b1ac461dcff6c85306ef659bffa5bc92e8641c
19+
SHA512 1c05320f0ce40028f730d3b73a10ced0c410f2fd612f87efefa52e44c41ebab35594a9c44902efaccd8b136cbf659828a8d1fcb80eea8691291c98a4cf76107f
20+
)
21+
22+
vcpkg_download_distfile(MINIZIP_ARCHIVE
23+
URLS "https://github.com/sebastiandev/minizip/archive/0b46a2b4ca317b80bc53594688883f7188ac4d08.tar.gz"
24+
FILENAME "minizip.tar.gz"
25+
SHA512 c88f7bbbf679830b2046ae295ece783c751cba98dd4cf4c27fd9e7cce05d8b4a5c717a672649a22ee845b140a665d2e18f5dfe30ac71fb226f21d46e6e66b970
26+
)
27+
28+
file(REMOVE_RECURSE ${SOURCE_PATH}/minizip)
29+
30+
vcpkg_extract_source_archive(${MINIZIP_ARCHIVE} ${SOURCE_PATH})
31+
32+
file(RENAME ${SOURCE_PATH}/minizip-0b46a2b4ca317b80bc53594688883f7188ac4d08 ${SOURCE_PATH}/minizip)
33+
34+
35+
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
36+
set(ST_BUILD_STATIC ON)
37+
set(ST_BUILD_SHARED OFF)
38+
else()
39+
set(ST_BUILD_STATIC OFF)
40+
set(ST_BUILD_SHARED ON)
41+
endif()
42+
43+
vcpkg_configure_cmake(
44+
SOURCE_PATH ${SOURCE_PATH}
45+
PREFER_NINJA
46+
OPTIONS -DBUILD_TEST=OFF
47+
)
48+
49+
vcpkg_install_cmake()
50+
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake)
51+
vcpkg_copy_pdbs()
52+
53+
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
54+
55+
# Handle copyright
56+
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/zipper RENAME copyright)

0 commit comments

Comments
 (0)