Skip to content

Commit

Permalink
Fiddled with the build to make it arch linux compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlandry93 committed Mar 28, 2017
1 parent 81f848a commit d4631e6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(MSVC AND (MSVC_VERSION LESS 1600))
endif(MSVC AND (MSVC_VERSION LESS 1600))

# openmp
set(USE_OPEN_MP "true" CACHE BOOL "Set to OFF to not use OpenMP")
set(USE_OPEN_MP TRUE CACHE BOOL "Set to OFF to not use OpenMP")
if (USE_OPEN_MP)
find_package(OpenMP)
if (OPENMP_FOUND)
Expand All @@ -74,7 +74,7 @@ find_path(EIGEN_INCLUDE_DIR Eigen/Core

# optionally, opencl
# OpenCL disabled as its code is not up-to-date with API
set(USE_OPEN_CL "FALSE" CACHE BOOL "Set to ON to look for OpenCL")
set(USE_OPEN_CL FALSE CACHE BOOL "Set to ON to look for OpenCL")
if (USE_OPEN_CL)
find_path(OPENCL_INCLUDE_DIR CL/cl.h
/usr/local/include
Expand Down Expand Up @@ -111,7 +111,7 @@ set(NABO_SRC
nabo/kdtree_cpu.cpp
nabo/kdtree_opencl.cpp
)
set(SHARED_LIBS "false" CACHE BOOL "To build shared (true) or static (false) library")
set(SHARED_LIBS FALSE CACHE BOOL "To build shared (true) or static (false) library")
if (SHARED_LIBS)
add_library(${LIB_NAME} SHARED ${NABO_SRC})
install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib)
Expand Down Expand Up @@ -159,7 +159,7 @@ install(FILES package.xml DESTINATION share/libnabo)
export(PACKAGE libnabo)

# Create variable with the library location
get_property(libnabo_library TARGET ${LIB_NAME} PROPERTY LOCATION)
#get_property(libnabo_library TARGET ${LIB_NAME} PROPERTY LOCATION)

# Create variable for the local build tree
get_property(libnabo_include_dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
Expand All @@ -170,8 +170,8 @@ configure_file(libnaboConfig.cmake.in
# 2- installation build #

# Change the library location for an install location
get_filename_component(NABO_LIB_NAME ${libnabo_library} NAME)
set(libnabo_library ${CMAKE_INSTALL_PREFIX}/lib/${NABO_LIB_NAME})
#get_filename_component(NABO_LIB_NAME ${libnabo_library} NAME)
set(libnabo_library ${LIB_NAME})

# Change the include location for the case of an install location
set(libnabo_include_dirs ${CMAKE_INSTALL_PREFIX}/include)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ To specify the version of the interpreter to use when building the bindings, set
For example if you have both python 2.7 and 3.5 installed, you could ask cmake to generate python 3 bindings by using the following command.

cmake -DPYTHON_VERSION_MAJOR=3 -DPYTHON_VERSION_MINOR=5 ..

On debian-based distributions you may also need the `-DPYTHON_DEB_INSTALL_TARGET` option enabled.

Unit testing
============
Expand Down
15 changes: 13 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,19 @@ endfunction(find_python_module)
# make sure we have the right modules
if (PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
message("Python libs and executable found, looking for numpy and boost::python")
set(BOOST_PYTHON_PACKAGE "python-py${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
find_package(Boost COMPONENTS ${BOOST_PYTHON_PACKAGE})

if (PYTHON_DEB_INSTALL_TARGET)
set(BOOST_PYTHON_COMPONENT "python-py${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
else (PYTHON_DEB_INSTALL_TARGET)
if (PYTHON_VERSION_MAJOR GREATER 2)
set(BOOST_PYTHON_COMPONENT "python${PYTHON_VERSION_MAJOR}")
else (PYTHON_VERSION_MAJOR GREATER 2)
set(BOOST_PYTHON_COMPONENT "python")
endif(PYTHON_VERSION_MAJOR GREATER 2)
endif (PYTHON_DEB_INSTALL_TARGET)

find_package(Boost COMPONENTS ${BOOST_PYTHON_PACKAGE} python3)
message(Boost_PYTHON3_FOUND found: ${Boost_PYTHON3_FOUND}})
find_python_module(numpy)
find_package_handle_standard_args(numpy DEFAULT_MSG PY_NUMPY)
if (Boost_FOUND AND NUMPY_FOUND)
Expand Down

0 comments on commit d4631e6

Please sign in to comment.