summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CTestCustom.cmake.in1
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake5
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake5
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake5
-rw-r--r--Modules/Compiler/Absoft-Fortran.cmake2
-rw-r--r--Modules/Compiler/Cray-Fortran.cmake2
-rw-r--r--Modules/Compiler/G95-Fortran.cmake2
-rw-r--r--Modules/Compiler/GNU-Fortran.cmake3
-rw-r--r--Modules/Compiler/HP-Fortran.cmake2
-rw-r--r--Modules/Compiler/Intel-Fortran.cmake2
-rw-r--r--Modules/Compiler/MIPSpro-Fortran.cmake2
-rw-r--r--Modules/Compiler/NAG-Fortran.cmake2
-rw-r--r--Modules/Compiler/PGI-Fortran.cmake3
-rw-r--r--Modules/Compiler/PathScale-Fortran.cmake2
-rw-r--r--Modules/Compiler/SunPro-Fortran.cmake2
-rw-r--r--Modules/Compiler/XL-Fortran.cmake3
-rw-r--r--Modules/FindBLAS.cmake23
-rw-r--r--Modules/FindLAPACK.cmake68
-rw-r--r--Modules/FindPackageMessage.cmake1
-rw-r--r--Modules/FindPythonInterp.cmake45
-rw-r--r--Modules/UseJava.cmake5
-rw-r--r--Modules/exportheader.cmake.in2
-rw-r--r--Source/CTest/cmCTestRunTest.cxx2
-rw-r--r--Source/CTest/cmParsePHPCoverage.cxx1
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.cxx2
-rw-r--r--Source/cmCTest.cxx2
-rw-r--r--Source/cmDocumentVariables.cxx9
-rw-r--r--Source/cmFileCommand.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx29
-rw-r--r--Source/cmLocalGenerator.cxx25
-rw-r--r--Source/cmLocalGenerator.h8
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx38
-rw-r--r--Source/cmMakefileTargetGenerator.cxx35
-rw-r--r--Source/cmMakefileTargetGenerator.h2
-rw-r--r--Source/cmSourceFile.cxx9
-rw-r--r--Source/cmTarget.cxx12
-rw-r--r--Source/cmake.cxx7
-rw-r--r--Source/kwsys/Glob.cxx40
-rw-r--r--Source/kwsys/Glob.hxx.in4
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake2
-rw-r--r--Tests/Fortran/CMakeLists.txt2
-rw-r--r--Tests/FortranOnly/CMakeLists.txt3
-rw-r--r--Tests/FortranOnly/world.f9
-rw-r--r--Tests/Module/GenerateExportHeader/CMakeLists.txt2
-rw-r--r--Tests/Module/GenerateExportHeader/nodeprecated/CMakeLists.txt26
-rw-r--r--Tests/Module/GenerateExportHeader/nodeprecated/CMakeLists.txt.in15
-rw-r--r--Tests/Module/GenerateExportHeader/nodeprecated/src/main.cpp9
-rw-r--r--Tests/Module/GenerateExportHeader/nodeprecated/src/someclass.cpp9
-rw-r--r--Tests/Module/GenerateExportHeader/nodeprecated/src/someclass.h10
-rw-r--r--Tests/Module/GenerateExportHeader/prefix/CMakeLists.txt15
-rw-r--r--Tests/Module/GenerateExportHeader/prefix/main.cpp8
-rw-r--r--Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp7
-rw-r--r--Tests/Module/GenerateExportHeader/prefix/useprefixclass.h13
53 files changed, 444 insertions, 100 deletions
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index e175d9f..0e61da4 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -43,6 +43,7 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element"
"cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast
"ld: warning: directory not found for option .-(F|L)"
+ "warning.*This version of Mac OS X is unsupported"
)
IF(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 06664c1..e2e268f 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -105,10 +105,7 @@ ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
SET(CMAKE_C_COMPILER_ID_RUN 1)
SET(CMAKE_C_PLATFORM_ID "Windows")
-
- # TODO: Set the compiler id. It is probably MSVC but
- # the user may be using an integrated Intel compiler.
- # SET(CMAKE_C_COMPILER_ID "MSVC")
+ SET(CMAKE_C_COMPILER_ID "MSVC")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT CMAKE_C_COMPILER_ID_RUN)
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index e77672d..8298369 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -117,10 +117,7 @@ ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
SET(CMAKE_CXX_COMPILER_ID_RUN 1)
SET(CMAKE_CXX_PLATFORM_ID "Windows")
-
- # TODO: Set the compiler id. It is probably MSVC but
- # the user may be using an integrated Intel compiler.
- # SET(CMAKE_CXX_COMPILER_ID "MSVC")
+ SET(CMAKE_CXX_COMPILER_ID "MSVC")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT CMAKE_CXX_COMPILER_ID_RUN)
SET(CMAKE_CXX_COMPILER_ID_RUN 1)
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index ed4e983..efcba29 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -146,10 +146,7 @@ MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER)
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
SET(CMAKE_Fortran_PLATFORM_ID "Windows")
-
- # TODO: Set the compiler id. It is probably MSVC but
- # the user may be using an integrated Intel compiler.
- # SET(CMAKE_Fortran_COMPILER_ID "MSVC")
+ SET(CMAKE_Fortran_COMPILER_ID "Intel")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
diff --git a/Modules/Compiler/Absoft-Fortran.cmake b/Modules/Compiler/Absoft-Fortran.cmake
index bb7d3dc..1bb7b1f 100644
--- a/Modules/Compiler/Absoft-Fortran.cmake
+++ b/Modules/Compiler/Absoft-Fortran.cmake
@@ -6,3 +6,5 @@ SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
SET(CMAKE_Fortran_MODDIR_FLAG "-YMOD_OUT_DIR=")
SET(CMAKE_Fortran_MODPATH_FLAG "-p")
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree")
diff --git a/Modules/Compiler/Cray-Fortran.cmake b/Modules/Compiler/Cray-Fortran.cmake
index 4f45176..5d81bb0 100644
--- a/Modules/Compiler/Cray-Fortran.cmake
+++ b/Modules/Compiler/Cray-Fortran.cmake
@@ -2,3 +2,5 @@ set(CMAKE_Fortran_VERBOSE_FLAG "-v")
set(CMAKE_Fortran_MODOUT_FLAG -em)
set(CMAKE_Fortran_MODDIR_FLAG -J)
set(CMAKE_Fortran_MODDIR_DEFAULT .)
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-f fixed")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-f free")
diff --git a/Modules/Compiler/G95-Fortran.cmake b/Modules/Compiler/G95-Fortran.cmake
index cbd4661..fd84848 100644
--- a/Modules/Compiler/G95-Fortran.cmake
+++ b/Modules/Compiler/G95-Fortran.cmake
@@ -5,3 +5,5 @@ 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")
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index 6e0f5f3..c710e86 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/GNU)
__compiler_gnu(Fortran)
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")
+
# No -DNDEBUG for Fortran.
SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
diff --git a/Modules/Compiler/HP-Fortran.cmake b/Modules/Compiler/HP-Fortran.cmake
index 7f7c128..04fb96e 100644
--- a/Modules/Compiler/HP-Fortran.cmake
+++ b/Modules/Compiler/HP-Fortran.cmake
@@ -1 +1,3 @@
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "+source=fixed")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "+source=free")
diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake
index f38b32e..467abdc 100644
--- a/Modules/Compiler/Intel-Fortran.cmake
+++ b/Modules/Compiler/Intel-Fortran.cmake
@@ -5,3 +5,5 @@ SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
diff --git a/Modules/Compiler/MIPSpro-Fortran.cmake b/Modules/Compiler/MIPSpro-Fortran.cmake
index 7f7c128..9220d3b 100644
--- a/Modules/Compiler/MIPSpro-Fortran.cmake
+++ b/Modules/Compiler/MIPSpro-Fortran.cmake
@@ -1 +1,3 @@
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixedform")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-freeform")
diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake
index b68c479..9a89746 100644
--- a/Modules/Compiler/NAG-Fortran.cmake
+++ b/Modules/Compiler/NAG-Fortran.cmake
@@ -30,3 +30,5 @@ endif()
set(CMAKE_Fortran_MODDIR_FLAG "-mdir ")
set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-PIC")
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
diff --git a/Modules/Compiler/PGI-Fortran.cmake b/Modules/Compiler/PGI-Fortran.cmake
index 1d26315..aebc7b1 100644
--- a/Modules/Compiler/PGI-Fortran.cmake
+++ b/Modules/Compiler/PGI-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/PGI)
__compiler_pgi(Fortran)
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-Mnofreeform")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-Mfreeform")
+
SET(CMAKE_Fortran_FLAGS_INIT "${CMAKE_Fortran_FLAGS_INIT} -Mpreprocess -Kieee")
SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "${CMAKE_Fortran_FLAGS_DEBUG_INIT} -Mbounds")
diff --git a/Modules/Compiler/PathScale-Fortran.cmake b/Modules/Compiler/PathScale-Fortran.cmake
index 20c9d7e..e05bf2a 100644
--- a/Modules/Compiler/PathScale-Fortran.cmake
+++ b/Modules/Compiler/PathScale-Fortran.cmake
@@ -2,3 +2,5 @@ include(Compiler/PathScale)
__compiler_pathscale(Fortran)
SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixedform")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-freeform")
diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake
index a41b454..86d6def 100644
--- a/Modules/Compiler/SunPro-Fortran.cmake
+++ b/Modules/Compiler/SunPro-Fortran.cmake
@@ -1,4 +1,6 @@
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G")
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index d88b3f3..e7026f1 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/XL)
__compiler_xl(Fortran)
+set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-qfixed") # [=<right_margin>]
+set(CMAKE_Fortran_FORMAT_FREE_FLAG "-qfree") # [=f90|ibm]
+
SET(CMAKE_Fortran_MODDIR_FLAG "-qmoddir=")
SET(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index dc9ab37..9b76d90 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -42,6 +42,8 @@
include(CheckFunctionExists)
include(CheckFortranFunctionExists)
+set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+
# Check the language being used
get_property( _LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES )
if( _LANGUAGES_ MATCHES Fortran )
@@ -89,13 +91,18 @@ foreach(_library ${_list})
if(_libraries_work)
if (BLA_STATIC)
if (WIN32)
- set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll")
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ( WIN32 )
if (APPLE)
- set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll")
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
else (APPLE)
- set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif (APPLE)
+ else (BLA_STATIC)
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ # for ubuntu's libblas3gf and liblapack3gf packages
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
+ endif ()
endif (BLA_STATIC)
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
@@ -349,7 +356,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
BLAS_LIBRARIES
BLAS
sgemm
- "" "acml_mp;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS}
+ "" "acml;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS}
)
if( BLAS_LIBRARIES )
break()
@@ -361,7 +368,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
BLAS_LIBRARIES
BLAS
sgemm
- "" "acml_mp;acml_mv" "" ${BLAS_ACML_LIB_DIRS}
+ "" "acml;acml_mv" "" ${BLAS_ACML_LIB_DIRS}
)
if( BLAS_LIBRARIES )
break()
@@ -408,7 +415,7 @@ if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
- cblas_dgemm
+ dgemm
""
"Accelerate"
""
@@ -421,7 +428,7 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
- cblas_dgemm
+ dgemm
""
"vecLib"
""
@@ -613,3 +620,5 @@ else(BLA_F95)
endif(BLAS_FOUND)
endif(NOT BLAS_FIND_QUIETLY)
endif(BLA_F95)
+
+set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 80fe867..bccf789 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -36,6 +36,8 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
if (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFunctionExists)
@@ -46,6 +48,8 @@ endif (NOT _LANGUAGES_ MATCHES Fortran)
set(LAPACK_FOUND FALSE)
set(LAPACK95_FOUND FALSE)
+# TODO: move this stuff to separate module
+
macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads)
# This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the
@@ -61,38 +65,38 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads
set(_libraries_work TRUE)
set(${LIBRARIES})
set(_combined_name)
+if (NOT _libdir)
+ if (WIN32)
+ set(_libdir ENV LIB)
+ elseif (APPLE)
+ set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH)
+ else ()
+ set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
+ endif ()
+endif ()
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
if(_libraries_work)
- IF (WIN32)
- if(BLA_STATIC)
- set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll")
- endif(BLA_STATIC)
- find_library(${_prefix}_${_library}_LIBRARY
- NAMES ${_library}
- PATHS ENV LIB
- )
- ENDIF (WIN32)
-
- if(APPLE)
- if(BLA_STATIC)
- set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib")
- endif(BLA_STATIC)
+ if (BLA_STATIC)
+ if (WIN32)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRRAY_SUFFIXES})
+ endif ( WIN32 )
+ if (APPLE)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRRAY_SUFFIXES})
+ else (APPLE)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRRAY_SUFFIXES})
+ endif (APPLE)
+ else (BLA_STATIC)
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ # for ubuntu's libblas3gf and liblapack3gf packages
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRRAY_SUFFIXES} .so.3gf)
+ endif ()
+ endif (BLA_STATIC)
find_library(${_prefix}_${_library}_LIBRARY
- NAMES ${_library}
- PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH
- )
- else(APPLE)
- if(BLA_STATIC)
- set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
- endif(BLA_STATIC)
- find_library(${_prefix}_${_library}_LIBRARY
- NAMES ${_library}
- PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH
- )
- endif(APPLE)
-
+ NAMES ${_library}
+ PATHS ${_libdir}
+ )
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
@@ -165,7 +169,7 @@ endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
#acml lapack
- if (BLA_VENDOR STREQUAL "ACML.*" OR BLA_VENDOR STREQUAL "All")
+ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
if (BLAS_LIBRARIES MATCHES ".+acml.+")
set (LAPACK_LIBRARIES ${BLAS_LIBRARIES})
endif ()
@@ -199,7 +203,9 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
endif ( NOT LAPACK_LIBRARIES )
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
# Generic LAPACK library?
-if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
+if (BLA_VENDOR STREQUAL "Generic" OR
+ BLA_VENDOR STREQUAL "ATLAS" OR
+ BLA_VENDOR STREQUAL "All")
if ( NOT LAPACK_LIBRARIES )
check_lapack_libraries(
LAPACK_LIBRARIES
@@ -211,7 +217,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
""
)
endif ( NOT LAPACK_LIBRARIES )
-endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
+endif ()
#intel lapack
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
@@ -297,3 +303,5 @@ else(BLA_F95)
endif(LAPACK_FOUND)
endif(NOT LAPACK_FIND_QUIETLY)
endif(BLA_F95)
+
+set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake
index eb398b2..48d3472 100644
--- a/Modules/FindPackageMessage.cmake
+++ b/Modules/FindPackageMessage.cmake
@@ -34,6 +34,7 @@
FUNCTION(FIND_PACKAGE_MESSAGE pkg msg details)
# Avoid printing a message repeatedly for the same find result.
IF(NOT ${pkg}_FIND_QUIETLY)
+ STRING(REGEX REPLACE "[\n]" "" details "${details}")
SET(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
IF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 46cde43..a10ec23 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -4,11 +4,17 @@
#
# PYTHONINTERP_FOUND - Was the Python executable found
# PYTHON_EXECUTABLE - path to the Python interpreter
-# Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for
#
+# PYTHON_VERSION_STRING - Python version found e.g. 2.5.2
+# PYTHON_VERSION_MAJOR - Python major version found e.g. 2
+# PYTHON_VERSION_MINOR - Python minor version found e.g. 5
+# PYTHON_VERSION_PATCH - Python patch version found e.g. 2
+#
+# Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for
#=============================================================================
# Copyright 2005-2010 Kitware, Inc.
+# Copyright 2011 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -20,32 +26,41 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Search for the current active python version first
+find_program(PYTHON_EXECUTABLE NAMES python)
+
# Set up the versions we know about, in the order we will search. Always add
# the user supplied additional versions to the front.
set(_Python_VERSIONS
${Python_ADDITIONAL_VERSIONS}
2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
-# Run first with the Python version in the executable
-foreach(_CURRENT_VERSION ${_Python_VERSIONS})
- set(_Python_NAMES python${_CURRENT_VERSION})
- if(WIN32)
- list(APPEND _Python_NAMES python)
- endif()
- find_program(PYTHON_EXECUTABLE
- NAMES ${_Python_NAMES}
- PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]
- )
-endforeach()
-# Now without any version if we still haven't found it
+# Search for newest python version if python executable isn't found
if(NOT PYTHON_EXECUTABLE)
- find_program(PYTHON_EXECUTABLE NAMES python)
+ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
+ set(_Python_NAMES python${_CURRENT_VERSION})
+ if(WIN32)
+ list(APPEND _Python_NAMES python)
+ endif()
+ find_program(PYTHON_EXECUTABLE
+ NAMES ${_Python_NAMES}
+ PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]
+ )
+ endforeach()
endif()
+# determine python version string
+if(PYTHON_EXECUTABLE)
+ execute_process(COMMAND "${PYTHON_EXECUTABLE}" --version ERROR_VARIABLE _VERSION OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE)
+ string(REPLACE "Python " "" PYTHON_VERSION_STRING "${_VERSION}")
+ string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}")
+ string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}")
+ string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}")
+endif()
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp DEFAULT_MSG PYTHON_EXECUTABLE)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING)
mark_as_advanced(PYTHON_EXECUTABLE)
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 869394d..b78278c 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -262,7 +262,10 @@ function(add_jar _TARGET_NAME)
set(_JAVA_CLASS_FILE "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_REL_PATH}/${_JAVA_FILE}.class")
set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES} ${_JAVA_CLASS_FILE})
- elseif (_JAVA_EXT MATCHES ".jar")
+ elseif (_JAVA_EXT MATCHES ".jar"
+ OR _JAVA_EXT MATCHES ".war"
+ OR _JAVA_EXT MATCHES ".ear"
+ OR _JAVA_EXT MATCHES ".sar")
list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_SOURCE_FILE})
elseif (_JAVA_EXT STREQUAL "")
diff --git a/Modules/exportheader.cmake.in b/Modules/exportheader.cmake.in
index 131d3a7..80a879d 100644
--- a/Modules/exportheader.cmake.in
+++ b/Modules/exportheader.cmake.in
@@ -32,4 +32,4 @@
# define @NO_DEPRECATED_MACRO_NAME@
#endif
-#endif // @INCLUDE_GUARD_NAME@
+#endif
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 60695da..81f18b0 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -93,6 +93,7 @@ void cmCTestRunTest::CompressOutput()
ret = deflateInit(&strm, -1); //default compression level
if (ret != Z_OK)
{
+ delete[] out;
return;
}
@@ -106,6 +107,7 @@ void cmCTestRunTest::CompressOutput()
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error during output "
"compression. Sending uncompressed output." << std::endl);
+ delete[] out;
return;
}
diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx
index 32c1ec1..593b2d1 100644
--- a/Source/CTest/cmParsePHPCoverage.cxx
+++ b/Source/CTest/cmParsePHPCoverage.cxx
@@ -159,6 +159,7 @@ bool cmParsePHPCoverage::ReadFileInformation(std::ifstream& in)
// read open quote
if(in.get(c) && c != '"')
{
+ delete[] s;
return false;
}
// read the string data
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index 1c48d8c..0e2cd22 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -68,7 +68,7 @@ void cmCursesLongMessageForm::UpdateStatusBar()
}
else
{
- width = cmCursesMainForm::MAX_WIDTH;
+ width = cmCursesMainForm::MAX_WIDTH-1;
}
bar[width] = '\0';
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 75a564e..702ba10 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -3096,6 +3096,7 @@ bool cmCTest::CompressString(std::string& str)
ret = deflateInit(&strm, -1); //default compression level
if (ret != Z_OK)
{
+ delete[] out;
return false;
}
@@ -3109,6 +3110,7 @@ bool cmCTest::CompressString(std::string& str)
{
cmCTestLog(this, ERROR_MESSAGE, "Error during gzip compression."
<< std::endl);
+ delete[] out;
return false;
}
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 26125d9..f2b01f1 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1049,6 +1049,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Variables that Control the Build");
cm->DefineProperty
+ ("CMAKE_Fortran_FORMAT", cmProperty::VARIABLE,
+ "Set to FIXED or FREE to indicate the Fortran source layout.",
+ "This variable is used to initialize the Fortran_FORMAT "
+ "property on all the targets. "
+ "See that target property for additional information.",
+ false,
+ "Variables that Control the Build");
+
+ cm->DefineProperty
("CMAKE_Fortran_MODULE_DIRECTORY", cmProperty::VARIABLE,
"Fortran module output directory.",
"This variable is used to initialize the "
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 9a3de9b..3b63906 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2982,6 +2982,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
std::string errStr = "UPLOAD cannot stat file '";
errStr += filename + "'.";
this->SetError(errStr.c_str());
+ fclose(fin);
return false;
}
@@ -2991,6 +2992,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
if(!curl)
{
this->SetError("UPLOAD error initializing curl.");
+ fclose(fin);
return false;
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 02a95fe..98a08a9 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -327,7 +327,9 @@ std::string
cmGlobalXCodeGenerator::PostBuildMakeTarget(std::string const& tName,
std::string const& configName)
{
- std::string out = "PostBuild." + tName;
+ std::string target = tName;
+ cmSystemTools::ReplaceString(target, " ", "_");
+ std::string out = "PostBuild." + target;
if(this->XcodeVersion > 20)
{
out += "." + configName;
@@ -582,6 +584,13 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
{
lg->AppendFlags(flags, cmtarget.GetProperty("COMPILE_FLAGS"));
}
+ const char* srcfmt = sf->GetProperty("Fortran_FORMAT");
+ switch(this->CurrentLocalGenerator->GetFortranFormat(srcfmt))
+ {
+ case cmLocalGenerator::FortranFormatFixed: flags="-fixed "+flags; break;
+ case cmLocalGenerator::FortranFormatFree: flags="-free "+flags; break;
+ default: break;
+ }
lg->AppendFlags(flags, sf->GetProperty("COMPILE_FLAGS"));
// Add per-source definitions.
@@ -770,7 +779,8 @@ cmGlobalXCodeGenerator::CreateXCodeFileReference(cmSourceFile* sf,
bool cmGlobalXCodeGenerator::SpecialTargetEmitted(std::string const& tname)
{
if(tname == "ALL_BUILD" || tname == "XCODE_DEPEND_HELPER" ||
- tname == "install" || tname == "package" || tname == "RUN_TESTS" )
+ tname == "install" || tname == "package" || tname == "RUN_TESTS" ||
+ tname == CMAKE_CHECK_BUILD_SYSTEM_TARGET )
{
if(this->TargetDoneSet.find(tname) != this->TargetDoneSet.end())
{
@@ -1903,6 +1913,21 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->CreateString(flags.c_str()));
}
+ // Add Fortran source format attribute if property is set.
+ const char* format = 0;
+ const char* tgtfmt = target.GetProperty("Fortran_FORMAT");
+ switch(this->CurrentLocalGenerator->GetFortranFormat(tgtfmt))
+ {
+ case cmLocalGenerator::FortranFormatFixed: format = "fixed"; break;
+ case cmLocalGenerator::FortranFormatFree: format = "free"; break;
+ default: break;
+ }
+ if(format)
+ {
+ buildSettings->AddAttribute("IFORT_LANG_SRCFMT",
+ this->CreateString(format));
+ }
+
// Create the INSTALL_PATH attribute.
std::string install_name_dir;
if(target.GetType() == cmTarget::SHARED_LIBRARY)
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 7da35eb..1d1e8da 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2917,6 +2917,31 @@ std::string cmLocalGenerator::EscapeForCMake(const char* str)
}
//----------------------------------------------------------------------------
+cmLocalGenerator::FortranFormat
+cmLocalGenerator::GetFortranFormat(const char* value)
+{
+ FortranFormat format = FortranFormatNone;
+ if(value && *value)
+ {
+ std::vector<std::string> fmt;
+ cmSystemTools::ExpandListArgument(value, fmt);
+ for(std::vector<std::string>::iterator fi = fmt.begin();
+ fi != fmt.end(); ++fi)
+ {
+ if(*fi == "FIXED")
+ {
+ format = FortranFormatFixed;
+ }
+ if(*fi == "FREE")
+ {
+ format = FortranFormatFree;
+ }
+ }
+ }
+ return format;
+}
+
+//----------------------------------------------------------------------------
std::string
cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
{
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index a204a73..cfc09dc 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -244,6 +244,14 @@ public:
/** Escape the given string as an argument in a CMake script. */
std::string EscapeForCMake(const char* str);
+ enum FortranFormat
+ {
+ FortranFormatNone,
+ FortranFormatFixed,
+ FortranFormatFree
+ };
+ FortranFormat GetFortranFormat(const char* value);
+
/** Return the directories into which object files will be put.
* There maybe more than one for fat binary systems like OSX.
*/
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 1f99cba..5417584 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -330,6 +330,8 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] =
{
{"Preprocess", "fpp", "Run Preprocessor on files", "preprocessYes", 0},
{"SuppressStartupBanner", "nologo", "SuppressStartupBanner", "true", 0},
+ {"SourceFileFormat", "fixed", "Use Fixed Format", "fileFormatFixed", 0},
+ {"SourceFileFormat", "free", "Use Free Format", "fileFormatFree", 0},
{"DebugInformationFormat", "Zi", "full debug", "debugEnabled", 0},
{"DebugInformationFormat", "debug:full", "full debug", "debugEnabled", 0},
{"DebugInformationFormat", "Z7", "c7 compat", "debugOldStyleInfo", 0},
@@ -687,6 +689,16 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
}
}
+ if(this->FortranProject)
+ {
+ switch(this->GetFortranFormat(target.GetProperty("Fortran_FORMAT")))
+ {
+ case FortranFormatFixed: flags += " -fixed"; break;
+ case FortranFormatFree: flags += " -free"; break;
+ default: break;
+ }
+ }
+
// Add the target-specific flags.
if(const char* targetFlags = target.GetProperty("COMPILE_FLAGS"))
{
@@ -1361,6 +1373,21 @@ cmLocalVisualStudio7GeneratorFCInfo
fc.CompileFlags = cflags;
needfc = true;
}
+ if(lg->FortranProject)
+ {
+ switch(lg->GetFortranFormat(sf.GetProperty("Fortran_FORMAT")))
+ {
+ case cmLocalGenerator::FortranFormatFixed:
+ fc.CompileFlags = "-fixed " + fc.CompileFlags;
+ needfc = true;
+ break;
+ case cmLocalGenerator::FortranFormatFree:
+ fc.CompileFlags = "-free " + fc.CompileFlags;
+ needfc = true;
+ break;
+ default: break;
+ }
+ }
if(const char* cdefs = sf.GetProperty("COMPILE_DEFINITIONS"))
{
fc.CompileDefs = cdefs;
@@ -1569,8 +1596,15 @@ void cmLocalVisualStudio7Generator
!fc.CompileDefs.empty() ||
!fc.CompileDefsConfig.empty())
{
- Options fileOptions(this, this->Version, Options::Compiler,
- cmLocalVisualStudio7GeneratorFlagTable,
+ Options::Tool tool = Options::Compiler;
+ cmVS7FlagTable const* table =
+ cmLocalVisualStudio7GeneratorFlagTable;
+ if(this->FortranProject)
+ {
+ tool = Options::FortranCompiler;
+ table = cmLocalVisualStudio7GeneratorFortranFlagTable;
+ }
+ Options fileOptions(this, this->Version, tool, table,
this->ExtraFlagTable);
fileOptions.Parse(fc.CompileFlags.c_str());
fileOptions.AddDefines(fc.CompileDefs.c_str());
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index d0df8f0..8b91194 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -504,6 +504,35 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(cmSourceFile& source)
//----------------------------------------------------------------------------
void
cmMakefileTargetGenerator
+::AppendFortranFormatFlags(std::string& flags, cmSourceFile& source)
+{
+ const char* srcfmt = source.GetProperty("Fortran_FORMAT");
+ cmLocalGenerator::FortranFormat format =
+ this->LocalGenerator->GetFortranFormat(srcfmt);
+ if(format == cmLocalGenerator::FortranFormatNone)
+ {
+ const char* tgtfmt = this->Target->GetProperty("Fortran_FORMAT");
+ format = this->LocalGenerator->GetFortranFormat(tgtfmt);
+ }
+ const char* var = 0;
+ switch (format)
+ {
+ case cmLocalGenerator::FortranFormatFixed:
+ var = "CMAKE_Fortran_FORMAT_FIXED_FLAG"; break;
+ case cmLocalGenerator::FortranFormatFree:
+ var = "CMAKE_Fortran_FORMAT_FREE_FLAG"; break;
+ default: break;
+ }
+ if(var)
+ {
+ this->LocalGenerator->AppendFlags(
+ flags, this->Makefile->GetDefinition(var));
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+cmMakefileTargetGenerator
::WriteObjectBuildFile(std::string &obj,
const char *lang,
cmSourceFile& source,
@@ -562,6 +591,12 @@ cmMakefileTargetGenerator
}
}
+ // Add Fortran format flags.
+ if(strcmp(lang, "Fortran") == 0)
+ {
+ this->AppendFortranFormatFlags(flags, source);
+ }
+
// Add flags from source file properties.
if (source.GetProperty("COMPILE_FLAGS"))
{
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index b68f8bf..674cd13 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -112,6 +112,8 @@ protected:
// Return the a string with -F flags on apple
std::string GetFrameworkFlags();
+ void AppendFortranFormatFlags(std::string& flags, cmSourceFile& source);
+
// append intertarget dependencies
void AppendTargetDepends(std::vector<std::string>& depends);
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index dfa2c0b..cd94753 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -437,6 +437,15 @@ void cmSourceFile::DefineProperties(cmake *cm)
"It will still be linked into the target though.");
cm->DefineProperty
+ ("Fortran_FORMAT", cmProperty::SOURCE_FILE,
+ "Set to FIXED or FREE to indicate the Fortran source layout.",
+ "This property tells CMake whether a given Fortran source file "
+ "uses fixed-format or free-format. "
+ "CMake will pass the corresponding format flag to the compiler. "
+ "Consider using the target-wide Fortran_FORMAT property if all "
+ "source files in a target share the same format.");
+
+ cm->DefineProperty
("GENERATED", cmProperty::SOURCE_FILE,
"Is this source file generated as part of the build process.",
"If a source file is generated by the build process CMake will "
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 4969b65..a7f50f6 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -919,6 +919,17 @@ void cmTarget::DefineProperties(cmake *cm)
);
cm->DefineProperty
+ ("Fortran_FORMAT", cmProperty::TARGET,
+ "Set to FIXED or FREE to indicate the Fortran source layout.",
+ "This property tells CMake whether the Fortran source files "
+ "in a target use fixed-format or free-format. "
+ "CMake will pass the corresponding format flag to the compiler. "
+ "Use the source-specific Fortran_FORMAT property to change the "
+ "format of a specific source file. "
+ "If the variable CMAKE_Fortran_FORMAT is set when a target "
+ "is created its value is used to initialize this property.");
+
+ cm->DefineProperty
("Fortran_MODULE_DIRECTORY", cmProperty::TARGET,
"Specify output directory for Fortran modules provided by the target.",
"If the target contains Fortran source files that provide modules "
@@ -1138,6 +1149,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->SetPropertyDefault("ARCHIVE_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("LIBRARY_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", 0);
+ this->SetPropertyDefault("Fortran_FORMAT", 0);
this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0);
this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
this->SetPropertyDefault("AUTOMOC", 0);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 2b8c718..86fd069 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2531,6 +2531,13 @@ int cmake::Generate()
this->ReportUndefinedPropertyAccesses
(this->GetProperty("REPORT_UNDEFINED_PROPERTIES"));
}
+ // Save the cache again after a successful Generate so that any internal
+ // variables created during Generate are saved. (Specifically target GUIDs
+ // for the Visual Studio and Xcode generators.)
+ if ( this->GetWorkingMode() == NORMAL_MODE )
+ {
+ this->CacheManager->SaveCache(this->GetHomeOutputDirectory());
+ }
return 0;
}
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx
index c1f5100..513eb64 100644
--- a/Source/kwsys/Glob.cxx
+++ b/Source/kwsys/Glob.cxx
@@ -215,7 +215,7 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
//----------------------------------------------------------------------------
void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, bool dir_only)
+ const kwsys_stl::string& dir)
{
kwsys::Directory d;
if ( !d.Load(dir.c_str()) )
@@ -258,25 +258,24 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
fullname = dir + "/" + fname;
}
- if ( !dir_only || !kwsys::SystemTools::FileIsDirectory(realname.c_str()) )
+ bool isDir = kwsys::SystemTools::FileIsDirectory(realname.c_str());
+ bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str());
+
+ if ( isDir && (!isSymLink || this->RecurseThroughSymlinks) )
{
- if ( (this->Internals->Expressions.size() > 0) &&
- this->Internals->Expressions[
- this->Internals->Expressions.size()-1].find(fname.c_str()) )
+ if (isSymLink)
{
- this->AddFile(this->Internals->Files, realname.c_str());
+ ++this->FollowedSymlinkCount;
}
+ this->RecurseDirectory(start+1, realname);
}
- if ( kwsys::SystemTools::FileIsDirectory(realname.c_str()) )
+ else
{
- bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str());
- if (!isSymLink || this->RecurseThroughSymlinks)
+ if ( (this->Internals->Expressions.size() > 0) &&
+ this->Internals->Expressions[
+ this->Internals->Expressions.size()-1].find(fname.c_str()) )
{
- if (isSymLink)
- {
- ++this->FollowedSymlinkCount;
- }
- this->RecurseDirectory(start+1, realname, dir_only);
+ this->AddFile(this->Internals->Files, realname.c_str());
}
}
}
@@ -284,13 +283,13 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
//----------------------------------------------------------------------------
void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, bool dir_only)
+ const kwsys_stl::string& dir)
{
//kwsys_ios::cout << "ProcessDirectory: " << dir << kwsys_ios::endl;
bool last = ( start == this->Internals->Expressions.size()-1 );
if ( last && this->Recurse )
{
- this->RecurseDirectory(start, dir, dir_only);
+ this->RecurseDirectory(start, dir);
return;
}
@@ -345,7 +344,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
// << this->Internals->TextExpressions[start].c_str() << kwsys_ios::endl;
//kwsys_ios::cout << "Full name: " << fullname << kwsys_ios::endl;
- if ( (!dir_only || !last) &&
+ if ( !last &&
!kwsys::SystemTools::FileIsDirectory(realname.c_str()) )
{
continue;
@@ -359,7 +358,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
}
else
{
- this->ProcessDirectory(start+1, realname + "/", dir_only);
+ this->ProcessDirectory(start+1, realname + "/");
}
}
}
@@ -462,12 +461,11 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr)
// Handle network paths
if ( skip > 0 )
{
- this->ProcessDirectory(0, fexpr.substr(0, skip) + "/",
- true);
+ this->ProcessDirectory(0, fexpr.substr(0, skip) + "/");
}
else
{
- this->ProcessDirectory(0, "/", true);
+ this->ProcessDirectory(0, "/");
}
return true;
}
diff --git a/Source/kwsys/Glob.hxx.in b/Source/kwsys/Glob.hxx.in
index cb050ee..88c343c 100644
--- a/Source/kwsys/Glob.hxx.in
+++ b/Source/kwsys/Glob.hxx.in
@@ -83,12 +83,12 @@ public:
protected:
//! Process directory
void ProcessDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, bool dir_only);
+ const kwsys_stl::string& dir);
//! Process last directory, but only when recurse flags is on. That is
// effectively like saying: /path/to/file/**/file
void RecurseDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, bool dir_only);
+ const kwsys_stl::string& dir);
//! Add regular expression
void AddExpression(const char* expr);
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 5cb5fc9..d3033d9 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011)
SET(KWSYS_DATE_STAMP_MONTH 09)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 05)
+SET(KWSYS_DATE_STAMP_DAY 07)
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index c216529..ba0bdcc 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -161,8 +161,10 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
add_executable(test_use_in_comment_fixedform
test_use_in_comment_fixedform.f)
+ set_property(SOURCE test_use_in_comment_fixedform.f PROPERTY Fortran_FORMAT FIXED)
add_executable(test_use_in_comment_freeform
test_use_in_comment_freeform.f90)
+ set_property(SOURCE test_use_in_comment_freeform.f90 PROPERTY Fortran_FORMAT FREE)
add_executable(test_in_interface
in_interface/main.f90
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index 3c4f0e7..d57a8b2 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -4,6 +4,9 @@ message("CTEST_FULL_OUTPUT ")
# create a library with hello and world functions
add_library(FortranOnlylib hello.f world.f)
+set_property(TARGET FortranOnlylib PROPERTY Fortran_FORMAT FIXED)
+set_property(SOURCE world.f PROPERTY Fortran_FORMAT FREE)
+
# create an executable that calls hello and world
add_executable(FortranOnly testf.f)
target_link_libraries(FortranOnly FortranOnlylib)
diff --git a/Tests/FortranOnly/world.f b/Tests/FortranOnly/world.f
index deae3fa..342b244 100644
--- a/Tests/FortranOnly/world.f
+++ b/Tests/FortranOnly/world.f
@@ -1,5 +1,4 @@
- SUBROUTINE WORLD
-
- PRINT *, 'World!'
-
- END
+! Free-format ".f" file to test Fortran_FORMAT property
+SUBROUTINE WORLD
+ PRINT *, 'World!'
+END
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index fee836e..3edb548 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -152,6 +152,8 @@ add_subdirectory(lib_shared_and_static)
add_subdirectory(lib_shared_and_statictest)
add_subdirectory(override_symbol)
+add_subdirectory(nodeprecated)
+add_subdirectory(prefix)
if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES Clang))
# We deliberately call deprecated methods, and test for that elsewhere.
diff --git a/Tests/Module/GenerateExportHeader/nodeprecated/CMakeLists.txt b/Tests/Module/GenerateExportHeader/nodeprecated/CMakeLists.txt
new file mode 100644
index 0000000..aeeb13a
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/nodeprecated/CMakeLists.txt
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(nodeprecated)
+
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_defined)
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_not_defined)
+
+configure_file(CMakeLists.txt.in ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_not_defined/CMakeLists.txt)
+set(DEFINE_NO_DEPRECATED DEFINE_NO_DEPRECATED)
+configure_file(CMakeLists.txt.in ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_defined/CMakeLists.txt)
+
+try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_not_defined_build
+ ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_not_defined
+ nodeprecated_test
+ OUTPUT_VARIABLE Out
+)
+
+test_pass(Result "Failed to build without no-deprecated define")
+
+try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_defined_build
+ ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_defined
+ nodeprecated_test
+ OUTPUT_VARIABLE Out
+)
+
+test_fail(Result "Built even with no-deprecated define") \ No newline at end of file
diff --git a/Tests/Module/GenerateExportHeader/nodeprecated/CMakeLists.txt.in b/Tests/Module/GenerateExportHeader/nodeprecated/CMakeLists.txt.in
new file mode 100644
index 0000000..d8dc482
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/nodeprecated/CMakeLists.txt.in
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(nodeprecated_test)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+include(GenerateExportHeader)
+
+add_library(nodeprecatedlib SHARED someclass.cpp)
+
+generate_export_header(nodeprecatedlib @DEFINE_NO_DEPRECATED@)
+
+add_executable(nodeprecatedconsumer main.cpp)
+
+target_link_libraries(nodeprecatedconsumer nodeprecatedlib)
diff --git a/Tests/Module/GenerateExportHeader/nodeprecated/src/main.cpp b/Tests/Module/GenerateExportHeader/nodeprecated/src/main.cpp
new file mode 100644
index 0000000..445a652
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/nodeprecated/src/main.cpp
@@ -0,0 +1,9 @@
+
+#include "someclass.h"
+
+int main(int, char**)
+{
+ SomeClass sc;
+ sc.someMethod();
+ return 0;
+} \ No newline at end of file
diff --git a/Tests/Module/GenerateExportHeader/nodeprecated/src/someclass.cpp b/Tests/Module/GenerateExportHeader/nodeprecated/src/someclass.cpp
new file mode 100644
index 0000000..a3f4111
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/nodeprecated/src/someclass.cpp
@@ -0,0 +1,9 @@
+
+#include "someclass.h"
+
+#ifndef NODEPRECATEDLIB_NO_DEPRECATED
+void SomeClass::someMethod() const
+{
+
+}
+#endif
diff --git a/Tests/Module/GenerateExportHeader/nodeprecated/src/someclass.h b/Tests/Module/GenerateExportHeader/nodeprecated/src/someclass.h
new file mode 100644
index 0000000..312a177
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/nodeprecated/src/someclass.h
@@ -0,0 +1,10 @@
+
+#include "nodeprecatedlib_export.h"
+
+class NODEPRECATEDLIB_EXPORT SomeClass
+{
+public:
+#ifndef NODEPRECATEDLIB_NO_DEPRECATED
+ void someMethod() const;
+#endif
+};
diff --git a/Tests/Module/GenerateExportHeader/prefix/CMakeLists.txt b/Tests/Module/GenerateExportHeader/prefix/CMakeLists.txt
new file mode 100644
index 0000000..bd64df2
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/prefix/CMakeLists.txt
@@ -0,0 +1,15 @@
+project(use_prefix)
+
+set(use_prefix_lib_SRCS
+ useprefixclass.cpp
+)
+
+add_library(use_prefix_lib SHARED useprefixclass.cpp)
+
+generate_export_header(use_prefix_lib
+ PREFIX_NAME MYPREFIX_
+)
+
+add_executable(use_prefix main.cpp)
+
+target_link_libraries(use_prefix use_prefix_lib) \ No newline at end of file
diff --git a/Tests/Module/GenerateExportHeader/prefix/main.cpp b/Tests/Module/GenerateExportHeader/prefix/main.cpp
new file mode 100644
index 0000000..d04ae3c
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/prefix/main.cpp
@@ -0,0 +1,8 @@
+
+#include "useprefixclass.h"
+
+int main(int argc, char **argv)
+{
+ UsePrefixClass upc;
+ return upc.someMethod();
+} \ No newline at end of file
diff --git a/Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp b/Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp
new file mode 100644
index 0000000..8337ab8
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp
@@ -0,0 +1,7 @@
+
+#include "useprefixclass.h"
+
+int UsePrefixClass::someMethod() const
+{
+ return 0;
+} \ No newline at end of file
diff --git a/Tests/Module/GenerateExportHeader/prefix/useprefixclass.h b/Tests/Module/GenerateExportHeader/prefix/useprefixclass.h
new file mode 100644
index 0000000..f5e31b5
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/prefix/useprefixclass.h
@@ -0,0 +1,13 @@
+
+#ifndef USEPREFIXCLASS_H
+#define USEPREFIXCLASS_H
+
+#include "use_prefix_lib_export.h"
+
+class MYPREFIX_USE_PREFIX_LIB_EXPORT UsePrefixClass
+{
+public:
+ int someMethod() const;
+};
+
+#endif