Commit b4ae8bad authored by Bill Hoffman's avatar Bill Hoffman
Browse files

RC 4 merge

parent ebd0c2d3
......@@ -141,12 +141,13 @@ MACRO(CMAKE_SETUP_TESTING)
# cmake.
SET(CMAKE_CTEST_COMMAND "${EXECUTABLE_OUTPUT_PATH}/ctest")
SET(CMAKE_CMAKE_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cmake")
SET(CMAKE_CPACK_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cpack")
ENDIF(BUILD_TESTING)
# configure some files for testing
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
@ONLY)
@ONLY)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
......@@ -315,7 +316,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8)
SET(CMake_VERSION_PATCH 0)
SET(CMake_VERSION_RC 3)
SET(CMake_VERSION_RC 4)
# We use odd minor numbers for development versions.
# Use a date for the development patch level.
......
......@@ -53,4 +53,7 @@ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
# Exclude try_compile sources from coverage results:
"/CMakeFiles/CMakeTmp/"
# Exclude Qt source files from coverage results:
"[A-Za-z]./[Qq]t/qt-.+-opensource-src"
)
Changes in CMake 2.8.0 RC 4
- Fix try_compile when file cannot be found
- Add new module to test manifest installation issues on windows.
- Add more test coverage
-Improvements in finding MPI on windows. ENH: reorganized searching mpi for mpi components (include,lib,bin) using a single set of search paths instead of seperately mainted lists of paths for each.
- Look for nvcc in the 32 bit bin directory before the 64 bin directory.
- BUG: hardcore some values so output matches cmVS10CLFlagTable.h (addresses bug #9753)
- Avoid Intel linker crash in BuildDepends test
- Fix Intel Fortran SHARED libraries on Linux
- Fix working dir issue for ctest
- Fix if() command and CMP0012 OLD/NEW behavior
- Allow for /D to change install directory on the command line for NSIS
- Move SetErrorMode around calls to generate and configure instead of setting it for the whole application for cmake-gui on windows. Allows for bad installs of windows shell programs to not break file completion.
- Fix Intel and MinGW Fortran DLL import libraries
- Fix Xcode dylib version default
- Fix the showing of non-cpp files in the IDE for VS 10
- Fix optionally-valued booleans in VS 10 flag table
- Detect and set Unicode character set in VS 10
- Add support for the g95 Fortran compiler
- Test all target types in Fortran
- Add Xcode file association for Fortran
- Fix VS 10 flag table for precompiled headers
- Fix VS 10 .sln files for Windows Explorer
- Fix Microsoft.Cpp.$(Platform).user.props in VS10b2
- Fix up file(DOWNLOAD ) a bit, better error checking and uses of long not double for timeout as curl needs, bug# 9748
- Add a VS 10 Win64 generator
- Fix for bug#9686 convert java_home to a cmake path before using.
- fix for bug# 9751, add check for MSVC10
- Fix for bugs #9756, #9690 and #9755, header files were not included, and link_directories we incorrect
- Add a module to test an install tree to verify that the MS CRT version is correct.
- Fix seg fault for empty ENV{} call bug #9747
- Better fix for finding the MSBuild that matches the VS 10 install.
- make testing the CodeBlocks and Eclipse generators easier by not requiring the CMAKE_EDIT_COMMAND variable
- Do not link library dependencies in VS solutions
- Ctest was broken for subdirs. Restored working directory state for tests so that their executables could be found.
- Fixes version detection using osg/Version on Mac OSX when OSG is installed as a framework
- Avoid C++ linker language in VS Fortran project
- Avoid duplicate ZERO_CHECK in VS solutions
- Fixed bug 8319, search for the Python shared library in the standard locations.
- Fix bug#9714, should not crash when version file is not where it should be...
- Fix ctest output alignment for cases where total tests run is not the same width as max test index.
- make it more robust wrt. #9621
- Add another possible error message that curl might emit with an empty drop location.
- Fix issue #5668 - use CollapseFullPath when determining if covered file is within source or binary tree. Allows gcc/gcov coverage analysis using MinGW on Windows.
- CTest-side support for compiler name and compiler version information. Requires CDash update to show on CDash.
- Add a bunch more testing coverage.
Changes in CMake 2.8.0 RC 3
- CTest Added OS Platform (cpu architecture) detection support to windows system
- Several minor FindBoost changes to address posts on mailing list
......
......@@ -21,13 +21,18 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
IF(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
SET(_INTEL_WINDOWS 1)
ENDIF()
# Disable deprecation warnings for standard C functions.
# really only needed for newer versions of VS, but should
# not hurt other versions, and this will work into the
# future
IF(MSVC)
IF(MSVC OR _INTEL_WINDOWS)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
ENDIF(MSVC)
ELSE()
ENDIF()
#silence duplicate symbol warnings on AIX
IF(CMAKE_SYSTEM MATCHES "AIX.*")
......
......@@ -6,6 +6,8 @@
PRINT *, 'INFO:compiler[Intel]'
#elif defined(__SUNPRO_F90) || defined(__SUNPRO_F95)
PRINT *, 'INFO:compiler[SunPro]'
#elif defined(__G95__)
PRINT *, 'INFO:compiler[G95]'
#elif defined(__GNUC__)
PRINT *, 'INFO:compiler[GNU]'
#elif defined(__IBMC__)
......
......@@ -21,8 +21,8 @@ ENDIF(NOT CMAKE_CROSSCOMPILING)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
NAMES MSBuild
HINTS
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/v4.0.20506/"
c:/WINDOWS/Microsoft.NET/Framework/v4.0.20506/
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
......
# CMakeVerifyManifest.cmake
#
# This script is used to verify that embeded manifests and
# side by side manifests for a project match. To run this
# script, cd to a directory and run the script with cmake -P.
# On the command line you can pass in versions that are OK even
# if not found in the .manifest files. For example,
# cmake -Dallow_versions=8.0.50608.0 -PCmakeVerifyManifest.cmake
# could be used to allow an embeded manifest of 8.0.50608.0
# to be used in a project even if that version was not found
# in the .manifest file.
# This script first recursively globs *.manifest files from
# the current directory. Then globs *.exe and *.dll. Each
# .exe and .dll is scanned for embeded manifests and the versions
# of CRT are compared to those found in the .manifest files
# from the first glob.
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
# crt_version:
# function to extract the CRT version from a file
# this can be passed a .exe, .dll, or a .manifest file
# it will put the list of versions found into the variable
# specified by list_var
function(crt_version file list_var)
file(STRINGS "${file}" strings REGEX "Microsoft.VC...CRT" NEWLINE_CONSUME)
foreach(s ${strings})
set(has_match 1)
string(REGEX
REPLACE ".*<assembly.*\"Microsoft.VC...CRT\".*version=\"([^\"]*)\".*</assembly>.*$" "\\1"
version "${s}")
if(NOT "${version}" STREQUAL "")
list(APPEND version_list ${version})
else()
message(FATAL_ERROR "Parse error could not find version in [${s}]")
endif()
endforeach(s)
if(NOT DEFINED has_match)
message("Information: no embeded manifest in: ${file}")
return()
endif()
list(APPEND version_list ${${list_var}})
list(REMOVE_DUPLICATES version_list)
if(version_list)
set(${list_var} ${version_list} PARENT_SCOPE)
endif()
endfunction(crt_version)
set(fatal_error FALSE)
# check_version:
#
# test a file against the shipped manifest versions
# for a directory
function(check_version file manifest_versions)
set(manifest_versions ${manifest_versions} ${allow_versions})
# collect versions for a given file
crt_version(${file} file_versions)
# see if the versions
foreach(ver ${file_versions})
list(FIND manifest_versions "${ver}" found_version)
if("${found_version}" EQUAL -1)
message("ERROR: ${file} uses ${ver} not found in shipped manifests:[${manifest_versions}].")
set(fatal_error TRUE PARENT_SCOPE)
endif()
endforeach(ver)
list(LENGTH file_versions len)
if(${len} GREATER 1)
message("WARNING: found more than one version of MICROSOFT.VC80.CRT referenced in ${file}: [${file_versions}]")
endif()
endfunction()
# collect up the versions of CRT that are shipped
# in .manifest files
set(manifest_version_list )
file(GLOB_RECURSE manifest_files "*.manifest")
foreach(f ${manifest_files})
crt_version("${f}" manifest_version_list)
endforeach(f)
list(LENGTH manifest_version_list LEN)
if(LEN EQUAL 0)
message(FATAL_ERROR "No .manifest files found, no version check can be done.")
endif()
message("Versions found in ${manifest_files}: ${manifest_version_list}")
if(DEFINED allow_versions)
message("Extra versions allowed: ${allow_versions}")
endif()
# now find all .exe and .dll files
# and call check_version on each of them
file(GLOB_RECURSE exe_files "*.exe")
file(GLOB_RECURSE dll_files "*.dll")
set(exe_files ${exe_files} ${dll_files})
foreach(f ${exe_files})
check_version(${f} "${manifest_version_list}")
endforeach()
# report a fatal error if there were any so that cmake will return
# a non zero value
if(fatal_error)
message(FATAL_ERROR "This distribution embeds dll "
" versions that it does not ship, and may not work on other machines.")
endif()
set(CMAKE_Fortran_FLAGS_INIT "")
set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
set(CMAKE_Fortran_MODDIR_FLAG "-fmod=")
set(CMAKE_Fortran_VERBOSE_FLAG "-v")
......@@ -45,7 +45,10 @@ UpdateCommand: @UPDATE_COMMAND@
UpdateOptions: @UPDATE_OPTIONS@
UpdateType: @UPDATE_TYPE@
# Dynamic analisys and coverage
# Compiler info
Compiler: @CMAKE_CXX_COMPILER@
# Dynamic analysis and coverage
PurifyCommand: @PURIFYCOMMAND@
ValgrindCommand: @VALGRIND_COMMAND@
ValgrindCommandOptions: @VALGRIND_COMMAND_OPTIONS@
......
......@@ -32,7 +32,7 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(SET_FEATURE_INFO _name _desc)
FUNCTION(SET_FEATURE_INFO _name _desc)
SET(_url "${ARGV2}")
SET(_comment "${ARGV3}")
SET_PROPERTY(GLOBAL PROPERTY ${_name}_DESCRIPTION "${_desc}" )
......@@ -42,10 +42,10 @@ MACRO(SET_FEATURE_INFO _name _desc)
IF(_comment MATCHES ".+")
SET_PROPERTY(GLOBAL PROPERTY ${_name}_COMMENT "${_comment}" )
ENDIF(_comment MATCHES ".+")
ENDMACRO(SET_FEATURE_INFO)
ENDFUNCTION(SET_FEATURE_INFO)
MACRO(_PRINT_FEATURES _property _text)
FUNCTION(_PRINT_FEATURES _property _text)
SET(_currentFeatureText "${_text}")
GET_PROPERTY(_EnabledFeatures GLOBAL PROPERTY ${_property})
FOREACH(_currentFeature ${_EnabledFeatures})
......@@ -64,15 +64,15 @@ MACRO(_PRINT_FEATURES _property _text)
ENDIF(_info)
ENDFOREACH(_currentFeature)
MESSAGE(STATUS "${_currentFeatureText}\n")
ENDMACRO(_PRINT_FEATURES)
ENDFUNCTION(_PRINT_FEATURES)
MACRO(PRINT_ENABLED_FEATURES)
FUNCTION(PRINT_ENABLED_FEATURES)
_PRINT_FEATURES( ENABLED_FEATURES "Enabled features:")
ENDMACRO(PRINT_ENABLED_FEATURES)
ENDFUNCTION(PRINT_ENABLED_FEATURES)
MACRO(PRINT_DISABLED_FEATURES)
FUNCTION(PRINT_DISABLED_FEATURES)
_PRINT_FEATURES( DISABLED_FEATURES "Disabled features:")
ENDMACRO(PRINT_DISABLED_FEATURES)
ENDFUNCTION(PRINT_DISABLED_FEATURES)
......@@ -569,6 +569,8 @@ ELSE (_boost_IN_CACHE)
endif()
elseif (MSVC90)
SET (_boost_COMPILER "-vc90")
elseif (MSVC10)
SET (_boost_COMPILER "-vc100")
elseif (MSVC80)
SET (_boost_COMPILER "-vc80")
elseif (MSVC71)
......
......@@ -469,8 +469,8 @@ endif (NOT CUDA_TOOLKIT_ROOT_DIR)
# CUDA_NVCC_EXECUTABLE
find_program(CUDA_NVCC_EXECUTABLE
NAMES nvcc
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/bin64"
"${CUDA_TOOLKIT_ROOT_DIR}/bin"
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/bin"
"${CUDA_TOOLKIT_ROOT_DIR}/bin64"
ENV CUDA_BIN_PATH
NO_DEFAULT_PATH
)
......
......@@ -67,11 +67,14 @@ SET(JAVA_AWT_LIBRARY_DIRECTORIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib"
)
FILE(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
$ENV{JAVA_HOME}/jre/lib/{libarch}
$ENV{JAVA_HOME}/jre/lib
$ENV{JAVA_HOME}/lib
$ENV{JAVA_HOME}
${_JAVA_HOME}/jre/lib/{libarch}
${_JAVA_HOME}/jre/lib
${_JAVA_HOME}/lib
${_JAVA_HOME}
/usr/lib
/usr/local/lib
/usr/lib/jvm/java/lib
......@@ -106,7 +109,7 @@ SET(JAVA_AWT_INCLUDE_DIRECTORIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
$ENV{JAVA_HOME}/include
${_JAVA_HOME}/include
/usr/include
/usr/local/include
/usr/lib/java/include
......
# - Message Passing Interface (MPI) module.
#
#
# The Message Passing Interface (MPI) is a library used to write
# high-performance parallel applications that use message passing, and
# is typically deployed on a cluster. MPI is a standard interface
......@@ -35,7 +35,7 @@
#
# If no compiler driver is found or the compiler driver is not
# recognized, this module will then search for common include paths
# and library names to try to detect MPI.
# and library names to try to detect MPI.
#
# If CMake initially finds a different MPI than was intended, and you
# want to use the MPI compiler auto-detection for a different MPI
......@@ -49,7 +49,7 @@
# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS ${MPIEXEC_PREFLAGS} EXECUTABLE
# ${MPIEXEC_POSTFLAGS} ARGS
# where PROCS is the number of processors on which to execute the program,
# EXECUTABLE is the MPI program, and ARGS are the arguments to pass to the
# EXECUTABLE is the MPI program, and ARGS are the arguments to pass to the
# MPI program.
#=============================================================================
......@@ -65,27 +65,64 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
# Try to find the MPI driver program
find_program(MPI_COMPILER
NAMES mpic++ mpicxx mpiCC mpicc
DOC "MPI compiler. Used only to detect MPI compilation flags.")
mark_as_advanced(MPI_COMPILER)
# This module is maintained by David Partyka <dave.partyka@kitware.com>.
# A set of directories to search through in addition to the standard system paths
# that find_program will search through.
# Microsoft HPC SDK is automatically added to the system path
# Argonne National Labs MPICH2 sets a registry key that we can use.
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles)
set(MPI_PACKAGE_DIR
mpi
mpich
openmpi
lib/mpi
lib/mpich
lib/openmpi
"MPICH/SDK"
"Microsoft Compute Cluster Pack"
)
set(MPI_PREFIX_PATH)
if(WIN32)
list(APPEND MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..")
endif()
foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH})
foreach(MpiPackageDir ${MPI_PREFIX_PATH})
if(EXISTS ${SystemPrefixDir}/${MpiPackageDir})
list(APPEND MPI_PREFIX_PATH "${SystemPrefixDir}/${MpiPackageDir}")
endif()
endforeach(MpiPackageDir)
endforeach(SystemPrefixDir)
# Most mpi distros have some form of mpiexec which gives us something we can reliably look for.
find_program(MPIEXEC
NAMES mpiexec mpirun lamexec
PATHS /usr/bin /usr/local/bin /usr/local/mpi/bin
"$ENV{SystemDrive}/Program Files/MPICH/SDK/Bin"
"${ProgramFiles}/MPICH2/Bin"
"$ENV{SystemDrive}/Program Files/Microsoft Compute Cluster Pack/Bin"
"$ENV{SystemDrive}/Program Files/Microsoft HPC Pack 2008 SDK/Bin"
DOC "Executable for running MPI programs.")
PATHS ${MPI_PREFIX_PATH}
PATH_SUFFIXES bin
DOC "Executable for running MPI programs."
)
# call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin).
# This gives us a fairly reliable base directory to search for /bin /lib and /include from.
get_filename_component(MPI_BASE_DIR "${MPIEXEC}" PATH)
get_filename_component(MPI_BASE_DIR "${MPI_BASE_DIR}" PATH)
# If there is an mpi compiler find it and interogate (farther below) it for the include
# and lib dirs otherwise we will continue to search from ${MPI_BASE_DIR}.
find_program(MPI_COMPILER
NAMES mpic++ mpicxx mpiCC mpicc
HINTS "${MPI_BASE_DIR}"
PATH_SUFFIXES bin
DOC "MPI compiler. Used only to detect MPI compilation flags.")
mark_as_advanced(MPI_COMPILER)
set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.")
set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.")
set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.")
set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.")
mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS
mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS
MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS)
if (MPI_INCLUDE_PATH AND MPI_LIBRARY)
......@@ -95,15 +132,16 @@ elseif (MPI_COMPILER)
# Check whether the -showme:compile option works. This indicates
# that we have either Open MPI or a newer version of LAM-MPI, and
# implies that -showme:link will also work.
exec_program(${MPI_COMPILER}
ARGS -showme:compile
# Note that Windows distros do not have an mpi compiler to interogate.
exec_program(${MPI_COMPILER}
ARGS -showme:compile
OUTPUT_VARIABLE MPI_COMPILE_CMDLINE
RETURN_VALUE MPI_COMPILER_RETURN)
if (MPI_COMPILER_RETURN EQUAL 0)
# If we appear to have -showme:compile, then we should also have
# -showme:link. Try it.
exec_program(${MPI_COMPILER}
exec_program(${MPI_COMPILER}
ARGS -showme:link
OUTPUT_VARIABLE MPI_LINK_CMDLINE
RETURN_VALUE MPI_COMPILER_RETURN)
......@@ -117,21 +155,21 @@ elseif (MPI_COMPILER)
# Do nothing: we have our command lines now
else (MPI_COMPILER_RETURN EQUAL 0)
# Older versions of LAM-MPI have "-showme". Try it.
exec_program(${MPI_COMPILER}
exec_program(${MPI_COMPILER}
ARGS -showme
OUTPUT_VARIABLE MPI_COMPILE_CMDLINE
RETURN_VALUE MPI_COMPILER_RETURN)
endif (MPI_COMPILER_RETURN EQUAL 0)
endif (MPI_COMPILER_RETURN EQUAL 0)
if (MPI_COMPILER_RETURN EQUAL 0)
# Do nothing: we have our command lines now
else (MPI_COMPILER_RETURN EQUAL 0)
# MPICH uses "-show". Try it.
exec_program(${MPI_COMPILER}
exec_program(${MPI_COMPILER}
ARGS -show
OUTPUT_VARIABLE MPI_COMPILE_CMDLINE
RETURN_VALUE MPI_COMPILER_RETURN)
endif (MPI_COMPILER_RETURN EQUAL 0)
endif (MPI_COMPILER_RETURN EQUAL 0)
if (MPI_COMPILER_RETURN EQUAL 0)
# We have our command lines, but we might need to copy
......@@ -167,12 +205,12 @@ elseif (MPI_COMPILE_CMDLINE)
string(REGEX REPLACE "//" "/" IPATH ${IPATH})
list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH})
endforeach(IPATH)
if (NOT MPI_INCLUDE_PATH_WORK)
if (MPI_COMPILER_MAY_HAVE_INCLIBDIRS)
# The compile command line didn't have any include paths on it,
# but we may have -showme:incdirs. Use it.
exec_program(${MPI_COMPILER}
exec_program(${MPI_COMPILER}
ARGS -showme:incdirs
OUTPUT_VARIABLE MPI_INCLUDE_PATH_WORK
RETURN_VALUE MPI_COMPILER_RETURN)
......@@ -183,7 +221,10 @@ elseif (MPI_COMPILE_CMDLINE)
if (NOT MPI_INCLUDE_PATH_WORK)
# If all else fails, just search for mpi.h in the normal include
# paths.
find_path(MPI_INCLUDE_PATH mpi.h)
find_path(MPI_INCLUDE_PATH mpi.h
HINTS ${MPI_BASE_DIR} ${MPI_PREFIX_PATH}
PATH_SUFFIXES include
)
set(MPI_INCLUDE_PATH_WORK ${MPI_INCLUDE_PATH})
endif (NOT MPI_INCLUDE_PATH_WORK)
......@@ -200,7 +241,7 @@ elseif (MPI_COMPILE_CMDLINE)
if (MPI_COMPILER_MAY_HAVE_INCLIBDIRS)
# The compile command line didn't have any linking paths on it,
# but we may have -showme:libdirs. Use it.
exec_program(${MPI_COMPILER}
exec_program(${MPI_COMPILER}
ARGS -showme:libdirs
OUTPUT_VARIABLE MPI_LINK_PATH
RETURN_VALUE MPI_COMPILER_RETURN)
......@@ -261,41 +302,29 @@ elseif (MPI_COMPILE_CMDLINE)
set(MPI_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI include path" FORCE)
set(MPI_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI linking flags" FORCE)
else (MPI_COMPILE_CMDLINE)
find_path(MPI_INCLUDE_PATH mpi.h
/usr/local/include
/usr/include
/usr/include/mpi
/usr/local/mpi/include
"$ENV{SystemDrive}/Program Files/MPICH/SDK/Include"
"${ProgramFiles}/MPICH2/include"
"$ENV{SystemDrive}/Program Files/Microsoft Compute Cluster Pack/Include"
"$ENV{SystemDrive}/Program Files/Microsoft HPC Pack 2008 SDK/Include"
# No MPI compiler to interogate so attempt to find everything with find functions.
find_path(MPI_INCLUDE_PATH mpi.h
HINTS ${MPI_BASE_DIR} ${MPI_PREFIX_PATH}
PATH_SUFFIXES include
)
# Decide between 32-bit and 64-bit libraries for Microsoft's MPI
if (CMAKE_CL_64)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
set(MS_MPI_ARCH_DIR amd64)
else (CMAKE_CL_64)
else()
set(MS_MPI_ARCH_DIR i386)
endif (CMAKE_CL_64)
endif()
find_library(MPI_LIBRARY
find_library(MPI_LIBRARY
NAMES mpi mpich msmpi
PATHS /usr/lib /usr/local/lib /usr/local/mpi/lib
"$ENV{SystemDrive}/Program Files/MPICH/SDK/Lib"
"${ProgramFiles}/MPICH2/Lib"
"$ENV{SystemDrive}/Program Files/Microsoft Compute Cluster Pack/Lib/${MS_MPI_ARCH_DIR}"
"$ENV{SystemDrive}/Program Files/Microsoft HPC Pack 2008 SDK/Lib/${MS_MPI_ARCH_DIR}"
HINTS ${MPI_BASE_DIR} ${MPI_PREFIX_PATH}
PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}
)
find_library(MPI_LIBRARY
NAMES mpich2
PATHS
"${ProgramFiles}/MPICH2/Lib")
find_library(MPI_EXTRA_LIBRARY
find_library(MPI_EXTRA_LIBRARY
NAMES mpi++
PATHS /usr/lib /usr/local/lib /usr/local/mpi/lib
"$ENV{SystemDrive}/Program Files/MPICH/SDK/Lib"
HINTS ${MPI_BASE_DIR} ${MPI_PREFIX_PATH}
PATH_SUFFIXES lib
DOC "Extra MPI libraries to link against.")
set(MPI_COMPILE_FLAGS "" CACHE STRING "MPI compilation flags")
......@@ -308,7 +337,7 @@ if("${MPI_LIBRARY}" MATCHES "mpich.rts")
set(MPI_LIBRARY ${MPI_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts)
endif("${MPI_LIBRARY}" MATCHES "mpich.rts")
# Set up extra variables to conform to
# Set up extra variables to conform to
if (MPI_EXTRA_LIBRARY)
set(MPI_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
else (MPI_EXTRA_LIBRARY)
......@@ -322,8 +351,13 @@ else (MPI_INCLUDE_PATH AND MPI_LIBRARY)
endif (MPI_INCLUDE_PATH AND MPI_LIBRARY)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments
# handle the QUIETLY and REQUIRED arguments
find_package_handle_standard_args(MPI DEFAULT_MSG MPI_LIBRARY MPI_INCLUDE_PATH)
mark_as_advanced(MPI_INCLUDE_PATH MPI_COMPILE_FLAGS MPI_LINK_FLAGS MPI_LIBRARY
mark_as_advanced(MPI_INCLUDE_PATH MPI_COMPILE_FLAGS MPI_LINK_FLAGS MPI_LIBRARY
MPI_EXTRA_LIBRARY)
# unset to cleanup namespace
unset(MPI_PACKAGE_DIR)
unset(MPI_PREFIX_PATH)
unset(MPI_BASE_DIR)
......@@ -96,13 +96,22 @@ if(OSG_INCLUDE_DIR)
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}")
endif()
file(READ "${OSG_INCLUDE_DIR}/osg/Version" _osg_Version_contents)