Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Apr 3, 2018
2 parents f384648 + e02ff75 commit 5dfbb81
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 83 deletions.
25 changes: 13 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,21 @@ set_directory_properties(PROPERTY ADDITIONAL_MAKE_CLEAN_FILES

if(WIN32)
add_definitions("-DPDAL_DLL_EXPORT=1")
foreach(config ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${config} CONFIG)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIG} "${PDAL_OUTPUT_LIB_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONFIG} "${PDAL_OUTPUT_BIN_DIR}")
# ---[ Windows requires DLLs (shared libraries) to be installed in
# ---[ the same directory as executables
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIG} "${PDAL_OUTPUT_BIN_DIR}")
endforeach(config)
else(WIN32)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PDAL_OUTPUT_LIB_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PDAL_OUTPUT_BIN_DIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PDAL_OUTPUT_LIB_DIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE} "${PDAL_OUTPUT_LIB_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE} "${PDAL_OUTPUT_BIN_DIR}")
# ---[ Windows requires DLLs (shared libraries) to be installed in
# ---[ the same directory as executables
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE} "${PDAL_OUTPUT_BIN_DIR}")
endif(WIN32)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PDAL_OUTPUT_LIB_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PDAL_OUTPUT_BIN_DIR}")
if(WIN32)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PDAL_OUTPUT_BIN_DIR}")
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PDAL_OUTPUT_LIB_DIR}")
endif()

# Choose package components

include(${PDAL_CMAKE_DIR}/options.cmake)
Expand Down
2 changes: 1 addition & 1 deletion apps/pdal-config-bat.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ IF "%1" == "--includes" echo @PDAL_INCLUDE_DEFINITIONS@ & goto exit
IF "%1" == "--cflags" echo @CMAKE_C_FLAGS@ & goto exit
IF "%1" == "--cxxflags" echo @CMAKE_CXX_FLAGS@ -std=c++11 & goto exit
IF "%1" == "--version" echo @PDAL_VERSION_STRING@ & goto exit
IF "%1" == "--python-version" echo @PYTHON_VERSION_STRING@ & goto exit
IF "%1" == "--python-version" echo @PDAL_PYTHON_VERSION_STRING@ & goto exit


echo Usage: pdal-config [OPTIONS]
Expand Down
2 changes: 1 addition & 1 deletion apps/pdal-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ case $1 in
;;

--python-version)
echo @PYTHON_VERSION_STRING@
echo @PDAL_PYTHON_VERSION_STRING@
;;

*)
Expand Down
1 change: 1 addition & 0 deletions apps/pdal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ int App::execute(StringList& cmdArgs, LogPtr& log)
log->setLevel(m_logLevel);
else if (m_debug)
log->setLevel(LogLevel::Debug);
log->get(LogLevel::Debug) << "Debugging..." << std::endl;
PluginManager<Stage>::setLog(log);
PluginManager<Kernel>::setLog(log);
#ifndef _WIN32
Expand Down
28 changes: 7 additions & 21 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,24 @@ install:
- ps: mkdir C:\temp | out-null
- ps: mkdir $env:OSGEO4W_ROOT | out-null
# make an install directory for packacing
- ps: mkdir C:\pdalbin | out-null
# get the OSGeo installer
- ps: (new-object net.webclient).DownloadFile("http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe", "C:\temp\osgeo4w-setup.exe")
# and install our dependencies
- C:\temp\osgeo4w-setup.exe -q -k -r -A -s http://download.osgeo.org/osgeo4w/ -a x86_64 -P eigen,gdal,geos,hexer,iconv,laszip,libgeotiff,libpq,libtiff,libxml2,msys,nitro,laz-perf,proj,zlib,python3-core,python3-devel,python3-numpy,oci,oci-devel,laz-perf,jsoncpp,xz-devel,zstd -R %OSGEO4W_ROOT% > NUL
# call our PDAL install script
- call %OSGEO4W_ROOT%\bin\o4w_env.bat
- call %OSGEO4W_ROOT%\bin\py3_env.bat
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
- set PATH=%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Tools\GitVersion;C:\Program Files (x86)\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\AppVeyor\BuildAgent\
- call .\\scripts\\appveyor\\config.cmd
- set PATH=%PATH%;C:\Program Files (x86)\CMake\bin
- call scripts\\appveyor\\config.cmd

build_script:
- call .\\scripts\\appveyor\\build.cmd

after_build:
- call %OSGEO4W_ROOT%\bin\o4w_env.bat
- call %OSGEO4W_ROOT%\bin\py3_env.bat
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
- set PATH=%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Tools\GitVersion;C:\Program Files (x86)\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\AppVeyor\BuildAgent\
- call .\\scripts\\appveyor\\install.cmd

- call scripts\\appveyor\\build.cmd

test_script:
# FIXME: Clear PATH to avoid OSGeo4W loading incompatible DLLs
- set PATH=
- set PATH=%OSGEO4W_ROOT%\bin;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Tools\GitVersion;C:\Program Files (x86)\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\AppVeyor\BuildAgent\
- call %OSGEO4W_ROOT%\bin\o4w_env.bat
- call %OSGEO4W_ROOT%\bin\py3_env.bat
- set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
- set PATH=%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Tools\GitVersion;C:\Program Files (x86)\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\AppVeyor\BuildAgent\
- ctest -V --output-on-failure -C Release
- call scripts\\appveyor\\test.cmd

deploy_script:
- call scripts\\appveyor\\install.cmd

artifacts:
- path: pdal-$(APPVEYOR_REPO_COMMIT).tar.bz2
Expand Down
4 changes: 2 additions & 2 deletions cmake/examples/hobu-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ CC=$CC CXX=$CXX cmake -G "$CONFIG" \
-DSQLITE3_INCLUDE_DIR=${SQLITE_HOME}/include \
-DSQLITE3_LIBRARY=${SQLITE_HOME}/lib/libsqlite3.${SO_EXT} \
-DPYTHON_EXECUTABLE=/usr/local/bin/python2 \
-DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib \
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/include/python2.7/ \
-DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6.dylib \
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/include/python3.6m/ \
-DOCI_CONNECTION="lidar/lidar@localhost:1521/xe.oracle.docker" \
-DPGPOINTCLOUD_TEST_DB_HOST="localhost"
# -DBUILD_PLUGIN_MATLAB=ON \
Expand Down
2 changes: 1 addition & 1 deletion cmake/python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(PYTHONLIBS_FOUND)
set(PDAL_HAVE_PYTHON 1)
add_definitions(-DPDAL_PYTHON_LIBRARY="${PYTHON_LIBRARY}")
set(PDAL_HAVE_PYTHON 1)
set(PYTHON_VERSION_STRING "${PYTHONLIBS_VERSION_STRING}" )
set(PDAL_PYTHON_VERSION_STRING "${PYTHONLIBS_VERSION_STRING}" CACHE STRING "PDAL Python version" FORCE)

find_package(NumPy QUIET 1.5 REQUIRED)
include_directories(SYSTEM ${NUMPY_INCLUDE_DIR})
Expand Down
2 changes: 2 additions & 0 deletions scripts/appveyor/build.cmd
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pushd build
nmake /f Makefile
popd
12 changes: 9 additions & 3 deletions scripts/appveyor/config.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set PDAL_BUILD_TESTS=OFF

) ELSE (

mkdir C:\pdalbin
SET PDAL_PLUGIN_INSTALL_PATH="C:\pdalbin"
set PDAL_BUILD_TESTS=ON

Expand All @@ -23,6 +24,9 @@ REM needed or else CMake won't find the Oracle library that OSGeo4W installs

SET ORACLE_HOME="C:/OSGEO4W64/"

mkdir build
pushd build

cmake -G "NMake Makefiles" ^
-DBUILD_PLUGIN_CPD=OFF ^
-DBUILD_PLUGIN_GREYHOUND=%PDAL_OPTIONAL_COMPONENTS% ^
Expand All @@ -34,12 +38,13 @@ cmake -G "NMake Makefiles" ^
-DBUILD_PLUGIN_PCL=OFF ^
-DBUILD_PLUGIN_PGPOINTCLOUD=%PDAL_OPTIONAL_COMPONENTS% ^
-DBUILD_PLUGIN_SQLITE=%PDAL_OPTIONAL_COMPONENTS% ^
-DLIBLZMA_LIBRARY=%OSGEO4W_ROOT%\lib\liblzma.lib ^
-DLIBLZMA_LIBRARY=%OSGEO4W_ROOT%\lib\liblzma.lib ^
-DBUILD_PLUGIN_RIVLIB=OFF ^
-DBUILD_PLUGIN_PYTHON=%PDAL_OPTIONAL_COMPONENTS% ^
-DENABLE_CTEST=OFF ^
-DWITH_LAZPERF=ON ^
-DLazperf_DIR=%OSGEO4W_ROOT% ^
-DLazperf_DIR=%OSGEO4W_ROOT% ^
-DWITH_LZMA=ON ^
-DWITH_LASZIP=ON ^
-DWITH_TESTS=%PDAL_BUILD_TESTS% ^
-DPDAL_PLUGIN_INSTALL_PATH=%PDAL_PLUGIN_INSTALL_PATH% ^
Expand All @@ -60,6 +65,7 @@ cmake -G "NMake Makefiles" ^
-DBUILD_SQLITE_TESTS=OFF ^
-DCMAKE_BUILD_TYPE=RelWithDebInfo ^
-DBUILD_OCI_TESTS=OFF ^
.
..

popd

11 changes: 9 additions & 2 deletions scripts/appveyor/install.cmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
@echo off

REM cmake --build . --target install --config Release
REM call %OSGEO4W_ROOT%\bin\o4w_env.bat
REM call %OSGEO4W_ROOT%\bin\py3_env.bat
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

REM set PATH=%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Tools\GitVersion;C:\Program Files (x86)\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\AppVeyor\BuildAgent\

nmake /f Makefile install DESTDIR=C:\projects\pdal\install

cd c:\projects\pdal\install\osgeo4w64
pushd c:\projects\pdal\install\osgeo4w64

tar jcvf ..\pdal-%APPVEYOR_REPO_COMMIT%.tar.bz2 .
copy c:\pdal-%APPVEYOR_REPO_COMMIT%.tar.bz2 c:\projects\pdal
echo "OSGeo4W64 build will be uploaded to https://s3.amazonaws.com/pdal/osgeo4w/pdal-%APPVEYOR_REPO_COMMIT%.tar.bz2"

popd
5 changes: 5 additions & 0 deletions scripts/appveyor/test.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pushd build

ctest -V --output-on-failure

popd
12 changes: 0 additions & 12 deletions test/unit/SpatialReferenceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@

using namespace pdal;

TEST(SpatialReferenceTest, test_env_vars)
{

#ifdef _MSC_VER
const char* gdal_data = getenv("GDAL_DATA");
const char* proj_lib = getenv("PROJ_LIB");

EXPECT_TRUE(FileUtils::fileExists(gdal_data));
EXPECT_TRUE(FileUtils::fileExists(proj_lib));
#endif
}

TEST(SpatialReferenceTest, test_ctor)
{
SpatialReference srs;
Expand Down
2 changes: 1 addition & 1 deletion test/unit/TestConfig.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#define UNITTEST_TESTCONFIG_DATA_PATH "@CMAKE_SOURCE_DIR@/test/data/"
#define UNITTEST_TESTCONFIG_CONFIGURED_PATH "@CMAKE_BINARY_DIR@/test/data/"
#define UNITTEST_TESTCONFIG_BINARY_PATH "@CMAKE_BINARY_DIR@/bin/"
#define UNITTEST_TESTCONFIG_BINARY_PATH "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/"
#define UNITTEST_TESTCONFIG_OCI_CONNECTION "@OCI_CONNECTION@"

#include <string>
Expand Down
3 changes: 3 additions & 0 deletions test/unit/apps/TIndexTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ TEST(TIndex, test2)
// Indentical to test1, but filespec input comes from find command.
TEST(TIndex, test3)
{
// No find on Windows.
#ifndef WIN32
std::string outSpec(Support::temppath("tindex.out"));
std::string outPoints(Support::temppath("points.txt"));

Expand Down Expand Up @@ -142,5 +144,6 @@ TEST(TIndex, test3)
Utils::run_shell_command(cmd, output);
pos = output.find("Merge filecount: 1");
EXPECT_NE(pos, std::string::npos);
#endif
}

2 changes: 1 addition & 1 deletion test/unit/filters/ColorinterpFilterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ std::string makeColor()
static uint8_t rgb[12] = { 1, 2, 3, 4 };

std::string ptr = Utils::toString(&rgb);
if (ptr[0] != '0' && ptr[1] != 'x')
if (ptr[0] != '0' || ptr[1] != 'x')
ptr = "0x" + ptr;
std::ostringstream ss;
ss << "MEM:::PIXELS=4,LINES=1,BANDS=3,DATAPOINTER=" << ptr;
Expand Down
28 changes: 8 additions & 20 deletions vendor/arbiter/arbiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3237,7 +3237,7 @@ Curl::Curl(const Json::Value& json)
{
if (h.isMember("timeout"))
{
m_timeout = h["timeout"].asUInt64();
m_timeout = long(h["timeout"].asUInt64());
}

if (h.isMember("followRedirect"))
Expand Down Expand Up @@ -4462,22 +4462,7 @@ namespace
std::time_t now(std::time(nullptr));
std::tm utc(*std::gmtime(&now));
std::tm loc(*std::localtime(&now));
return std::difftime(std::mktime(&utc), std::mktime(&loc));
}

std::tm getTm()
{
std::tm tm;
tm.tm_sec = 0;
tm.tm_min = 0;
tm.tm_hour = 0;
tm.tm_mday = 0;
tm.tm_mon = 0;
tm.tm_year = 0;
tm.tm_wday = 0;
tm.tm_yday = 0;
tm.tm_isdst = 0;
return tm;
return (int64_t)std::difftime(std::mktime(&utc), std::mktime(&loc));
}
}

Expand All @@ -4494,7 +4479,7 @@ Time::Time(const std::string& s, const std::string& format)
{
static const int64_t utcOffset(utcOffsetSeconds());

auto tm(getTm());
std::tm tm {};
#ifndef ARBITER_WINDOWS
// We'd prefer to use get_time, but it has poor compiler support.
if (!strptime(s.c_str(), format.c_str(), &tm))
Expand All @@ -4509,7 +4494,10 @@ Time::Time(const std::string& s, const std::string& format)
throw ArbiterError("Failed to parse " + s + " as time: " + format);
}
#endif
tm.tm_sec -= utcOffset;
if (utcOffset > std::numeric_limits<int>::max())
throw ArbiterError("Can't convert offset time in seconds to tm type.");

tm.tm_sec -= (int)utcOffset;
m_time = std::mktime(&tm);
}

Expand All @@ -4534,7 +4522,7 @@ std::string Time::str(const std::string& format) const

int64_t Time::operator-(const Time& other) const
{
return std::difftime(m_time, other.m_time);
return (int64_t)std::difftime(m_time, other.m_time);
}

int64_t Time::asUnix() const
Expand Down
1 change: 1 addition & 0 deletions vendor/arbiter/arbiter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ SOFTWARE.


#pragma once
#pragma warning(disable:4251) // DLL export warnings
/// If defined, indicates that the source file is amalgamated
/// to prevent private header inclusion.
#define ARBITER_IS_AMALGAMATION
Expand Down
12 changes: 6 additions & 6 deletions vendor/pdalboost/libs/filesystem/src/windows_file_codecvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
{
UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;

int count;
if ((count = ::MultiByteToWideChar(codepage, MB_PRECOMPOSED, from,
from_end - from, to, to_end - to)) == 0)
auto count = ::MultiByteToWideChar(codepage, MB_PRECOMPOSED, from,
int(from_end - from), to, int(to_end - to));
if (count == 0)
{
return error; // conversion failed
}
Expand All @@ -58,9 +58,9 @@
{
UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;

int count;
if ((count = ::WideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, from,
from_end - from, to, to_end - to, 0, 0)) == 0)
auto count = ::WideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, from,
int(from_end - from), to, int(to_end - to), 0, 0);
if (count == 0)
{
return error; // conversion failed
}
Expand Down

0 comments on commit 5dfbb81

Please sign in to comment.