Skip to content

Commit c069929

Browse files
committed
Merge pull request #10 from dcoeurjo/externaldata
Externaldata enabled
2 parents b32db47 + 9dd87c4 commit c069929

9 files changed

Lines changed: 809 additions & 275798 deletions

CMakeLists.txt

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 2.8)
22
cmake_policy(SET CMP0015 OLD)
3-
list(APPEND CMAKE_MODULE_PATH "modules")
3+
list(APPEND CMAKE_MODULE_PATH "cmake")
44

55
##### BUILD ############################################################
66
project(sampler)
@@ -28,6 +28,34 @@ link_directories(
2828
${OPENGL_LIBRARY_DIRS}
2929
)
3030

31+
32+
33+
######## External Data for production/barycenter/lut files######
34+
##
35+
## Data files will be located in the {build-folder}/data/lut/
36+
##
37+
include(ExternalData)
38+
list(APPEND ExternalData_URL_TEMPLATES
39+
"http://liris.cnrs.fr/polyhex/data/%(algo)-%(hash)")
40+
ExternalData_Expand_Arguments(
41+
GetData
42+
OUT-data
43+
DATA{data/lut/production_rules.dat}
44+
DATA{data/lut/barycenters.dat}
45+
)
46+
MESSAGE(STATUS "PATH to the data files: ${OUT-data}")
47+
ExternalData_Add_Target(GetData)
48+
ExternalData_Expand_Arguments(
49+
GetLUT
50+
OUT-LUT
51+
DATA{data/lut/offsets_bnot.dat}
52+
)
53+
MESSAGE(STATUS "PATH to the LUT file: ${OUT-LUT}")
54+
ExternalData_Add_Target(GetLUT)
55+
set_target_properties(GetLUT PROPERTIES EXCLUDE_FROM_ALL "TRUE")
56+
##########"
57+
58+
3159
file(GLOB sampler-core-src ${PROJECT_SOURCE_DIR}/src/*.cpp )
3260
file(GLOB sampler-gui-src ${PROJECT_SOURCE_DIR}/src/gui/*.cpp )
3361
file(GLOB sampler-gui-hdr ${PROJECT_SOURCE_DIR}/src/gui/*.hpp )

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Data
4040
This program needs full offsets table to produce best sampling distribution.
4141
These tables are heavy (1.5G) and can be downloaded here: http://liris.cnrs.fr/polyhex/data/
4242

43+
Aternatively, `make GetLUT` (GetLUT target in your IDE) will download the data file to the folder `{your-build-folder}/data/lut`.
44+
4345

4446
Usage examples
4547
--------------

cmake/ExternalData.cmake

Lines changed: 771 additions & 0 deletions
Large diffs are not rendered by default.

cmake/ExternalData_config.cmake.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(ExternalData_OBJECT_STORES "@ExternalData_OBJECT_STORES@")
2+
set(ExternalData_URL_TEMPLATES "@ExternalData_URL_TEMPLATES@")
3+
set(ExternalData_TIMEOUT_INACTIVITY "@ExternalData_TIMEOUT_INACTIVITY@")
4+
set(ExternalData_TIMEOUT_ABSOLUTE "@ExternalData_TIMEOUT_ABSOLUTE@")

0 commit comments

Comments
 (0)