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 @@ + + + Using AMDiS with cmake + + +

Using AMDiS with cmake

+With this short page, I will show you, how to use the cmake buildsystem with AMDiS. The introduction consists of two main parts: +
  1. compiling and installing AMDiS with CMake
  2. +
  3. using the cmake-installed AMDiS in your project
+ +

Compiling and installing AMDiS with CMake

+

configure

+There are 3 different configure tools for CMake: + + +

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 getamdis_cmake.sh, which can be found on gforge.zih.tu-dresden.de, creates such a directory structure.

+Assume, you have AMDiS downloaded in the directory +

+ /home/joe/work/ +

+, the AMDiS source directory is +

+ /home/joe/work/amdis/AMDiS +

+. To configure and compile AMDiS I recommend to create a directory +

+ /home/joe/work/amdis_build +

+and run +

+ cd /home/joe/work/amdis_build
+ cmake -DCMAKE_INSTALL_PREFIX=/home/joe/programs/ ../amdis/AMDiS +

+ +Compilation and installation is the same as with automake/autoconf: +

+ make ; make install +

+The last command will install AMDiS to /home/joe/programs + +fast and simple configuration +configuration with options +If you only want to build with standard options, you can simply run + cmake . +

Using the cmake-installed AMDiS in your project

+ + 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