diff --git a/AMDiS/CMakeLists.txt b/AMDiS/CMakeLists.txt index 7f3fd02e8eda44a5380a3db9cffc86c57f2f2240..2ef0320061970728ed4b5ccd96b12918ca350a11 100644 --- a/AMDiS/CMakeLists.txt +++ b/AMDiS/CMakeLists.txt @@ -276,6 +276,7 @@ if(ENABLE_MARMOT) Message("please set marmotcc manually") endif(ENABLE_MARMOT) +#dont change this destination. the GUI depends on it to guess the buildsystem list(APPEND deb_add_dirs "lib/amdis") install(TARGETS amdis compositeFEM LIBRARY DESTINATION lib/amdis/ ) diff --git a/AMDiS/HOWTO_cmake.html b/AMDiS/HOWTO_cmake.html new file mode 100644 index 0000000000000000000000000000000000000000..1e91dcc305bafd90ff0ae597724de12deca8bfee --- /dev/null +++ b/AMDiS/HOWTO_cmake.html @@ -0,0 +1,49 @@ +<html> +<head> +<title> Using AMDiS with cmake </title> +</head> +<body> +<h1> Using AMDiS with cmake </h1> +With this short page, I will show you, how to use the cmake buildsystem with AMDiS. The introduction consists of two main parts: +<ol> <li>compiling and installing AMDiS with CMake </li> +<li> using the cmake-installed AMDiS in your project </li></ol> + +<h2> Compiling and installing AMDiS with CMake </h2> +<h3> configure </h3> +There are 3 different configure tools for CMake: +<ul> <li> cmake (non interactive) </li> +<li> ccmake (interactive on command line) </li> +<li> cmake-gui (qt-based gui) </li></ul> + +<p>I will use the cmake and ccmake. The autoconf/automake implementation was used directly inside the AMDiS source directory (i.e. the directory you get through svn). To use the CMake buildsystem, I recommend a different directory structure for building and compiling AMDiS. The script <a href="https://gforge.zih.tu-dresden.de/frs/download.php/34/getamdis_cmake.sh" >getamdis_cmake.sh</a>, which can be found on <ah ref="https://gforge.zih.tu-dresden.de" >gforge.zih.tu-dresden.de</a>, creates such a directory structure.</p> +Assume, you have AMDiS downloaded in the directory +<p align="center"> + /home/joe/work/ + </p> +, the AMDiS source directory is +<p align="center"> + /home/joe/work/amdis/AMDiS + </p> +. To configure and compile AMDiS I recommend to create a directory +<p align="center"> + /home/joe/work/amdis_build + </p> +and run +<p align="center"> + cd /home/joe/work/amdis_build<br> + cmake -DCMAKE_INSTALL_PREFIX=/home/joe/programs/ ../amdis/AMDiS + </p> + +Compilation and installation is the same as with automake/autoconf: +<p align="center"> + make ; make install + </p> +The last command will install AMDiS to /home/joe/programs + +<a href="#config_fast_and_simple" >fast and simple configuration </a> +<a href="#config_with_options" >configuration with options </a> +If you only want to build with standard options, you can simply run + <verbatim> cmake . </verbatim> +<h2> Using the cmake-installed AMDiS in your project </h2> +</body> +</html> diff --git a/AMDiS/getamdis_cmake.sh b/AMDiS/getamdis_cmake.sh new file mode 100755 index 0000000000000000000000000000000000000000..749f3c7d0b3ef415591944a07c1469d461ec67f0 --- /dev/null +++ b/AMDiS/getamdis_cmake.sh @@ -0,0 +1,53 @@ +if test -e ./AMDiS ; then + echo "there is already an AMDiS directory. I will abort. " + exit 1 +fi + +ERROR="" +DOWNLOAD="OK" +svn --username studentiwr co https://gforge.zih.tu-dresden.de/svn/amdis/trunk amdis +if test $? -ne 0 ; then + DOWNLOAD="NOT OK" + ERROR="DOWNLOAD" +fi +if test "$1" ; then + prefix="$1" +else + prefix=$(pwd)/amdis_installed +fi +echo "prefix: ${prefix}" +if test ! -d ${prefix} ; then + mkdir --parents ${prefix} +fi +if test ! -d amdis_build ; then + mkdir amdis_build +fi +cd amdis_build +CONFIGURING="OK" +cmake -DCMAKE_INSTALL_PREFIX=${prefix} ../AMDiS +if test $? -ne 0; then + CONFIGURING="NOT OK" + ERROR="${ERROR} CONFIGURE" +fi +COMPILE="OK" +make +if test $? -ne 0; then + COMPILE="NOT OK" + ERROR="${ERROR} COMPILE" +fi +INSTALLING="OK" +make install +if test $? -ne 0; then + INSTALLING="NOT OK" + ERROR="${ERROR} INSTALL" +fi +if test -z "${ERROR}"; then + echo "amdis was successfully downloaded, configured and installed to ${prefix}" + echo "you can use this installation in cmake with the AMDiS_DIR ${prefix}/share/amdis" +else + echo "something went wrong: " + echo "download: ${DOWNLOAD}" + echo "configure: ${CONFIGURING}" + echo "compile: ${COMPILE}" + echo "install: ${INSTALLING}" +fi