* pyeo cmake config file

This commit is contained in:
Caner Candan 2011-05-05 11:47:30 +02:00
commit 8bec56f469

View file

@ -3,98 +3,73 @@
# PyEO - cmake version # PyEO - cmake version
# #
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# #
# Hochschule fuer Gestaltung und Kunst Zuerich # Hochschule fuer Gestaltung und Kunst Zuerich
# Studienberreich Interaction Design # Studienberreich Interaction Design
# http://interaction.hgkz.ch # http://interaction.hgkz.ch
# #
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# #
# prog: max rheiner;xohm@users.sourceforge.net # prog: max rheiner;xohm@users.sourceforge.net
# date: 7/27/2007 (m/d/y) # date: 7/27/2007 (m/d/y)
# #
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# change this to your local boost-path
# SET(BOOST_PATH "C:/development/libs/os/boost/boost_1_33_1")
# ----------------------------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(PyEO) PROJECT(PyEO)
FIND_PACKAGE(Boost 1.42 COMPONENTS program_options python) FIND_PACKAGE(Boost 1.42 COMPONENTS program_options python)
FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
# python # python
IF(APPLE) IF(APPLE)
# osx internal
# python FIND_LIBRARY(APPLE_CARBON Carbon)
# osx can have several version of python, on dif places
# SET(PYTHON /Library/Frameworks/Python.framework/Versions/)
# SET(PYTHON_VERSION 2.4)
# SET(PYTHON_INCLUDE_PATH "${PYTHON}${PYTHON_VERSION}/include/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_DEBUG_LIBRARIES ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
FIND_PACKAGE(PythonLibs)
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)
# windows/unix
# python
FIND_PACKAGE(PythonLibs)
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)
ENDIF(APPLE) ENDIF(APPLE)
# includes # includes
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(../) INCLUDE_DIRECTORIES(../)
# source # source
SET(PYEO_SRCS SET(PYEO_SRCS
../eoFunctorStore.cpp ../eoFunctorStore.cpp
PyEO.cpp abstract1.cpp algos.cpp random_numbers.cpp geneticOps.cpp selectOne.cpp continuators.cpp PyEO.cpp
reduce.cpp replacement.cpp selectors.cpp breeders.cpp mergers.cpp valueParam.cpp abstract1.cpp
perf2worth.cpp monitors.cpp statistics.cpp algos.cpp
) random_numbers.cpp
geneticOps.cpp
selectOne.cpp
continuators.cpp
reduce.cpp
replacement.cpp
selectors.cpp
breeders.cpp
mergers.cpp
valueParam.cpp
perf2worth.cpp
monitors.cpp
statistics.cpp
)
# 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} ${Boost_LIBRARIES} TARGET_LINK_LIBRARIES(PyEO ${APPLE_CARBON} ${PYTHON_LIBRARY} ${Boost_LIBRARIES})
#${BOOSTPYTHON_LIBRARY} ELSE(APPLE)
) TARGET_LINK_LIBRARIES(PyEO ${PYTHON_LIBRARY} ${Boost_LIBRARIES})
else(APPLE) ENDIF(APPLE)
target_link_libraries(PyEO ${PYTHON_LIBRARY} ${Boost_LIBRARIES}
#${BOOSTPYTHON_LIBRARY}
)
endif(APPLE)