python: only add python dir if we have the prerequisites
This means we can depend on the directory existing to check if the prerequisites are met in the tests/ section Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
set_source_files_properties (mraapython.i PROPERTIES CPLUSPLUS ON)
|
set_source_files_properties (mraapython.i PROPERTIES CPLUSPLUS ON)
|
||||||
set_source_files_properties (mraapython.i PROPERTIES SWIG_FLAGS "-I${CMAKE_BINARY_DIR}/src")
|
set_source_files_properties (mraapython.i PROPERTIES SWIG_FLAGS "-I${CMAKE_BINARY_DIR}/src")
|
||||||
|
|
||||||
|
if (PYTHON2_LIBRARY)
|
||||||
add_subdirectory (python2)
|
add_subdirectory (python2)
|
||||||
|
endif ()
|
||||||
|
if (PYTHON3_LIBRARY)
|
||||||
add_subdirectory (python3)
|
add_subdirectory (python3)
|
||||||
|
endif ()
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
set_source_files_properties (mraa2.i PROPERTIES CPLUSPLUS ON)
|
set_source_files_properties (mraa2.i PROPERTIES CPLUSPLUS ON)
|
||||||
set_source_files_properties (mraa2.i PROPERTIES SWIG_FLAGS "-I${CMAKE_BINARY_DIR}/src")
|
set_source_files_properties (mraa2.i PROPERTIES SWIG_FLAGS "-I${CMAKE_BINARY_DIR}/src")
|
||||||
|
|
||||||
if (PYTHON2_LIBRARY)
|
|
||||||
message ("PYTHON2 attempting to build!")
|
message ("PYTHON2 attempting to build!")
|
||||||
|
|
||||||
swig_add_module (python2-mraa python mraa2.i ../mraapy.c)
|
swig_add_module (python2-mraa python mraa2.i ../mraapy.c)
|
||||||
@@ -32,6 +31,5 @@ if (PYTHON2_LIBRARY)
|
|||||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/mraa.py
|
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/mraa.py
|
||||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${PYTHON2_PACKAGES_PATH}
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/${PYTHON2_PACKAGES_PATH}
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory (docs)
|
add_subdirectory (docs)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
set_source_files_properties (mraa3.i PROPERTIES CPLUSPLUS ON)
|
set_source_files_properties (mraa3.i PROPERTIES CPLUSPLUS ON)
|
||||||
set_source_files_properties (mraa3.i PROPERTIES SWIG_FLAGS "-I${CMAKE_BINARY_DIR}/src")
|
set_source_files_properties (mraa3.i PROPERTIES SWIG_FLAGS "-I${CMAKE_BINARY_DIR}/src")
|
||||||
|
|
||||||
if (PYTHON3_LIBRARY)
|
|
||||||
message ("PYTHON3 attempting to build!")
|
message ("PYTHON3 attempting to build!")
|
||||||
|
|
||||||
swig_add_module (python3-mraa python mraa3.i ../mraapy.c)
|
swig_add_module (python3-mraa python mraa3.i ../mraapy.c)
|
||||||
@@ -25,4 +24,3 @@ if (PYTHON3_LIBRARY)
|
|||||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/mraa.py
|
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/mraa.py
|
||||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${PYTHON3_PACKAGES_PATH}
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/${PYTHON3_PACKAGES_PATH}
|
||||||
)
|
)
|
||||||
endif ()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user