Skip to content

Commit

Permalink
Link with necessary target-based libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed May 3, 2018
1 parent 44017c8 commit 22c3395
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 39 deletions.
2 changes: 2 additions & 0 deletions apps/CMakeLists.txt
Expand Up @@ -22,6 +22,8 @@ target_link_libraries(${PDAL_APP}
${PDAL_BASE_LIB_NAME}
${PDAL_UTIL_LIB_NAME}
${PDAL_JSONCPP_LIB_NAME}
${GDAL_LIBRARY}
${WINSOCK_LIBRARY}
)
target_include_directories(${PDAL_APP} PRIVATE
${PDAL_JSONCPP_INCLUDE_DIR}
Expand Down
32 changes: 18 additions & 14 deletions cmake/macros.cmake
Expand Up @@ -131,10 +131,13 @@ macro(PDAL_ADD_PLUGIN _name _type _shortname)
target_include_directories(${${_name}} PRIVATE
${PROJECT_BINARY_DIR}/include
${PDAL_INCLUDE_DIR})
target_link_libraries(${${_name}} PUBLIC
${PDAL_BASE_LIB_NAME}
${PDAL_UTIL_LIB_NAME}
${PDAL_ADD_PLUGIN_LINK_WITH})
target_link_libraries(${${_name}}
PUBLIC
${PDAL_BASE_LIB_NAME}
${PDAL_UTIL_LIB_NAME}
${PDAL_ADD_PLUGIN_LINK_WITH}
${WINSOCK_LIBRARY}
)

set_property(TARGET ${${_name}} PROPERTY FOLDER "Plugins/${_type}")
set_target_properties(${${_name}} PROPERTIES
Expand Down Expand Up @@ -176,13 +179,14 @@ macro(PDAL_ADD_TEST _name)
${PROJECT_SOURCE_DIR}/test/unit
${PROJECT_BINARY_DIR}/test/unit
${PROJECT_BINARY_DIR}/include)
set_target_properties(${_name}
PROPERTIES
COMPILE_DEFINITIONS PDAL_DLL_IMPORT)
set_property(TARGET ${_name} PROPERTY FOLDER "Tests")
target_link_libraries(${_name} PRIVATE
${PDAL_BASE_LIB_NAME} ${PDAL_UTIL_LIB_NAME} gtest
${PDAL_ADD_TEST_LINK_WITH})
target_link_libraries(${_name}
PRIVATE
${PDAL_BASE_LIB_NAME}
${PDAL_UTIL_LIB_NAME} gtest
${PDAL_ADD_TEST_LINK_WITH}
${WINSOCK_LIBRARY}
)
add_test(NAME ${_name}
COMMAND
"${PROJECT_BINARY_DIR}/bin/${_name}"
Expand All @@ -191,11 +195,11 @@ macro(PDAL_ADD_TEST _name)
# Ensure plugins are loaded from build dir
# https://github.com/PDAL/PDAL/issues/840
if (WIN32)
set_property(TEST ${_name} PROPERTY ENVIRONMENT
"PDAL_DRIVER_PATH=${PROJECT_BINARY_DIR}/bin")
set_property(TEST ${_name} PROPERTY ENVIRONMENT
"PDAL_DRIVER_PATH=${PROJECT_BINARY_DIR}/bin")
else()
set_property(TEST ${_name} PROPERTY ENVIRONMENT
"PDAL_DRIVER_PATH=${PROJECT_BINARY_DIR}/lib")
set_property(TEST ${_name} PROPERTY ENVIRONMENT
"PDAL_DRIVER_PATH=${PROJECT_BINARY_DIR}/lib")
endif()
endmacro(PDAL_ADD_TEST)

Expand Down
1 change: 0 additions & 1 deletion cmake/win32_compiler_options.cmake
Expand Up @@ -4,7 +4,6 @@
#

function(pdal_target_compile_settings target)
message("*** Compile settings for ${target} ***")
target_compile_definitions(${target} PRIVATE
-DWIN32_LEAN_AND_MEAN)
if (MSVC)
Expand Down
4 changes: 3 additions & 1 deletion plugins/hexbin/CMakeLists.txt
Expand Up @@ -10,7 +10,9 @@ if (HEXER_FOUND)
FILES
filters/HexBin.cpp
LINK_WITH
${HEXER_LIBRARY})
${HEXER_LIBRARY}
${GDAL_LIBRARY}
)
target_include_directories(${libname} PRIVATE ${PDAL_VENDOR_DIR}/pdalboost)
target_include_directories(${libname} PUBLIC ${HEXER_INCLUDE_DIR})

Expand Down
8 changes: 0 additions & 8 deletions plugins/python/io/NumpyReader.cpp
Expand Up @@ -43,14 +43,6 @@

#include "../plang/Environment.hpp"

/**
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#define NO_IMPORT_ARRAY
#define PY_ARRAY_UNIQUE_SYMBOL PDAL_ARRAY_API
#include <numpy/arrayobject.h>
**/

namespace pdal
{

Expand Down
45 changes: 37 additions & 8 deletions test/unit/CMakeLists.txt
Expand Up @@ -43,6 +43,7 @@ PDAL_ADD_TEST(pdal_options_test
OptionsTest.cpp
LINK_WITH
${PDAL_JSONCPP_LIB_NAME}
${GDAL_LIBRARY}
)
target_include_directories(pdal_options_test PRIVATE
${PDAL_JSONCPP_INCLUDE_DIR})
Expand All @@ -60,9 +61,19 @@ PDAL_ADD_TEST(pdal_program_arg_test
${PDAL_JSONCPP_INCLUDE_DIR})
PDAL_ADD_TEST(pdal_artifact_test FILES ArtifactTest.cpp)

PDAL_ADD_TEST(pdal_polygon_test FILES PolygonTest.cpp)
PDAL_ADD_TEST(pdal_polygon_test
FILES
PolygonTest.cpp
LINK_WITH
${GDAL_LIBRARY}
)
PDAL_ADD_TEST(pdal_segmentation_test FILES SegmentationTest.cpp)
PDAL_ADD_TEST(pdal_spatial_reference_test FILES SpatialReferenceTest.cpp)
PDAL_ADD_TEST(pdal_spatial_reference_test
FILES
SpatialReferenceTest.cpp
LINK_WITH
${GDAL_LIBRARY}
)
target_include_directories(pdal_spatial_reference_test PRIVATE ${PDAL_JSONCPP_INCLUDE_DIR})
PDAL_ADD_TEST(pdal_stage_factory_test FILES StageFactoryTest.cpp)
PDAL_ADD_TEST(pdal_streaming_test FILES StreamingTest.cpp)
Expand Down Expand Up @@ -91,7 +102,12 @@ if (PDAL_HAVE_ZLIB)
endif()
PDAL_ADD_TEST(pdal_io_buffer_test FILES io/BufferTest.cpp)
PDAL_ADD_TEST(pdal_io_faux_test FILES io/FauxReaderTest.cpp)
PDAL_ADD_TEST(pdal_io_gdal_reader_test FILES io/GDALReaderTest.cpp)
PDAL_ADD_TEST(pdal_io_gdal_reader_test
FILES
io/GDALReaderTest.cpp
LINK_WITH
${GDAL_LIBRARY}
)
PDAL_ADD_TEST(pdal_io_gdal_writer_test
FILES
io/GDALWriterTest.cpp
Expand Down Expand Up @@ -122,11 +138,24 @@ PDAL_ADD_TEST(pdal_io_text_writer_test FILES io/TextWriterTest.cpp)
PDAL_ADD_TEST(pdal_filters_assign_test FILES filters/AssignFilterTest.cpp)
PDAL_ADD_TEST(pdal_filters_chipper_test FILES filters/ChipperTest.cpp)
target_include_directories(pdal_filters_chipper_test PRIVATE ${PDAL_JSONCPP_INCLUDE_DIR})
PDAL_ADD_TEST(pdal_filters_colorinterp_test FILES
filters/ColorinterpFilterTest.cpp)
PDAL_ADD_TEST(pdal_filters_colorization_test FILES
filters/ColorizationFilterTest.cpp)
PDAL_ADD_TEST(pdal_filters_crop_test FILES filters/CropFilterTest.cpp)
PDAL_ADD_TEST(pdal_filters_colorinterp_test
FILES
filters/ColorinterpFilterTest.cpp
LINK_WITH
${GDAL_LIBRARY}
)
PDAL_ADD_TEST(pdal_filters_colorization_test
FILES
filters/ColorizationFilterTest.cpp
LINK_WITH
${GDAL_LIBRARY}
)
PDAL_ADD_TEST(pdal_filters_crop_test
FILES
filters/CropFilterTest.cpp
LINK_WITH
${GDAL_LIBRARY}
)
PDAL_ADD_TEST(pdal_filters_decimation_test FILES
filters/DecimationFilterTest.cpp)
PDAL_ADD_TEST(pdal_filters_divider_test FILES filters/DividerFilterTest.cpp)
Expand Down
2 changes: 0 additions & 2 deletions test/unit/OptionsTest.cpp
Expand Up @@ -37,8 +37,6 @@
#include <json/json.h>

#include <pdal/Options.hpp>
#include <pdal/PDALUtils.hpp>
#include <io/FauxReader.hpp>
#include <filters/CropFilter.hpp>

#include "Support.hpp"
Expand Down
6 changes: 1 addition & 5 deletions test/unit/PolygonTest.cpp
Expand Up @@ -35,15 +35,11 @@
#include <pdal/pdal_test_main.hpp>

#include <pdal/util/FileUtils.hpp>


#include <pdal/PointView.hpp>
#include <pdal/Options.hpp>

#include <pdal/Polygon.hpp>
#include "Support.hpp"


#include "Support.hpp"

namespace pdal
{
Expand Down

0 comments on commit 22c3395

Please sign in to comment.