Add a new CMake module for finding Windows CCP libraries, so that we can remove the library files in the source tree.
This commit was SVN r21071.
Этот коммит содержится в:
родитель
d8f61695cd
Коммит
4067d739b4
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart,
|
||||
# Copyright (c) 2007-2009 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
@ -43,6 +43,7 @@ INCLUDE(ompi_get_version)
|
||||
|
||||
# Make the include path visible to all targets
|
||||
INCLUDE_DIRECTORIES (
|
||||
${OpenMPI_SOURCE_DIR}/contrib/platform/win32
|
||||
${OpenMPI_SOURCE_DIR}/
|
||||
${OpenMPI_SOURCE_DIR}/opal
|
||||
${OpenMPI_SOURCE_DIR}/opal/include
|
||||
@ -57,7 +58,6 @@ INCLUDE_DIRECTORIES (
|
||||
${OpenMPI_BINARY_DIR}/ompi/include
|
||||
${OpenMPI_BINARY_DIR}/orte
|
||||
${OpenMPI_BINARY_DIR}/orte/include
|
||||
${OpenMPI_SOURCE_DIR}/contrib/platform/win32
|
||||
)
|
||||
|
||||
|
||||
@ -77,7 +77,6 @@ INCLUDE(ompi_configure)
|
||||
ADD_SUBDIRECTORY(opal)
|
||||
ADD_SUBDIRECTORY(ompi)
|
||||
ADD_SUBDIRECTORY(orte)
|
||||
ADD_SUBDIRECTORY(test)
|
||||
|
||||
INCLUDE(InstallRequiredSystemLibraries)
|
||||
|
||||
|
@ -96,98 +96,122 @@ FOREACH (MCA_FRAMEWORK ${MCA_FRAMEWORK_LIST})
|
||||
ELSEIF(EXISTS "${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}/.windows")
|
||||
|
||||
SET(COMPONENT_FILES "")
|
||||
FILE(STRINGS ${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}/.windows
|
||||
VALUE REGEX "^not_single_shared_lib=")
|
||||
IF(NOT VALUE STREQUAL "")
|
||||
STRING(REPLACE "not_single_shared_lib=" "" NOT_SINGLE_SHARED_LIB ${VALUE})
|
||||
ENDIF(NOT VALUE STREQUAL "")
|
||||
|
||||
SET(CURRENT_PATH ${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT})
|
||||
FILE(GLOB COMPONENT_FILES "${CURRENT_PATH}/*.C" "${CURRENT_PATH}/*.h"
|
||||
"${CURRENT_PATH}/*.cc" "${CURRENT_PATH}/*.cpp")
|
||||
|
||||
# check out if we have to exlude some source files.
|
||||
SET(EXCLUDE_LIST "")
|
||||
FILE(STRINGS ${CURRENT_PATH}/.windows EXCLUDE_LIST REGEX "^exclude_list=")
|
||||
|
||||
IF(NOT EXCLUDE_LIST STREQUAL "")
|
||||
STRING(REPLACE "exclude_list=" "" EXCLUDE_LIST ${EXCLUDE_LIST})
|
||||
ENDIF(NOT EXCLUDE_LIST STREQUAL "")
|
||||
|
||||
# remove the files in the exclude list
|
||||
FOREACH(FILE ${EXCLUDE_LIST})
|
||||
LIST(REMOVE_ITEM COMPONENT_FILES "${CURRENT_PATH}/${FILE}")
|
||||
ENDFOREACH(FILE)
|
||||
# by default, build this component.
|
||||
SET(BUILD_COMPONENT TRUE)
|
||||
|
||||
IF(NOT BUILD_SHARED_LIBS OR NOT_SINGLE_SHARED_LIB STREQUAL "1")
|
||||
SET(NOT_SINGLE_SHARED_LIB "")
|
||||
# add sources for static build or for the shared build when this is not a stand along library.
|
||||
SET(MCA_FILES ${MCA_FILES} ${COMPONENT_FILES})
|
||||
SOURCE_GROUP(mca\\${MCA_FRAMEWORK}\\${MCA_COMPONENT} FILES ${COMPONENT_FILES})
|
||||
# do we have to run a check module first?
|
||||
SET(REQUIRED_CHECK "")
|
||||
FILE(STRINGS ${CURRENT_PATH}/.windows REQUIRED_CHECK REGEX "^required_check=")
|
||||
|
||||
SET(EXTRA_INCLUDE_PATH "")
|
||||
IF(NOT REQUIRED_CHECK STREQUAL "")
|
||||
STRING(REPLACE "required_check=" "" REQUIRED_CHECK ${REQUIRED_CHECK})
|
||||
INCLUDE(${REQUIRED_CHECK})
|
||||
IF(RESULT)
|
||||
SET(EXTRA_INCLUDE_PATH ${RESULT_INCLUDE_PATH})
|
||||
ELSE(RESULT)
|
||||
# Required check failed, don't build this component.
|
||||
SET(BUILD_COMPONENT FALSE)
|
||||
ENDIF(RESULT)
|
||||
ENDIF(NOT REQUIRED_CHECK STREQUAL "")
|
||||
|
||||
IF(EXISTS "${CURRENT_PATH}/configure.params")
|
||||
FILE(STRINGS "${CURRENT_PATH}/configure.params"
|
||||
CURRENT_COMPONENT_PRIORITY REGEX "PRIORITY")
|
||||
IF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "")
|
||||
STRING(REGEX REPLACE "[A-Z_]+=" "" CURRENT_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY})
|
||||
ENDIF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "")
|
||||
ENDIF(EXISTS "${CURRENT_PATH}/configure.params")
|
||||
IF(BUILD_COMPONENT)
|
||||
|
||||
# check the library build type
|
||||
FILE(STRINGS ${CURRENT_PATH}/.windows
|
||||
VALUE REGEX "^not_single_shared_lib=")
|
||||
IF(NOT VALUE STREQUAL "")
|
||||
STRING(REPLACE "not_single_shared_lib=" "" NOT_SINGLE_SHARED_LIB ${VALUE})
|
||||
ENDIF(NOT VALUE STREQUAL "")
|
||||
|
||||
# check out if we have to exlude some source files.
|
||||
SET(EXCLUDE_LIST "")
|
||||
FILE(STRINGS ${CURRENT_PATH}/.windows EXCLUDE_LIST REGEX "^exclude_list=")
|
||||
|
||||
IF(NOT EXCLUDE_LIST STREQUAL "")
|
||||
STRING(REPLACE "exclude_list=" "" EXCLUDE_LIST ${EXCLUDE_LIST})
|
||||
ENDIF(NOT EXCLUDE_LIST STREQUAL "")
|
||||
|
||||
# remove the files in the exclude list
|
||||
FOREACH(FILE ${EXCLUDE_LIST})
|
||||
LIST(REMOVE_ITEM COMPONENT_FILES "${CURRENT_PATH}/${FILE}")
|
||||
ENDFOREACH(FILE)
|
||||
|
||||
IF(NOT BUILD_SHARED_LIBS OR NOT_SINGLE_SHARED_LIB STREQUAL "1")
|
||||
SET(NOT_SINGLE_SHARED_LIB "")
|
||||
# add sources for static build or for the shared build when this is not a stand along library.
|
||||
SET(MCA_FILES ${MCA_FILES} ${COMPONENT_FILES})
|
||||
SOURCE_GROUP(mca\\${MCA_FRAMEWORK}\\${MCA_COMPONENT} FILES ${COMPONENT_FILES})
|
||||
|
||||
INCLUDE_DIRECTORIES(${EXTRA_INCLUDE_PATH})
|
||||
|
||||
IF(EXISTS "${CURRENT_PATH}/configure.params")
|
||||
FILE(STRINGS "${CURRENT_PATH}/configure.params"
|
||||
CURRENT_COMPONENT_PRIORITY REGEX "PRIORITY")
|
||||
IF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "")
|
||||
STRING(REGEX REPLACE "[A-Z_]+=" "" CURRENT_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY})
|
||||
ENDIF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "")
|
||||
ENDIF(EXISTS "${CURRENT_PATH}/configure.params")
|
||||
|
||||
IF(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
|
||||
# I have a higher priority for this mca, put me at the very beginning.
|
||||
SET (OUTFILE_EXTERN
|
||||
"extern const mca_base_component_t mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component"
|
||||
"\n${OUTFILE_EXTERN}")
|
||||
SET(FRAMEWORK_STRUCT_DEF
|
||||
"&mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component,\n"
|
||||
${FRAMEWORK_STRUCT_DEF})
|
||||
SET(BEST_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY})
|
||||
ELSE(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
|
||||
SET (OUTFILE_EXTERN ${OUTFILE_EXTERN}
|
||||
"\nextern const mca_base_component_t mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component;")
|
||||
SET(FRAMEWORK_STRUCT_DEF ${FRAMEWORK_STRUCT_DEF}
|
||||
"&mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component,\n")
|
||||
ENDIF(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
|
||||
ELSE(NOT BUILD_SHARED_LIBS OR NOT_SINGLE_SHARED_LIB STREQUAL "1")
|
||||
IF(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
|
||||
# I have a higher priority for this mca, put me at the very beginning.
|
||||
SET (OUTFILE_EXTERN
|
||||
"extern const mca_base_component_t mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component"
|
||||
"\n${OUTFILE_EXTERN}")
|
||||
SET(FRAMEWORK_STRUCT_DEF
|
||||
"&mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component,\n"
|
||||
${FRAMEWORK_STRUCT_DEF})
|
||||
SET(BEST_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY})
|
||||
ELSE(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
|
||||
SET (OUTFILE_EXTERN ${OUTFILE_EXTERN}
|
||||
"\nextern const mca_base_component_t mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component;")
|
||||
SET(FRAMEWORK_STRUCT_DEF ${FRAMEWORK_STRUCT_DEF}
|
||||
"&mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component,\n")
|
||||
ENDIF(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
|
||||
ELSE(NOT BUILD_SHARED_LIBS OR NOT_SINGLE_SHARED_LIB STREQUAL "1")
|
||||
|
||||
# get the dependencies for this component.
|
||||
SET(MCA_DEPENDENCIES "")
|
||||
FILE(STRINGS ${CURRENT_PATH}/.windows VALUE REGEX "^mca_dependencies=")
|
||||
IF(NOT VALUE STREQUAL "")
|
||||
STRING(REPLACE "mca_dependencies=" "" MCA_DEPENDENCIES ${VALUE})
|
||||
ENDIF(NOT VALUE STREQUAL "")
|
||||
# get the dependencies for this component.
|
||||
SET(MCA_DEPENDENCIES "")
|
||||
FILE(STRINGS ${CURRENT_PATH}/.windows VALUE REGEX "^mca_dependencies=")
|
||||
IF(NOT VALUE STREQUAL "")
|
||||
STRING(REPLACE "mca_dependencies=" "" MCA_DEPENDENCIES ${VALUE})
|
||||
ENDIF(NOT VALUE STREQUAL "")
|
||||
|
||||
# get the libraries required for this component.
|
||||
SET(MCA_LINK_LIBRARIES "")
|
||||
FILE(STRINGS ${CURRENT_PATH}/.windows VALUE REGEX "^mca_link_libraries=")
|
||||
IF(NOT VALUE STREQUAL "")
|
||||
STRING(REPLACE "mca_link_libraries=" "" MCA_LINK_LIBRARIES ${VALUE})
|
||||
ENDIF(NOT VALUE STREQUAL "")
|
||||
# get the libraries required for this component.
|
||||
SET(MCA_LINK_LIBRARIES "")
|
||||
FILE(STRINGS ${CURRENT_PATH}/.windows VALUE REGEX "^mca_link_libraries=")
|
||||
IF(NOT VALUE STREQUAL "")
|
||||
STRING(REPLACE "mca_link_libraries=" "" MCA_LINK_LIBRARIES ${VALUE})
|
||||
ENDIF(NOT VALUE STREQUAL "")
|
||||
|
||||
# the mca_common_* libraries should be installed into bin,
|
||||
# this will avoid the runtime open module failure.
|
||||
IF("${MCA_FRAMEWORK}" STREQUAL "common")
|
||||
SET(LIB_NAME_PREFIX "lib")
|
||||
SET(INSTALL_DEST "RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib")
|
||||
ELSE("${MCA_FRAMEWORK}" STREQUAL "common")
|
||||
SET(LIB_NAME_PREFIX "")
|
||||
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
SET(INSTALL_DEST "RUNTIME DESTINATION lib/openmpi/debug
|
||||
LIBRARY DESTINATION lib/openmpi/debug
|
||||
ARCHIVE DESTINATION lib/openmpi/debug")
|
||||
ELSE(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
SET(INSTALL_DEST "RUNTIME DESTINATION lib/openmpi
|
||||
LIBRARY DESTINATION lib/openmpi
|
||||
ARCHIVE DESTINATION lib/openmpi")
|
||||
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
ENDIF("${MCA_FRAMEWORK}" STREQUAL "common")
|
||||
# the mca_common_* libraries should be installed into bin,
|
||||
# this will avoid the runtime open module failure.
|
||||
IF("${MCA_FRAMEWORK}" STREQUAL "common")
|
||||
SET(LIB_NAME_PREFIX "lib")
|
||||
SET(INSTALL_DEST "RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib")
|
||||
ELSE("${MCA_FRAMEWORK}" STREQUAL "common")
|
||||
SET(LIB_NAME_PREFIX "")
|
||||
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
SET(INSTALL_DEST "RUNTIME DESTINATION lib/openmpi/debug
|
||||
LIBRARY DESTINATION lib/openmpi/debug
|
||||
ARCHIVE DESTINATION lib/openmpi/debug")
|
||||
ELSE(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
SET(INSTALL_DEST "RUNTIME DESTINATION lib/openmpi
|
||||
LIBRARY DESTINATION lib/openmpi
|
||||
ARCHIVE DESTINATION lib/openmpi")
|
||||
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
ENDIF("${MCA_FRAMEWORK}" STREQUAL "common")
|
||||
|
||||
|
||||
# generate CMakeLists.txt for each component for shared build.
|
||||
FILE (WRITE "${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}/CMakeLists.txt"
|
||||
"
|
||||
# generate CMakeLists.txt for each component for shared build.
|
||||
FILE (WRITE "${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}/CMakeLists.txt"
|
||||
"
|
||||
#
|
||||
# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
@ -203,6 +227,8 @@ FOREACH (MCA_FRAMEWORK ${MCA_FRAMEWORK_LIST})
|
||||
SET_SOURCE_FILES_PROPERTIES(\${COMPONENT_FILES}
|
||||
PROPERTIES LANGUAGE CXX)
|
||||
|
||||
INCLUDE_DIRECTORIES(\${EXTRA_INCLUDE_PATH})
|
||||
|
||||
ADD_LIBRARY(${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} SHARED
|
||||
\${COMPONENT_FILES})
|
||||
|
||||
@ -216,14 +242,16 @@ ADD_DEPENDENCIES(${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} libopen
|
||||
INSTALL(TARGETS ${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} ${INSTALL_DEST})
|
||||
")
|
||||
|
||||
ADD_SUBDIRECTORY (${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT} mca/${MCA_FRAMEWORK}/${MCA_COMPONENT})
|
||||
ENDIF(NOT BUILD_SHARED_LIBS OR NOT_SINGLE_SHARED_LIB STREQUAL "1")
|
||||
ADD_SUBDIRECTORY (${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT} mca/${MCA_FRAMEWORK}/${MCA_COMPONENT})
|
||||
ENDIF(NOT BUILD_SHARED_LIBS OR NOT_SINGLE_SHARED_LIB STREQUAL "1")
|
||||
|
||||
# Install help files if they are here.
|
||||
INSTALL(DIRECTORY ${CURRENT_PATH}/ DESTINATION share/openmpi/
|
||||
FILES_MATCHING PATTERN "*.txt" PATTERN ".svn" EXCLUDE)
|
||||
|
||||
# Install help files if they are here.
|
||||
INSTALL(DIRECTORY ${CURRENT_PATH}/ DESTINATION share/openmpi/
|
||||
FILES_MATCHING PATTERN "*.txt" PATTERN ".svn" EXCLUDE)
|
||||
|
||||
ENDIF(BUILD_COMPONENT)
|
||||
ENDIF(${MCA_COMPONENT} STREQUAL "base")
|
||||
|
||||
ENDFOREACH(MCA_COMPONENT)
|
||||
|
||||
STRING(LENGTH "${FRAMEWORK_STRUCT_DEF}" STRUCT_STRING_LENTH)
|
||||
|
37
contrib/platform/win32/CMakeModules/find_ccp.cmake
Исполняемый файл
37
contrib/platform/win32/CMakeModules/find_ccp.cmake
Исполняемый файл
@ -0,0 +1,37 @@
|
||||
# Copyright (c) 2009 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# The CCP components need to import the type library ccpapi.tlb,
|
||||
# if it's not installed, the CCP components won't be built.
|
||||
|
||||
SET(EXTRA_INCLUDE_PATH "")
|
||||
|
||||
IF(NOT CCPAPI_FOUND)
|
||||
MESSAGE(STATUS "looking for ccp...")
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
SET(CCP_LIB_PATH $ENV{CCP_LIB64})
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(CCP_LIB_PATH $ENV{CCP_LIB32})
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
FIND_FILE(CCPAPI_FOUND ccpapi.tlb PATHS ${CCP_LIB_PATH})
|
||||
|
||||
IF(CCPAPI_FOUND)
|
||||
SET(RESULT TRUE)
|
||||
SET(RESULT_INCLUDE_PATH ${CCP_LIB_PATH})
|
||||
MESSAGE(STATUS "looking for ccp...found.")
|
||||
ELSE(CCPAPI_FOUND)
|
||||
SET(RESULT FALSE)
|
||||
MESSAGE(STATUS "looking for ccp...not found.")
|
||||
ENDIF(CCPAPI_FOUND)
|
||||
|
||||
ELSE(NOT CCPAPI_FOUND)
|
||||
SET(RESULT_INCLUDE_PATH ${CCP_LIB_PATH})
|
||||
ENDIF(NOT CCPAPI_FOUND)
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2008 High Performance Computing Center Stuttgart,
|
||||
# Copyright (c) 2009 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
@ -11,3 +11,4 @@
|
||||
# Specific to this module
|
||||
|
||||
mca_dependencies=libopen-rte
|
||||
required_check=find_ccp
|
||||
|
Двоичные данные
orte/mca/plm/ccp/ccpapi.tlb
Двоичные данные
orte/mca/plm/ccp/ccpapi.tlb
Двоичный файл не отображается.
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2008 High Performance Computing Center Stuttgart,
|
||||
# Copyright (c) 2009 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
@ -11,3 +11,4 @@
|
||||
# Specific to this module
|
||||
|
||||
mca_dependencies=libopen-rte
|
||||
required_check=find_ccp
|
||||
|
Двоичные данные
orte/mca/ras/ccp/ccpapi.tlb
Двоичные данные
orte/mca/ras/ccp/ccpapi.tlb
Двоичный файл не отображается.
Загрузка…
Ссылка в новой задаче
Block a user