* ./vlsisapd:
- Change: New cmake to find the python site packages directory. Install python modules in that library.
This commit is contained in:
parent
7745f1a8fb
commit
f64001a35d
|
@ -2,9 +2,10 @@ PROJECT(VLSISAPD)
|
|||
|
||||
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(PythonSitePackages REQUIRED)
|
||||
|
||||
ADD_SUBDIRECTORY(agds)
|
||||
ADD_SUBDIRECTORY(cif)
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
install(FILES FindVLSISAPD.cmake DESTINATION share/cmake/Modules)
|
||||
install(FILES FindVLSISAPD.cmake
|
||||
FindPythonSitePackages.cmake DESTINATION share/cmake/Modules)
|
||||
|
|
|
@ -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 )
|
|
@ -30,7 +30,7 @@ SET_TARGET_PROPERTIES(pyDTR PROPERTIES
|
|||
PREFIX ""
|
||||
)
|
||||
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)
|
||||
|
||||
INSTALL(FILES ${hpps} DESTINATION include/vlsisapd/dtr)
|
||||
|
|
Loading…
Reference in New Issue