diff --git a/eo/CMakeLists.txt b/eo/CMakeLists.txt index eea4df29..7217df60 100644 --- a/eo/CMakeLists.txt +++ b/eo/CMakeLists.txt @@ -57,7 +57,7 @@ INCLUDE(ConfigureChecks.cmake) INCLUDE(Dart OPTIONNAL) # now create config headers -configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) +CONFIGURE_FILE(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) # Set a special flag if the environment is windows (should do the same in a config.g file) IF (WIN32) @@ -113,7 +113,11 @@ ADD_SUBDIRECTORY(tutorial) ### 6) Install pkg-config config file for EO ###################################################################################### -INSTALL(FILES eo.pc DESTINATION lib/pkgconfig COMPONENT headers) +SET(PCPREFIX "/usr") +SET(PCFLAGS "-leoutils -leo -les -lga -lcma -lgcov") +SET(PCINCLUDEDIR "eo") +CONFIGURE_FILE(pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/eo.pc) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/eo.pc DESTINATION lib/pkgconfig COMPONENT headers) ###################################################################################### diff --git a/eo/build_gcc_linux_tutorial b/eo/build_gcc_linux_tutorial new file mode 100755 index 00000000..f4168fd3 --- /dev/null +++ b/eo/build_gcc_linux_tutorial @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +mkdir release +cd release +cmake -DENABLE_EO_TUTORIAL=1 .. +make +cd .. diff --git a/eo/build_gcc_linux_unittest b/eo/build_gcc_linux_unittest new file mode 100755 index 00000000..36220ba0 --- /dev/null +++ b/eo/build_gcc_linux_unittest @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +mkdir debug +cd debug +cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_CMAKE_TESTING=1 .. +make +cd .. diff --git a/eo/build_vs2008_release.bat b/eo/build_vs2008_release.bat new file mode 100644 index 00000000..13513c14 --- /dev/null +++ b/eo/build_vs2008_release.bat @@ -0,0 +1,5 @@ +mkdir release +cd release +cmake -G "Visual Studio 9 2008" .. +cd .. +pause diff --git a/eo/eo.pc b/eo/eo.pc deleted file mode 100644 index d15d1081..00000000 --- a/eo/eo.pc +++ /dev/null @@ -1,12 +0,0 @@ -# Package Information for pkg-config - -prefix=/usr -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include/eo - -Name: Evolving Object -Description: Evolving Object -Version: 1.02-cvs1 -Libs: -L${libdir} -leoutils -leo -les -lga -lcma -leomoo -lgcov -Cflags: -I${includedir} diff --git a/eo/pc.cmake b/eo/pc.cmake new file mode 100644 index 00000000..ad3c17ef --- /dev/null +++ b/eo/pc.cmake @@ -0,0 +1,6 @@ +# Package Information for pkg-config +Name: @PACKAGE_NAME@ +Description: @PACKAGE_NAME@ +Version: @PROJECT_VERSION@ +Libs: -L@PCPREFIX@/lib @PCFLAGS@ +Cflags: -I@PCPREFIX@/include/@PCINCLUDEDIR@ diff --git a/eo/src/do/make_pop.h b/eo/src/do/make_pop.h index 76242cab..191ab065 100644 --- a/eo/src/do/make_pop.h +++ b/eo/src/do/make_pop.h @@ -57,17 +57,17 @@ template eoPop& do_make_pop(eoParser & _parser, eoState& _state, eoInit & _init) { // random seed - eoValueParam& seedParam = _parser.createParam(uint32_t(0), "seed", "Random number seed", 'S'); + eoValueParam& seedParam = _parser.getORcreateParam(uint32_t(0), "seed", "Random number seed", 'S'); if (seedParam.value() == 0) seedParam.value() = time(0); - eoValueParam& popSize = _parser.createParam(unsigned(20), "popSize", "Population Size", 'P', "Evolution Engine"); + eoValueParam& popSize = _parser.getORcreateParam(unsigned(20), "popSize", "Population Size", 'P', "Evolution Engine"); // Either load or initialize // create an empty pop and let the state handle the memory eoPop& pop = _state.takeOwnership(eoPop()); - eoValueParam& loadNameParam = _parser.createParam(std::string(""), "Load","A save file to restart from",'L', "Persistence" ); - eoValueParam & recomputeFitnessParam = _parser.createParam(false, "recomputeFitness", "Recompute the fitness after re-loading the pop.?", 'r', "Persistence" ); + eoValueParam& loadNameParam = _parser.getORcreateParam(std::string(""), "Load","A save file to restart from",'L', "Persistence" ); + eoValueParam & recomputeFitnessParam = _parser.getORcreateParam(false, "recomputeFitness", "Recompute the fitness after re-loading the pop.?", 'r', "Persistence" ); if (loadNameParam.value() != "") // something to load { diff --git a/eo/src/utils/eoLogger.cpp b/eo/src/utils/eoLogger.cpp index a0aa36e5..a729d0cf 100644 --- a/eo/src/utils/eoLogger.cpp +++ b/eo/src/utils/eoLogger.cpp @@ -26,7 +26,12 @@ Authors: */ +#ifdef _INTERIX +#include +#else // _INTERIX #include +#endif // ! _INTERIX + #include #include #include // used to define EOF diff --git a/eo/test/CMakeLists.txt b/eo/test/CMakeLists.txt index 9bf42f16..8536ee0c 100644 --- a/eo/test/CMakeLists.txt +++ b/eo/test/CMakeLists.txt @@ -66,6 +66,7 @@ SET (TEST_LIST t-eoLogger t-eoIQRStat t-eoDualFitness + t-eoParser ) diff --git a/eo/test/t-eoParser.cpp b/eo/test/t-eoParser.cpp new file mode 100644 index 00000000..1fd6c7fd --- /dev/null +++ b/eo/test/t-eoParser.cpp @@ -0,0 +1,31 @@ +#include +#include + +int main(int ac, char** av) +{ + eoParser parser(ac, av); + + unsigned int alpha1 = parser.createParam(10, "alpha1", "Alpha parameter").value(); + unsigned int alpha2 = parser.createParam(10, "alpha2", "Alpha parameter").value(); + unsigned int alpha3 = parser.createParam(10, "alpha3", "Alpha parameter").value(); + unsigned int alpha4 = parser.createParam(10, "alpha4", "Alpha parameter").value(); + unsigned int alpha5 = parser.createParam(10, "alpha5", "Alpha parameter").value(); + unsigned int alpha6 = parser.createParam(10, "alpha6", "Alpha parameter").value(); + + if (parser.userNeedsHelp()) + { + parser.printHelp(std::cout); + exit(1); + } + + make_help(parser); + + std::cout << "alpha1: " << alpha1 << std::endl; + std::cout << "alpha2: " << alpha2 << std::endl; + std::cout << "alpha3: " << alpha3 << std::endl; + std::cout << "alpha4: " << alpha4 << std::endl; + std::cout << "alpha5: " << alpha5 << std::endl; + std::cout << "alpha6: " << alpha6 << std::endl; + + return 0; +} diff --git a/eo/tutorial/CMakeLists.txt b/eo/tutorial/CMakeLists.txt index 4573f0b4..6462b5a5 100644 --- a/eo/tutorial/CMakeLists.txt +++ b/eo/tutorial/CMakeLists.txt @@ -2,11 +2,15 @@ ### 1) Where must cmake go now ? ###################################################################################### -ADD_SUBDIRECTORY(Lesson1) -ADD_SUBDIRECTORY(Lesson2) -ADD_SUBDIRECTORY(Lesson3) -ADD_SUBDIRECTORY(Lesson4) -ADD_SUBDIRECTORY(Lesson5) -ADD_SUBDIRECTORY(Lesson6) +IF(ENABLE_EO_TUTORIAL) + + ADD_SUBDIRECTORY(Lesson1) + ADD_SUBDIRECTORY(Lesson2) + ADD_SUBDIRECTORY(Lesson3) + ADD_SUBDIRECTORY(Lesson4) + ADD_SUBDIRECTORY(Lesson5) + ADD_SUBDIRECTORY(Lesson6) + +ENDIF() ######################################################################################