2008-12-10 23:59:20 +03:00
|
|
|
#
|
2010-01-19 20:34:55 +03:00
|
|
|
# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart,
|
2008-12-10 23:59:20 +03:00
|
|
|
# University of Stuttgart. All rights reserved.
|
|
|
|
# $COPYRIGHT$
|
|
|
|
#
|
|
|
|
# Additional copyrights may follow
|
|
|
|
#
|
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check the CMake version
|
|
|
|
IF(WIN32)
|
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
|
|
|
|
ELSE(WIN32)
|
|
|
|
MESSAGE( FATAL_ERROR "Only support Windows. Aborting.")
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
|
|
|
|
# create top-level target(solution file)
|
|
|
|
PROJECT("OpenMPI" C CXX)
|
|
|
|
|
|
|
|
|
|
|
|
SET (OpenMPI_VERSION $(OpenMPI_MAJOR_VERSION).$(OpenMPI_MINOR_VERSION).$(OpenMPI_PATCH_VERSION))
|
|
|
|
SET (CMAKE_MODULE_PATH "${OpenMPI_SOURCE_DIR}/contrib/platform/win32/CMakeModules;${CMAKE_MODULE_PATH}")
|
|
|
|
|
|
|
|
# default to debug-builds
|
|
|
|
IF (NOT CMAKE_BUILD_TYPE)
|
|
|
|
SET (CMAKE_BUILD_TYPE Debug CACHE STRING
|
|
|
|
"Choose the type of build, options are: None, Debug, Release, RelWithDebInfo and MinSizeRel." FORCE)
|
|
|
|
ENDIF (NOT CMAKE_BUILD_TYPE)
|
|
|
|
|
2009-11-03 13:40:58 +03:00
|
|
|
STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
|
|
|
|
IF(${CMAKE_BUILD_TYPE} STREQUAL "debug")
|
|
|
|
SET(OMPI_DEBUG_BUILD 1)
|
2010-11-19 18:54:13 +03:00
|
|
|
# add debug-suffix to distinguish between debug and release version libraries.
|
|
|
|
SET(CMAKE_DEBUG_POSTFIX "d")
|
|
|
|
|
|
|
|
OPTION(WANT_EXE_DEBUG_POSTFIX "Whether we want postfix for executables" OFF)
|
|
|
|
IF(WANT_EXE_DEBUG_POSTFIX)
|
|
|
|
SET(OMPI_EXE_DEBUG_POSTFIX "d")
|
|
|
|
ENDIF(WANT_EXE_DEBUG_POSTFIX)
|
2009-11-03 13:40:58 +03:00
|
|
|
ENDIF(${CMAKE_BUILD_TYPE} STREQUAL "debug")
|
|
|
|
|
2009-03-18 20:46:24 +03:00
|
|
|
|
2008-12-10 23:59:20 +03:00
|
|
|
# preset install dir
|
|
|
|
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
|
|
SET(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/installed" CACHE PATH "CMAKE_INSTALL_PREFIX" FORCE)
|
|
|
|
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
|
|
|
|
|
|
# Make the include path visible to all targets
|
|
|
|
INCLUDE_DIRECTORIES (
|
2009-04-24 20:51:31 +04:00
|
|
|
${OpenMPI_SOURCE_DIR}/contrib/platform/win32
|
2008-12-10 23:59:20 +03:00
|
|
|
${OpenMPI_SOURCE_DIR}/
|
|
|
|
${OpenMPI_SOURCE_DIR}/opal
|
|
|
|
${OpenMPI_SOURCE_DIR}/opal/include
|
|
|
|
${OpenMPI_SOURCE_DIR}/ompi
|
|
|
|
${OpenMPI_SOURCE_DIR}/ompi/include
|
|
|
|
${OpenMPI_SOURCE_DIR}/orte
|
|
|
|
${OpenMPI_SOURCE_DIR}/orte/include
|
|
|
|
${OpenMPI_BINARY_DIR}/
|
|
|
|
${OpenMPI_BINARY_DIR}/opal
|
|
|
|
${OpenMPI_BINARY_DIR}/opal/include
|
|
|
|
${OpenMPI_BINARY_DIR}/ompi
|
|
|
|
${OpenMPI_BINARY_DIR}/ompi/include
|
|
|
|
${OpenMPI_BINARY_DIR}/orte
|
|
|
|
${OpenMPI_BINARY_DIR}/orte/include
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Output directroies for binaries and libraries.
|
|
|
|
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OpenMPI_BINARY_DIR})
|
|
|
|
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OpenMPI_BINARY_DIR})
|
|
|
|
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OpenMPI_BINARY_DIR})
|
|
|
|
|
|
|
|
# get rid of VS-project file reloading after "cleanup" or "rebuild"
|
|
|
|
SET (CMAKE_SUPPRESS_REGENERATION true)
|
|
|
|
|
|
|
|
# Dynamic/shared build, the default is set to static(OFF)
|
2010-11-19 18:54:13 +03:00
|
|
|
OPTION(BUILD_SHARED_LIBS "Whether we want to build shared libraries." ON)
|
2008-12-10 23:59:20 +03:00
|
|
|
|
2009-11-03 13:40:58 +03:00
|
|
|
IF(CMAKE_CL_64)
|
|
|
|
SET(COMPILER_TYPE "x64")
|
|
|
|
ELSE(CMAKE_CL_64)
|
|
|
|
SET(COMPILER_TYPE "win32")
|
|
|
|
ENDIF(CMAKE_CL_64)
|
|
|
|
|
2010-02-08 02:16:06 +03:00
|
|
|
#store current environment variables
|
|
|
|
SET(PATH_OLD "$ENV{PATH}")
|
|
|
|
SET(LIB_OLD "$ENV{LIB}")
|
|
|
|
SET(INCLUDE_OLD "$ENV{INCLUDE}")
|
2009-11-03 13:40:58 +03:00
|
|
|
|
2008-12-10 23:59:20 +03:00
|
|
|
INCLUDE(ompi_configure)
|
2010-07-13 17:41:57 +04:00
|
|
|
BEGIN_CONFIGURE()
|
2008-12-10 23:59:20 +03:00
|
|
|
|
2010-01-19 20:34:55 +03:00
|
|
|
# find flex command
|
|
|
|
INCLUDE (find_flex)
|
|
|
|
FIND_FLEX()
|
|
|
|
|
2008-12-10 23:59:20 +03:00
|
|
|
ADD_SUBDIRECTORY(opal)
|
2010-11-02 19:39:27 +03:00
|
|
|
# set up the libevent include dirs
|
|
|
|
INCLUDE_DIRECTORIES (${LIBEVENT_INCLUDE_DIRS})
|
2008-12-10 23:59:20 +03:00
|
|
|
ADD_SUBDIRECTORY(ompi)
|
|
|
|
ADD_SUBDIRECTORY(orte)
|
|
|
|
|
2010-07-13 17:41:57 +04:00
|
|
|
END_CONFIGURE()
|
|
|
|
|
2010-02-08 02:16:06 +03:00
|
|
|
#restore environment variables
|
|
|
|
SET(ENV{PATH} "${PATH_OLD}")
|
|
|
|
SET(ENV{LIB} "${LIB_OLD}")
|
|
|
|
SET(ENV{INCLUDE} "${INCLUDE_OLD}")
|
|
|
|
|
2010-01-19 20:34:55 +03:00
|
|
|
INCLUDE(InstallRequiredSystemLibraries)
|
2008-12-10 23:59:20 +03:00
|
|
|
|
|
|
|
# CPACK settings
|
|
|
|
#SET(CPACK_PACKAGE_NAME "Open MPI")
|
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open MPI")
|
|
|
|
SET(CPACK_PACKAGE_VENDOR "Open MPI")
|
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
|
|
|
|
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
|
|
|
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
|
|
|
|
SET(CPACK_PACKAGE_VERSION_PATCH "${RELEASE_VERSION}")
|
|
|
|
|
|
|
|
IF(${RELEASE_VERSION} EQUAL 0)
|
|
|
|
SET(OpenMPI_version "${MAJOR_VERSION}.${MINOR_VERSION}")
|
|
|
|
ELSE(${RELEASE_VERSION} EQUAL 0)
|
|
|
|
SET(OpenMPI_version "${MAJOR_VERSION}.${MINOR_VERSION}.${RELEASE_VERSION}")
|
|
|
|
ENDIF(${RELEASE_VERSION} EQUAL 0)
|
|
|
|
|
2009-11-03 13:40:58 +03:00
|
|
|
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "OpenMPI_v${OpenMPI_version}-${COMPILER_TYPE}")
|
|
|
|
SET(CPACK_PACKAGE_FILE_NAME "OpenMPI_v${OpenMPI_version}-${COMPILER_TYPE}-${CMAKE_BUILD_TYPE}")
|
2008-12-10 23:59:20 +03:00
|
|
|
SET(CPACK_INSTALLED_DIRECTORIES "${CMAKE_INSTALL_PREFIX}" ".")
|
|
|
|
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Open MPI")
|
|
|
|
|
2009-11-03 13:40:58 +03:00
|
|
|
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "OpenMPI-${OpenMPI_version}")
|
2008-12-10 23:59:20 +03:00
|
|
|
#SET(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
#There is a bug in NSI that does not handle full unix paths properly. Make
|
|
|
|
# sure there is at least one set of four (4) backlasshes.
|
|
|
|
# SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
|
|
|
|
# SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
|
|
|
|
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} OpenMPI")
|
|
|
|
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.open-mpi.org")
|
|
|
|
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.open-mpi.org")
|
|
|
|
# SET(CPACK_NSIS_CONTACT "me@my-personal-home-page.com")
|
|
|
|
# SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable")
|
|
|
|
|
|
|
|
|
2009-03-18 20:46:24 +03:00
|
|
|
SET(CPACK_NSIS_MODIFY_PATH ON)
|
2008-12-10 23:59:20 +03:00
|
|
|
SET(CPACK_SOURCE_ZIP ON)
|
2009-03-18 20:46:24 +03:00
|
|
|
SET(CPACK_BINARY_ZIP ON)
|
2008-12-10 23:59:20 +03:00
|
|
|
|
|
|
|
# setup the register entries when install
|
|
|
|
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} "
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_PREFIX\\\" \\\"$INSTDIR\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_EXEC_PREFIX\\\" \\\"$INSTDIR\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_BINDIR\\\" \\\"$INSTDIR\\\\bin\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_SBINDIR\\\" \\\"$INSTDIR\\\\sbin\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_LIBEXECDIR\\\" \\\"$INSTDIR\\\\libexec\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_DATAROOTDIR\\\" \\\"$INSTDIR\\\\share\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_DATADIR\\\" \\\"$INSTDIR\\\\share\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_SYSCONFDIR\\\" \\\"$INSTDIR\\\\etc\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_LOCALSTATEDIR\\\" \\\"$INSTDIR\\\\etc\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_LIBDIR\\\" \\\"$INSTDIR\\\\lib\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_INCLUDEDIR\\\" \\\"$INSTDIR\\\\include\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_INFODIR\\\" \\\"$INSTDIR\\\\share\\\\info\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_MANDIR\\\" \\\"$INSTDIR\\\\share\\\\man\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_PKGDATADIR\\\" \\\"$INSTDIR\\\\share\\\\openmpi\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_PKGLIBDIR\\\" \\\"$INSTDIR\\\\lib\\\\openmpi\\\"
|
|
|
|
WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_PKGINCLUDEDIR\\\" \\\"$INSTDIR\\\\include\\\\openmpi\\\"
|
|
|
|
")
|
|
|
|
|
|
|
|
|
|
|
|
# delete the register entries when uninstall
|
|
|
|
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} "
|
|
|
|
DeleteRegKey HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\"
|
|
|
|
")
|
|
|
|
|
|
|
|
|
|
|
|
# (un)install icons
|
|
|
|
#SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/contrib/platform/win32/open-mpi-logo.ico")
|
|
|
|
#SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/contrib/platform/win32/uninstall.ico")
|
|
|
|
|
|
|
|
INCLUDE(CPack)
|