Permalink
Browse files

Can make python example from configure

  • Loading branch information...
1 parent afafe7d commit 847bda64b4e7c6910517e2a48a2f2743d2a1e384 @pjotrp committed Mar 28, 2009
View
8 CMakeLists.txt
@@ -105,6 +105,14 @@ if (RQTL_LIB)
set(BLD_BIOLIB FALSE)
endif (RQTL_LIB)
+if (EXAMPLE_LIB)
+ set(BLD_RQTL FALSE)
+ set(BLD_STADEN FALSE)
+ set(BLD_AFFYIO FALSE)
+ set(BLD_EXAMPLE TRUE)
+ set(BLD_BIOLIB FALSE)
+endif (EXAMPLE_LIB)
+
message(" Biolib libraries")
message(STATUS "Install Affyio ${BLD_AFFYIO}")
message(STATUS "Install Staden ${BLD_STADEN}")
View
6 cmake_modules/FindPythonLibs.cmake
@@ -71,12 +71,8 @@ IF(PYTHON_EXECUTABLE)
NAMES Python.h
PATHS ${PYTHON_INC_DIR}
)
-
- FIND_LIBRARY(PYTHON_LIBRARY
- NAMES python python2.5 python2.4 python2.3 python2.2
- PATHS ${PYTHON_POSSIBLE_LIB_PATH}
- )
+ SET(PYTHON_LIB_PATH ${PYTHON_POSSIBLE_LIB_PATH})
IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_PATH)
SET(PYTHON_FOUND TRUE)
ENDIF(PYTHON_LIBRARY AND PYTHON_INCLUDE_PATH)
View
5 configure
@@ -14,6 +14,7 @@
# --with-staden : see the BioLib docs
# --with-affyio
# --with-rqtl
+# --with-example
#
if [ ! -d ./src ]; then
@@ -67,6 +68,10 @@ case $library in
plib="-DRQTL_LIB:BOOLEAN=TRUE"
shift
;;
+ '--with-example')
+ plib="-DEXAMPLE_LIB:BOOLEAN=TRUE"
+ shift
+ ;;
*)
echo "BioLib building all libraries"
plib=""
View
16 src/mappings/swig/python/example/CMakeLists.txt
@@ -12,22 +12,26 @@ IF(NOT BUILD_LIBS)
SET (CMAKE_MODULE_PATH ../../../../../cmake_modules)
ENDIF(NOT BUILD_LIBS)
-# SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY biolib)
+SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY biolib)
FIND_PACKAGE(BioLibPython REQUIRED)
ADD_CUSTOM_COMMAND(
- TARGET ${M_MODULE}
+ TARGET _${M_MODULE}
POST_BUILD
+ COMMAND touch biolib/__init__.py
COMMAND ${CMAKE_COMMAND} -E copy ${M_NAME}.py biolib/${M_NAME}.py
+ COMMAND python -m compileall biolib/
)
ADD_TEST(TestPythonExample ${PYTHON_EXECUTABLE} ./../test/test_${M_NAME}.py)
-# INSTALL(TARGETS _${M_MODULE}
-# LIBRARY DESTINATION ${PYTHON_LIB_PATH}
-# )
+message(${PYTHON_LIB_PATH})
+INSTALL(TARGETS _${M_MODULE}
+ LIBRARY DESTINATION ${PYTHON_LIB_PATH}
+)
-# INSTALL(FILES ${M_MODULE}.pyc DESTINATION ${PYTHON_LIB_PATH}/biolib )
+INSTALL(FILES biolib/${M_MODULE}.pyc DESTINATION ${PYTHON_LIB_PATH}/biolib )
+INSTALL(FILES biolib/__init__.pyc DESTINATION ${PYTHON_LIB_PATH}/biolib )
View
2 src/mappings/swig/python/test/test_example.py
@@ -4,7 +4,7 @@
sys.path += ['../example']
print sys.path
-import example
+import biolib.example as example
result = example.my_mod(7,3)
print result

0 comments on commit 847bda6

Please sign in to comment.