From b3451ed2e473f7308f6cec6b0f9f058183e4aaba Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 7 Jan 2016 11:31:10 +0100 Subject: [PATCH] install boost lib and headers in windows --- CMakeLists.txt | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35531455..b84b707b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,20 +190,25 @@ if (USE_PYTHON) find_package(PythonLibs ${PYTHON_VERSION} EXACT REQUIRED) endif( PYTHON_VERSION STREQUAL "3") set(Boost_FIND_QUIETLY ON) - if(NOT Boost_LIBRARIES) - find_package(Boost COMPONENTS python${PYTHON_VERSION_MAJOR}) - endif(NOT Boost_LIBRARIES) - if(NOT Boost_LIBRARIES) - find_package(Boost COMPONENTS python-py${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}) - endif(NOT Boost_LIBRARIES) - if(NOT Boost_LIBRARIES) - find_package(Boost COMPONENTS python) - endif(NOT Boost_LIBRARIES) + + foreach( component IN ITEMS PYTHON${PYTHON_VERSION_MAJOR} PYTHON-PY${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} PYTHON) + if(NOT Boost_LIBRARIES) + find_package(Boost COMPONENTS ${component}) + set(BOOST_PYTHON_LIB ${Boost_${component}_LIBRARY_RELEASE}) + endif(NOT Boost_LIBRARIES) + endforeach() + if(NOT Boost_LIBRARIES) message(FATAL_ERROR "Could NOT find Boost-Python" ) + else(NOT Boost_LIBRARIES) + message("-- Found Boost_python: ${BOOST_PYTHON_LIB}") endif(NOT Boost_LIBRARIES) add_definitions(-DNG_PYTHON) + if(WIN32) + install(FILES ${BOOST_PYTHON_LIB} DESTINATION lib COMPONENT netgen) + install(DIRECTORY ${Boost_INCLUDE_DIR}/boost DESTINATION include COMPONENT netgen) + endif(WIN32) if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") # fix problems with boosts config/auto_link.hpp