Skip to content

Commit 1e7b391

Browse files
committed
run cmake tests
1 parent b3d1cd7 commit 1e7b391

File tree

6 files changed

+46
-29
lines changed

6 files changed

+46
-29
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
pdal/libpdalpython.cpp
22
*.pyc
3+
_skbuild/*
4+
.vscode/*
35
__pycache__
46
build/*
57
PDAL.egg-info/*

pdal/CMakeLists.txt

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ include(${PROJECT_SOURCE_DIR}/macros.cmake NO_POLICY_SCOPE)
77
set(CMAKE_CXX_STANDARD 11)
88
set(CMAKE_CXX_STANDARD_REQUIRED ON)
99
set(CMAKE_CXX_EXTENSIONS OFF)
10-
set(CMAKE_BUILD_TYPE "Debug")
10+
set(CMAKE_BUILD_TYPE "Release")
1111

1212
enable_testing()
1313

1414
# Python-finding settings
1515
set(Python3_FIND_STRATEGY "LOCATION")
16-
set(Python3_FIND_REGISTRY "LAST")
16+
set(Python3_FIND_REGISTRY "LAST")
1717
set(Python3_FIND_FRAMEWORK "LAST")
1818
find_package(Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
1919

@@ -33,24 +33,24 @@ execute_process(
3333
OUTPUT_STRIP_TRAILING_WHITESPACE
3434
)
3535

36-
execute_process(
37-
COMMAND
38-
${Python3_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LDSHARED').split(' ', 1)[1])"
39-
OUTPUT_VARIABLE PYTHON_LDSHARED
40-
OUTPUT_STRIP_TRAILING_WHITESPACE
41-
)
42-
43-
if (NOT Py_ENABLE_SHARED)
44-
message(STATUS "Python ${Python3_EXECUTABLE} is statically linked")
45-
if (APPLE)
46-
# conda gives us -bundle, which isn't valid
47-
message(STATUS "Removing extra -bundle argument from sysconfig.get_config_var('LDSHARED')")
48-
string(REPLACE "-bundle" "" PYTHON_LDSHARED "${PYTHON_LDSHARED}")
49-
string(STRIP ${PYTHON_LDSHARED} PYTHON_LDSHARED)
50-
endif()
51-
# set(Python3_LIBRARIES ${PYTHON_LDSHARED})
52-
message(STATUS "Setting Python3_LIBRARIES to '${Python3_LIBRARIES}' due to static Python")
53-
endif()
36+
#execute_process(
37+
# COMMAND
38+
# ${Python3_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LDSHARED').split(' ', 1)[1])"
39+
# OUTPUT_VARIABLE PYTHON_LDSHARED
40+
# OUTPUT_STRIP_TRAILING_WHITESPACE
41+
#)
42+
43+
#if (NOT Py_ENABLE_SHARED)
44+
# message(STATUS "Python ${Python3_EXECUTABLE} is statically linked")
45+
# if (APPLE)
46+
# # conda gives us -bundle, which isn't valid
47+
# message(STATUS "Removing extra -bundle argument from sysconfig.get_config_var('LDSHARED')")
48+
# string(REPLACE "-bundle" "" PYTHON_LDSHARED "${PYTHON_LDSHARED}")
49+
# string(STRIP ${PYTHON_LDSHARED} PYTHON_LDSHARED)
50+
# endif()
51+
# # set(Python3_LIBRARIES ${PYTHON_LDSHARED})
52+
# message(STATUS "Setting Python3_LIBRARIES to '${Python3_LIBRARIES}' due to static Python")
53+
#endif()
5454

5555
set(EXTENSION_SRC
5656
PyArray.cpp
@@ -76,15 +76,15 @@ python_extension_module(${extension})
7676
install(TARGETS ${extension} LIBRARY DESTINATION ${PROJECT_NAME})
7777

7878
PDAL_PYTHON_ADD_PLUGIN(numpy_reader reader numpy
79-
FILES
79+
FILES
8080
./io/NumpyReader.cpp
8181
./io/NumpyReader.hpp
8282
./plang/Invocation.cpp
8383
./plang/Environment.cpp
8484
./plang/Redirector.cpp
8585
./plang/Script.cpp
86-
LINK_WITH
87-
${PDAL_LIBRARIES}
86+
LINK_WITH
87+
${PDAL_LIBRARIES}
8888
${Python3_LIBRARIES}
8989
${CMAKE_DL_LIBS}
9090
SYSTEM_INCLUDES
@@ -122,15 +122,15 @@ add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
122122
EXCLUDE_FROM_ALL)
123123

124124
PDAL_PYTHON_ADD_PLUGIN(python_filter filter python
125-
FILES
125+
FILES
126126
./filters/PythonFilter.cpp
127127
./filters/PythonFilter.hpp
128128
./plang/Invocation.cpp
129129
./plang/Environment.cpp
130130
./plang/Redirector.cpp
131131
./plang/Script.cpp
132-
LINK_WITH
133-
${PDAL_LIBRARIES}
132+
LINK_WITH
133+
${PDAL_LIBRARIES}
134134
${Python3_LIBRARIES}
135135
${CMAKE_DL_LIBS}
136136
SYSTEM_INCLUDES
@@ -146,7 +146,7 @@ PDAL_PYTHON_ADD_TEST(pdal_io_numpy_test
146146
./test/NumpyReaderTest.cpp
147147
./test/Support.cpp
148148
LINK_WITH
149-
${numpy_reader}
149+
${numpy_reader}
150150
${Python3_LIBRARIES}
151151
${PDAL_LIBRARIES}
152152
${CMAKE_DL_LIBS}

scripts/azp/linux.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
displayName: Add conda to PATH
1111
- script: |
1212
conda update -n base -c defaults conda -y
13-
conda create --yes --name pdal -c conda-forge pdal pytest numpy compilers
13+
conda create --yes --name pdal -c conda-forge pdal pytest numpy compilers scikit-build
1414
displayName: 'Dependencies'
1515
- script: |
1616
source activate pdal
@@ -22,5 +22,9 @@ jobs:
2222
- script: |
2323
source activate pdal
2424
pip install -e .
25+
SKPATH=$(python -c "import skbuild; print (skbuild.constants.SKBUILD_DIR())")/cmake-build
26+
export PDAL_DRIVER_PATH=$SKPATH
27+
$SKPATH/pdal_filters_python_test
28+
$SKPATH/pdal_io_numpy_test
2529
py.test
2630
displayName: 'Local test'

scripts/azp/osx.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ jobs:
4646
source activate pdal
4747
which pytest
4848
pytest
49+
SKPATH=$(python -c "import skbuild; print (skbuild.constants.SKBUILD_DIR())")/cmake-build
50+
export PDAL_DRIVER_PATH=$SKPATH
51+
$SKPATH/pdal_filters_python_test
52+
$SKPATH/pdal_io_numpy_test
4953
pdal --version
5054
pdal --drivers
5155
displayName: 'Test'

scripts/azp/win.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ jobs:
3535
- script: |
3636
call activate pdal
3737
py.test
38-
pdal info --drivers
38+
for /f %%i in ('python -c "import skbuild; print (skbuild.constants.SKBUILD_DIR())"') do set SKPATH=%%i
39+
set PDAL_DRIVER_PATH=%SKPATH%
40+
%SKPATH%/pdal_filters_python_test
41+
%SKPATH%/pdal_io_numpy_test
42+
pdal --version
43+
pdal --drivers
3944
displayName: 'Test'
4045
4146

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
norecursedirs = _skbuild/*

0 commit comments

Comments
 (0)