[Paradiseo-help] CMakeList.txt example

Olivier Ricou ricou at lrde.epita.fr
Mar 1 Sep 17:22:22 CEST 2009


Hi,

I downloaded Paradiseo and succeded to compile PEO tutorials (with
few modification in CMakeFiles/xxx/link.txt to use static libs).

Now I would like to have an standalone CMakeList.txt file to compile
one lesson so I can use it to compile my project. I tried but without
success. The CMake part runs but not the generated Makefile:

[hermes] % make
Scanning dependencies of target island
[100%] Building CXX object CMakeFiles/island.dir/main.cpp.o
Linking CXX executable island
/opt/paradiseo/paradiseo-peo/build/lib/librmc_mpi.a(worker.cpp.o): In
function `Worker::unpackData()':
/opt/paradiseo/paradiseo-peo/src/rmc/mpi/worker.cpp:81: undefined
reference to `getService(unsigned int)'
/opt/paradiseo/paradiseo-peo/build/lib/librmc_mpi.a(send.cpp.o): In
function `sendMessages()':
....

I wonder if my librmc_mpi.a is ok or if I forget a library in my
CMakeList.txt file.

I join my CMakeList.txt. If you can correct it, I will appreciate.
If you can provide a independant CMakeList.txt for Lesson5 in PEO,
I could use it.

TIA,

Olivier.

ps: BTW, when I run PEO tutorials, they ends with error 1 however the
    runs seem ok.
-------------- section suivante --------------
project(MyProject)

cmake_minimum_required(VERSION 2.6)

SET (CMAKE_CXX_COMPILER mpicxx)

SET(EO_SRC_DIR "/opt/paradiseo/paradiseo-eo" CACHE PATH "ParadisEO-EO source directory" FORCE)
SET(EO_BIN_DIR "/opt/paradiseo/paradiseo-eo/build" CACHE PATH "ParadisEO-EO binary directory" FORCE)

SET(MO_SRC_DIR "/opt/paradiseo/paradiseo-mo" CACHE PATH "ParadisMO-MO source directory" FORCE)
SET(MO_BIN_DIR "/opt/paradiseo/paradiseo-mo/build" CACHE PATH "ParadisMO-MO binary directory" FORCE)

SET(MOEO_SRC_DIR "/opt/paradiseo/paradiseo-moeo" CACHE PATH "ParadisMOEO-MOEO source directory" FORCE)
SET(MOEO_BIN_DIR "/opt/paradiseo/paradiseo-moeo/build" CACHE PATH "ParadisMOEO-MOEO binary directory" FORCE)

SET(ParadisEO-PEO_SOURCE_DIR "/opt/paradiseo/paradiseo-peo" CACHE PATH "ParadisEO-PEO source directory" FORCE)
SET(ParadisEO-PEO_BINARY_DIR "/opt/paradiseo/paradiseo-peo/build" CACHE PATH "ParadisEO-PEO binary directory" FORCE)

#--- check libxml2
FIND_PROGRAM(XML2_CONFIG_PROGRAM NAMES xml2-config  PATHS /usr/local/bin /usr/bin  DOC "The libxml2 (www.xmlsoft.org) configuration tool")
# set libxml2 cflags in XML2_CFLAGS
EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --cflags  OUTPUT_VARIABLE XML2_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
# set libxml2 libs in XML2_LIBSINCLUDE(FindLibXml2)
EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --libs  OUTPUT_VARIABLE XML2_LIBS)

IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
  STRING(STRIP ${XML2_LIBS} XML2_LIBS)
ELSEIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
  STRING(REGEX REPLACE "^ " "" XML2_LIBS ${XML2_LIBS})
  STRING(REGEX REPLACE "( +)$" "" XML2_LIBS ${XML2_LIBS})
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
#--- end libxml2 part

ADD_CUSTOM_TARGET(install DEPENDS param schema.xml)


INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src ${MOEO_SRC_DIR}/src ${MO_SRC_DIR}/src ${ParadisEO-PEO_SOURCE_DIR}/src)

LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib)

ADD_EXECUTABLE(island main.cpp)

SET(PEO_VERSION 0.1)
SET_TARGET_PROPERTIES(island PROPERTIES VERSION "${PEO_VERSION}")

TARGET_LINK_LIBRARIES(island /opt/paradiseo/paradiseo-eo/build/lib/libeo.a
                             /opt/paradiseo/paradiseo-eo/build/lib/libeoutils.a
                             /opt/paradiseo/paradiseo-eo/build/lib/libga.a
                             /opt/paradiseo/paradiseo-eo/build/lib/libes.a
                             ${XML2_LIBS}
                             /opt/paradiseo/paradiseo-peo/build/lib/libpeo.a
                             /opt/paradiseo/paradiseo-peo/build/lib/librmc_mpi.a )
-------------- section suivante --------------
Une pièce jointe autre que texte a été nettoyée...
Nom: signature.asc
Type: application/pgp-signature
Taille: 197 octets
Desc: Digital signature
URL: <http://lists.gforge.inria.fr/pipermail/paradiseo-help/attachments/20090901/aced331e/attachment.sig>


Plus d'informations sur la liste de diffusion Paradiseo-help