From 355995a2173cdeb5c1ec9d54aaf42b61db421b56 Mon Sep 17 00:00:00 2001 From: legrand Date: Tue, 6 Nov 2007 09:42:09 +0000 Subject: [PATCH] deleted wrong stuff git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@758 331e1502-861f-0410-8da2-ba01fb791d7f --- .../mySimpleApplication-1.0/CMakeLists.txt | 72 ---- .../tags/mySimpleApplication-1.0/index.html | 322 ------------------ 2 files changed, 394 deletions(-) delete mode 100644 utilities/tags/mySimpleApplication-1.0/CMakeLists.txt delete mode 100644 utilities/tags/mySimpleApplication-1.0/index.html diff --git a/utilities/tags/mySimpleApplication-1.0/CMakeLists.txt b/utilities/tags/mySimpleApplication-1.0/CMakeLists.txt deleted file mode 100644 index a5e5283f5..000000000 --- a/utilities/tags/mySimpleApplication-1.0/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ - -###################################################################################### -### 0) Include the install configuration file where are defined the main variables -###################################################################################### - -INCLUDE(${CMAKE_SOURCE_DIR}/install.cmake) - -###################################################################################### - - -###################################################################################### -### 1) Set your application properties -###################################################################################### - -# Define your project name -PROJECT(mySimpleApplication) - -###################################################################################### - - -###################################################################################### -### 2) Include the sources -###################################################################################### - -INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src - ${PARADISEO_MO_SRC_DIR}/src - ${PARADISEO_MOEO_SRC_DIR}/src - ${PARADISEO_PEO_SRC_DIR}/src) - -###################################################################################### - - -###################################################################################### -### 3) Specify where CMake can find the libraries -###################################################################################### - -# Link with the EO library directory, only if you need it -LINK_DIRECTORIES(${PARADISEO_EO_BIN_DIR}/lib) - -# Link with the MOEO library directory, only if you need it -LINK_DIRECTORIES(${PARADISEO_MOEO_BIN_DIR}/lib) - -# Link with the PEO library directory, only if you need it -LINK_DIRECTORIES(${PARADISEO_PEO_BIN_DIR}/lib) - -###################################################################################### - - - -###################################################################################### -### 4) Define your target: just an executable here -###################################################################################### - -ADD_EXECUTABLE(mySimpleApplication mySimpleApplication.cpp) - -###################################################################################### - - -###################################################################################### -### 5) Link the librairies for your executable -###################################################################################### - -# Only if you need to link libraries -TARGET_LINK_LIBRARIES(mySimpleApplication eo eoutils) - -###################################################################################### - - - - - - diff --git a/utilities/tags/mySimpleApplication-1.0/index.html b/utilities/tags/mySimpleApplication-1.0/index.html deleted file mode 100644 index 806332e29..000000000 --- a/utilities/tags/mySimpleApplication-1.0/index.html +++ /dev/null @@ -1,322 +0,0 @@ - - - - - - - - Build My Simple Application - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
- -
- -
-

Build a simple application using ParadisEO

-

Introduction

-

There are many steps required to produce a ParadisEO-based program. As ParadisEO is a C++ library, any "main" file containing the basic instructions of your program is expected to be first compiled. The way the program should be compiled depends on the environment. For example on Unix platforms, some "Makefiles" allow an automatic compilation of a C++ source file and the generation of the "makefiles" themselves is achieved by CMake. CMake manages the software compilation process and it can be used with several generators: -

-
  • Visual Studio 8 2005 (Win32 + Win64) projects -
  • Visual Studio 7 .NET 2003 projects -
  • Visual Studio 7 and 6 projects -
  • NMake Makefiles -
  • MinGW Makefiles -
  • Borland Makefiles -
  • KDevelop projects -
  • Unix Makefiles -
  • Xcode Projects -
  • MSYS Makefiles -
  • WMake Makefiles -

A package containing all the required files has been developped for any user who wants to build his own application easily. In this case, we suppose this application to be only made of a "main.cpp" file (no specific components). The content of the package is pre-filled so that a user has just to paste his algorithm in the cpp-file and change one variable. -

-

"mySimpleApplication" package's content

-

The package contains the following files: -

-
  • install.cmake: Contains variables that specify where ParadisEO has been installed. -
  • mySimpleApplication.cpp : A C++ main containing the algorithm -
  • README: Contains basic information -
  • CMakeLists.txt: The only CMake configuration file -
  • index.html: The content of the current web-page -

It can be downloaded from here. -

-

Adapt the package

-

Here, we give the steps to custom the package for any application. -

-

Note: For further help about CMake, see the CMake documentation. -

-


-

-

Step 1 : Develop your algorithm

-
-

You just have to edit the mySimpleApplication.cpp and implement your code. -

-
-
  1. include <iostream> -

/// #include < file > -

-

/// Use functions from namespace std ? -
using namespace std; -

-

int main(int argc, char **argv) -
{ -

	/// Your code ...
-	cout << "I'm a simple application linked with ParadisEO" << endl ;	
-
-    return 1;
-

}' -

-


-

-

Step 2 : Change the ParadisEO-path in "install.cmake"

-
-

When ParadisEO has been configured in the standard way (the global package containing all the modules has been installed), just replace "myDirectory" by the absolute path to ParadisEO the section n°1: -

-
-
SET(PARADISEO_DIR "myDirectory" CACHE PATH "ParadisEO directory" FORCE) -
-

... replaced (for example) by: -

-
-
SET(PARADISEO_DIR "/home/john/paradiseo-ix86-1.0" CACHE PATH "ParadisEO directory" FORCE) -
-

If you have simply installed ParadisEO using the provided install script, go to the next step. -

-

Advanced configuration:
-
If the modules of ParadisEO have been deployed separately, the path to each module (EO, MO, MOEO and PEO) can also be specified. Here's an example for EO, PARADISEO_EO_SRC_DIR refers to the EO sources, PARADISEO_EO_BIN_DIR is the directory where EO has been compiled. -

-
-
SET(PARADISEO_EO_SRC_DIR "${PARADISEO_DIR}/paradiseo-eo" CACHE PATH -
"ParadisEO-EO source directory" FORCE) -
SET(PARADISEO_EO_BIN_DIR "${PARADISEO_DIR/paradiseo-eo/build" CACHE PATH -
"ParadisEO-EO binary directory" FORCE) -
-

A third section is added to automatically set the flags required when using the package under Visual Studio 8. It has no effect for all the other cases. -

-


-

-

Step 3 : Adapt the CMakeLists.txt

-
-
  • Give your project name in the section n°1 : -
-
PROJECT(mySimpleApplication) -
-
  • Specify the source directories to include -
-
INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src -
${PARADISEO_MO_SRC_DIR}/src -
${PARADISEO_MOEO_SRC_DIR}/src -
${PARADISEO_PEO_SRC_DIR}/src) -
-

For example, if you only use ParadisEO-EO sources, just set: -

-
INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src -
-
  • Specify where are the libraries (for the linker) -
-
LINK_DIRECTORIES(${PARADISEO_EO_BIN_DIR}/lib) -
LINK_DIRECTORIES(${PARADISEO_MOEO_BIN_DIR}/lib) -
LINK_DIRECTORIES(${PARADISEO_PEO_BIN_DIR}/lib) -
-

For example, if you only use ParadisEO-EO and ParadisEO-MOEO libraries, just set: -

-
LINK_DIRECTORIES(${PARADISEO_EO_BIN_DIR}/lib) -
LINK_DIRECTORIES(${PARADISEO_MOEO_BIN_DIR}/lib) -
-
  • Define your executable: give the executable name + the name of the cpp file -
-
ADD_EXECUTABLE(mySimpleApplication mySimpleApplication.cpp) -
-

Important: If you change the name of the cpp file "mySimpleApplication.cpp", don't forget to give the right name for the ADD_EXECUTABLE command. -

-
  • Specify the libraries that should be linked to build your executable (for example, for Unix Makefiles, the option used to give the linked libraries is "-L < a path to the lib>") -
-
TARGET_LINK_LIBRARIES(mySimpleApplication lib1 lib2 ...) -
-

An example using the "eo" and "eoutils" of ParadisEO-EO is: -

-
TARGET_LINK_LIBRARIES(mySimpleApplication eo eoutils) -
-

Important: If you change the name of the executable (see a few lines above), don't forget to replace "mySimpleApplication " by the right name in: -

-
-
TARGET_LINK_LIBRARIES(mySimpleApplication eo eoutils) -
-


-

-

Step 4 : Launch the build process and compile

-
-

There are two ways to build and compile your program: -

- Compile it in the source directory, that means where your main cpp file is -
- Compile it somewhere else in order to have on one hand the source files, on the other the rest (makefiles of configuration file, ".o" files, the executable itself). This way is called out-source-build and is highly recommended. -

Moreover, you should know in advance the kind of generator you want CMake to use. -

-

For an "out-source-build", let's suppose your application's source file is located in /home/john/mySimpleApplication and you want to build it in /home/john/mySimpleApplication/build for Visual Studio 8 2005 : -

-

(Note: The "build" directory exists if the archive, we would advise you to build your program in it.) -

-

From /home/john/mySimpleApplication/build, simply run (from a terminal/console) -

-
cmake /home/john/mySimpleApplication -G"Visual Studio 8 2005" -
-

The generic call for CMake is: -

-
cmake <path to the sources> -G"<generator name>" -
-

Then : -

-

- Go in /home/john/mySimpleApplication/build -
- Compile your program using the appropriate tool. Examples: -

--> If you chose the Unix Makefiles generator, enter "make" -
--> If you chose Visual Studio generator, open the generated solution/project and compile -
--> ... -
-


-
For further help and information, feel free to send us an email at paradiseo-help@lists.gforge.inria.fr . -

-
- - - -
-
-
-
- - - - - - -
- - -
- - -