1+ # Copyright 2013-2015 Felix Schmitt, Axel Huebl
12 #
2- # Copyright 2013 Felix Schmitt
3+ # This file is part of libSplash.
34 #
4- # This file is part of libSplash.
5- #
6- # libSplash is free software: you can redistribute it and/or modify
7- # it under the terms of of either the GNU General Public License or
8- # the GNU Lesser General Public License as published by
9- # the Free Software Foundation, either version 3 of the License, or
10- # (at your option) any later version.
11- # libSplash is distributed in the hope that it will be useful,
12- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14- # GNU General Public License and the GNU Lesser General Public License
15- # for more details.
16- #
17- # You should have received a copy of the GNU General Public License
18- # and the GNU Lesser General Public License along with libSplash.
5+ # libSplash is free software: you can redistribute it and/or modify
6+ # it under the terms of of either the GNU General Public License or
7+ # the GNU Lesser General Public License as published by
8+ # the Free Software Foundation, either version 3 of the License, or
9+ # (at your option) any later version.
10+ #
11+ # libSplash is distributed in the hope that it will be useful,
12+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ # GNU General Public License and the GNU Lesser General Public License
15+ # for more details.
16+ #
17+ # You should have received a copy of the GNU General Public License
18+ # and the GNU Lesser General Public License along with libSplash.
1919 # If not, see <http://www.gnu.org/licenses/>.
2020
2121cmake_minimum_required (VERSION 2.8.5 )
@@ -40,6 +40,7 @@ OPTION(WITH_MPI "build MPI examples" OFF)
4040
4141SET (EXAMPLES domain_read/domain_read)
4242SET (MPI_EXAMPLES domain_read/domain_read_mpi domain_write/domain_write_mpi)
43+ SET (PARALLEL_EXAMPLES parallel_domain_write/parallel_domain_write)
4344
4445FOREACH (EXAMPLE_NAME ${EXAMPLES} )
4546 SET (EXAMPLE_FILES "${EXAMPLE_FILES} ;${EXAMPLE_NAME} .cpp" )
@@ -48,6 +49,9 @@ ENDFOREACH()
4849FOREACH (EXAMPLE_NAME ${MPI_EXAMPLES} )
4950 SET (MPI_EXAMPLE_FILES "${MPI_EXAMPLE_FILES} ;${EXAMPLE_NAME} .cpp" )
5051ENDFOREACH ()
52+ FOREACH (PARALLEL_EXAMPLE_NAME ${PARALLEL_EXAMPLES} )
53+ SET (PARALLEL_EXAMPLE_FILES "${PARALLEL_EXAMPLE_FILES} ;${PARALLEL_EXAMPLE_NAME} .cpp" )
54+ ENDFOREACH ()
5155
5256#-------------------------------------------------------------------------------
5357
@@ -66,8 +70,8 @@ INCLUDE_DIRECTORIES("${SPLASH_ROOT_DIR}/include")
6670
6771# link static
6872ADD_LIBRARY (splash_static STATIC IMPORTED )
69- SET_TARGET_PROPERTIES (splash_static PROPERTIES
70- IMPORTED_LOCATION "${SPLASH_ROOT_DIR} /lib/libsplash.a" )
73+ SET_TARGET_PROPERTIES (splash_static PROPERTIES
74+ IMPORTED_LOCATION "${SPLASH_ROOT_DIR} /lib/libsplash.a" )
7175SET (LIBS splash_static ${LIBS} )
7276
7377# link dynamic
@@ -102,6 +106,10 @@ ENDFOREACH()
102106
103107# build all MPI examples
104108IF (WITH_MPI)
109+ # add parallel examples
110+ IF (HDF5_IS_PARALLEL)
111+ SET (MPI_EXAMPLE_FILES ${MPI_EXAMPLE_FILES} ${PARALLEL_EXAMPLE_FILES} )
112+ ENDIF (HDF5_IS_PARALLEL )
105113 MESSAGE (STATUS "Building MPI examples" )
106114 FOREACH (EXAMPLE_FILE ${MPI_EXAMPLE_FILES} )
107115 GET_FILENAME_COMPONENT (FILE ${EXAMPLE_FILE} NAME )
0 commit comments