* ./vlsisapd:

- Change: New cmake to find the python site packages directory. Install
        python modules in that library.
This commit is contained in:
Jean-Paul Chaput 2010-05-22 22:22:54 +00:00
parent 7745f1a8fb
commit f64001a35d
4 changed files with 42 additions and 3 deletions

View File

@ -2,9 +2,10 @@ PROJECT(VLSISAPD)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0) CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0)
LIST(INSERT CMAKE_MODULE_PATH 0 "${VLSISAPD_SOURCE_DIR}/cmake/Modules/") LIST(INSERT CMAKE_MODULE_PATH 0 "${VLSISAPD_SOURCE_DIR}/cmake_modules")
FIND_PACKAGE(LibXml2 REQUIRED) FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PythonSitePackages REQUIRED)
ADD_SUBDIRECTORY(agds) ADD_SUBDIRECTORY(agds)
ADD_SUBDIRECTORY(cif) ADD_SUBDIRECTORY(cif)

View File

@ -1 +1,2 @@
install(FILES FindVLSISAPD.cmake DESTINATION share/cmake/Modules) install(FILES FindVLSISAPD.cmake
FindPythonSitePackages.cmake DESTINATION share/cmake/Modules)

View File

@ -0,0 +1,37 @@
if ( UNIX )
execute_process ( COMMAND python
-c
"
import os.path
import distutils.sysconfig
pathes = distutils.sysconfig.get_python_lib().split('/')
print os.path.join ( pathes[-2], pathes[-1] )
"
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE RCODE)
if ( RCODE EQUAL 0 )
set ( FindPythonSitePackages_FOUND TRUE )
else ( RCODE EQUAL 0 )
set ( FindPythonSitePackages_FOUND FALSE )
endif ( RCODE EQUAL 0 )
set ( PYTHON_SITE_PACKAGES "lib${LIB_SUFFIX}/${PYTHON_SITE_PACKAGES}"
CACHE STRING "Python site packages directory." FORCE )
mark_as_advanced ( PYTHON_SITE_PACKAGES )
if ( FindPythonSitePackages_FOUND )
if ( NOT FindPythonSitePackages_FIND_QUIETLY )
if ( FindPythonSitePackages_FOUND )
message ( STATUS "Found FindPythonSitePackages : ${PYTHON_SITE_PACKAGES}" )
endif ( FindPythonSitePackages_FOUND )
endif ( NOT FindPythonSitePackages_FIND_QUIETLY )
else ( FindPythonSitePackages_FOUND )
#if ( FindPythonSitePackages_FIND_REQUIRED )
message ( FATAL_ERROR "Python site packages directory was not found (pythonV.R/site-packages/)." )
#endif ( FindPythonSitePackages_FIND_REQUIRED )
endif ( FindPythonSitePackages_FOUND )
endif ( UNIX )

View File

@ -30,7 +30,7 @@ SET_TARGET_PROPERTIES(pyDTR PROPERTIES
PREFIX "" PREFIX ""
) )
TARGET_LINK_LIBRARIES(pyDTR dtr ${LIBXML2_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) TARGET_LINK_LIBRARIES(pyDTR dtr ${LIBXML2_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
INSTALL(TARGETS pyDTR DESTINATION lib${LIB_SUFFIX}/python) INSTALL(TARGETS pyDTR DESTINATION ${PYTHON_SITE_PACKAGES})
ENDIF(Boost_FOUND) ENDIF(Boost_FOUND)
INSTALL(FILES ${hpps} DESTINATION include/vlsisapd/dtr) INSTALL(FILES ${hpps} DESTINATION include/vlsisapd/dtr)