Cmake multiplattform buildfile
This commit is contained in:
parent
cf2310ff62
commit
a6d670243d
1 changed files with 38 additions and 29 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# pyEO - cmake version
|
# PyEO - cmake version
|
||||||
#
|
#
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
|
@ -10,15 +10,23 @@
|
||||||
#
|
#
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# prog: max rheiner;max.rheiner@zhdk.ch
|
# prog: max rheiner;xohm@users.sourceforge.net
|
||||||
# date: 7/27/2007 (m/d/y)
|
# date: 7/27/2007 (m/d/y)
|
||||||
#
|
#
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
PROJECT(pyEO)
|
# change this to your local boost-path
|
||||||
|
SET(BOOST_PATH "C:/development/libs/os/boost/boost_1_33_1")
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
PROJECT(PyEO)
|
||||||
|
|
||||||
# python
|
# python
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
|
|
||||||
|
# python
|
||||||
# osx can have several version of python, on dif places
|
# osx can have several version of python, on dif places
|
||||||
# SET(PYTHON /Library/Frameworks/Python.framework/Versions/)
|
# SET(PYTHON /Library/Frameworks/Python.framework/Versions/)
|
||||||
# SET(PYTHON_VERSION 2.4)
|
# SET(PYTHON_VERSION 2.4)
|
||||||
|
|
@ -26,57 +34,58 @@ IF(APPLE)
|
||||||
# SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
|
# SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
|
||||||
# SET(PYTHON_LIBRARIES ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
|
# SET(PYTHON_LIBRARIES ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
|
||||||
# SET(PYTHON_DEBUG_LIBRARIES ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
|
# SET(PYTHON_DEBUG_LIBRARIES ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
|
||||||
|
|
||||||
FIND_PACKAGE(PythonLibs)
|
FIND_PACKAGE(PythonLibs)
|
||||||
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
|
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
|
||||||
|
|
||||||
|
# boost
|
||||||
|
SET(BOOST_INC ${BOOST_PATH})
|
||||||
|
INCLUDE_DIRECTORIES(${BOOST_INC})
|
||||||
|
SET(BOOST_LIBRARY ${BOOST_PATH}/libs/python/build/bin-stage/)
|
||||||
|
SET(BOOSTPYTHON_LIBRARY ${BOOST_LIBRARY}/boost_python)
|
||||||
|
|
||||||
|
# osx internal
|
||||||
|
find_library(APPLE_CARBON Carbon)
|
||||||
|
|
||||||
ELSE(APPLE)
|
ELSE(APPLE)
|
||||||
|
# windows/unix
|
||||||
|
|
||||||
|
# python
|
||||||
FIND_PACKAGE(PythonLibs)
|
FIND_PACKAGE(PythonLibs)
|
||||||
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
|
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
|
||||||
ENDIF(APPLE)
|
|
||||||
|
|
||||||
# boost
|
# boost
|
||||||
SET(BOOST_PATH "C:/development/libs/os/boost/boost_1_33_1")
|
SET(BOOST_INC ${BOOST_PATH})
|
||||||
SET(BOOST_INC ${BOOST_PATH})
|
INCLUDE_DIRECTORIES(${BOOST_INC})
|
||||||
INCLUDE_DIRECTORIES(${BOOST_INC})
|
SET(BOOST_LIBRARY ${BOOST_PATH}/libs/python/build/bin-stage/)
|
||||||
SET(BOOST_LIBRARY ${BOOST_PATH}/libs/python/build/bin-stage/)
|
SET(BOOSTPYTHON_LIBRARY ${BOOST_LIBRARY}/boost_python)
|
||||||
SET(BOOSTPYTHON_LIBRARY ${BOOST_LIBRARY}/boost_python)
|
|
||||||
|
|
||||||
|
|
||||||
# mac specific libs, carbon
|
|
||||||
IF(APPLE)
|
|
||||||
find_library(APPLE_CARBON Carbon)
|
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
|
|
||||||
# includes
|
# includes
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
INCLUDE_DIRECTORIES(../src)
|
INCLUDE_DIRECTORIES(../)
|
||||||
|
|
||||||
# source
|
# source
|
||||||
SET(SrcDir "./")
|
|
||||||
SET(PYEO_SRCS
|
SET(PYEO_SRCS
|
||||||
../src/eoFunctorStore.cpp
|
../eoFunctorStore.cpp
|
||||||
PyEO.cpp abstract1.cpp algos.cpp random_numbers.cpp geneticOps.cpp selectOne.cpp continuators.cpp
|
PyEO.cpp abstract1.cpp algos.cpp random_numbers.cpp geneticOps.cpp selectOne.cpp continuators.cpp
|
||||||
reduce.cpp replacement.cpp selectors.cpp breeders.cpp mergers.cpp valueParam.cpp
|
reduce.cpp replacement.cpp selectors.cpp breeders.cpp mergers.cpp valueParam.cpp
|
||||||
perf2worth.cpp monitors.cpp statistics.cpp
|
perf2worth.cpp monitors.cpp statistics.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
#flags
|
|
||||||
ADD_DEFINITIONS(-DHAVE_SSTREAM)
|
|
||||||
|
|
||||||
# shared library
|
# shared library
|
||||||
ADD_LIBRARY(pyEO MODULE ${PYEO_SRCS})
|
ADD_LIBRARY(PyEO MODULE ${PYEO_SRCS})
|
||||||
|
|
||||||
# python 2.5 must have pyd
|
# python 2.5 must have pyd
|
||||||
IF(WIN32 AND NOT CYGWIN)
|
IF(WIN32 AND NOT CYGWIN)
|
||||||
SET_TARGET_PROPERTIES(pyEO PROPERTIES SUFFIX ".pyd")
|
SET_TARGET_PROPERTIES(PyEO PROPERTIES SUFFIX ".pyd")
|
||||||
ENDIF(WIN32 AND NOT CYGWIN)
|
ENDIF(WIN32 AND NOT CYGWIN)
|
||||||
|
|
||||||
# add the libs
|
# add the libs
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
target_link_libraries(pyEO ${APPLE_CARBON} ${PYTHON_LIBRARY} ${BOOSTPYTHON_LIBRARY} )
|
target_link_libraries(PyEO ${APPLE_CARBON} ${PYTHON_LIBRARY} ${BOOSTPYTHON_LIBRARY} )
|
||||||
else(APPLE)
|
else(APPLE)
|
||||||
target_link_libraries(pyEO ${PYTHON_LIBRARY} ${BOOSTPYTHON_LIBRARY} )
|
target_link_libraries(PyEO ${PYTHON_LIBRARY} ${BOOSTPYTHON_LIBRARY} )
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue