Fixed dependency on HERMES_COMMON
authorIvo Hanak <hanak@byte.cz>
Thu, 27 May 2010 18:16:27 +0000 (11:16 -0700)
committerIvo Hanak <hanak@byte.cz>
Thu, 27 May 2010 18:24:44 +0000 (11:24 -0700)
 - added a script cmake/FindHERMES_COMMON.cmake
 - fixed use of the enum BCType
 - updated README file

CMakeLists.txt
README
cmake/FindHERMES_COMMON.cmake [new file with mode: 0644]
src/CMakeLists.txt
src/himg.cpp

index 5b30bf9..d83cbdb 100644 (file)
@@ -24,6 +24,7 @@ endif(EXISTS ${PROJECT_SOURCE_DIR}/CMake.vars)
 # end of configuration section
 #---------------------------------------------------------
 
+find_package(HERMES_COMMON REQUIRED)
 find_package(HERMES2D REQUIRED)
 find_package(UMFPACK REQUIRED)
 find_package(LIBPNG REQUIRED)
diff --git a/README b/README
index eecf985..4cb0c32 100644 (file)
--- a/README
+++ b/README
@@ -16,6 +16,7 @@ Installation Instructions (Linux/*nix)
        - ``HERMES2D_ROOT``: A path to a folder containing an installed library Hermes2D. Use if the library Hermes2D is installed in a specific folder. The system assumes a sub-folder ``include``, which contains header files, and a sub-folder ``lib``, which contains library files. Ignore, otherwise.
        - ``HERMES2D_SOURCE_ROOT``: A path to a folder containing source code (including header files) of the library Hermes2D. This variable can be ignored if the variable ``HERMES2D_ROOT`` is used.
        - ``HERMES2D_LIBRARY_ROOT``: A path to a folder containing library files of the library Hermes2D. If not installed, the path is equal to ``HERMES2D_SOURCE_ROOT``, i.e., use ``set(HERMES2D_LIBRARY_ROOT ${HERMES2D_SOURCE_ROOT})``. This variable can be ignored if the variable ``HERMES2D_ROOT`` is used.
+       - ``HERMES_COMMON_ROOT``: A path to a folder containing the library Hermes_common. Usually, it is a sub-folder of the library Hermes2D.
        
  4. Run CMAKE: ``cmake .``
  5. Compile using MAKE: ``make``
@@ -40,6 +41,7 @@ Installation Instructions (MSVC)
        - ``HERMES2D_ROOT``: A path to a folder containing an installed library Hermes2D. Use if the library Hermes2D is installed in a specific folder. The system assumes a sub-folder ``include``, which contains header files, and a sub-folder ``lib``, which contains library files.
        - ``HERMES2D_SOURCE_ROOT``: A path to a folder containing a source code (including header files) of the library Hermes2D. Not necessary if the library was installed and it is accessible either at a standard path or at a path defined by the variable ``HERMES2D_ROOT``. Nevertheless, it is more comfortable to set this variable to a src/ folder of the library Hermes2D rather than installing the library.
        - ``HERMES2D_LIBRARY_ROOT``: A path to a folder containing library files (i.e. .lib) of the library Hermes2D. Set it to the folder in which the files .LIB are generated, e.g., use ``set(HERMES2D_LIBRARY_ROOT "my_hermes2d_root/src/Debug")``.
+       - ``HERMES_COMMON_ROOT``: A path to a folder containing the library Hermes_common. Usually, it is a sub-folder of the library Hermes2D.
        - ``UMFPACK_ROOT``: Use ``set(UMFPACK_ROOT ${DEP_ROOT})``.
        - ``AMD_ROOT``: Use ``set(AMD_ROOT ${DEP_ROOT})``.
        - ``LIBPNG_ROOT``: Use ``set(LIBPNG_ROOT ${DEP_ROOT})``. If the library libpng was installed elsewhere, use an appropriate path. The script assumes that the path contains a sub-folder 'include' and a sub-folder 'lib'.
diff --git a/cmake/FindHERMES_COMMON.cmake b/cmake/FindHERMES_COMMON.cmake
new file mode 100644 (file)
index 0000000..ae62366
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# HERMES_COMMON
+#
+
+set(PYTHON_SUBDIR python2.6)
+
+FIND_PATH(PYTHON_INCLUDE_DIR Python.h /usr/include/${PYTHON_SUBDIR} /usr/local/include/${PYTHON_SUBDIR})
+FIND_PATH(HERMES_COMMON_INCLUDE_DIR _hermes_common_api.h ${HERMES_COMMON_ROOT} ${HERMES2D_ROOT}/include /usr/include /usr/local/include)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(HERMES_COMMON DEFAULT_MSG HERMES_COMMON_INCLUDE_DIR PYTHON_INCLUDE_DIR)
+
index 57d5594..60febac 100644 (file)
@@ -14,7 +14,8 @@ add_executable(${PROJECT_NAME} ${SRC})
 
 # include directories
 include_directories(${UMFPACK_INCLUDE_DIR} ${AMD_INCLUDE_DIR})
-include_directories(${HERMES2D_INCLUDE_DIR})
+include_directories(${HERMES2D_INCLUDE_DIR} ${HERMES_COMMON_INCLUDE_DIR}
+${PYTHON_INCLUDE_DIR})
 include_directories(${LIBPNG_INCLUDE_DIR})
 
 # linking
index 5887c84..a4d96d8 100644 (file)
@@ -30,7 +30,7 @@ double get_image_sample(double x, double y, double &dx, double &dy)
 }
 
 /***** Boundary conditions for Hermes *****/
-int bc_mesh_1(int marker) {
+BCType bc_mesh_1(int marker) {
   return BC_NONE;
 }