File: CMakeLists.txt

package info (click to toggle)
openmpi 1.6.5-9.1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 91,628 kB
  • ctags: 44,305
  • sloc: ansic: 408,966; cpp: 44,454; sh: 27,828; makefile: 10,486; asm: 3,882; python: 1,239; lex: 805; perl: 549; csh: 253; fortran: 232; f90: 126; tcl: 12
file content (55 lines) | stat: -rw-r--r-- 1,898 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright (c) 2007-2011 High Performance Computing Center Stuttgart, 
#                         University of Stuttgart.  All rights reserved.
# $COPYRIGHT$
# 
# Additional copyrights may follow
# 
# $HEADER$
#

FILE(GLOB CXX_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp")

# skip the file interface sources if not wanted
IF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE)
  SET( TMP_SRC "" )
  FOREACH ( FILENAME ${CXX_SOURCE_FILES})
    GET_FILENAME_COMPONENT(relname ${FILENAME} NAME)
    IF (NOT ${relname} MATCHES "file.*[ch]$")
	  LIST(APPEND TMP_SRC ${FILENAME})
    ENDIF (NOT ${relname} MATCHES "file.*[ch]$")
  ENDFOREACH(FILENAME)
  SET( CXX_SOURCE_FILES ${TMP_SRC})
ENDIF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE)

ADD_LIBRARY (libmpi_cxx ${CXX_SOURCE_FILES})

SET_TARGET_PROPERTIES (libmpi_cxx PROPERTIES LINKER_LANGUAGE CXX PREFIX "" IMPORT_PREFIX "")

# Set compile flags for this target
IF (BUILD_SHARED_LIBS)

  TARGET_LINK_LIBRARIES(libmpi_cxx libmpi libopen-pal)
  # Need OMPI_BUILDING_CXX_BINDINGS_LIBRARY so that we can get the path 
  # names correct inside the MPI C++ library.  OMPI_SKIP_MPICXX is necessary
  # so that mpi.h doesn't include mpicxx.h through the incorrect pathname 
  # in any of the C++ bindings .c files.  Just use the define for this purpose 
  # from user code.
  ADD_DEFINITIONS (-D_USRDLL -DOMPI_BUILDING 
    -DOMPI_BUILDING_CXX_BINDINGS_LIBRARY=1  -DOMPI_SKIP_MPICXX=1
    -DOMPI_IMPORTS -DOPAL_IMPORTS)

ELSE (BUILD_SHARED_LIBS)
  ADD_DEFINITIONS (-D_LIB -DOMPI_BUILDING
    -DOMPI_BUILDING_CXX_BINDINGS_LIBRARY=1  -DOMPI_SKIP_MPICXX=1)
ENDIF(BUILD_SHARED_LIBS)

INSTALL(TARGETS libmpi_cxx
        RUNTIME DESTINATION bin
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib)

IF (OMPI_DEBUG_BUILD AND WINDOWS_VS)
  INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi_cxx${CMAKE_DEBUG_POSTFIX}.pdb
    DESTINATION bin)
ENDIF (OMPI_DEBUG_BUILD AND WINDOWS_VS)