aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2020-07-23 18:35:18 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2020-07-23 18:35:18 +0200
commit8f2b707d026597018333ac60e707e5ab78c25a91 (patch)
treeebf5c6490a56269d674a5d1d5357c7b5e2210872 /CMakeLists.txt
parent444e535f000fd7b53dadf6726d5cd29ac34cc75f (diff)
downloadnextpnr-8f2b707d026597018333ac60e707e5ab78c25a91.tar.gz
nextpnr-8f2b707d026597018333ac60e707e5ab78c25a91.tar.bz2
nextpnr-8f2b707d026597018333ac60e707e5ab78c25a91.zip
Initial conversion to pybind11
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt57
1 files changed, 1 insertions, 56 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 78c72b53..9591c216 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,17 +45,9 @@ if (STATIC_BUILD)
set(CMAKE_CXX_FLAGS_RELEASE "/MT")
set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
endif()
- if (BUILD_PYTHON)
- add_definitions(-DBOOST_PYTHON_STATIC_LIB)
- endif()
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".so")
set(link_param "-static")
- if (BUILD_PYTHON)
- find_package(ZLIB)
- find_package(EXPAT)
- find_package(Threads)
- endif()
endif()
endif()
@@ -173,54 +165,7 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/common/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/generated/version.h
)
-if (BUILD_PYTHON)
- # Find Boost::Python of a suitable version in a cross-platform way
- # Some distributions (Arch) call it libboost_python3, others such as Ubuntu
- # call it libboost_python35. In the latter case we must consider all minor versions
- # Original source: https://github.com/BVLC/caffe/blob/master/cmake/Dependencies.cmake#L148
- set(version ${PYTHONLIBS_VERSION_STRING})
-
- STRING(REGEX REPLACE "[^0-9]" "" boost_py_version "${version}")
- find_package(Boost QUIET COMPONENTS "python-py${boost_py_version}" ${boost_libs})
- set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND})
-
- while (NOT "${version}" STREQUAL "" AND NOT Boost_PYTHON_FOUND)
- STRING(REGEX REPLACE "([0-9.]+).[0-9]+" "\\1" version "${version}")
-
- STRING(REGEX REPLACE "[^0-9]" "" boost_py_version "${version}")
- find_package(Boost QUIET COMPONENTS "python-py${boost_py_version}" ${boost_libs})
- set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND})
-
- STRING(REGEX MATCHALL "([0-9.]+).[0-9]+" has_more_version "${version}")
- if ("${has_more_version}" STREQUAL "")
- break()
- endif ()
- endwhile ()
-
- if (NOT Boost_PYTHON_FOUND)
- foreach (PyVer 3 36 37 38 39)
- find_package(Boost QUIET COMPONENTS python${PyVer} ${boost_libs})
- if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" )
- set(Boost_PYTHON_FOUND TRUE)
- break()
- endif ()
- endforeach ()
- endif ()
-
- if (NOT Boost_PYTHON_FOUND)
- STRING(REGEX REPLACE "([0-9]+\\.[0-9]+).*" "\\1" gentoo_version "${PYTHONLIBS_VERSION_STRING}")
- find_package(Boost QUIET COMPONENTS python-${gentoo_version} ${boost_libs})
- if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" )
- set(Boost_PYTHON_FOUND TRUE)
- endif ()
- endif ()
-
- if (NOT Boost_PYTHON_FOUND )
- message( FATAL_ERROR "No version of Boost::Python 3.x could be found.")
- endif ()
-endif()
-
-include_directories(common/ json/ frontend/ 3rdparty/json11/ ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
+include_directories(common/ json/ frontend/ 3rdparty/json11/ 3rdparty/pybind11/include ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
if(BUILD_HEAP)
find_package (Eigen3 REQUIRED NO_MODULE)