summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--CTestCustom.cmake.in1
-rw-r--r--Docs/cmake-help.vim21
-rw-r--r--Modules/BundleUtilities.cmake42
-rw-r--r--Modules/CMakeASM_NASMInformation.cmake46
-rw-r--r--Modules/CMakeCCompilerId.c.in5
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in5
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake4
-rw-r--r--Modules/CMakeDetermineASM_NASMCompiler.cmake27
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake3
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake7
-rw-r--r--Modules/CMakeDetermineRCCompiler.cmake6
-rw-r--r--Modules/CMakeFindEclipseCDT4.cmake6
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in1
-rw-r--r--Modules/CMakeFortranCompilerId.F.in9
-rw-r--r--Modules/CMakeFortranInformation.cmake42
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake7
-rw-r--r--Modules/CMakePlatformId.h.in6
-rw-r--r--Modules/CMakeRCCompiler.cmake.in2
-rw-r--r--Modules/CMakeTestASM-ATTCompiler.cmake8
-rw-r--r--Modules/CMakeTestASMCompiler.cmake9
-rw-r--r--Modules/CMakeTestASM_MASMCompiler.cmake8
-rw-r--r--Modules/CMakeTestASM_NASMCompiler.cmake23
-rwxr-xr-xModules/CPack.STGZ_Header.sh.in2
-rw-r--r--Modules/CPack.cmake18
-rw-r--r--Modules/CPackRPM.cmake42
-rw-r--r--Modules/CheckCCompilerFlag.cmake2
-rw-r--r--Modules/Compiler/NAG-Fortran.cmake32
-rw-r--r--Modules/ExternalProject.cmake53
-rw-r--r--Modules/FindBLAS.cmake48
-rw-r--r--Modules/FindBoost.cmake411
-rw-r--r--Modules/FindBullet.cmake5
-rw-r--r--Modules/FindCxxTest.cmake7
-rw-r--r--Modules/FindFLEX.cmake4
-rw-r--r--Modules/FindITK.cmake78
-rw-r--r--Modules/FindLAPACK.cmake34
-rw-r--r--Modules/FindOpenGL.cmake9
-rw-r--r--Modules/FindQt4.cmake92
-rw-r--r--Modules/FindTCL.cmake4
-rw-r--r--Modules/FortranCInterface/CMakeLists.txt2
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake138
-rw-r--r--Modules/NSIS.template.in7
-rw-r--r--Modules/Platform/CYGWIN-GNU.cmake3
-rw-r--r--Modules/Platform/CYGWIN-windres.cmake1
-rw-r--r--Modules/Platform/CYGWIN.cmake48
-rw-r--r--Modules/Platform/Darwin-GNU.cmake4
-rw-r--r--Modules/Platform/Darwin-NAG-Fortran.cmake5
-rw-r--r--Modules/Platform/Darwin-icc.cmake8
-rw-r--r--Modules/Platform/Darwin.cmake8
-rw-r--r--Modules/Platform/Linux-NAG-Fortran.cmake10
-rw-r--r--Modules/Platform/Windows-GNU.cmake2
-rw-r--r--Modules/Platform/Windows-Intel-C.cmake2
-rw-r--r--Modules/Platform/Windows-Intel-CXX.cmake4
-rw-r--r--Modules/Platform/Windows-Intel-Fortran.cmake11
-rw-r--r--Modules/Platform/Windows-Intel.cmake91
-rw-r--r--Modules/Platform/Windows-cl.cmake2
-rw-r--r--Modules/Platform/Windows-g++.cmake1
-rw-r--r--Modules/Platform/Windows-icl.cmake109
-rw-r--r--Modules/Platform/Windows-ifort.cmake80
-rw-r--r--Modules/Platform/Windows-windres.cmake1
-rw-r--r--Modules/Qt4ConfigDependentSettings.cmake23
-rw-r--r--Modules/Qt4Macros.cmake18
-rw-r--r--Modules/SystemInformation.cmake3
-rw-r--r--Source/CMakeLists.txt9
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx101
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.h4
-rw-r--r--Source/CPack/cmCPackGenerator.cxx103
-rw-r--r--Source/CPack/cmCPackGenerator.h28
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx104
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx77
-rw-r--r--Source/CPack/cmCPackRPMGenerator.h1
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx5
-rw-r--r--Source/CTest/cmCTestGIT.cxx57
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx67
-rw-r--r--Source/CTest/cmCTestRunTest.cxx11
-rw-r--r--Source/CTest/cmCTestRunTest.h4
-rw-r--r--Source/CTest/cmCTestSleepCommand.h9
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx84
-rw-r--r--Source/CTest/cmCTestTestHandler.h1
-rw-r--r--Source/CTest/cmCTestVC.cxx5
-rw-r--r--Source/CTest/cmCTestVC.h3
-rw-r--r--Source/CursesDialog/form/frm_driver.c18
-rw-r--r--Source/CursesDialog/form/frm_post.c9
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx153
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h12
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx28
-rw-r--r--Source/QtDialog/QCMakeCacheView.h4
-rw-r--r--Source/cmAddCustomCommandCommand.cxx1
-rw-r--r--Source/cmAddCustomCommandCommand.h12
-rw-r--r--Source/cmAddDependenciesCommand.cxx6
-rw-r--r--Source/cmAddDependenciesCommand.h2
-rw-r--r--Source/cmAddTestCommand.cxx17
-rw-r--r--Source/cmAddTestCommand.h20
-rw-r--r--Source/cmBootstrapCommands.cxx2
-rw-r--r--Source/cmCacheManager.cxx19
-rw-r--r--Source/cmCacheManager.h4
-rw-r--r--Source/cmCommands.cxx2
-rw-r--r--Source/cmComputeLinkInformation.cxx2
-rw-r--r--Source/cmComputeTargetDepends.cxx69
-rw-r--r--Source/cmComputeTargetDepends.h4
-rw-r--r--Source/cmCoreTryCompile.cxx37
-rw-r--r--Source/cmCustomCommand.cxx27
-rw-r--r--Source/cmCustomCommand.h11
-rw-r--r--Source/cmCustomCommandGenerator.cxx72
-rw-r--r--Source/cmCustomCommandGenerator.h40
-rw-r--r--Source/cmDepends.cxx2
-rw-r--r--Source/cmDocumentGeneratorExpressions.h30
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx21
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h1
-rw-r--r--Source/cmFileCommand.h7
-rw-r--r--Source/cmFindBase.cxx5
-rw-r--r--Source/cmGeneratorExpression.cxx8
-rw-r--r--Source/cmGeneratorExpression.h10
-rw-r--r--Source/cmGlobalGenerator.cxx24
-rw-r--r--Source/cmGlobalGenerator.h6
-rw-r--r--Source/cmGlobalMSYSMakefileGenerator.cxx7
-rw-r--r--Source/cmGlobalMinGWMakefileGenerator.cxx7
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx14
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h10
-rw-r--r--Source/cmGlobalVisualStudio10Win64Generator.cxx49
-rw-r--r--Source/cmGlobalVisualStudio10Win64Generator.h3
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx8
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx14
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx8
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h1
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx209
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h25
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx52
-rw-r--r--Source/cmGraphVizWriter.cxx435
-rw-r--r--Source/cmGraphVizWriter.h84
-rw-r--r--Source/cmLoadCacheCommand.cxx38
-rw-r--r--Source/cmLoadCacheCommand.h1
-rw-r--r--Source/cmLocalGenerator.cxx50
-rw-r--r--Source/cmLocalGenerator.h9
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx36
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx6
-rw-r--r--Source/cmLocalVisualStudio10Generator.h4
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx27
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx33
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx61
-rw-r--r--Source/cmLocalVisualStudioGenerator.h13
-rw-r--r--Source/cmMakefile.cxx25
-rw-r--r--Source/cmMakefileTargetGenerator.cxx21
-rw-r--r--Source/cmSourceFile.cxx4
-rw-r--r--Source/cmStringCommand.cxx2
-rw-r--r--Source/cmTarget.cxx73
-rw-r--r--Source/cmTargetDepend.h48
-rw-r--r--Source/cmTargetLinkLibrariesCommand.h4
-rw-r--r--Source/cmTest.cxx6
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx70
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx14
-rw-r--r--Source/cmWin32ProcessExecution.cxx3
-rw-r--r--Source/cmake.cxx392
-rw-r--r--Source/cmake.h76
-rw-r--r--Source/kwsys/CMakeLists.txt5
-rw-r--r--Source/kwsys/Registry.cxx3
-rw-r--r--Source/kwsys/SystemInformation.cxx451
-rw-r--r--Source/kwsys/SystemTools.cxx17
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake6
-rw-r--r--Source/kwsys/testSystemTools.cxx2
-rw-r--r--Tests/CMakeInstall.cmake3
-rw-r--r--Tests/CMakeLists.txt142
-rw-r--r--Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in9
-rw-r--r--Tests/CPackComponents/CMakeLists.txt13
-rw-r--r--Tests/CPackComponentsForAll/CMakeLists.txt120
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in7
-rw-r--r--Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake73
-rw-r--r--Tests/CPackComponentsForAll/mylib.cpp7
-rw-r--r--Tests/CPackComponentsForAll/mylib.h1
-rw-r--r--Tests/CPackComponentsForAll/mylibapp.cpp6
-rw-r--r--Tests/CTestTestCostSerial/CMakeLists.txt13
-rw-r--r--Tests/CTestTestCostSerial/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestCostSerial/sleep.c16
-rw-r--r--Tests/CTestTestCostSerial/test.cmake.in31
-rw-r--r--Tests/CTestTestZeroTimeout/CMakeLists.txt8
-rw-r--r--Tests/CTestTestZeroTimeout/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestZeroTimeout/sleep.c16
-rw-r--r--Tests/CTestTestZeroTimeout/test.cmake.in23
-rw-r--r--Tests/Complex/Executable/CMakeLists.txt9
-rw-r--r--Tests/Complex/Executable/complex_nobuild.c1
-rw-r--r--Tests/Contracts/Trilinos-10-6/CMakeLists.txt103
-rw-r--r--Tests/Contracts/Trilinos-10-6/Dashboard.cmake.in63
-rw-r--r--Tests/Contracts/Trilinos-10-6/EnvScript.cmake32
-rw-r--r--Tests/Contracts/Trilinos-10-6/Patch.cmake20
-rw-r--r--Tests/Contracts/Trilinos-10-6/RunTest.cmake7
-rw-r--r--Tests/Contracts/Trilinos-10-6/ValidateBuild.cmake.in39
-rw-r--r--Tests/CustomCommand/CMakeLists.txt20
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt56
-rw-r--r--Tests/ExportImport/Import/A/imp_lib1.c2
-rw-r--r--Tests/ForceInclude/CMakeLists.txt10
-rw-r--r--Tests/ForceInclude/foo.c7
-rw-r--r--Tests/ForceInclude/foo1.h1
-rw-r--r--Tests/ForceInclude/foo2.h1
-rw-r--r--Tests/Jump/Library/Shared/CMakeLists.txt4
-rw-r--r--Tests/PerConfig/CMakeLists.txt34
-rw-r--r--Tests/PerConfig/pcShared.c (renamed from Tests/Testing/pcShared.c)0
-rw-r--r--Tests/PerConfig/pcShared.h (renamed from Tests/Testing/pcShared.h)0
-rw-r--r--Tests/PerConfig/pcStatic.c (renamed from Tests/Testing/pcStatic.c)0
-rw-r--r--Tests/PerConfig/perconfig.c (renamed from Tests/Testing/perconfig.c)0
-rw-r--r--Tests/PerConfig/perconfig.cmake (renamed from Tests/Testing/driver.cmake)2
-rw-r--r--Tests/StringFileTest/CMakeLists.txt24
-rw-r--r--Tests/Testing/CMakeLists.txt34
-rw-r--r--Tests/Testing/Sub/Sub2/CMakeLists.txt12
-rw-r--r--Tests/TestsWorkingDirectory/CMakeLists.txt38
-rw-r--r--Tests/TestsWorkingDirectory/main.c64
-rw-r--r--Tests/TryCompile/CMakeLists.txt6
-rw-r--r--Tests/VSMidl/CMakeLists.txt81
-rw-r--r--Tests/VSMidl/src/CMakeLists.txt12
-rw-r--r--Tests/VSMidl/src/main.cpp17
-rw-r--r--Tests/VSMidl/src/test.idl30
-rw-r--r--Tests/VSResource/CMakeLists.txt7
-rw-r--r--Tests/VSResource/main.cpp10
-rw-r--r--Tests/VSResource/test.rc5
-rw-r--r--Tests/VSResource/test.txt1
-rw-r--r--Utilities/Release/Cygwin/CMakeLists.txt4
-rw-r--r--Utilities/cmcurl/CMake/OtherTests.cmake8
-rw-r--r--Utilities/cmcurl/CMakeLists.txt43
-rw-r--r--Utilities/cmcurl/config.h.in12
-rw-r--r--Utilities/cmcurl/select.c6
-rwxr-xr-xbootstrap1
221 files changed, 4727 insertions, 2098 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98bde02..4508e33 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,7 @@
# See the License for more information.
#=============================================================================
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR)
+SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
PROJECT(CMake)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index 882fa4c..0047e68 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -25,6 +25,7 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"Clock skew detected"
"remark\\(1209"
"remark: .*LOOP WAS VECTORIZED"
+ "warning .980: wrong number of actual arguments to intrinsic function .std::basic_"
"LINK : warning LNK4089: all references to.*ADVAPI32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF"
"Warning: library was too large for page size.*"
diff --git a/Docs/cmake-help.vim b/Docs/cmake-help.vim
new file mode 100644
index 0000000..17cfa83
--- /dev/null
+++ b/Docs/cmake-help.vim
@@ -0,0 +1,21 @@
+nmap ,hc :call OpenCmakeHelp()<CR>
+
+function! OpenCmakeHelp()
+ let s = getline( '.' )
+ let i = col( '.' ) - 1
+ while i > 0 && strpart( s, i, 1 ) =~ '[A-Za-z0-9_]'
+ let i = i - 1
+ endwhile
+ while i < col('$') && strpart( s, i, 1 ) !~ '[A-Za-z0-9_]'
+ let i = i + 1
+ endwhile
+ let start = match( s, '[A-Za-z0-9_]\+', i )
+ let end = matchend( s, '[A-Za-z0-9_]\+', i )
+ let ident = strpart( s, start, end - start )
+ execute "vertical new"
+ execute "%!cmake --help-command ".ident
+ set nomodified
+ set readonly
+endfunction
+
+autocmd BufRead,BufNewFile *.cmake,CMakeLists.txt,*.cmake.in nmap <F1> :call OpenCmakeHelp()<CR>
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index c7ead5b..44f2c20 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -27,6 +27,11 @@
# drag-n-drop copied to another machine and run on that machine as long as all
# of the system libraries are compatible.
#
+# If you pass plugins to fixup_bundle as the libs parameter, you should install
+# them or copy them into the bundle before calling fixup_bundle. The "libs"
+# parameter is a list of libraries that must be fixed up, but that cannot be
+# determined by otool output analysis. (i.e., plugins)
+#
# Gather all the keys for all the executables and libraries in a bundle, and
# then, for each key, copy each prerequisite into the bundle. Then fix each one
# up according to its own list of prerequisites.
@@ -112,6 +117,13 @@
# _EMBEDDED_ITEM keyed variable for that prerequisite. (Most likely changing to
# an "@executable_path" style reference.)
#
+# This function requires that the resolved_embedded_item be "inside" the bundle
+# already. In other words, if you pass plugins to fixup_bundle as the libs
+# parameter, you should install them or copy them into the bundle before
+# calling fixup_bundle. The "libs" parameter is a list of libraries that must
+# be fixed up, but that cannot be determined by otool output analysis. (i.e.,
+# plugins)
+#
# Also, change the id of the item being fixed up to its own _EMBEDDED_ITEM
# value.
#
@@ -472,11 +484,11 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
else()
#message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
+ if(UNIX AND NOT APPLE)
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
+ endif(UNIX AND NOT APPLE)
endif()
- if(UNIX AND NOT APPLE)
- file(RPATH_REMOVE FILE "${resolved_embedded_item}")
- endif(UNIX AND NOT APPLE)
endfunction(copy_resolved_item_into_bundle)
@@ -514,11 +526,11 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}")
endif()
endif()
+ if(UNIX AND NOT APPLE)
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
+ endif(UNIX AND NOT APPLE)
endif()
- if(UNIX AND NOT APPLE)
- file(RPATH_REMOVE FILE "${resolved_embedded_item}")
- endif(UNIX AND NOT APPLE)
endfunction(copy_resolved_framework_into_bundle)
@@ -527,6 +539,24 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
#
get_item_key("${resolved_embedded_item}" ikey)
+ # Ensure the item is "inside the .app bundle" -- it should not be fixed up if
+ # it is not in the .app bundle... Otherwise, we'll modify files in the build
+ # tree, or in other varied locations around the file system, with our call to
+ # install_name_tool. Make sure that doesn't happen here:
+ #
+ get_dotapp_dir("${exepath}" exe_dotapp_dir)
+ string(LENGTH "${exe_dotapp_dir}/" exe_dotapp_dir_length)
+ string(SUBSTRING "${resolved_embedded_item}" 0 ${exe_dotapp_dir_length} item_substring)
+ if(NOT "${exe_dotapp_dir}/" STREQUAL "${item_substring}")
+ message(" exe_dotapp_dir/='${exe_dotapp_dir}/'")
+ message(" item_substring='${item_substring}'")
+ message(" resolved_embedded_item='${resolved_embedded_item}'")
+ message("")
+ message("Install or copy the item into the bundle before calling fixup_bundle")
+ message("")
+ message(FATAL_ERROR "cannot fixup an item that is not in the bundle...")
+ endif()
+
set(prereqs "")
get_prerequisites("${resolved_embedded_item}" prereqs 1 0 "${exepath}" "${dirs}")
diff --git a/Modules/CMakeASM_NASMInformation.cmake b/Modules/CMakeASM_NASMInformation.cmake
new file mode 100644
index 0000000..9da7d30
--- /dev/null
+++ b/Modules/CMakeASM_NASMInformation.cmake
@@ -0,0 +1,46 @@
+
+#=============================================================================
+# Copyright 2010 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 distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# support for the nasm assembler
+
+set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
+
+if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
+ if(WIN32)
+ if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
+ else()
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
+ endif()
+ elseif(APPLE)
+ if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
+ else()
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
+ endif()
+ else()
+ if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
+ else()
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
+ endif()
+ endif()
+endif()
+
+set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
+
+# Load the generic ASMInformation file:
+set(ASM_DIALECT "_NASM")
+include(CMakeASMInformation)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 2b80c88..c7778fb 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -45,6 +45,9 @@
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
+#elif defined(__TI_COMPILER_VERSION__)
+# define COMPILER_ID "TI_DSP"
+
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
@@ -88,7 +91,7 @@
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
-char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
+char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 91f116a..2ff227a 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -47,6 +47,9 @@
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
+#elif defined(__TI_COMPILER_VERSION__)
+# define COMPILER_ID "TI_DSP"
+
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
@@ -79,7 +82,7 @@
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
-char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
+char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 06dd6b8..7a443e0 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -64,7 +64,11 @@ IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU )
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "GNU assembler")
+ LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP )
+ SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h")
+ SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments")
+ INCLUDE(CMakeDetermineCompilerId)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
diff --git a/Modules/CMakeDetermineASM_NASMCompiler.cmake b/Modules/CMakeDetermineASM_NASMCompiler.cmake
new file mode 100644
index 0000000..d184c0a
--- /dev/null
+++ b/Modules/CMakeDetermineASM_NASMCompiler.cmake
@@ -0,0 +1,27 @@
+
+#=============================================================================
+# Copyright 2010 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 distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
+
+SET(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
+
+IF(NOT CMAKE_ASM_NASM_COMPILER)
+ FIND_PROGRAM(CMAKE_ASM_NASM_COMPILER nasm
+ "$ENV{ProgramFiles}/NASM")
+ENDIF(NOT CMAKE_ASM_NASM_COMPILER)
+
+# Load the generic DetermineASM compiler file with the DIALECT set properly:
+SET(ASM_DIALECT "_NASM")
+INCLUDE(CMakeDetermineASMCompiler)
+SET(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index d6df305..ed0b6fb 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -64,7 +64,8 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
AND NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";"
# Skip this with Xcode for now.
AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
- CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log)
+ CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log
+ "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Parsed ${lang} implicit link information from above output:\n${log}\n\n")
ENDIF()
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 03ddd78..5355886 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -169,6 +169,9 @@ IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
+ LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS NAG) # Numerical Algorithms Group
+ SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V")
+ SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler")
# Try to identify the compiler.
SET(CMAKE_Fortran_COMPILER_ID)
@@ -215,6 +218,10 @@ ENDIF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
INCLUDE(CMakeFindBinUtils)
+IF(MSVC_Fortran_ARCHITECTURE_ID)
+ SET(SET_MSVC_Fortran_ARCHITECTURE_ID
+ "SET(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
+ENDIF()
# configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake
index 094b893..8e085af 100644
--- a/Modules/CMakeDetermineRCCompiler.cmake
+++ b/Modules/CMakeDetermineRCCompiler.cmake
@@ -54,6 +54,12 @@ ENDIF(NOT CMAKE_RC_COMPILER)
MARK_AS_ADVANCED(CMAKE_RC_COMPILER)
+GET_FILENAME_COMPONENT(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
+IF(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
+ SET(CMAKE_RC_OUTPUT_EXTENSION .obj)
+ELSE()
+ SET(CMAKE_RC_OUTPUT_EXTENSION .res)
+ENDIF()
# configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index 836e4c9..fbcdc98 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -17,6 +17,12 @@
FIND_PROGRAM(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable")
+# This variable is used by the Eclipse generator and appended to the make invocation commands.
+SET(CMAKE_ECLIPSE_MAKE_ARGUMENTS "" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
+
+# This variable is used by the Eclipse generator in out-of-source builds only.
+SET(ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
+MARK_AS_ADVANCED(ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT)
# The Eclipse generator needs to know the standard include path
# so that Eclipse ca find the headers at runtime and parsing etc. works better
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index 5558651..146a6f2 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -2,6 +2,7 @@ SET(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
SET(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
SET(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
SET(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
+@SET_MSVC_Fortran_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 4080cc1..8584731 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -109,4 +109,13 @@
# endif
PRINT *, 'INFO:platform[]'
#endif
+#if defined(_WIN32) && (defined(__INTEL_COMPILER) || defined(__ICC))
+# if defined(_M_IA64)
+ PRINT *, 'INFO:arch[IA64]'
+# elif defined(_M_X64) || defined(_M_AMD64)
+ PRINT *, 'INFO:arch[x64]'
+# elif defined(_M_IX86)
+ PRINT *, 'INFO:arch[X86]'
+# endif
+#endif
END
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index f6a52c6..1e9b4e0 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -67,29 +67,29 @@ SET(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
# Create a set of shared library variable specific to Fortran
# For 90% of the systems, these are the same flags as the C versions
# so if these are not set just copy the flags from the c version
-IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
+ENDIF()
-IF(NOT CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
+ENDIF()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
-ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
+ENDIF()
-IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
+ENDIF()
-IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
+ENDIF()
-IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
+ENDIF()
IF(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
SET(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
@@ -100,25 +100,25 @@ IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
ENDIF()
# repeat for modules
-IF(NOT CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
+IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
+ENDIF()
-IF(NOT CMAKE_SHARED_MODULE_Fortran_FLAGS)
+IF(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_Fortran_FLAGS)
+ENDIF()
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
+IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
+ENDIF()
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
+IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
+ENDIF()
-IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
+IF(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
SET(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
+ENDIF()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index defdb47..5405bda 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -16,7 +16,7 @@
# This is used internally by CMake and should not be included by user
# code.
-function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
+function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex)
set(implicit_libs_tmp "")
set(implicit_dirs_tmp)
set(log "")
@@ -59,6 +59,11 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
# Unix library full path.
list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> lib [${arg}]\n")
+ elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.o$"
+ AND obj_regex AND "${arg}" MATCHES "${obj_regex}")
+ # Object file full path.
+ list(APPEND implicit_libs_tmp ${arg})
+ set(log "${log} arg [${arg}] ==> obj [${arg}]\n")
elseif("${arg}" MATCHES "^-Y(P,)?")
# Sun search path.
string(REGEX REPLACE "^-Y(P,)?" "" dirs "${arg}")
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index e20348a..cb3f40a 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -83,7 +83,7 @@
#endif
/* For windows compilers MSVC and Intel we can determine
- the architecture of the compiler being used. This is becase
+ the architecture of the compiler being used. This is because
the compilers do not have flags that can change the architecture,
but rather depend on which compiler is being used
*/
@@ -109,6 +109,6 @@
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
-char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
-char* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
+char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
+char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
diff --git a/Modules/CMakeRCCompiler.cmake.in b/Modules/CMakeRCCompiler.cmake.in
index 93bc850..83428e2 100644
--- a/Modules/CMakeRCCompiler.cmake.in
+++ b/Modules/CMakeRCCompiler.cmake.in
@@ -2,5 +2,5 @@ SET(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@")
SET(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@")
SET(CMAKE_RC_COMPILER_LOADED 1)
SET(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc)
-SET(CMAKE_RC_OUTPUT_EXTENSION .res)
+SET(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@)
SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
diff --git a/Modules/CMakeTestASM-ATTCompiler.cmake b/Modules/CMakeTestASM-ATTCompiler.cmake
index 3b7a74f..581ad0c 100644
--- a/Modules/CMakeTestASM-ATTCompiler.cmake
+++ b/Modules/CMakeTestASM-ATTCompiler.cmake
@@ -13,10 +13,10 @@
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
-# determine that that selected ASM-ATT compiler can actually compile
-# and link the most basic of programs. If not, a fatal error
-# is set and cmake stops processing commands and will not generate
-# any makefiles or projects.
+# determine that the selected ASM-ATT "compiler" works.
+# For assembler this can only check whether the compiler has been found,
+# because otherwise there would have to be a separate assembler source file
+# for each assembler on every architecture.
SET(ASM_DIALECT "-ATT")
INCLUDE(CMakeTestASMCompiler)
diff --git a/Modules/CMakeTestASMCompiler.cmake b/Modules/CMakeTestASMCompiler.cmake
index 54def81..56cf332 100644
--- a/Modules/CMakeTestASMCompiler.cmake
+++ b/Modules/CMakeTestASMCompiler.cmake
@@ -13,10 +13,11 @@
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
-# determine that that selected ASM compiler can actually compile
-# and link the most basic of programs. If not, a fatal error
-# is set and cmake stops processing commands and will not generate
-# any makefiles or projects.
+# determine that the selected ASM compiler works.
+# For assembler this can only check whether the compiler has been found,
+# because otherwise there would have to be a separate assembler source file
+# for each assembler on every architecture.
+
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS 1 CACHE INTERNAL "")
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER)
diff --git a/Modules/CMakeTestASM_MASMCompiler.cmake b/Modules/CMakeTestASM_MASMCompiler.cmake
index 84ca98f..8369b94 100644
--- a/Modules/CMakeTestASM_MASMCompiler.cmake
+++ b/Modules/CMakeTestASM_MASMCompiler.cmake
@@ -13,10 +13,10 @@
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
-# determine that the selected ASM_MASM "compiler" (should be masm or masm64)
-# can actually "compile" and link the most basic of programs. If not, a
-# fatal error is set and cmake stops processing commands and will not generate
-# any makefiles or projects.
+# determine that the selected ASM_MASM "compiler" (should be masm or masm64)
+# works. For assembler this can only check whether the compiler has been found,
+# because otherwise there would have to be a separate assembler source file
+# for each assembler on every architecture.
SET(ASM_DIALECT "_MASM")
INCLUDE(CMakeTestASMCompiler)
diff --git a/Modules/CMakeTestASM_NASMCompiler.cmake b/Modules/CMakeTestASM_NASMCompiler.cmake
new file mode 100644
index 0000000..a5e2bea
--- /dev/null
+++ b/Modules/CMakeTestASM_NASMCompiler.cmake
@@ -0,0 +1,23 @@
+
+#=============================================================================
+# Copyright 2010 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 distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This file is used by EnableLanguage in cmGlobalGenerator to
+# determine that the selected ASM_NASM "compiler" works.
+# For assembler this can only check whether the compiler has been found,
+# because otherwise there would have to be a separate assembler source file
+# for each assembler on every architecture.
+
+SET(ASM_DIALECT "_NASM")
+INCLUDE(CMakeTestASMCompiler)
+SET(ASM_DIALECT)
diff --git a/Modules/CPack.STGZ_Header.sh.in b/Modules/CPack.STGZ_Header.sh.in
index 3b50e74..dee576f 100755
--- a/Modules/CPack.STGZ_Header.sh.in
+++ b/Modules/CPack.STGZ_Header.sh.in
@@ -80,7 +80,7 @@ then
if [ "x${cpack_skip_license}x" != "xTRUEx" ]
then
- more << ____cpack__here_doc____
+ more << '____cpack__here_doc____'
@CPACK_RESOURCE_FILE_LICENSE_CONTENT@
____cpack__here_doc____
echo
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 7033e31..797ee57 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -210,6 +210,11 @@
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
# installing this project.
#
+# CPACK_NSIS_INSTALL_ROOT - The default installation directory presented
+# to the end user by the NSIS installer is under this root dir. The full
+# directory presented to the end user is:
+# ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
+#
# CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated
# install program.
#
@@ -257,6 +262,14 @@
# CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
# uninstall start menu shortcuts.
#
+# CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links
+# assumes that they are in 'bin' unless this variable is set.
+# For example, you would set this to 'exec' if your executables are
+# in an exec directory.
+#
+# CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option
+# to run on the finish page of the NSIS installer.
+#
# The following variable is specific to installers build on Mac OS X
# using PackageMaker:
#
@@ -777,6 +790,11 @@ IF(${__cpack_system_name} MATCHES Windows)
ENDIF(${__cpack_system_name} MATCHES Windows)
cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
+# Root dir: default value should be the string literal "$PROGRAMFILES"
+# for backwards compatibility. Projects may set this value to anything.
+set(__cpack_root_default "$PROGRAMFILES")
+cpack_set_if_not_set(CPACK_NSIS_INSTALL_ROOT "${__cpack_root_default}")
+
# <project>-<major>.<minor>.<patch>-<release>-<platform>.<pkgtype>
cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index e2d78802..026c45a 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -331,7 +331,7 @@ ELSE(CPACK_RPM_COMPRESSION_TYPE)
ENDIF(CPACK_RPM_COMPRESSION_TYPE)
if(CPACK_PACKAGE_RELOCATABLE)
- set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
+ set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
endif(CPACK_PACKAGE_RELOCATABLE)
if(CPACK_RPM_PACKAGE_RELOCATABLE)
if(CPACK_RPM_PACKAGE_DEBUG)
@@ -453,6 +453,17 @@ SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
#STRING(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
+
+# Are we packaging components ?
+IF(CPACK_RPM_PACKAGE_COMPONENT)
+ SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
+ SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
+ SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
+ELSE(CPACK_RPM_PACKAGE_COMPONENT)
+ SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
+ SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
+ SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
+ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
# Use files tree to construct files command (spec file)
# We should not forget to include symlinks (thus -o -type l)
# We must remove the './' due to the local search and escape the
@@ -460,10 +471,10 @@ SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
# Then we must authorize any man pages extension (adding * at the end)
# because rpmbuild may automatically compress those files
EXECUTE_PROCESS(COMMAND find -type f -o -type l
- COMMAND sed {s:.*/man.*/.*:&*:}
- COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/}
- WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
- OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
+ COMMAND sed {s:.*/man.*/.*:&*:}
+ COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/}
+ WORKING_DIRECTORY "${WDIR}"
+ OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
if (CPACK_ABSOLUTE_DESTINATION_FILES)
IF(CPACK_RPM_PACKAGE_DEBUG)
@@ -494,7 +505,7 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES)
endif(CPACK_ABSOLUTE_DESTINATION_FILES)
# The name of the final spec file to be used by rpmbuild
-SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec")
+SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec")
# Print out some debug information if we were asked for that
IF(CPACK_RPM_PACKAGE_DEBUG)
@@ -517,7 +528,7 @@ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
"# -*- rpm-spec -*-
-BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@
+BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@
Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@
Name: \@CPACK_RPM_PACKAGE_NAME\@
Version: \@CPACK_RPM_PACKAGE_VERSION\@
@@ -555,10 +566,9 @@ mv $RPM_BUILD_ROOT \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\"
%install
if [ -e $RPM_BUILD_ROOT ];
then
- mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/*\" $RPM_BUILD_ROOT
-else
- mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT
+ rm -rf $RPM_BUILD_ROOT
fi
+mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT
%clean
@@ -608,15 +618,15 @@ IF(RPMBUILD_EXECUTABLE)
# Now call rpmbuild using the SPECFILE
EXECUTE_PROCESS(
COMMAND "${RPMBUILD_EXECUTABLE}" -bb
- --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
+ --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
"${CPACK_RPM_BINARY_SPECFILE}"
- WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
- ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err"
- OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out")
+ WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
+ ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err"
+ OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ")
- MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err")
- MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out")
+ MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
+ MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
ELSE(RPMBUILD_EXECUTABLE)
IF(ALIEN_EXECUTABLE)
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index cf519b1..a03b64d 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -25,7 +25,7 @@ INCLUDE(CheckCSourceCompiles)
MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
- CHECK_C_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
+ CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
# Some compilers do not fail with a bad flag
FAIL_REGEX "unrecognized .*option" # GNU
FAIL_REGEX "ignoring unknown option" # MSVC
diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake
new file mode 100644
index 0000000..b68c479
--- /dev/null
+++ b/Modules/Compiler/NAG-Fortran.cmake
@@ -0,0 +1,32 @@
+# Help CMAKE_PARSE_IMPLICIT_LINK_INFO detect NAG Fortran object files.
+if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED)
+ message(STATUS "Detecting NAG Fortran directory")
+ # Run with -dryrun to see sample "link" line.
+ execute_process(
+ COMMAND ${CMAKE_Fortran_COMPILER} dummy.o -dryrun
+ OUTPUT_VARIABLE _dryrun
+ ERROR_VARIABLE _dryrun
+ )
+ # Match an object file.
+ string(REGEX MATCH "/[^ ]*/[^ /][^ /]*\\.o" _nag_obj "${_dryrun}")
+ if(_nag_obj)
+ # Parse object directory and convert to a regex.
+ string(REGEX REPLACE "/[^/]*$" "" _nag_dir "${_nag_obj}")
+ string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" _nag_regex "${_nag_dir}")
+ set(CMAKE_Fortran_IMPLICIT_OBJECT_REGEX "^${_nag_regex}/")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Detecting NAG Fortran directory with -dryrun found\n"
+ " object: ${_nag_obj}\n"
+ " directory: ${_nag_dir}\n"
+ " regex: ${CMAKE_Fortran_IMPLICIT_OBJECT_REGEX}\n"
+ "from output:\n${_dryrun}\n\n")
+ message(STATUS "Detecting NAG Fortran directory - ${_nag_dir}")
+ else()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Detecting NAG Fortran directory with -dryrun failed:\n${_dryrun}\n\n")
+ message(STATUS "Detecting NAG Fortran directory - failed")
+ endif()
+endif()
+
+set(CMAKE_Fortran_MODDIR_FLAG "-mdir ")
+set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-PIC")
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 1be6cfd..a3590cf 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -32,6 +32,7 @@
# [CMAKE_COMMAND /.../cmake] # Specify alternative cmake executable
# [CMAKE_GENERATOR gen] # Specify generator for native build
# [CMAKE_ARGS args...] # Arguments to CMake command line
+# [CMAKE_CACHE_ARGS args...] # Initial cache arguments, of the form -Dvar:string=on
# #--Build step-----------------
# [BINARY_DIR dir] # Specify build dir location
# [BUILD_COMMAND cmd...] # Command to drive the native build
@@ -549,6 +550,47 @@ function(_ep_set_directories name)
endforeach()
endfunction(_ep_set_directories)
+function(_ep_write_initial_cache script_filename args)
+ # Write out values into an initial cache, that will be passed to CMake with -C
+ set(script_initial_cache "")
+ set(regex "^([^:]+):([^=]+)=(.*)$")
+ set(setArg "")
+ foreach(line ${args})
+ if("${line}" MATCHES "^-D")
+ if(setArg)
+ # This is required to build up lists in variables, or complete an entry
+ set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" FORCE)")
+ set(script_initial_cache "${script_initial_cache}\n${setArg}")
+ set(accumulator "")
+ set(setArg "")
+ endif()
+ string(REGEX REPLACE "^-D" "" line ${line})
+ if("${line}" MATCHES "${regex}")
+ string(REGEX MATCH "${regex}" match "${line}")
+ set(name "${CMAKE_MATCH_1}")
+ set(type "${CMAKE_MATCH_2}")
+ set(value "${CMAKE_MATCH_3}")
+ set(setArg "set(${name} \"${value}")
+ else()
+ message(WARNING "Line '${line}' does not match regex. Ignoring.")
+ endif()
+ else()
+ # Assume this is a list to append to the last var
+ set(accumulator "${accumulator};${line}")
+ endif()
+ endforeach()
+ # Catch the final line of the args
+ if(setArg)
+ set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" FORCE)")
+ set(script_initial_cache "${script_initial_cache}\n${setArg}")
+ endif()
+ # Write out the initial cache file to the location specified.
+ if(NOT EXISTS "${script_filename}.in")
+ file(WRITE "${script_filename}.in" "\@script_initial_cache\@\n")
+ endif()
+ configure_file("${script_filename}.in" "${script_filename}")
+endfunction(_ep_write_initial_cache)
+
function(ExternalProject_Get_Property name)
foreach(var ${ARGN})
@@ -1224,6 +1266,14 @@ function(_ep_add_configure_command name)
get_property(cmake_args TARGET ${name} PROPERTY _EP_CMAKE_ARGS)
list(APPEND cmd ${cmake_args})
+ # If there are any CMAKE_CACHE_ARGS, write an initial cache and use it
+ get_property(cmake_cache_args TARGET ${name} PROPERTY _EP_CMAKE_CACHE_ARGS)
+ if(cmake_cache_args)
+ set(_ep_cache_args_script "${tmp_dir}/${name}-cache.cmake")
+ _ep_write_initial_cache("${_ep_cache_args_script}" "${cmake_cache_args}")
+ list(APPEND cmd "-C${_ep_cache_args_script}")
+ endif()
+
get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR)
if(cmake_generator)
list(APPEND cmd "-G${cmake_generator}" "${source_dir}")
@@ -1242,10 +1292,11 @@ function(_ep_add_configure_command name)
# Fixes issue http://public.kitware.com/Bug/view.php?id=10258
#
if(NOT EXISTS ${tmp_dir}/${name}-cfgcmd.txt.in)
- file(WRITE ${tmp_dir}/${name}-cfgcmd.txt.in "cmd='@cmd@'\n")
+ file(WRITE ${tmp_dir}/${name}-cfgcmd.txt.in "cmd='\@cmd\@'\n")
endif()
configure_file(${tmp_dir}/${name}-cfgcmd.txt.in ${tmp_dir}/${name}-cfgcmd.txt)
list(APPEND file_deps ${tmp_dir}/${name}-cfgcmd.txt)
+ list(APPEND file_deps ${_ep_cache_args_script})
get_property(log TARGET ${name} PROPERTY _EP_LOG_CONFIGURE)
if(log)
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 94bbed5..d57513c 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -40,16 +40,11 @@
# License text for the above reference.)
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
-if(NOT _LANGUAGES_ MATCHES Fortran)
- if(BLAS_FIND_REQUIRED)
- message(FATAL_ERROR "FindBLAS is Fortran-only so Fortran must be enabled.")
- else(BLAS_FIND_REQUIRED)
- message(STATUS "Looking for BLAS... - NOT found (Fortran not enabled)") #
- return()
- endif(BLAS_FIND_REQUIRED)
-endif(NOT _LANGUAGES_ MATCHES Fortran)
-
+if (NOT _LANGUAGES_ MATCHES Fortran)
+include(CheckFunctionExists)
+else ()
include(CheckFortranFunctionExists)
+endif()
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _threads)
# This macro checks for the existence of the combination of fortran libraries
@@ -107,7 +102,11 @@ if(_libraries_work)
# Test this combination of libraries.
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads})
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
- check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
+ if (_LANGUAGES_ MATCHES Fortran)
+ check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
+ else()
+ check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
+ endif()
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
@@ -246,13 +245,24 @@ endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
#BLAS in acml library?
if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All")
+ # Either acml or acml_mp should be in LD_LIBRARY_PATH but not both
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
- "acml"
+ "acml;acml_mv"
+ ""
+ )
+ endif(NOT BLAS_LIBRARIES)
+ if(NOT BLAS_LIBRARIES)
+ check_fortran_libraries(
+ BLAS_LIBRARIES
+ BLAS
+ sgemm
+ ""
+ "acml_mp;acml_mv"
""
)
endif(NOT BLAS_LIBRARIES)
@@ -300,6 +310,9 @@ endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
#BLAS in intel mkl 10 library? (em64t 64bit)
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
+ if (NOT WIN32)
+ set(LM "-lm")
+ endif ()
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads)
@@ -340,7 +353,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
sgemm
""
"mkl_blas95;mkl_intel;mkl_intel_thread;mkl_core;guide"
- "${CMAKE_THREAD_LIBS_INIT}"
+ "${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS95_LIBRARIES)
else(BLA_F95)
@@ -352,6 +365,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
""
"mkl_intel;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT}"
+ "${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif(BLA_F95)
@@ -365,7 +379,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
sgemm
""
"mkl_blas95;mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
- "${CMAKE_THREAD_LIBS_INIT}"
+ "${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS95_LIBRARIES)
else(BLA_F95)
@@ -376,7 +390,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
sgemm
""
"mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
- "${CMAKE_THREAD_LIBS_INIT}"
+ "${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif(BLA_F95)
@@ -391,7 +405,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
sgemm
""
"mkl;guide"
- "${CMAKE_THREAD_LIBS_INIT}"
+ "${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
#BLAS in intel mkl library? (static, 32bit)
@@ -402,7 +416,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
sgemm
""
"mkl_ia32;guide"
- "${CMAKE_THREAD_LIBS_INIT}"
+ "${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
#BLAS in intel mkl library? (static, em64t 64bit)
@@ -413,7 +427,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
sgemm
""
"mkl_em64t;guide"
- "${CMAKE_THREAD_LIBS_INIT}"
+ "${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 28296f1..f17e599 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -64,14 +64,15 @@
# Currently this module searches for the following version numbers:
# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1,
# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0,
-# 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0
+# 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0,
+# 1.45, 1.45.0, 1.46, 1.46.0
#
# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should
# add both 1.x and 1.x.0 as shown above. Official Boost include directories
# omit the 3rd version number from include paths if it is 0 although not all
# binary Boost releases do so.
#
-# SET(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0")
+# set(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0")
#
# ===================================== ============= ========================
#
@@ -163,6 +164,7 @@
#
# These last three variables are available also as environment variables:
+# Also, note they are completely UPPERCASE.
#
# BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for
# Boost. Set this if the module has problems finding
@@ -250,59 +252,59 @@
# And ELSE/ENDIF pairs were removed for readability.
#########################################################################
-MACRO (_Boost_ADJUST_LIB_VARS basename)
- IF (Boost_INCLUDE_DIR )
- IF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
+macro(_Boost_ADJUST_LIB_VARS basename)
+ if(Boost_INCLUDE_DIR )
+ if(Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
# if the generator supports configuration types then set
# optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
- IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
- ELSE()
+ if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ set(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
+ else()
# if there are no configuration types and CMAKE_BUILD_TYPE has no value
# then just use the release libraries
- SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
- ENDIF()
+ set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
+ endif()
# FIXME: This probably should be set for both cases
- SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
- ENDIF()
+ set(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
+ endif()
# if only the release version was found, set the debug variable also to the release version
- IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
- SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
- SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
- SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
- ENDIF()
+ if(Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
+ set(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
+ set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
+ set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
+ endif()
# if only the debug version was found, set the release variable also to the debug version
- IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
- SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
- SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
- SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
- ENDIF()
+ if(Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
+ set(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
+ set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
+ set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
+ endif()
- IF (Boost_${basename}_LIBRARY)
+ if(Boost_${basename}_LIBRARY)
set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library")
# Remove superfluous "debug" / "optimized" keywords from
# Boost_LIBRARY_DIRS
- FOREACH(_boost_my_lib ${Boost_${basename}_LIBRARY})
- GET_FILENAME_COMPONENT(_boost_my_lib_path "${_boost_my_lib}" PATH)
- LIST(APPEND Boost_LIBRARY_DIRS ${_boost_my_lib_path})
- ENDFOREACH()
- LIST(REMOVE_DUPLICATES Boost_LIBRARY_DIRS)
+ foreach(_boost_my_lib ${Boost_${basename}_LIBRARY})
+ get_filename_component(_boost_my_lib_path "${_boost_my_lib}" PATH)
+ list(APPEND Boost_LIBRARY_DIRS ${_boost_my_lib_path})
+ endforeach()
+ list(REMOVE_DUPLICATES Boost_LIBRARY_DIRS)
set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory")
- SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found")
- ENDIF(Boost_${basename}_LIBRARY)
+ set(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found")
+ endif(Boost_${basename}_LIBRARY)
- ENDIF (Boost_INCLUDE_DIR )
+ endif(Boost_INCLUDE_DIR )
# Make variables changeble to the advanced user
- MARK_AS_ADVANCED(
+ mark_as_advanced(
Boost_${basename}_LIBRARY
Boost_${basename}_LIBRARY_RELEASE
Boost_${basename}_LIBRARY_DEBUG
)
-ENDMACRO (_Boost_ADJUST_LIB_VARS)
+endmacro(_Boost_ADJUST_LIB_VARS)
#-------------------------------------------------------------------------------
@@ -310,17 +312,17 @@ ENDMACRO (_Boost_ADJUST_LIB_VARS)
# Runs compiler with "-dumpversion" and parses major/minor
# version with a regex.
#
-FUNCTION(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION)
+function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION)
- EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
+ exec_program(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE _boost_COMPILER_VERSION
)
- STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
+ string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
_boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
- SET(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
-ENDFUNCTION()
+ set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
+endfunction()
#
# A convenience function for marking desired components
@@ -355,6 +357,13 @@ function(_Boost_SWAP_WITH_REALPATH _library _docstring)
endif()
endfunction()
+function(_Boost_CHECK_SPELLING _var)
+ if(${_var})
+ string(TOUPPER ${_var} _var_UC)
+ message(FATAL_ERROR "ERROR: ${_var} is not the correct spelling. The proper spelling is ${_var_UC}.")
+ endif()
+endfunction()
+
#
# End functions/macros
#
@@ -363,9 +372,9 @@ endfunction()
-IF(NOT DEFINED Boost_USE_MULTITHREADED)
- SET(Boost_USE_MULTITHREADED TRUE)
-ENDIF()
+if(NOT DEFINED Boost_USE_MULTITHREADED)
+ set(Boost_USE_MULTITHREADED TRUE)
+endif()
if(Boost_FIND_VERSION_EXACT)
# The version may appear in a directory with or without the patch
@@ -377,7 +386,7 @@ else(Boost_FIND_VERSION_EXACT)
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
- "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
+ "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
"1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37"
"1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
"1.34" "1.33.1" "1.33.0" "1.33")
@@ -406,49 +415,47 @@ endif(Boost_FIND_VERSION_EXACT)
# Boost.
set(Boost_ERROR_REASON)
-SET( _boost_IN_CACHE TRUE)
-IF(Boost_INCLUDE_DIR)
+set( _boost_IN_CACHE TRUE)
+if(Boost_INCLUDE_DIR)
# On versions < 1.35, remove the System library from the considered list
# since it wasn't added until 1.35.
if(Boost_VERSION AND Boost_FIND_COMPONENTS)
- math(EXPR _boost_maj "${Boost_VERSION} / 100000")
- math(EXPR _boost_min "${Boost_VERSION} / 100 % 1000")
- if(${_boost_maj}.${_boost_min} VERSION_LESS 1.35)
+ if(Boost_VERSION LESS 103500)
list(REMOVE_ITEM Boost_FIND_COMPONENTS system)
endif()
endif()
- FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
- STRING(TOUPPER ${COMPONENT} COMPONENT)
- IF(NOT Boost_${COMPONENT}_FOUND)
- SET( _boost_IN_CACHE FALSE)
- ENDIF(NOT Boost_${COMPONENT}_FOUND)
- ENDFOREACH(COMPONENT)
-ELSE(Boost_INCLUDE_DIR)
- SET( _boost_IN_CACHE FALSE)
-ENDIF(Boost_INCLUDE_DIR)
-
-IF (_boost_IN_CACHE)
+ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+ string(TOUPPER ${COMPONENT} COMPONENT)
+ if(NOT Boost_${COMPONENT}_FOUND)
+ set( _boost_IN_CACHE FALSE)
+ endif(NOT Boost_${COMPONENT}_FOUND)
+ endforeach(COMPONENT)
+else(Boost_INCLUDE_DIR)
+ set( _boost_IN_CACHE FALSE)
+endif(Boost_INCLUDE_DIR)
+
+if(_boost_IN_CACHE)
# in cache already
- SET(Boost_FOUND TRUE)
- FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
- STRING(TOUPPER ${COMPONENT} COMPONENT)
+ set(Boost_FOUND TRUE)
+ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+ string(TOUPPER ${COMPONENT} COMPONENT)
_Boost_ADJUST_LIB_VARS( ${COMPONENT} )
- SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY})
- ENDFOREACH(COMPONENT)
- SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
- IF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
- MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
- MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
- MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
- ENDIF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
+ set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY})
+ endforeach(COMPONENT)
+ set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
+ if(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
+ math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
+ math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
+ math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
+ endif(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} "
"is already in the cache. To view debugging messages, please clear the cache.")
endif()
-ELSE (_boost_IN_CACHE)
+else(_boost_IN_CACHE)
# Need to search for boost
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@@ -468,7 +475,7 @@ ELSE (_boost_IN_CACHE)
"Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}")
endif()
- IF(WIN32)
+ if(WIN32)
# In windows, automatic linking is performed, so you do not have
# to specify the libraries. If you are linking to a dynamic
# runtime, then you can choose to link to either a static or a
@@ -477,18 +484,18 @@ ELSE (_boost_IN_CACHE)
# BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
# linked dynamically. Alternatively you can force all Boost
# libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
-
+
# This feature can be disabled for Boost library "whatever" by
# defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
# BOOST_ALL_NO_LIB.
-
+
# If you want to observe which libraries are being linked against
# then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
# code to emit a #pragma message each time a library is selected
# for linking.
- SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS
+ set(Boost_LIB_DIAGNOSTIC_DEFINITIONS
"-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
- ENDIF(WIN32)
+ endif(WIN32)
set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM
C:/boost/include
@@ -498,36 +505,33 @@ ELSE (_boost_IN_CACHE)
/sw/local/include
)
- # If Boost_ROOT was defined, gently correct the user
- if(Boost_ROOT)
- message("WARNING: Boost_ROOT was set which is incorrect and is being ignored. "
- "You need to use BOOST_ROOT instead. "
- "Also, we suggest setting Boost_NO_SYSTEM_PATHS.")
- endif()
+ _Boost_CHECK_SPELLING(Boost_ROOT)
+ _Boost_CHECK_SPELLING(Boost_LIBRARYDIR)
+ _Boost_CHECK_SPELLING(Boost_INCLUDEDIR)
# If BOOST_ROOT was defined in the environment, use it.
if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
set(BOOST_ROOT $ENV{BOOST_ROOT})
- endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
+ endif()
# If BOOSTROOT was defined in the environment, use it.
if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "")
set(BOOST_ROOT $ENV{BOOSTROOT})
- endif(NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "")
+ endif()
# If BOOST_INCLUDEDIR was defined in the environment, use it.
- IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
+ if( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR})
- ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
-
+ endif()
+
# If BOOST_LIBRARYDIR was defined in the environment, use it.
- IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
+ if( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR})
- ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
-
- IF( BOOST_ROOT )
+ endif()
+
+ if( BOOST_ROOT )
file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT)
- ENDIF( BOOST_ROOT )
+ endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@@ -563,33 +567,33 @@ ELSE (_boost_IN_CACHE)
endif( BOOST_INCLUDEDIR )
# ------------------------------------------------------------------------
- # Search for Boost include DIR
+ # Search for Boost include DIR
# ------------------------------------------------------------------------
# Try to find Boost by stepping backwards through the Boost versions
# we know about.
- IF( NOT Boost_INCLUDE_DIR )
+ if( NOT Boost_INCLUDE_DIR )
# Build a list of path suffixes for each version.
- SET(_boost_PATH_SUFFIXES)
- FOREACH(_boost_VER ${_boost_TEST_VERSIONS})
+ set(_boost_PATH_SUFFIXES)
+ foreach(_boost_VER ${_boost_TEST_VERSIONS})
# Add in a path suffix, based on the required version, ideally
# we could read this from version.hpp, but for that to work we'd
# need to know the include dir already
set(_boost_BOOSTIFIED_VERSION)
# Transform 1.35 => 1_35 and 1.36.0 => 1_36_0
- IF(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
- STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3"
+ if(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
+ string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3"
_boost_BOOSTIFIED_VERSION ${_boost_VER})
- ELSEIF(_boost_VER MATCHES "[0-9]+\\.[0-9]+")
- STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2"
+ elseif(_boost_VER MATCHES "[0-9]+\\.[0-9]+")
+ string(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2"
_boost_BOOSTIFIED_VERSION ${_boost_VER})
- ENDIF()
-
+ endif()
+
list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}")
list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
- ENDFOREACH(_boost_VER)
-
+ endforeach(_boost_VER)
+
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Include debugging info:")
@@ -600,62 +604,62 @@ ELSE (_boost_IN_CACHE)
endif()
# Look for a standard boost header file.
- FIND_PATH(Boost_INCLUDE_DIR
+ find_path(Boost_INCLUDE_DIR
NAMES boost/config.hpp
HINTS ${_boost_INCLUDE_SEARCH_DIRS}
PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
${_boost_FIND_OPTIONS}
)
- ENDIF( NOT Boost_INCLUDE_DIR )
-
+ endif( NOT Boost_INCLUDE_DIR )
+
# ------------------------------------------------------------------------
# Extract version information from version.hpp
# ------------------------------------------------------------------------
- IF(Boost_INCLUDE_DIR)
+ if(Boost_INCLUDE_DIR)
# Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp
# Read the whole file:
#
- SET(BOOST_VERSION 0)
- SET(BOOST_LIB_VERSION "")
- FILE(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS)
+ set(BOOST_VERSION 0)
+ set(BOOST_LIB_VERSION "")
+ file(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS)
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp")
endif()
-
- STRING(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}")
- STRING(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}")
-
- SET(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries")
- SET(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries")
-
- IF(NOT "${Boost_VERSION}" STREQUAL "0")
- MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
- MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
- MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
+
+ string(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}")
+ string(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}")
+
+ set(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries")
+ set(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries")
+
+ if(NOT "${Boost_VERSION}" STREQUAL "0")
+ math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
+ math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
+ math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
- ENDIF(NOT "${Boost_VERSION}" STREQUAL "0")
+ endif(NOT "${Boost_VERSION}" STREQUAL "0")
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"version.hpp reveals boost "
"${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
endif()
- ELSE(Boost_INCLUDE_DIR)
+ else(Boost_INCLUDE_DIR)
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
- ENDIF(Boost_INCLUDE_DIR)
-
+ endif(Boost_INCLUDE_DIR)
+
# ------------------------------------------------------------------------
# Suffix initialization and compiler suffix detection.
# ------------------------------------------------------------------------
# Setting some more suffixes for the library
- SET (Boost_LIB_PREFIX "")
+ set(Boost_LIB_PREFIX "")
if ( WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN)
- SET (Boost_LIB_PREFIX "lib")
+ set(Boost_LIB_PREFIX "lib")
endif()
if (Boost_COMPILER)
@@ -670,7 +674,7 @@ ELSE (_boost_IN_CACHE)
# please report them and use the Boost_COMPILER variable
# to work around the problems.
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"
- OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
+ OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
if(WIN32)
set (_boost_COMPILER "-iw")
@@ -678,54 +682,54 @@ ELSE (_boost_IN_CACHE)
set (_boost_COMPILER "-il")
endif()
elseif (MSVC90)
- SET (_boost_COMPILER "-vc90")
+ set(_boost_COMPILER "-vc90")
elseif (MSVC10)
- SET (_boost_COMPILER "-vc100")
+ set(_boost_COMPILER "-vc100")
elseif (MSVC80)
- SET (_boost_COMPILER "-vc80")
+ set(_boost_COMPILER "-vc80")
elseif (MSVC71)
- SET (_boost_COMPILER "-vc71")
+ set(_boost_COMPILER "-vc71")
elseif (MSVC70) # Good luck!
- SET (_boost_COMPILER "-vc7") # yes, this is correct
+ set(_boost_COMPILER "-vc7") # yes, this is correct
elseif (MSVC60) # Good luck!
- SET (_boost_COMPILER "-vc6") # yes, this is correct
+ set(_boost_COMPILER "-vc6") # yes, this is correct
elseif (BORLAND)
- SET (_boost_COMPILER "-bcb")
+ set(_boost_COMPILER "-bcb")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro")
set(_boost_COMPILER "-sw")
elseif (MINGW)
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
- SET(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
+ set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
else()
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION)
- SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
+ set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
endif()
elseif (UNIX)
if (CMAKE_COMPILER_IS_GNUCXX)
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
- SET(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34
+ set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34
else()
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION)
# Determine which version of GCC we have.
- IF(APPLE)
- IF(Boost_MINOR_VERSION)
- IF(${Boost_MINOR_VERSION} GREATER 35)
+ if(APPLE)
+ if(Boost_MINOR_VERSION)
+ if(${Boost_MINOR_VERSION} GREATER 35)
# In Boost 1.36.0 and newer, the mangled compiler name used
# on Mac OS X/Darwin is "xgcc".
- SET(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
- ELSE(${Boost_MINOR_VERSION} GREATER 35)
+ set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
+ else(${Boost_MINOR_VERSION} GREATER 35)
# In Boost <= 1.35.0, there is no mangled compiler name for
# the Mac OS X/Darwin version of GCC.
- SET(_boost_COMPILER "")
- ENDIF(${Boost_MINOR_VERSION} GREATER 35)
- ELSE(Boost_MINOR_VERSION)
+ set(_boost_COMPILER "")
+ endif(${Boost_MINOR_VERSION} GREATER 35)
+ else(Boost_MINOR_VERSION)
# We don't know the Boost version, so assume it's
# pre-1.36.0.
- SET(_boost_COMPILER "")
- ENDIF(Boost_MINOR_VERSION)
- ELSE()
- SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
- ENDIF()
+ set(_boost_COMPILER "")
+ endif(Boost_MINOR_VERSION)
+ else()
+ set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
+ endif()
endif()
endif (CMAKE_COMPILER_IS_GNUCXX)
endif()
@@ -958,13 +962,13 @@ ELSE (_boost_IN_CACHE)
# End finding boost libraries
# ------------------------------------------------------------------------
- SET(Boost_INCLUDE_DIRS
+ set(Boost_INCLUDE_DIRS
${Boost_INCLUDE_DIR}
)
- SET(Boost_FOUND FALSE)
- IF(Boost_INCLUDE_DIR)
- SET( Boost_FOUND TRUE )
+ set(Boost_FOUND FALSE)
+ if(Boost_INCLUDE_DIR)
+ set( Boost_FOUND TRUE )
# Check the version of Boost against the requested version.
if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
@@ -999,7 +1003,7 @@ ELSE (_boost_IN_CACHE)
if (NOT Boost_FIND_VERSION_PATCH)
set(Boost_FIND_VERSION_PATCH 0)
endif (NOT Boost_FIND_VERSION_PATCH)
-
+
# We'll set Boost_FOUND true again if we have an exact version match.
set(Boost_FOUND FALSE)
_Boost_MARK_COMPONENTS_FOUND(OFF)
@@ -1018,7 +1022,7 @@ ELSE (_boost_IN_CACHE)
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
if (Boost_FIND_VERSION_PATCH)
- set(Boost_ERROR_REASON
+ set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}")
endif (Boost_FIND_VERSION_PATCH)
if (NOT Boost_FIND_VERSION_EXACT)
@@ -1037,7 +1041,7 @@ ELSE (_boost_IN_CACHE)
string(TOLOWER ${COMPONENT} COMPONENT)
list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
set( Boost_FOUND FALSE)
- endif(NOT Boost_${COMPONENT}_FOUND)
+ endif()
endforeach(COMPONENT)
if(Boost_DEBUG)
@@ -1058,67 +1062,67 @@ ELSE (_boost_IN_CACHE)
list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
set(Boost_ERROR_REASON
- "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
+ "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
set(Boost_ERROR_REASON
- "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
+ "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
endif (_Boost_MISSING_COMPONENTS)
- IF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
+ if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
# Compatibility Code for backwards compatibility with CMake
# 2.4's FindBoost module.
# Look for the boost library path.
# Note that the user may not have installed any libraries
# so it is quite possible the Boost_LIBRARY_PATH may not exist.
- SET(_boost_LIB_DIR ${Boost_INCLUDE_DIR})
-
- IF("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
- GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
- ENDIF ("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
-
- IF("${_boost_LIB_DIR}" MATCHES "/include$")
+ set(_boost_LIB_DIR ${Boost_INCLUDE_DIR})
+
+ if("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
+ get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
+ endif()
+
+ if("${_boost_LIB_DIR}" MATCHES "/include$")
# Strip off the trailing "/include" in the path.
- GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
- ENDIF("${_boost_LIB_DIR}" MATCHES "/include$")
-
- IF(EXISTS "${_boost_LIB_DIR}/lib")
- SET (_boost_LIB_DIR ${_boost_LIB_DIR}/lib)
- ELSE(EXISTS "${_boost_LIB_DIR}/lib")
- IF(EXISTS "${_boost_LIB_DIR}/stage/lib")
- SET(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib)
- ELSE(EXISTS "${_boost_LIB_DIR}/stage/lib")
- SET(_boost_LIB_DIR "")
- ENDIF(EXISTS "${_boost_LIB_DIR}/stage/lib")
- ENDIF(EXISTS "${_boost_LIB_DIR}/lib")
-
- IF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
- SET(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory")
- ENDIF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
+ get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
+ endif()
+
+ if(EXISTS "${_boost_LIB_DIR}/lib")
+ set(_boost_LIB_DIR ${_boost_LIB_DIR}/lib)
+ else()
+ if(EXISTS "${_boost_LIB_DIR}/stage/lib")
+ set(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib)
+ else()
+ set(_boost_LIB_DIR "")
+ endif()
+ endif()
+
+ if(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
+ set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory")
+ endif()
- ENDIF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
+ endif( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
- ELSE(Boost_INCLUDE_DIR)
- SET( Boost_FOUND FALSE)
- ENDIF(Boost_INCLUDE_DIR)
+ else(Boost_INCLUDE_DIR)
+ set( Boost_FOUND FALSE)
+ endif(Boost_INCLUDE_DIR)
- IF (Boost_FOUND)
- IF (NOT Boost_FIND_QUIETLY)
- MESSAGE(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
+ if(Boost_FOUND)
+ if(NOT Boost_FIND_QUIETLY)
+ message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
if(Boost_FIND_COMPONENTS)
message(STATUS "Found the following Boost libraries:")
endif()
- ENDIF(NOT Boost_FIND_QUIETLY)
- FOREACH ( COMPONENT ${Boost_FIND_COMPONENTS} )
- STRING( TOUPPER ${COMPONENT} UPPERCOMPONENT )
- IF ( Boost_${UPPERCOMPONENT}_FOUND )
- IF (NOT Boost_FIND_QUIETLY)
- MESSAGE (STATUS " ${COMPONENT}")
- ENDIF(NOT Boost_FIND_QUIETLY)
- SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY})
- ENDIF ( Boost_${UPPERCOMPONENT}_FOUND )
- ENDFOREACH(COMPONENT)
+ endif(NOT Boost_FIND_QUIETLY)
+ foreach( COMPONENT ${Boost_FIND_COMPONENTS} )
+ string( TOUPPER ${COMPONENT} UPPERCOMPONENT )
+ if( Boost_${UPPERCOMPONENT}_FOUND )
+ if(NOT Boost_FIND_QUIETLY)
+ message (STATUS " ${COMPONENT}")
+ endif(NOT Boost_FIND_QUIETLY)
+ set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY})
+ endif( Boost_${UPPERCOMPONENT}_FOUND )
+ endforeach(COMPONENT)
else()
if(Boost_FIND_REQUIRED)
message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
@@ -1138,9 +1142,8 @@ ELSE (_boost_IN_CACHE)
endif()
# show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view
- MARK_AS_ADVANCED(Boost_INCLUDE_DIR
+ mark_as_advanced(Boost_INCLUDE_DIR
Boost_INCLUDE_DIRS
Boost_LIBRARY_DIRS
)
-ENDIF(_boost_IN_CACHE)
-
+endif(_boost_IN_CACHE)
diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake
index d10a388..a7c6de2 100644
--- a/Modules/FindBullet.cmake
+++ b/Modules/FindBullet.cmake
@@ -31,7 +31,7 @@ macro(_FIND_BULLET_LIBRARY _var)
find_library(${_var}
NAMES
${ARGN}
- PATHS
+ HINTS
${BULLET_ROOT}
${BULLET_ROOT}/out/release8/libs
${BULLET_ROOT}/out/debug8/libs
@@ -50,9 +50,10 @@ macro(_BULLET_APPEND_LIBRARIES _list _release)
endmacro()
find_path(BULLET_INCLUDE_DIR NAMES btBulletCollisionCommon.h
- PATHS
+ HINTS
${BULLET_ROOT}/include
${BULLET_ROOT}/src
+ PATH_SUFFIXES bullet
)
# Find the libraries
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index 6a66d21..69104c5 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -97,6 +97,11 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Version 1.4 (11/18/10) (CMake 2.8.4)
+# Issue 11384: Added support to the CXX_ADD_TEST macro so header
+# files (containing the tests themselves) show up in
+# Visual Studio and other IDEs.
+#
# Version 1.3 (8/19/10) (CMake 2.8.3)
# Included patch by Simone Rossetto to check if either Python or Perl
# are present in the system. Whichever intepreter that is detected
@@ -131,7 +136,7 @@ macro(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
)
set_source_files_properties(${_cxxtest_real_outfname} PROPERTIES GENERATED true)
- add_executable(${_cxxtest_testname} ${_cxxtest_real_outfname})
+ add_executable(${_cxxtest_testname} ${_cxxtest_real_outfname} ${ARGN})
if(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
add_test(${_cxxtest_testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_cxxtest_testname})
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index d42e514..481e1e2 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -36,8 +36,8 @@
# find_package(BISON)
# find_package(FLEX)
#
-# BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
-# FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BIANRY_DIR}/lexer.cpp)
+# BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
+# FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
# ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
#
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake
index 244ce54..5f43dd9 100644
--- a/Modules/FindITK.cmake
+++ b/Modules/FindITK.cmake
@@ -21,7 +21,7 @@
# instead.
#=============================================================================
-# Copyright 2001-2009 Kitware, Inc.
+# Copyright 2001-2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -33,67 +33,23 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(ITK_DIR_STRING "directory containing ITKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/InsightToolkit for an installation.")
+# Use the Config mode of the find_package() command to find ITKConfig.
+# If this succeeds (possibly because ITK_DIR is already set), the
+# command will have already loaded ITKConfig.cmake and set ITK_FOUND.
+IF(NOT ITK_FOUND)
+ FIND_PACKAGE(ITK QUIET NO_MODULE
+ NAMES ITK InsightToolkit
+ CONFIGS ITKConfig.cmake
+ )
+ENDIF()
-# Search only if the location is not already known.
-IF(NOT ITK_DIR)
- # Get the system search path as a list.
- IF(UNIX)
- STRING(REGEX MATCHALL "[^:]+" ITK_DIR_SEARCH1 "$ENV{PATH}")
- ELSE(UNIX)
- STRING(REGEX REPLACE "\\\\" "/" ITK_DIR_SEARCH1 "$ENV{PATH}")
- ENDIF(UNIX)
- STRING(REGEX REPLACE "/;" ";" ITK_DIR_SEARCH2 ${ITK_DIR_SEARCH1})
-
- # Construct a set of paths relative to the system search path.
- SET(ITK_DIR_SEARCH "")
- FOREACH(dir ${ITK_DIR_SEARCH2})
- SET(ITK_DIR_SEARCH ${ITK_DIR_SEARCH} "${dir}/../lib/InsightToolkit")
- ENDFOREACH(dir)
-
- #
- # Look for an installation or build tree.
- #
- FIND_PATH(ITK_DIR ITKConfig.cmake
- # Look for an environment variable ITK_DIR.
- $ENV{ITK_DIR}
-
- # Look in places relative to the system executable search path.
- ${ITK_DIR_SEARCH}
-
- # Look in standard UNIX install locations.
- /usr/local/lib/InsightToolkit
- /usr/lib/InsightToolkit
-
- # Read from the CMakeSetup registry entries. It is likely that
- # ITK will have been recently built.
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10]
-
- # Help the user find it if we cannot.
- DOC "The ${ITK_DIR_STRING}"
- )
-ENDIF(NOT ITK_DIR)
-
-# If ITK was found, load the configuration file to get the rest of the
-# settings.
-IF(ITK_DIR)
- SET(ITK_FOUND 1)
- INCLUDE(${ITK_DIR}/ITKConfig.cmake)
+SET(ITK_DIR_MESSAGE "Please set ITK_DIR to the directory containing ITKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/InsightToolkit for an installation.")
+IF(ITK_FOUND)
# Set USE_ITK_FILE for backward-compatability.
SET(USE_ITK_FILE ${ITK_USE_FILE})
-ELSE(ITK_DIR)
- SET(ITK_FOUND 0)
- IF(ITK_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Please set ITK_DIR to the ${ITK_DIR_STRING}")
- ENDIF(ITK_FIND_REQUIRED)
-ENDIF(ITK_DIR)
+ELSEIF(ITK_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR ${ITK_DIR_MESSAGE})
+ELSEIF(NOT ITK_FIND_QUIETLY)
+ MESSAGE(STATUS ${ITK_DIR_MESSAGE})
+ENDIF()
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 40effb0..bf45406 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -37,17 +37,12 @@
# License text for the above reference.)
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
-if(NOT _LANGUAGES_ MATCHES Fortran)
- if(LAPACK_FIND_REQUIRED)
- message(FATAL_ERROR
- "FindLAPACK is Fortran-only so Fortran must be enabled.")
- else(LAPACK_FIND_REQUIRED)
- message(STATUS "Looking for LAPACK... - NOT found (Fortran not enabled)")
- return()
- endif(LAPACK_FIND_REQUIRED)
-endif(NOT _LANGUAGES_ MATCHES Fortran)
-
+if (NOT _LANGUAGES_ MATCHES Fortran)
+include(CheckFunctionExists)
+else (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFortranFunctionExists)
+endif (NOT _LANGUAGES_ MATCHES Fortran)
+
set(LAPACK_FOUND FALSE)
set(LAPACK95_FOUND FALSE)
@@ -112,7 +107,11 @@ if(_libraries_work)
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads})
endif(UNIX AND BLA_STATIC)
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
- check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
+ if (NOT _LANGUAGES_ MATCHES Fortran)
+ check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
+ else (NOT _LANGUAGES_ MATCHES Fortran)
+ check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
+ endif (NOT _LANGUAGES_ MATCHES Fortran)
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
@@ -157,7 +156,18 @@ if(BLAS_FOUND)
LAPACK
cheev
""
- "acml"
+ "acml;acml_mv"
+ ""
+ ""
+ )
+ endif(NOT LAPACK_LIBRARIES)
+ if(NOT LAPACK_LIBRARIES)
+ check_lapack_libraries(
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "acml_mp;acml_mv"
""
""
)
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 21aafa9..3618963 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -123,7 +123,6 @@ ELSE (WIN32)
ENDIF(APPLE)
ENDIF (WIN32)
-SET( OPENGL_FOUND "NO" )
IF(OPENGL_gl_LIBRARY)
IF(OPENGL_xmesa_INCLUDE_DIR)
@@ -140,10 +139,7 @@ IF(OPENGL_gl_LIBRARY)
SET( OPENGL_GLU_FOUND "NO" )
ENDIF(OPENGL_glu_LIBRARY)
- SET( OPENGL_FOUND "YES" )
-
# This deprecated setting is for backward compatibility with CMake1.4
-
SET (OPENGL_LIBRARY ${OPENGL_LIBRARIES})
ENDIF(OPENGL_gl_LIBRARY)
@@ -151,6 +147,11 @@ ENDIF(OPENGL_gl_LIBRARY)
# This deprecated setting is for backward compatibility with CMake1.4
SET(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
+# handle the QUIETLY and REQUIRED arguments and set OPENGL_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL DEFAULT_MSG OPENGL_gl_LIBRARY)
+
MARK_AS_ADVANCED(
OPENGL_INCLUDE_DIR
OPENGL_xmesa_INCLUDE_DIR
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 6129329..d9d6ea7 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -1074,15 +1074,6 @@ IF (QT4_QMAKE_FOUND)
######################################
#
- # Macros for building Qt files
- #
- ######################################
-
- INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake")
-
-
- ######################################
- #
# decide if Qt got found
#
######################################
@@ -1118,6 +1109,89 @@ IF (QT4_QMAKE_FOUND)
#######################################
#
+ # Check the plugins of Qt
+ #
+ #######################################
+
+ SET( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers )
+
+ SET( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets )
+ SET( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer )
+ SET( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs )
+ SET( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows )
+ SET( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin )
+ SET( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb )
+ SET( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem )
+ SET( QT_ICONENGINES_PLUGINS qsvgicon )
+ SET( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff )
+ SET( QT_INPUTMETHODS_PLUGINS qimsw_multi )
+ SET( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler )
+ SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 )
+ SET( QT_SCRIPT_PLUGINS qtscriptdbus )
+ SET( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds )
+
+ IF(QT_QMAKE_CHANGED)
+ FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
+ STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
+ SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
+ FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
+ STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
+ UNSET(QT_${_upper_qt_plugin}_LIBRARY_RELEASE CACHE)
+ UNSET(QT_${_upper_qt_plugin}_LIBRARY_DEBUG CACHE)
+ UNSET(QT_${_upper_qt_plugin}_LIBRARY CACHE)
+ UNSET(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE)
+ UNSET(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE)
+ UNSET(QT_${_upper_qt_plugin}_PLUGIN CACHE)
+ ENDFOREACH(QT_PLUGIN)
+ ENDFOREACH(QT_PLUGIN_TYPE)
+ ENDIF(QT_QMAKE_CHANGED)
+
+ # find_library works better than find_file but we need to set prefixes to only match plugins
+ FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
+ STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
+ SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
+ FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
+ STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
+ IF(QT_IS_STATIC)
+ FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_RELEASE
+ NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4
+ PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH
+ )
+ FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_DEBUG
+ NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4
+ PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH
+ )
+ _QT4_ADJUST_LIB_VARS(${QT_PLUGIN})
+ ELSE(QT_IS_STATIC)
+ # find_library works easier/better than find_file but we need to set suffixes to only match plugins
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX})
+ FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_RELEASE
+ NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4
+ PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH
+ )
+ FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_DEBUG
+ NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4
+ PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH
+ )
+ MARK_AS_ADVANCED(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT})
+ ENDIF(QT_IS_STATIC)
+ ENDFOREACH(QT_PLUGIN)
+ ENDFOREACH(QT_PLUGIN_TYPE)
+
+
+ ######################################
+ #
+ # Macros for building Qt files
+ #
+ ######################################
+
+ INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake")
+
+
+ #######################################
+ #
# compatibility settings
#
#######################################
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index 314d706..b206c9a 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -104,7 +104,7 @@ ENDIF(WIN32)
FIND_LIBRARY(TCL_LIBRARY
NAMES
tcl
- tcl${TK_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
+ tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
tcl86 tcl8.6
tcl85 tcl8.5
tcl84 tcl8.4
@@ -117,7 +117,7 @@ FIND_LIBRARY(TCL_LIBRARY
FIND_LIBRARY(TK_LIBRARY
NAMES
tk
- tk${TCL_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
+ tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
tk86 tk8.6
tk85 tk8.5
tk84 tk8.4
diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index 18014af..4bcaae9 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -45,10 +45,12 @@ set(module_symbols
my_module_mp_my_sub_ # Intel
MY_MODULE_mp_MY_SUB # Intel on Windows
my_module_my_sub_ # PGI
+ my_module_MP_my_sub # NAG
mymodule$mysub # HP
mymodule_mp_mysub_ # Intel
MYMODULE_mp_MYSUB # Intel on Windows
mymodule_mysub_ # PGI
+ mymodule_MP_mysub # NAG
${FortranCInterface_MODULE_SYMBOLS}
)
list(REMOVE_DUPLICATES module_symbols)
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index b60fed8..4564e74 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -1,16 +1,21 @@
-# By including this file, all files in the CMAKE_INSTALL_DEBUG_LIBRARIES,
-# will be installed with INSTALL_PROGRAMS into /bin for WIN32 and /lib
-# for non-win32. If CMAKE_SKIP_INSTALL_RULES is set to TRUE before including
-# this file, then the INSTALL command is not called. The user can use
-# the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a custom install
-# command and install them into any directory they want.
+# By including this file, all library files listed in the variable
+# CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will be installed with
+# INSTALL(PROGRAMS ...) into bin for WIN32 and lib
+# for non-WIN32. If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE
+# before including this file, then the INSTALL command is not called.
+# The user can use the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a
+# custom install command and install them however they want.
# If it is the MSVC compiler, then the microsoft run
# time libraries will be found and automatically added to the
-# CMAKE_INSTALL_DEBUG_LIBRARIES, and installed.
+# CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS, and installed.
# If CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC
# compiler, then the debug libraries are installed when available.
+# If CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY is set then only the debug
+# libraries are installed when both debug and release are available.
# If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run time
# libraries are installed as well as the CRT run time libraries.
+# If CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set then the libraries are
+# installed to that directory rather than the default.
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -63,12 +68,14 @@ IF(MSVC)
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- SET(__install__libs
- "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
- "${MSVC80_CRT_DIR}/msvcm80.dll"
- "${MSVC80_CRT_DIR}/msvcp80.dll"
- "${MSVC80_CRT_DIR}/msvcr80.dll"
- )
+ IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ SET(__install__libs
+ "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
+ "${MSVC80_CRT_DIR}/msvcm80.dll"
+ "${MSVC80_CRT_DIR}/msvcp80.dll"
+ "${MSVC80_CRT_DIR}/msvcr80.dll"
+ )
+ ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC80_CRT_DIR
@@ -96,12 +103,15 @@ IF(MSVC)
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- SET(__install__libs
- "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
- "${MSVC90_CRT_DIR}/msvcm90.dll"
- "${MSVC90_CRT_DIR}/msvcp90.dll"
- "${MSVC90_CRT_DIR}/msvcr90.dll"
- )
+ IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ SET(__install__libs
+ "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
+ "${MSVC90_CRT_DIR}/msvcm90.dll"
+ "${MSVC90_CRT_DIR}/msvcp90.dll"
+ "${MSVC90_CRT_DIR}/msvcr90.dll"
+ )
+ ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+
IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC90_CRT_DIR
"${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
@@ -111,8 +121,8 @@ IF(MSVC)
"${MSVC90_CRT_DIR}/msvcp90d.dll"
"${MSVC90_CRT_DIR}/msvcr90d.dll"
)
- ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
- ENDIF(MSVC90)
+ ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ ENDIF(MSVC90)
IF(MSVC10)
# Find the runtime library redistribution directory.
@@ -126,11 +136,14 @@ IF(MSVC)
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- SET(__install__libs
- "${MSVC10_CRT_DIR}/Microsoft.VC100.CRT.manifest"
- "${MSVC10_CRT_DIR}/msvcp100.dll"
- "${MSVC10_CRT_DIR}/msvcr100.dll"
- )
+ IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ SET(__install__libs
+ "${MSVC10_CRT_DIR}/Microsoft.VC100.CRT.manifest"
+ "${MSVC10_CRT_DIR}/msvcp100.dll"
+ "${MSVC10_CRT_DIR}/msvcr100.dll"
+ )
+ ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+
IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC10_CRT_DIR
"${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
@@ -139,7 +152,7 @@ IF(MSVC)
"${MSVC10_CRT_DIR}/msvcp100d.dll"
"${MSVC10_CRT_DIR}/msvcr100d.dll"
)
- ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
ENDIF(MSVC10)
IF(CMAKE_INSTALL_MFC_LIBRARIES)
@@ -165,17 +178,20 @@ IF(MSVC)
"${MSVC80_MFC_DIR}/mfcm80ud.dll"
)
ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-
+
SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- SET(__install__libs ${__install__libs}
- "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
- "${MSVC80_MFC_DIR}/mfc80.dll"
- "${MSVC80_MFC_DIR}/mfc80u.dll"
- "${MSVC80_MFC_DIR}/mfcm80.dll"
- "${MSVC80_MFC_DIR}/mfcm80u.dll"
- )
+ IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ SET(__install__libs ${__install__libs}
+ "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
+ "${MSVC80_MFC_DIR}/mfc80.dll"
+ "${MSVC80_MFC_DIR}/mfc80u.dll"
+ "${MSVC80_MFC_DIR}/mfcm80.dll"
+ "${MSVC80_MFC_DIR}/mfcm80u.dll"
+ )
+ ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+
# include the language dll's for vs8 as well as the actuall dll's
SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
@@ -206,17 +222,20 @@ IF(MSVC)
"${MSVC90_MFC_DIR}/mfcm90ud.dll"
)
ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-
+
SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- SET(__install__libs ${__install__libs}
- "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
- "${MSVC90_MFC_DIR}/mfc90.dll"
- "${MSVC90_MFC_DIR}/mfc90u.dll"
- "${MSVC90_MFC_DIR}/mfcm90.dll"
- "${MSVC90_MFC_DIR}/mfcm90u.dll"
- )
+ IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ SET(__install__libs ${__install__libs}
+ "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
+ "${MSVC90_MFC_DIR}/mfc90.dll"
+ "${MSVC90_MFC_DIR}/mfc90u.dll"
+ "${MSVC90_MFC_DIR}/mfcm90.dll"
+ "${MSVC90_MFC_DIR}/mfcm90u.dll"
+ )
+ ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+
# include the language dll's for vs9 as well as the actuall dll's
SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
@@ -247,17 +266,20 @@ IF(MSVC)
"${MSVC10_MFC_DIR}/mfcm100ud.dll"
)
ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-
+
SET(MSVC10_MFC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- SET(__install__libs ${__install__libs}
- "${MSVC10_MFC_DIR}/Microsoft.VC100.MFC.manifest"
- "${MSVC10_MFC_DIR}/mfc100.dll"
- "${MSVC10_MFC_DIR}/mfc100u.dll"
- "${MSVC10_MFC_DIR}/mfcm100.dll"
- "${MSVC10_MFC_DIR}/mfcm100u.dll"
- )
+ IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ SET(__install__libs ${__install__libs}
+ "${MSVC10_MFC_DIR}/Microsoft.VC100.MFC.manifest"
+ "${MSVC10_MFC_DIR}/mfc100.dll"
+ "${MSVC10_MFC_DIR}/mfc100u.dll"
+ "${MSVC10_MFC_DIR}/mfcm100.dll"
+ "${MSVC10_MFC_DIR}/mfcm100u.dll"
+ )
+ ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+
# include the language dll's for vs10 as well as the actuall dll's
SET(MSVC10_MFCLOC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
@@ -292,10 +314,14 @@ ENDIF(MSVC)
# specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
- IF(WIN32)
- INSTALL_PROGRAMS(/bin ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
- ELSE(WIN32)
- INSTALL_PROGRAMS(/lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
- ENDIF(WIN32)
+ IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
+ IF(WIN32)
+ SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
+ ELSE(WIN32)
+ SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
+ ENDIF(WIN32)
+ ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
+ INSTALL(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
+ DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION})
ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 776bc07..df9d2d3 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -25,7 +25,7 @@
!include "MUI.nsh"
;Default installation folder
- InstallDir "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
+ InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
;--------------------------------
;General
@@ -540,6 +540,7 @@ FunctionEnd
@CPACK_NSIS_INSTALLER_MUI_ICON_CODE@
@CPACK_NSIS_INSTALLER_ICON_CODE@
@CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@
+@CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE@
;--------------------------------
;Pages
@@ -906,7 +907,7 @@ Function .onInit
; install directory that is expected to be the
; default
StrCpy $IS_DEFAULT_INSTALLDIR 0
- StrCmp "$INSTDIR" "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2
+ StrCmp "$INSTDIR" "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2
StrCpy $IS_DEFAULT_INSTALLDIR 1
StrCpy $SV_ALLUSERS "JustMe"
@@ -939,7 +940,7 @@ Function .onInit
done:
StrCmp $SV_ALLUSERS "AllUsers" 0 +3
StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2
- StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
+ StrCpy $INSTDIR "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index 6f72a75..5aad45b 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -24,7 +24,8 @@ set(CMAKE_CREATE_WIN32_EXE "-mwindows")
set(CMAKE_GNULD_IMAGE_VERSION
"-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>")
-
+set(CMAKE_GENERATOR_RC windres)
+enable_language(RC)
macro(__cygwin_compiler_gnu lang)
# Binary link rules.
set(CMAKE_${lang}_CREATE_SHARED_MODULE
diff --git a/Modules/Platform/CYGWIN-windres.cmake b/Modules/Platform/CYGWIN-windres.cmake
new file mode 100644
index 0000000..8bc1b15
--- /dev/null
+++ b/Modules/Platform/CYGWIN-windres.cmake
@@ -0,0 +1 @@
+SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")
diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake
index b157f72..b7ad2ce 100644
--- a/Modules/Platform/CYGWIN.cmake
+++ b/Modules/Platform/CYGWIN.cmake
@@ -1,9 +1,53 @@
-SET(WIN32 1)
+if("${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS "2.8.3.20101214")
+ set(__USE_CMAKE_LEGACY_CYGWIN_WIN32 1)
+endif()
+if(NOT DEFINED WIN32)
+ set(WIN32 0)
+ if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32)
+ if(NOT DEFINED CMAKE_LEGACY_CYGWIN_WIN32
+ AND DEFINED ENV{CMAKE_LEGACY_CYGWIN_WIN32})
+ set(CMAKE_LEGACY_CYGWIN_WIN32 $ENV{CMAKE_LEGACY_CYGWIN_WIN32})
+ endif()
+ if(CMAKE_LEGACY_CYGWIN_WIN32)
+ message(STATUS "Defining WIN32 under Cygwin due to CMAKE_LEGACY_CYGWIN_WIN32")
+ set(WIN32 1)
+ elseif("x${CMAKE_LEGACY_CYGWIN_WIN32}" STREQUAL "x")
+ message(WARNING "CMake no longer defines WIN32 on Cygwin!"
+ "\n"
+ "(1) If you are just trying to build this project, ignore this warning "
+ "or quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or "
+ "in the CMake cache. "
+ "If later configuration or build errors occur then this project may "
+ "have been written under the assumption that Cygwin is WIN32. "
+ "In that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead."
+ "\n"
+ "(2) If you are developing this project, add the line\n"
+ " set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required\n"
+ "at the top of your top-level CMakeLists.txt file or set the minimum "
+ "required version of CMake to 2.8.4 or higher. "
+ "Then teach your project to build on Cygwin without WIN32.")
+ endif()
+ elseif(DEFINED CMAKE_LEGACY_CYGWIN_WIN32)
+ message(AUTHOR_WARNING "CMAKE_LEGACY_CYGWIN_WIN32 ignored because\n"
+ " cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})\n"
+ "is at least 2.8.4.")
+ endif()
+endif()
+if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32)
+ # Pass WIN32 legacy setting to scripts.
+ if(WIN32)
+ set(ENV{CMAKE_LEGACY_CYGWIN_WIN32} 1)
+ else()
+ set(ENV{CMAKE_LEGACY_CYGWIN_WIN32} 0)
+ endif()
+ unset(__USE_CMAKE_LEGACY_CYGWIN_WIN32)
+endif()
+
SET(CYGWIN 1)
SET(CMAKE_SHARED_LIBRARY_PREFIX "cyg")
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
-SET(CMAKE_SHARED_MODULE_PREFIX "lib")
+SET(CMAKE_SHARED_MODULE_PREFIX "cyg")
SET(CMAKE_SHARED_MODULE_SUFFIX ".dll")
SET(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
diff --git a/Modules/Platform/Darwin-GNU.cmake b/Modules/Platform/Darwin-GNU.cmake
index f425eb9..8a50a6a 100644
--- a/Modules/Platform/Darwin-GNU.cmake
+++ b/Modules/Platform/Darwin-GNU.cmake
@@ -20,8 +20,8 @@ set(__DARWIN_COMPILER_GNU 1)
macro(__darwin_compiler_gnu lang)
# GNU does not have -shared on OS X
- set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -headerpad_max_install_names")
- set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -headerpad_max_install_names")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
+ set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names")
endmacro()
macro(cmake_gnu_has_isysroot lang)
diff --git a/Modules/Platform/Darwin-NAG-Fortran.cmake b/Modules/Platform/Darwin-NAG-Fortran.cmake
new file mode 100644
index 0000000..933f9e1
--- /dev/null
+++ b/Modules/Platform/Darwin-NAG-Fortran.cmake
@@ -0,0 +1,5 @@
+set(CMAKE_Fortran_VERBOSE_FLAG "-Wl,-v") # Runs gcc under the hood.
+
+# Need -fpp explicitly on case-insensitive filesystem.
+set(CMAKE_Fortran_COMPILE_OBJECT
+ "<CMAKE_Fortran_COMPILER> -fpp -o <OBJECT> <DEFINES> <FLAGS> -c <SOURCE>")
diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake
index 49aa843..b62036c 100644
--- a/Modules/Platform/Darwin-icc.cmake
+++ b/Modules/Platform/Darwin-icc.cmake
@@ -33,11 +33,11 @@ SET(CMAKE_SHARED_MODULE_PREFIX "lib")
SET(CMAKE_SHARED_MODULE_SUFFIX ".so")
SET(CMAKE_MODULE_EXISTS 1)
SET(CMAKE_DL_LIBS "")
-SET(CMAKE_C_LINK_FLAGS "-headerpad_max_install_names")
-SET(CMAKE_CXX_LINK_FLAGS "-headerpad_max_install_names")
+SET(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+SET(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
SET(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names")
-SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")
+SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
+SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index db0642e..a99ff4a 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -33,8 +33,8 @@ SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
SET(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
-SET(CMAKE_C_LINK_FLAGS "-headerpad_max_install_names")
-SET(CMAKE_CXX_LINK_FLAGS "-headerpad_max_install_names")
+SET(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+SET(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
SET(CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
@@ -42,8 +42,8 @@ IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST)
SET(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names")
-SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")
+SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
+SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
SET(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
SET(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
diff --git a/Modules/Platform/Linux-NAG-Fortran.cmake b/Modules/Platform/Linux-NAG-Fortran.cmake
new file mode 100644
index 0000000..353bae6
--- /dev/null
+++ b/Modules/Platform/Linux-NAG-Fortran.cmake
@@ -0,0 +1,10 @@
+set(CMAKE_Fortran_VERBOSE_FLAG "-Wl,-v") # Runs gcc under the hood.
+
+# Need one "-Wl," level to send flag through to gcc.
+# Use "-Xlinker" to get through gcc to real linker.
+set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-Wl,-shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-Wl,-Xlinker,-rpath,-Xlinker,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG "-Wl,-Xlinker,-rpath-link,-Xlinker,")
+set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-Wl,-Xlinker,-soname,-Xlinker,")
+set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-rdynamic")
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index ac635a5..7084b83 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -56,6 +56,8 @@ if("${_help}" MATCHES "GNU ld .* 2\\.1[1-6]")
set(__WINDOWS_GNU_LD_RESPONSE 0)
endif()
+enable_language(RC)
+
macro(__windows_compiler_gnu lang)
if(MSYS OR MINGW)
diff --git a/Modules/Platform/Windows-Intel-C.cmake b/Modules/Platform/Windows-Intel-C.cmake
new file mode 100644
index 0000000..767fec5
--- /dev/null
+++ b/Modules/Platform/Windows-Intel-C.cmake
@@ -0,0 +1,2 @@
+include(Platform/Windows-Intel)
+__windows_compiler_intel(C)
diff --git a/Modules/Platform/Windows-Intel-CXX.cmake b/Modules/Platform/Windows-Intel-CXX.cmake
new file mode 100644
index 0000000..2845b0f
--- /dev/null
+++ b/Modules/Platform/Windows-Intel-CXX.cmake
@@ -0,0 +1,4 @@
+include(Platform/Windows-Intel)
+set(_COMPILE_CXX " /TP")
+set(_FLAGS_CXX " /GX /GR")
+__windows_compiler_intel(CXX)
diff --git a/Modules/Platform/Windows-Intel-Fortran.cmake b/Modules/Platform/Windows-Intel-Fortran.cmake
new file mode 100644
index 0000000..c959287
--- /dev/null
+++ b/Modules/Platform/Windows-Intel-Fortran.cmake
@@ -0,0 +1,11 @@
+include(Platform/Windows-Intel)
+set(CMAKE_BUILD_TYPE_INIT Debug)
+set(_COMPILE_Fortran " /fpp")
+set(CMAKE_Fortran_MODDIR_FLAG "-module:")
+set(CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")
+__windows_compiler_intel(Fortran)
+SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads")
+SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs")
+SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /D NDEBUG")
+SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O1 /D NDEBUG")
+SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O1 /debug:full /D NDEBUG")
diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake
index e893925..e7462ba 100644
--- a/Modules/Platform/Windows-Intel.cmake
+++ b/Modules/Platform/Windows-Intel.cmake
@@ -1,3 +1,66 @@
+
+#=============================================================================
+# Copyright 2002-2010 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 distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This module is shared by multiple languages; use include blocker.
+if(__WINDOWS_INTEL)
+ return()
+endif()
+set(__WINDOWS_INTEL 1)
+
+# make sure to enable languages after setting configuration types
+ENABLE_LANGUAGE(RC)
+SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+
+SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
+SET(CMAKE_LINK_LIBRARY_FLAG "")
+SET(WIN32 1)
+IF(CMAKE_VERBOSE_MAKEFILE)
+ SET(CMAKE_CL_NOLOGO)
+ELSE(CMAKE_VERBOSE_MAKEFILE)
+ SET(CMAKE_CL_NOLOGO "/nologo")
+ENDIF(CMAKE_VERBOSE_MAKEFILE)
+SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
+SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
+
+# default to Debug builds
+#SET(CMAKE_BUILD_TYPE_INIT Debug)
+SET(CMAKE_BUILD_TYPE_INIT Release)
+
+SET(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib")
+SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+
+# executable linker flags
+SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
+IF(MSVC_C_ARCHITECTURE_ID)
+ SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_C_ARCHITECTURE_ID}")
+ELSEIF(MSVC_CXX_ARCHITECTURE_ID)
+ SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_CXX_ARCHITECTURE_ID}")
+ELSEIF(MSVC_Fortran_ARCHITECTURE_ID)
+ SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_Fortran_ARCHITECTURE_ID}")
+ENDIF()
+SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:YES ${_MACHINE_ARCH_FLAG}")
+SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
+SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
+
+SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
+SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
+SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
+SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+
INCLUDE("${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake" OPTIONAL)
IF(NOT _INTEL_XILINK_TEST_RUN)
@@ -15,3 +78,31 @@ SET(_INTEL_COMPILER_SUPPORTS_MANIFEST ${_INTEL_COMPILER_SUPPORTS_MANIFEST})
")
ENDIF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake")
ENDIF(NOT _INTEL_XILINK_TEST_RUN)
+
+macro(__windows_compiler_intel lang)
+ set(CMAKE_${lang}_COMPILE_OBJECT
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} /Fo<OBJECT> <DEFINES> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
+ "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <DEFINES> <FLAGS> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+ set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
+ "xilink ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
+ set(CMAKE_${lang}_LINK_EXECUTABLE
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}")
+ set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Od /GZ")
+ set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/DNDEBUG /MD /O1")
+ set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/DNDEBUG /MD /O2")
+ set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/DNDEBUG /MD /Zi /O2")
+
+ if(_INTEL_COMPILER_SUPPORTS_MANIFEST)
+ SET(CMAKE_${lang}_LINK_EXECUTABLE
+ "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_${lang}_LINK_EXECUTABLE}")
+ SET(CMAKE_${lang}_CREATE_SHARED_LIBRARY
+ "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
+ SET(CMAKE_${lang}_CREATE_SHARED_MODULE
+ "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_MODULE}")
+ endif()
+endmacro()
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index 7463c62..56582ff 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -212,6 +212,8 @@ SET (CMAKE_EXE_LINKER_FLAGS_INIT
SET( MSVC_INCREMENTAL_YES_FLAG "")
IF(NOT MSVC_INCREMENTAL_DEFAULT)
SET( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
+ELSE()
+ SET( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
ENDIF()
IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
diff --git a/Modules/Platform/Windows-g++.cmake b/Modules/Platform/Windows-g++.cmake
deleted file mode 100644
index 3aa393c..0000000
--- a/Modules/Platform/Windows-g++.cmake
+++ /dev/null
@@ -1 +0,0 @@
-INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-gcc.cmake)
diff --git a/Modules/Platform/Windows-icl.cmake b/Modules/Platform/Windows-icl.cmake
deleted file mode 100644
index 9088cc7..0000000
--- a/Modules/Platform/Windows-icl.cmake
+++ /dev/null
@@ -1,109 +0,0 @@
-SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
-SET(CMAKE_LINK_LIBRARY_FLAG "")
-SET(WIN32 1)
-IF(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_CL_NOLOGO)
-ELSE(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_CL_NOLOGO "/nologo")
-ENDIF(CMAKE_VERBOSE_MAKEFILE)
-
-SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-
-# create a shared C++ library
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
- "xilink ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
-
-# create a C shared library
-SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
-
-# create a C shared module just copy the shared library rule
-SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
-
-
-# create a C++ static library
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
-
-# create a C static library
-SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
-
-# compile a C++ file into an object file
-SET(CMAKE_CXX_COMPILE_OBJECT
- "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /TP -DWIN32 /Fo<OBJECT> <DEFINES> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-# compile a C file into an object file
-SET(CMAKE_C_COMPILE_OBJECT
- "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} -DWIN32 /Fo<OBJECT> <DEFINES> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-
-SET(CMAKE_C_LINK_EXECUTABLE
- "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE
- "<CMAKE_C_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
- "<CMAKE_CXX_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP -E <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
-
-SET(CMAKE_CXX_LINK_EXECUTABLE
- "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
-SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
-
-# default to Debug builds
-#SET(CMAKE_BUILD_TYPE_INIT Debug)
-SET(CMAKE_BUILD_TYPE_INIT Release)
-SET (CMAKE_CXX_FLAGS_INIT "/W3 /Zm1000 /GX /GR")
-SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ")
-SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1")
-SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2")
-SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2")
-SET (CMAKE_C_FLAGS_INIT "/W3 /Zm1000")
-SET (CMAKE_C_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ")
-SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1")
-SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2")
-SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2")
-
-
-SET(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib")
-SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
-
-# executable linker flags
-SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
-SET(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID})
-IF(NOT _MACHINE_ARCH_FLAG)
- SET(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID})
-ENDIF(NOT _MACHINE_ARCH_FLAG)
-SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:YES /machine:${_MACHINE_ARCH_FLAG}")
-SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
-SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
-
-SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
-
-
-INCLUDE(Platform/Windows-Intel)
-
-IF(_INTEL_COMPILER_SUPPORTS_MANIFEST)
- SET(CMAKE_C_LINK_EXECUTABLE
- "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_C_LINK_EXECUTABLE}")
- SET(CMAKE_C_CREATE_SHARED_LIBRARY
- "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_C_CREATE_SHARED_LIBRARY}")
- SET(CMAKE_C_CREATE_SHARED_MODULE
- "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_C_CREATE_SHARED_MODULE}")
- SET(CMAKE_CXX_LINK_EXECUTABLE
- "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}")
- SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
- "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
- SET(CMAKE_CXX_CREATE_SHARED_MODULE
- "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_MODULE}")
-ENDIF(_INTEL_COMPILER_SUPPORTS_MANIFEST)
diff --git a/Modules/Platform/Windows-ifort.cmake b/Modules/Platform/Windows-ifort.cmake
deleted file mode 100644
index 6cffed9..0000000
--- a/Modules/Platform/Windows-ifort.cmake
+++ /dev/null
@@ -1,80 +0,0 @@
-SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
-SET(CMAKE_LINK_LIBRARY_FLAG "")
-SET(WIN32 1)
-IF(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_CL_NOLOGO)
-ELSE(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_CL_NOLOGO "/nologo")
-ENDIF(CMAKE_VERBOSE_MAKEFILE)
-
-SET(CMAKE_Fortran_MODDIR_FLAG "-module:")
-
-SET(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-
-SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
- "link ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /dll <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
-
-# create a C++ static library
-SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
-
-# compile a C++ file into an object file
-SET(CMAKE_Fortran_COMPILE_OBJECT
- "<CMAKE_Fortran_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /fpp /Fo<OBJECT> <DEFINES> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
-
-SET(CMAKE_Fortran_LINK_EXECUTABLE
- "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
-
-INCLUDE(Platform/Windows-Intel)
-
-IF(_INTEL_COMPILER_SUPPORTS_MANIFEST)
- SET(CMAKE_Fortran_LINK_EXECUTABLE
- "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_Fortran_LINK_EXECUTABLE}")
- SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
- "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}")
- SET(CMAKE_Fortran_CREATE_SHARED_MODULE
- "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_Fortran_CREATE_SHARED_MODULE}")
-ENDIF(_INTEL_COMPILER_SUPPORTS_MANIFEST)
-
-SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
-SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
-
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
- SET (CMAKE_NO_BUILD_TYPE 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
- SET (CMAKE_NO_BUILD_TYPE 1)
- SET (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
- "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
-# does the compiler support pdbtype and is it the newer compiler
-
-SET(CMAKE_BUILD_TYPE_INIT Debug)
-SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads")
-SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs")
-SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /D NDEBUG")
-SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O1 /D NDEBUG")
-SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O1 /debug:full /D NDEBUG")
-
-SET (CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")
-
-# executable linker flags
-SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
-SET (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES")
-IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept")
- SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept")
-ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
- SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
-ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
-
-SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
diff --git a/Modules/Platform/Windows-windres.cmake b/Modules/Platform/Windows-windres.cmake
new file mode 100644
index 0000000..8bc1b15
--- /dev/null
+++ b/Modules/Platform/Windows-windres.cmake
@@ -0,0 +1 @@
+SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index bfb50de..10af3bc 100644
--- a/Modules/Qt4ConfigDependentSettings.cmake
+++ b/Modules/Qt4ConfigDependentSettings.cmake
@@ -35,10 +35,10 @@ SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
IF(Q_WS_WIN)
- # On Windows, qconfig.pri has "static" for static library builds
- IF(QT_CONFIG MATCHES "static")
+ # On Windows, qconfig.pri has "shared" for shared library builds
+ IF(NOT QT_CONFIG MATCHES "shared")
SET(QT_IS_STATIC 1)
- ENDIF(QT_CONFIG MATCHES "static")
+ ENDIF(NOT QT_CONFIG MATCHES "shared")
ELSE(Q_WS_WIN)
# On other platforms, check file extension to know if its static
IF(QT_QTCORE_LIBRARY_RELEASE)
@@ -75,6 +75,23 @@ IF(QT_QCONFIG MATCHES "system-png")
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY})
ENDIF(QT_QCONFIG MATCHES "system-png")
+## system jpeg
+IF(QT_QCONFIG MATCHES "system-jpeg")
+ find_package(JPEG)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${JPEG_LIBRARIES})
+ENDIF(QT_QCONFIG MATCHES "system-jpeg")
+
+## system tiff
+IF(QT_QCONFIG MATCHES "system-tiff")
+ find_package(TIFF)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${TIFF_LIBRARIES})
+ENDIF(QT_QCONFIG MATCHES "system-tiff")
+
+## system mng
+IF(QT_QCONFIG MATCHES "system-mng")
+ find_library(MNG_LIBRARY NAMES mng)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${MNG_LIBRARY})
+ENDIF(QT_QCONFIG MATCHES "system-mng")
# for X11, get X11 library directory
IF(Q_WS_X11)
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index df07d25..86a7404 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -71,12 +71,12 @@ MACRO (QT4_GET_MOC_FLAGS _moc_flags)
GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
FOREACH(_current ${_inc_DIRS})
- IF("${_current}" MATCHES ".framework/?$")
- STRING(REGEX REPLACE "/[^/]+.framework" "" framework_path "${_current}")
+ IF("${_current}" MATCHES "\\.framework/?$")
+ STRING(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
SET(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
- ELSE("${_current}" MATCHES ".framework/?$")
+ ELSE("${_current}" MATCHES "\\.framework/?$")
SET(${_moc_flags} ${${_moc_flags}} "-I${_current}")
- ENDIF("${_current}" MATCHES ".framework/?$")
+ ENDIF("${_current}" MATCHES "\\.framework/?$")
ENDFOREACH(_current ${_inc_DIRS})
GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS)
@@ -254,7 +254,15 @@ MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options
GET_FILENAME_COMPONENT(_basename ${_header} NAME_WE)
IF (_customName)
- SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
+ if (IS_ABSOLUTE ${_customName})
+ get_filename_component(_containingDir ${_customName} PATH)
+ if (NOT EXISTS ${_containingDir})
+ file(MAKE_DIRECTORY "${_containingDir}")
+ endif()
+ SET(_target ${_customName})
+ else()
+ SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
+ endif()
ELSE (_customName)
SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
ENDIF (_customName)
diff --git a/Modules/SystemInformation.cmake b/Modules/SystemInformation.cmake
index d973e90f..d4f2233 100644
--- a/Modules/SystemInformation.cmake
+++ b/Modules/SystemInformation.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2007-2009 Kitware, Inc.
+# Copyright 2007-2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -12,6 +12,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})
PROJECT(DumpInformation)
# first get the standard information for th platform
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 71284b2..f183eb4 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -131,6 +131,8 @@ SET(SRCS
cmComputeTargetDepends.cxx
cmCustomCommand.cxx
cmCustomCommand.h
+ cmCustomCommandGenerator.cxx
+ cmCustomCommandGenerator.h
cmDefinitions.cxx
cmDefinitions.h
cmDepends.cxx
@@ -156,6 +158,7 @@ SET(SRCS
cmDocumentationFormatterText.cxx
cmDocumentationFormatterUsage.cxx
cmDocumentationSection.cxx
+ cmDocumentGeneratorExpressions.h
cmDocumentVariables.cxx
cmDynamicLoader.cxx
cmDynamicLoader.h
@@ -183,6 +186,8 @@ SET(SRCS
cmGlobalUnixMakefileGenerator3.cxx
cmGlobalUnixMakefileGenerator3.h
cmGraphAdjacencyList.h
+ cmGraphVizWriter.cxx
+ cmGraphVizWriter.h
cmInstallGenerator.h
cmInstallGenerator.cxx
cmInstallExportGenerator.cxx
@@ -332,7 +337,7 @@ ENDIF (WIN32)
# create a library used by the command line and the GUI
ADD_LIBRARY(CMakeLib ${SRCS})
-TARGET_LINK_LIBRARIES(CMakeLib cmsys
+TARGET_LINK_LIBRARIES(CMakeLib cmsys
${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
${CMAKE_CURL_LIBRARIES} )
@@ -432,7 +437,7 @@ IF(CYGWIN)
CPack/cmCPackCygwinSourceGenerator.cxx
)
ENDIF(CYGWIN)
-
+
IF(UNIX)
SET(CPACK_SRCS ${CPACK_SRCS}
CPack/cmCPackDebGenerator.cxx
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index c86434e..46be99b 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -105,12 +105,12 @@ if (!archive) \
}
//----------------------------------------------------------------------
-int cmCPackArchiveGenerator::PackageComponents(bool ignoreComponentGroup)
+int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
{
packageFileNames.clear();
// The default behavior is to have one package by component group
// unless CPACK_COMPONENTS_IGNORE_GROUP is specified.
- if (!ignoreComponentGroup)
+ if (!ignoreGroup)
{
std::map<std::string, cmCPackComponentGroup>::iterator compGIt;
for (compGIt=this->ComponentGroups.begin();
@@ -170,7 +170,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreComponentGroup)
}
//----------------------------------------------------------------------
-int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponentInOne)
+int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponent)
{
// reset the package file names
packageFileNames.clear();
@@ -185,7 +185,7 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponentInOne)
DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive);
// The ALL GROUP in ONE package case
- if (! allComponentInOne) {
+ if (! allComponent) {
// iterate over the component groups
std::map<std::string, cmCPackComponentGroup>::iterator compGIt;
for (compGIt=this->ComponentGroups.begin();
@@ -226,78 +226,27 @@ int cmCPackArchiveGenerator::PackageFiles()
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: "
<< toplevel << std::endl);
- // The default behavior is to create 1 package by component group
- // unless the user asked to put all COMPONENTS in a single package
- bool allGroupInOne = (NULL !=
- (this->GetOption(
- "CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE")));
- bool allComponentInOne = (NULL !=
- (this->GetOption(
- "CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE")));
- bool ignoreComponentGroup = ( NULL !=
- (this->GetOption(
- "CPACK_COMPONENTS_IGNORE_GROUPS")));
+ PrepareGroupingKind();
- std::string groupingType;
-
- // Second way to specify grouping
- if (NULL != this->GetOption("CPACK_COMPONENTS_GROUPING")) {
- groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING");
- }
-
- if (groupingType.length()>0)
- {
- cmCPackLogger(cmCPackLog::LOG_VERBOSE, "["
- << this->Name << "]"
- << " requested component grouping = "<< groupingType <<std::endl);
- if (groupingType == "ALL_GROUP_IN_ONE")
- {
- allGroupInOne = true;
- }
- else if (groupingType == "ALL_COMPONENT_IN_ONE")
- {
- allComponentInOne = true;
- }
- else if (groupingType == "IGNORE")
+ if (SupportsComponentInstallation()) {
+ // CASE 1 : COMPONENT ALL-IN-ONE package
+ // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested
+ // then the package file is unique and should be open here.
+ if (allComponentInOne ||
+ (allGroupInOne && (!this->ComponentGroups.empty()))
+ )
{
- ignoreComponentGroup = true;
+ return PackageComponentsAllInOne(allComponentInOne);
}
- else
+ // CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
+ // There will be 1 package for each component group
+ // however one may require to ignore component group and
+ // in this case you'll get 1 package for each component.
+ else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup))
{
- cmCPackLogger(cmCPackLog::LOG_WARNING, "["
- << this->Name << "]"
- << " requested component grouping type <"<< groupingType
- << "> UNKNOWN not in (ALL_GROUP_IN_ONE,"
- "ALL_COMPONENT_IN_ONE,IGNORE)" <<std::endl);
+ return PackageComponents(ignoreComponentGroup);
}
- }
-
- // Some components were defined but NO group
- // force ignoreGroups
- if (this->ComponentGroups.empty() && (!this->Components.empty())
- && (!ignoreComponentGroup)) {
- cmCPackLogger(cmCPackLog::LOG_WARNING, "["
- << this->Name << "]"
- << " Some Components defined but NO component group:"
- << " Ignoring component group."
- << std::endl);
- ignoreComponentGroup = true;
}
- // CASE 1 : COMPONENT ALL-IN-ONE package
- // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested
- // then the package file is unique and should be open here.
- if (allComponentInOne || (allGroupInOne && (!this->ComponentGroups.empty())))
- {
- return PackageComponentsAllInOne(allComponentInOne);
- }
- // CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
- // There will be 1 package for each component group
- // however one may require to ignore component group and
- // in this case you'll get 1 package for each component.
- else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup))
- {
- return PackageComponents(ignoreComponentGroup);
- }
// CASE 3 : NON COMPONENT package.
DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive);
@@ -333,5 +282,15 @@ int cmCPackArchiveGenerator::GenerateHeader(std::ostream*)
}
bool cmCPackArchiveGenerator::SupportsComponentInstallation() const {
- return true;
+ // The Component installation support should only
+ // be activated if explicitly requested by the user
+ // (for backward compatibility reason)
+ if (IsOn("CPACK_ARCHIVE_COMPONENT_INSTALL"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h
index 6e173bd..dc17257 100644
--- a/Source/CPack/cmCPackArchiveGenerator.h
+++ b/Source/CPack/cmCPackArchiveGenerator.h
@@ -60,12 +60,12 @@ protected:
* install is used. This will create one
* archive for each component group.
*/
- int PackageComponents(bool ignoreComponentGroup);
+ int PackageComponents(bool ignoreGroup);
/**
* Special case of component install where all
* components will be put in a single installer.
*/
- int PackageComponentsAllInOne(bool allComponentInOne);
+ int PackageComponentsAllInOne(bool allComponent);
virtual const char* GetOutputExtension() = 0;
cmArchiveWrite::Compress Compress;
cmArchiveWrite::Type Archive;
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index c39aea4..feda52c 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -35,6 +35,9 @@ cmCPackGenerator::cmCPackGenerator()
this->GeneratorVerbose = false;
this->MakefileMap = 0;
this->Logger = 0;
+ this->allGroupInOne = false;
+ this->allComponentInOne = false;
+ this->ignoreComponentGroup = false;
}
//----------------------------------------------------------------------
@@ -220,7 +223,7 @@ int cmCPackGenerator::InstallProject()
// If the CPackConfig file sets CPACK_INSTALLED_DIRECTORIES
// then glob it and copy it to CPACK_TEMPORARY_DIRECTORY
- // This is used in Source packageing
+ // This is used in Source packaging
if ( !this->InstallProjectViaInstalledDirectories(
setDestDir, tempInstallDirectory) )
{
@@ -548,7 +551,14 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::vector<std::string> componentsVector;
bool componentInstall = false;
- if (this->SupportsComponentInstallation())
+ /*
+ * We do a component install iff
+ * - the CPack generator support component
+ * - the user did not request Monolithic install
+ * (this works at CPack time too)
+ */
+ if (this->SupportsComponentInstallation() &
+ !(this->IsSet("CPACK_MONOLITHIC_INSTALL")))
{
// Determine the installation types for this project (if provided).
std::string installTypesVar = "CPACK_"
@@ -691,7 +701,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
//
// If DESTDIR has been 'internally set ON' this means that
// the underlying CPack specific generator did ask for that
- // In this case we may overrode CPACK_INSTALL_PREFIX with
+ // In this case we may override CPACK_INSTALL_PREFIX with
// CPACK_PACKAGING_INSTALL_PREFIX
// I know this is tricky and awkward but it's the price for
// CPACK_SET_DESTDIR backward compatibility.
@@ -727,7 +737,20 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
{
dir = tempInstallDirectory + "/" + dir;
}
-
+ /*
+ * We must re-set DESTDIR for each component
+ * We must not add the CPACK_INSTALL_PREFIX part because
+ * it will be added using the override of CMAKE_INSTALL_PREFIX
+ * The main reason for this awkward trick is that
+ * are using DESTDIR for 2 different reasons:
+ * - Because it was asked by the CPack Generator or the user
+ * using CPACK_SET_DESTDIR
+ * - Because it was already used for component install
+ * in order to put things in subdirs...
+ */
+ cmSystemTools::PutEnv(
+ (std::string("DESTDIR=")+tempInstallDirectory).c_str()
+ );
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Creating directory: '" << dir << "'" << std::endl);
@@ -1047,7 +1070,13 @@ bool cmCPackGenerator::IsSet(const char* name) const
}
//----------------------------------------------------------------------
-const char* cmCPackGenerator::GetOption(const char* op)
+bool cmCPackGenerator::IsOn(const char* name) const
+{
+ return cmSystemTools::IsOn(GetOption(name));
+}
+
+//----------------------------------------------------------------------
+const char* cmCPackGenerator::GetOption(const char* op) const
{
const char* ret = this->MakefileMap->GetDefinition(op);
if(!ret)
@@ -1196,6 +1225,70 @@ int cmCPackGenerator::CleanTemporaryDirectory()
}
//----------------------------------------------------------------------
+int cmCPackGenerator::PrepareGroupingKind()
+{
+ // The default behavior is to create 1 package by component group
+ // unless the user asked to put all COMPONENTS in a single package
+ allGroupInOne = (NULL !=
+ (this->GetOption(
+ "CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE")));
+ allComponentInOne = (NULL !=
+ (this->GetOption(
+ "CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE")));
+ ignoreComponentGroup = (NULL !=
+ (this->GetOption(
+ "CPACK_COMPONENTS_IGNORE_GROUPS")));
+
+ std::string groupingType;
+
+ // Second way to specify grouping
+ if (NULL != this->GetOption("CPACK_COMPONENTS_GROUPING")) {
+ groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING");
+ }
+
+ if (groupingType.length()>0)
+ {
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "["
+ << this->Name << "]"
+ << " requested component grouping = "<< groupingType <<std::endl);
+ if (groupingType == "ALL_GROUP_IN_ONE")
+ {
+ allGroupInOne = true;
+ }
+ else if (groupingType == "ALL_COMPONENT_IN_ONE")
+ {
+ allComponentInOne = true;
+ }
+ else if (groupingType == "IGNORE")
+ {
+ ignoreComponentGroup = true;
+ }
+ else
+ {
+ cmCPackLogger(cmCPackLog::LOG_WARNING, "["
+ << this->Name << "]"
+ << " requested component grouping type <"<< groupingType
+ << "> UNKNOWN not in (ALL_GROUP_IN_ONE,"
+ "ALL_COMPONENT_IN_ONE,IGNORE)" <<std::endl);
+ }
+ }
+
+ // Some components were defined but NO group
+ // force ignoreGroups
+ if (this->ComponentGroups.empty() && (!this->Components.empty())
+ && (!ignoreComponentGroup)) {
+ cmCPackLogger(cmCPackLog::LOG_WARNING, "["
+ << this->Name << "]"
+ << " Some Components defined but NO component group:"
+ << " Ignoring component group."
+ << std::endl);
+ ignoreComponentGroup = true;
+ }
+
+ return 1;
+}
+
+//----------------------------------------------------------------------
bool cmCPackGenerator::SupportsComponentInstallation() const
{
return false;
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 74b780d..f44a334 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -88,8 +88,9 @@ public:
//! Set and get the options
void SetOption(const char* op, const char* value);
void SetOptionIfNotSet(const char* op, const char* value);
- const char* GetOption(const char* op);
+ const char* GetOption(const char* op) const;
bool IsSet(const char* name) const;
+ bool IsOn(const char* name) const;
//! Set all the variables
int SetCMakeRoot();
@@ -120,6 +121,17 @@ protected:
virtual const char* GetOutputPostfix() { return 0; }
/**
+ * Prepare requested grouping kind from CPACK_xxx vars
+ * CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE
+ * CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE
+ * CPACK_COMPONENTS_IGNORE_GROUPS
+ * or
+ * CPACK_COMPONENTS_GROUPING
+ * @return 1 on success 0 on failure.
+ */
+ virtual int PrepareGroupingKind();
+
+ /**
* Package the list of files and/or components which
* has been prepared by the beginning of DoPackage.
* @pre @ref toplevel has been filled-in
@@ -200,6 +212,20 @@ protected:
*/
std::map<std::string, cmCPackComponent> Components;
std::map<std::string, cmCPackComponentGroup> ComponentGroups;
+ /**
+ * If true All component groups will be put in a single package.
+ */
+ bool allGroupInOne;
+ /**
+ * If true All component will be put in a single package.
+ */
+ bool allComponentInOne;
+ /**
+ * If true component grouping will be ignored.
+ * You will still get 1 package for each component unless
+ * allComponentInOne is true.
+ */
+ bool ignoreComponentGroup;
cmCPackLog* Logger;
private:
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index d0eda81..e5fe575 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -129,14 +129,21 @@ int cmCPackNSISGenerator::PackageFiles()
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << nsisInFileName
<< " to " << nsisFileName << std::endl);
if(this->IsSet("CPACK_NSIS_MUI_ICON")
- && this->IsSet("CPACK_NSIS_MUI_UNIICON"))
+ || this->IsSet("CPACK_NSIS_MUI_UNIICON"))
{
- std::string installerIconCode="!define MUI_ICON \"";
- installerIconCode += this->GetOption("CPACK_NSIS_MUI_ICON");
- installerIconCode += "\"\n";
- installerIconCode += "!define MUI_UNICON \"";
- installerIconCode += this->GetOption("CPACK_NSIS_MUI_UNIICON");
- installerIconCode += "\"\n";
+ std::string installerIconCode;
+ if(this->IsSet("CPACK_NSIS_MUI_ICON"))
+ {
+ installerIconCode += "!define MUI_ICON \"";
+ installerIconCode += this->GetOption("CPACK_NSIS_MUI_ICON");
+ installerIconCode += "\"\n";
+ }
+ if(this->IsSet("CPACK_NSIS_MUI_UNIICON"))
+ {
+ installerIconCode += "!define MUI_UNICON \"";
+ installerIconCode += this->GetOption("CPACK_NSIS_MUI_UNIICON");
+ installerIconCode += "\"\n";
+ }
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_ICON_CODE",
installerIconCode.c_str());
}
@@ -149,6 +156,17 @@ int cmCPackNSISGenerator::PackageFiles()
installerIconCode.c_str());
}
+ if(this->IsSet("CPACK_NSIS_MUI_FINISHPAGE_RUN"))
+ {
+ std::string installerRunCode = "!define MUI_FINISHPAGE_RUN \"$INSTDIR\\";
+ installerRunCode += this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY");
+ installerRunCode += "\\";
+ installerRunCode += this->GetOption("CPACK_NSIS_MUI_FINISHPAGE_RUN");
+ installerRunCode += "\"\n";
+ this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE",
+ installerRunCode.c_str());
+ }
+
// Setup all of the component sections
if (this->Components.empty())
{
@@ -337,6 +355,7 @@ int cmCPackNSISGenerator::InitializeInternal()
<< std::endl);
std::vector<std::string> path;
std::string nsisPath;
+ bool gotRegValue = true;
#ifdef _WIN32
if ( !cmsys::SystemTools::ReadRegistryValue(
@@ -346,24 +365,37 @@ int cmCPackNSISGenerator::InitializeInternal()
if ( !cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath) )
{
- cmCPackLogger
- (cmCPackLog::LOG_ERROR,
- "Cannot find NSIS registry value. This is usually caused by NSIS "
- "not being installed. Please install NSIS from "
- "http://nsis.sourceforge.net"
- << std::endl);
- return 0;
+ gotRegValue = false;
}
}
- path.push_back(nsisPath);
+
+ if (gotRegValue)
+ {
+ path.push_back(nsisPath);
+ }
#endif
+
nsisPath = cmSystemTools::FindProgram("makensis", path, false);
+
if ( nsisPath.empty() )
{
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find NSIS compiler"
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Cannot find NSIS compiler makensis: likely it is not installed, "
+ "or not in your PATH"
<< std::endl);
+
+ if (!gotRegValue)
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Could not read NSIS registry value. This is usually caused by "
+ "NSIS not being installed. Please install NSIS from "
+ "http://nsis.sourceforge.net"
+ << std::endl);
+ }
+
return 0;
}
+
std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: "
<< nsisCmd.c_str() << std::endl);
@@ -400,10 +432,13 @@ int cmCPackNSISGenerator::InitializeInternal()
return 0;
}
this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str());
+ this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin");
const char* cpackPackageExecutables
= this->GetOption("CPACK_PACKAGE_EXECUTABLES");
const char* cpackPackageDeskTopLinks
= this->GetOption("CPACK_CREATE_DESKTOP_LINKS");
+ const char* cpackNsisExecutablesDirectory
+ = this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY");
std::vector<std::string> cpackPackageDesktopLinksVector;
if(cpackPackageDeskTopLinks)
{
@@ -426,12 +461,14 @@ int cmCPackNSISGenerator::InitializeInternal()
cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: "
<< "not set" << std::endl);
}
+
+ cmOStringStream str;
+ cmOStringStream deleteStr;
+
if ( cpackPackageExecutables )
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: "
<< cpackPackageExecutables << "." << std::endl);
- cmOStringStream str;
- cmOStringStream deleteStr;
std::vector<std::string> cpackPackageExecutablesVector;
cmSystemTools::ExpandListArgument(cpackPackageExecutables,
cpackPackageExecutablesVector);
@@ -451,7 +488,8 @@ int cmCPackNSISGenerator::InitializeInternal()
++ it;
std::string linkName = *it;
str << " CreateShortCut \"$SMPROGRAMS\\$STARTMENU_FOLDER\\"
- << linkName << ".lnk\" \"$INSTDIR\\bin\\" << execName << ".exe\""
+ << linkName << ".lnk\" \"$INSTDIR\\"
+ << cpackNsisExecutablesDirectory << "\\" << execName << ".exe\""
<< std::endl;
deleteStr << " Delete \"$SMPROGRAMS\\$MUI_TEMP\\" << linkName
<< ".lnk\"" << std::endl;
@@ -465,18 +503,21 @@ int cmCPackNSISGenerator::InitializeInternal()
{
str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
str << " CreateShortCut \"$DESKTOP\\"
- << linkName << ".lnk\" \"$INSTDIR\\bin\\" << execName << ".exe\""
+ << linkName << ".lnk\" \"$INSTDIR\\"
+ << cpackNsisExecutablesDirectory << "\\" << execName << ".exe\""
<< std::endl;
deleteStr << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
deleteStr << " Delete \"$DESKTOP\\" << linkName
<< ".lnk\"" << std::endl;
}
}
- this->CreateMenuLinks(str, deleteStr);
- this->SetOptionIfNotSet("CPACK_NSIS_CREATE_ICONS", str.str().c_str());
- this->SetOptionIfNotSet("CPACK_NSIS_DELETE_ICONS",
- deleteStr.str().c_str());
}
+
+ this->CreateMenuLinks(str, deleteStr);
+ this->SetOptionIfNotSet("CPACK_NSIS_CREATE_ICONS", str.str().c_str());
+ this->SetOptionIfNotSet("CPACK_NSIS_DELETE_ICONS",
+ deleteStr.str().c_str());
+
this->SetOptionIfNotSet("CPACK_NSIS_COMPRESSOR", "lzma");
return this->Superclass::InitializeInternal();
@@ -505,22 +546,25 @@ void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str,
"<icon name>." << std::endl);
return;
}
+
+ cmsys::RegularExpression urlRegex;
+ urlRegex.compile("^(mailto:|(ftps?|https?|news)://).*$");
+
std::vector<std::string>::iterator it;
for ( it = cpackMenuLinksVector.begin();
it != cpackMenuLinksVector.end();
++it )
{
std::string sourceName = *it;
- bool url = false;
- if(sourceName.find("http:") == 0)
- {
- url = true;
- }
- /* convert / to \\ */
+ const bool url = urlRegex.find(sourceName);
+
+ // Convert / to \ in filenames, but not in urls:
+ //
if(!url)
{
cmSystemTools::ReplaceString(sourceName, "/", "\\");
}
+
++ it;
std::string linkName = *it;
if(!url)
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 0641418..a5db78f 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -37,13 +37,84 @@ int cmCPackRPMGenerator::InitializeInternal()
//----------------------------------------------------------------------
int cmCPackRPMGenerator::PackageFiles()
{
- this->ReadListFile("CPackRPM.cmake");
+ int retval = 1;
+ /* Digest Component grouping specification */
+ retval = PrepareGroupingKind();
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: "
+ << toplevel << std::endl);
+
+ /* Are we in the component packaging case */
+ if (SupportsComponentInstallation() & (!this->ComponentGroups.empty()))
+ {
+ /* Reset package file name list it will be populated during the
+ * component packaging run*/
+ packageFileNames.clear();
+ std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
+ /* One Package per component CASE */
+ /* Iterate over components */
+ std::map<std::string, cmCPackComponent>::iterator compIt;
+ for (compIt=this->Components.begin();
+ compIt!=this->Components.end(); ++compIt )
+ {
+ std::string localToplevel(initialTopLevel);
+ std::string packageFileName(
+ cmSystemTools::GetParentDirectory(toplevel.c_str())
+ );
+ std::string outputFileName(
+ std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")
+ )
+ +"-"+compIt->first + this->GetOutputExtension());
+
+ localToplevel += "/"+ compIt->first;
+ /* replace the TEMP DIRECTORY with the component one */
+ this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str());
+ packageFileName += "/"+ outputFileName;
+ /* replace proposed CPACK_OUTPUT_FILE_NAME */
+ this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str());
+ /* replace the TEMPORARY package file name */
+ this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME",
+ packageFileName.c_str());
+
+ this->SetOption("CPACK_RPM_PACKAGE_COMPONENT",compIt->first.c_str());
+ if (!this->ReadListFile("CPackRPM.cmake"))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error while execution CPackRPM.cmake" << std::endl);
+ retval = 0;
+ }
+
+ // add the generated package to package file names list
+ packageFileNames.push_back(packageFileName);
+ }
+ }
+ /* This is the non component case */
+ else
+ {
+ if (!this->ReadListFile("CPackRPM.cmake"))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error while execution CPackRPM.cmake" << std::endl);
+ retval = 0;
+ }
+ }
+
if (!this->IsSet("RPMBUILD_EXECUTABLE"))
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find rpmbuild" << std::endl);
- return 0;
+ retval = 0;
}
- return 1;
+ return retval;
}
+bool cmCPackRPMGenerator::SupportsComponentInstallation() const
+ {
+ if (IsOn("CPACK_RPM_COMPONENT_INSTALL"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h
index 570e45f..57d5cca 100644
--- a/Source/CPack/cmCPackRPMGenerator.h
+++ b/Source/CPack/cmCPackRPMGenerator.h
@@ -39,6 +39,7 @@ protected:
virtual int InitializeInternal();
virtual int PackageFiles();
virtual const char* GetOutputExtension() { return ".rpm"; }
+ virtual bool SupportsComponentInstallation() const;
};
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 3c5993d..9678ac4 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -43,6 +43,7 @@ static const char* cmCTestErrorMatches[] = {
"^[Bb]us [Ee]rror",
"^[Ss]egmentation [Vv]iolation",
"^[Ss]egmentation [Ff]ault",
+ ":.*[Pp]ermission [Dd]enied",
"([^ :]+):([0-9]+): ([^ \\t])",
"([^:]+): error[ \\t]*[0-9]+[ \\t]*:",
"^Error ([0-9]+):",
@@ -61,9 +62,9 @@ static const char* cmCTestErrorMatches[] = {
": syntax error ",
"^collect2: ld returned 1 exit status",
"ld terminated with signal",
- "Unsatisfied symbols:",
+ "Unsatisfied symbol",
"^Unresolved:",
- "Undefined symbols:",
+ "Undefined symbol",
"^Undefined[ \\t]+first referenced",
"^CMake Error.*:",
":[ \\t]cannot find",
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index a6f10ec..aa9e55b 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -503,28 +503,15 @@ private:
this->ParsePerson(this->Line.c_str()+7, author);
this->Rev.Author = author.Name;
this->Rev.EMail = author.EMail;
-
- // Convert the time to a human-readable format that is also easy
- // to machine-parse: "CCYY-MM-DD hh:mm:ss".
- time_t seconds = static_cast<time_t>(author.Time);
- struct tm* t = gmtime(&seconds);
- char dt[1024];
- sprintf(dt, "%04d-%02d-%02d %02d:%02d:%02d",
- t->tm_year+1900, t->tm_mon+1, t->tm_mday,
- t->tm_hour, t->tm_min, t->tm_sec);
- this->Rev.Date = dt;
-
- // Add the time-zone field "+zone" or "-zone".
- char tz[32];
- if(author.TimeZone >= 0)
- {
- sprintf(tz, " +%04ld", author.TimeZone);
- }
- else
- {
- sprintf(tz, " -%04ld", -author.TimeZone);
- }
- this->Rev.Date += tz;
+ this->Rev.Date = this->FormatDateTime(author);
+ }
+ else if(strncmp(this->Line.c_str(), "committer ", 10) == 0)
+ {
+ Person committer;
+ this->ParsePerson(this->Line.c_str()+10, committer);
+ this->Rev.Committer = committer.Name;
+ this->Rev.CommitterEMail = committer.EMail;
+ this->Rev.CommitDate = this->FormatDateTime(committer);
}
}
@@ -537,6 +524,32 @@ private:
}
this->Rev.Log += "\n";
}
+
+ std::string FormatDateTime(Person const& person)
+ {
+ // Convert the time to a human-readable format that is also easy
+ // to machine-parse: "CCYY-MM-DD hh:mm:ss".
+ time_t seconds = static_cast<time_t>(person.Time);
+ struct tm* t = gmtime(&seconds);
+ char dt[1024];
+ sprintf(dt, "%04d-%02d-%02d %02d:%02d:%02d",
+ t->tm_year+1900, t->tm_mon+1, t->tm_mday,
+ t->tm_hour, t->tm_min, t->tm_sec);
+ std::string out = dt;
+
+ // Add the time-zone field "+zone" or "-zone".
+ char tz[32];
+ if(person.TimeZone >= 0)
+ {
+ sprintf(tz, " +%04ld", person.TimeZone);
+ }
+ else
+ {
+ sprintf(tz, " -%04ld", -person.TimeZone);
+ }
+ out += tz;
+ return out;
+ }
};
char const cmCTestGIT::CommitParser::SectionSep[SectionCount] =
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 0d14c2d..f3a4457 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -275,12 +275,6 @@ void cmCTestMultiProcessHandler::StartNextTests()
}
numToStart -= processors;
}
- else
- {
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
- << "Test did not start waiting on depends to finish: "
- << *test << "\n");
- }
if(numToStart == 0)
{
return;
@@ -434,7 +428,10 @@ void cmCTestMultiProcessHandler::ReadCostData()
if(index == -1) continue;
this->Properties[index]->PreviousRuns = prev;
- if(this->Properties[index] && this->Properties[index]->Cost == 0)
+ // When not running in parallel mode, don't use cost data
+ if(this->ParallelLevel > 1 &&
+ this->Properties[index] &&
+ this->Properties[index]->Cost == 0)
{
this->Properties[index]->Cost = cost;
}
@@ -475,20 +472,19 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
{
SortedTests.push_back(i->first);
- //If the test failed last time, it should be run first, so max the cost
- if(std::find(this->LastTestsFailed.begin(),
- this->LastTestsFailed.end(),
- this->Properties[i->first]->Name)
- != this->LastTestsFailed.end())
+ //If the test failed last time, it should be run first, so max the cost.
+ //Only do this for parallel runs; in non-parallel runs, avoid clobbering
+ //the test's explicitly set cost.
+ if(this->ParallelLevel > 1 &&
+ std::find(this->LastTestsFailed.begin(), this->LastTestsFailed.end(),
+ this->Properties[i->first]->Name) != this->LastTestsFailed.end())
{
this->Properties[i->first]->Cost = FLT_MAX;
}
}
- if(this->ParallelLevel > 1)
- {
- TestComparator comp(this);
- std::sort(SortedTests.begin(), SortedTests.end(), comp);
- }
+
+ TestComparator comp(this);
+ std::sort(SortedTests.begin(), SortedTests.end(), comp);
}
//---------------------------------------------------------
@@ -659,32 +655,37 @@ bool cmCTestMultiProcessHandler::CheckCycles()
it != this->Tests.end(); ++it)
{
//DFS from each element to itself
+ int root = it->first;
+ std::set<int> visited;
std::stack<int> s;
- std::vector<int> visited;
-
- s.push(it->first);
-
+ s.push(root);
while(!s.empty())
{
int test = s.top();
s.pop();
-
- for(TestSet::iterator d = this->Tests[test].begin();
- d != this->Tests[test].end(); ++d)
+ if(visited.insert(test).second)
{
- if(std::find(visited.begin(), visited.end(), *d) != visited.end())
+ for(TestSet::iterator d = this->Tests[test].begin();
+ d != this->Tests[test].end(); ++d)
{
- //cycle exists
- cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in "
- "the test dependency graph for the test \""
- << this->Properties[it->first]->Name << "\"." << std::endl
- << "Please fix the cycle and run ctest again." << std::endl);
- return false;
+ if(*d == root)
+ {
+ //cycle exists
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Error: a cycle exists in the test dependency graph "
+ "for the test \"" << this->Properties[root]->Name <<
+ "\".\nPlease fix the cycle and run ctest again.\n");
+ return false;
+ }
+ else
+ {
+ s.push(*d);
+ }
}
- s.push(*d);
}
- visited.push_back(test);
}
}
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Checking test dependency graph end" << std::endl);
return true;
}
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 76ff23a..42a4cff 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -455,7 +455,8 @@ bool cmCTestRunTest::StartTest(size_t total)
{
return false;
}
- return this->ForkProcess(timeout, &this->TestProperties->Environment);
+ return this->ForkProcess(timeout, this->TestProperties->ExplicitTimeout,
+ &this->TestProperties->Environment);
}
//----------------------------------------------------------------------
@@ -598,7 +599,7 @@ double cmCTestRunTest::ResolveTimeout()
}
//----------------------------------------------------------------------
-bool cmCTestRunTest::ForkProcess(double testTimeOut,
+bool cmCTestRunTest::ForkProcess(double testTimeOut, bool explicitTimeout,
std::vector<std::string>* environment)
{
this->TestProcess = new cmProcess;
@@ -619,12 +620,16 @@ bool cmCTestRunTest::ForkProcess(double testTimeOut,
{
timeout = testTimeOut;
}
-
// always have at least 1 second if we got to here
if (timeout <= 0)
{
timeout = 1;
}
+ // handle timeout explicitly set to 0
+ if (testTimeOut == 0 && explicitTimeout)
+ {
+ timeout = 0;
+ }
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index << ": "
<< "Test timeout computed to be: " << timeout << "\n");
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 66e6b7b..89456d5 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -63,8 +63,8 @@ private:
void ExeNotFound(std::string exe);
// Figures out a final timeout which is min(STOP_TIME, NOW+TIMEOUT)
double ResolveTimeout();
- bool ForkProcess(double testTimeOut,
- std::vector<std::string>* environment);
+ bool ForkProcess(double testTimeOut, bool explicitTimeout,
+ std::vector<std::string>* environment);
void WriteLogOutputTop(size_t completed, size_t total);
//Run post processing of the process output for MemCheck
void MemCheckPostProcess();
diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h
index 411eb01..468cd85 100644
--- a/Source/CTest/cmCTestSleepCommand.h
+++ b/Source/CTest/cmCTestSleepCommand.h
@@ -63,11 +63,10 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " ctest_sleep( seconds )\n"
- " ctest_sleep( time1 duration time2 )\n"
- "With one argument it will sleep for a given number of seconds. "
- "With three arguments it will wait for time2 - time1 - duration "
- "seconds.";
+ " ctest_sleep(<seconds>)\n"
+ "Sleep for given number of seconds.\n"
+ " ctest_sleep(<time1> <duration> <time2>)\n"
+ "Sleep for t=(time1 + duration - time2) seconds if t > 0.";
}
cmTypeMacro(cmCTestSleepCommand, cmCTestCommand);
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 6dd348d..87c75eb 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -26,6 +26,7 @@
#include "cmCommand.h"
#include "cmSystemTools.h"
#include "cmXMLSafe.h"
+#include "cm_utf8.h"
#include <stdlib.h>
#include <math.h>
@@ -438,6 +439,8 @@ void cmCTestTestHandler::Initialize()
this->TestsToRun.clear();
+ this->UseIncludeLabelRegExpFlag = false;
+ this->UseExcludeLabelRegExpFlag = false;
this->UseIncludeRegExpFlag = false;
this->UseExcludeRegExpFlag = false;
this->UseExcludeRegExpFirst = false;
@@ -1978,65 +1981,45 @@ void cmCTestTestHandler::SetTestsToRunInformation(const char* in)
}
}
-//----------------------------------------------------------------------
-bool cmCTestTestHandler::CleanTestOutput(std::string& output,
- size_t remove_threshold)
+//----------------------------------------------------------------------------
+bool cmCTestTestHandler::CleanTestOutput(std::string& output, size_t length)
{
- if ( remove_threshold == 0 )
+ if(!length || length >= output.size() ||
+ output.find("CTEST_FULL_OUTPUT") != output.npos)
{
return true;
}
- if ( output.find("CTEST_FULL_OUTPUT") != output.npos )
+
+ // Truncate at given length but do not break in the middle of a multi-byte
+ // UTF-8 encoding.
+ char const* const begin = output.c_str();
+ char const* const end = begin + output.size();
+ char const* const truncate = begin + length;
+ char const* current = begin;
+ while(current < truncate)
{
- return true;
- }
- cmOStringStream ostr;
- std::string::size_type cc;
- std::string::size_type skipsize = 0;
- int inTag = 0;
- int skipped = 0;
- for ( cc = 0; cc < output.size(); cc ++ )
- {
- int ch = output[cc];
- if ( ch < 0 || ch > 255 )
- {
- break;
- }
- if ( ch == '<' )
- {
- inTag = 1;
- }
- if ( !inTag )
+ unsigned int ch;
+ if(const char* next = cm_utf8_decode_character(current, end, &ch))
{
- int notskip = 0;
- // Skip
- if ( skipsize < remove_threshold )
+ if(next > truncate)
{
- ostr << static_cast<char>(ch);
- notskip = 1;
- }
- skipsize ++;
- if ( notskip && skipsize >= remove_threshold )
- {
- skipped = 1;
+ break;
}
+ current = next;
}
- else
- {
- ostr << static_cast<char>(ch);
- }
- if ( ch == '>' )
+ else // Bad byte will be handled by cmXMLSafe.
{
- inTag = 0;
+ ++current;
}
}
- if ( skipped )
- {
- ostr << "..." << std::endl << "The rest of the test output was removed "
- "since it exceeds the threshold of "
- << remove_threshold << " characters." << std::endl;
- }
- output = ostr.str();
+ output = output.substr(0, current - begin);
+
+ // Append truncation message.
+ cmOStringStream msg;
+ msg << "...\n"
+ "The rest of the test output was removed since it exceeds the threshold "
+ "of " << length << " bytes.\n";
+ output += msg.str();
return true;
}
@@ -2120,6 +2103,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "TIMEOUT" )
{
rtit->Timeout = atof(val.c_str());
+ rtit->ExplicitTimeout = true;
}
if ( key == "COST" )
{
@@ -2190,7 +2174,6 @@ bool cmCTestTestHandler::SetTestsProperties(
{
rtit->Labels.push_back(*crit);
}
-
}
if ( key == "MEASUREMENT" )
{
@@ -2219,6 +2202,10 @@ bool cmCTestTestHandler::SetTestsProperties(
std::string(crit->c_str())));
}
}
+ if ( key == "WORKING_DIRECTORY" )
+ {
+ rtit->Directory = val;
+ }
}
}
}
@@ -2290,6 +2277,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
test.WillFail = false;
test.RunSerial = false;
test.Timeout = 0;
+ test.ExplicitTimeout = false;
test.Cost = 0;
test.Processors = 1;
test.PreviousRuns = 0;
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 7049564..7aa8522 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -99,6 +99,7 @@ public:
int PreviousRuns;
bool RunSerial;
double Timeout;
+ bool ExplicitTimeout;
int Index;
//Requested number of process slots
int Processors;
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index f9ad79a..fbee227 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -228,6 +228,11 @@ void cmCTestVC::WriteXMLEntry(std::ostream& xml,
<< "\t\t\t<CheckinDate>" << cmXMLSafe(rev.Date) << "</CheckinDate>\n"
<< "\t\t\t<Author>" << cmXMLSafe(rev.Author) << "</Author>\n"
<< "\t\t\t<Email>" << cmXMLSafe(rev.EMail) << "</Email>\n"
+ << "\t\t\t<Committer>" << cmXMLSafe(rev.Committer) << "</Committer>\n"
+ << "\t\t\t<CommitterEmail>" << cmXMLSafe(rev.CommitterEMail)
+ << "</CommitterEmail>\n"
+ << "\t\t\t<CommitDate>" << cmXMLSafe(rev.CommitDate)
+ << "</CommitDate>\n"
<< "\t\t\t<Log>" << cmXMLSafe(rev.Log) << "</Log>\n"
<< "\t\t\t<Revision>" << cmXMLSafe(rev.Rev) << "</Revision>\n"
<< "\t\t\t<PriorRevision>" << cmXMLSafe(prior) << "</PriorRevision>\n"
diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h
index d36bc8f..44e1dac 100644
--- a/Source/CTest/cmCTestVC.h
+++ b/Source/CTest/cmCTestVC.h
@@ -74,6 +74,9 @@ protected:
std::string Date;
std::string Author;
std::string EMail;
+ std::string Committer;
+ std::string CommitterEMail;
+ std::string CommitDate;
std::string Log;
};
diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c
index 0b53b5a..03896c2 100644
--- a/Source/CursesDialog/form/frm_driver.c
+++ b/Source/CursesDialog/form/frm_driver.c
@@ -357,8 +357,12 @@ static void Buffer_To_Window(const FIELD * field, WINDOW * win)
assert(win && field);
+#if defined(__LSB_VERSION__)
+ getmaxyx(win, height, width);
+#else
width = getmaxx(win);
height = getmaxy(win);
+#endif
for(row=0, pBuffer=field->buf;
row < height;
@@ -396,7 +400,11 @@ static void Window_To_Buffer(WINDOW * win, FIELD * field)
pad = field->pad;
p = field->buf;
+#if defined(__LSB_VERSION__)
+ { int width; getmaxyx(win, height, width); }
+#else
height = getmaxy(win);
+#endif
for(row=0; (row < height) && (row < field->drows); row++ )
{
@@ -871,7 +879,17 @@ static int Display_Or_Erase_Field(FIELD * field, bool bEraseFlag)
if (field->opts & O_VISIBLE)
Set_Field_Window_Attributes(field,win);
else
+ {
+#if defined(__LSB_VERSION__)
+ /* getattrs() would be handy, but it is not part of LSB 4.0 */
+ attr_t fwinAttrs;
+ short fwinPair;
+ wattr_get(fwin, &fwinAttrs, &fwinPair, 0);
+ wattr_set(win, fwinAttrs, fwinPair, 0);
+#else
wattrset(win,getattrs(fwin));
+#endif
+ }
werase(win);
}
diff --git a/Source/CursesDialog/form/frm_post.c b/Source/CursesDialog/form/frm_post.c
index 5ead942..3c63de7 100644
--- a/Source/CursesDialog/form/frm_post.c
+++ b/Source/CursesDialog/form/frm_post.c
@@ -51,6 +51,7 @@ int post_form(FORM * form)
WINDOW *formwin;
int err;
int page;
+ int height, width;
if (!form)
RETURN(E_BAD_ARGUMENT);
@@ -62,7 +63,13 @@ int post_form(FORM * form)
RETURN(E_NOT_CONNECTED);
formwin = Get_Form_Window(form);
- if ((form->cols > getmaxx(formwin)) || (form->rows > getmaxy(formwin)))
+#if defined(__LSB_VERSION__)
+ getmaxyx(formwin, height, width);
+#else
+ width = getmaxx(formwin);
+ height = getmaxy(formwin);
+#endif
+ if ((form->cols > width) || (form->rows > height))
RETURN(E_NO_ROOM);
/* reset form->curpage to an invald value. This forces Set_Form_Page
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 29fcfc0..408dbac 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -55,7 +55,7 @@ void QCMakeThread::run()
}
CMakeSetupDialog::CMakeSetupDialog()
- : ExitAfterGenerate(true), CacheModified(false), CurrentState(Interrupting)
+ : ExitAfterGenerate(true), CacheModified(false), ConfigureNeeded(true), CurrentState(Interrupting)
{
QString title = QString(tr("CMake %1"));
title = title.arg(cmVersion::GetCMakeVersion());
@@ -167,6 +167,9 @@ CMakeSetupDialog::CMakeSetupDialog()
this->CMakeThread->start();
this->enterState(ReadyConfigure);
+
+ ProgressOffset = 0.0;
+ ProgressFactor = 1.0;
}
void CMakeSetupDialog::initialize()
@@ -179,12 +182,11 @@ void CMakeSetupDialog::initialize()
QObject::connect(this->ConfigureButton, SIGNAL(clicked(bool)),
this, SLOT(doConfigure()));
- QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(configureDone(int)),
- this, SLOT(finishConfigure(int)));
- QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(generateDone(int)),
- this, SLOT(finishGenerate(int)));
+
+ QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(configureDone(int)),
+ this, SLOT(exitLoop(int)));
+ QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(generateDone(int)),
+ this, SLOT(exitLoop(int)));
QObject::connect(this->GenerateButton, SIGNAL(clicked(bool)),
this, SLOT(doGenerate()));
@@ -270,15 +272,8 @@ CMakeSetupDialog::~CMakeSetupDialog()
this->CMakeThread->wait(2000);
}
-void CMakeSetupDialog::doConfigure()
+bool CMakeSetupDialog::prepareConfigure()
{
- if(this->CurrentState == Configuring)
- {
- // stop configure
- doInterrupt();
- return;
- }
-
// make sure build directory exists
QString bindir = this->CMakeThread->cmakeInstance()->binaryDirectory();
QDir dir(bindir);
@@ -295,7 +290,7 @@ void CMakeSetupDialog::doConfigure()
QMessageBox::Yes | QMessageBox::No);
if(btn == QMessageBox::No)
{
- return;
+ return false;
}
if(!dir.mkpath("."))
{
@@ -303,7 +298,7 @@ void CMakeSetupDialog::doConfigure()
QString(tr("Failed to create directory %1")).arg(dir.path()),
QMessageBox::Ok);
- return;
+ return false;
}
}
@@ -312,27 +307,45 @@ void CMakeSetupDialog::doConfigure()
{
if(!this->setupFirstConfigure())
{
- return;
+ return false;
}
}
// remember path
this->addBinaryPath(dir.absolutePath());
- this->enterState(Configuring);
+ return true;
+}
- this->CacheValues->selectionModel()->clear();
- QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
- "setProperties", Qt::QueuedConnection,
- Q_ARG(QCMakePropertyList,
- this->CacheValues->cacheModel()->properties()));
- QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
- "configure", Qt::QueuedConnection);
+void CMakeSetupDialog::exitLoop(int err)
+{
+ this->LocalLoop.exit(err);
}
-void CMakeSetupDialog::finishConfigure(int err)
+void CMakeSetupDialog::doConfigure()
{
- if(0 == err && !this->CacheValues->cacheModel()->newPropertyCount())
+ if(this->CurrentState == Configuring)
+ {
+ // stop configure
+ doInterrupt();
+ return;
+ }
+
+ if(!prepareConfigure())
+ {
+ return;
+ }
+
+ this->enterState(Configuring);
+
+ bool ret = doConfigureInternal();
+
+ if(ret)
+ {
+ this->ConfigureNeeded = false;
+ }
+
+ if(ret && !this->CacheValues->cacheModel()->newPropertyCount())
{
this->enterState(ReadyGenerate);
}
@@ -341,6 +354,22 @@ void CMakeSetupDialog::finishConfigure(int err)
this->enterState(ReadyConfigure);
this->CacheValues->scrollToTop();
}
+ this->ProgressBar->reset();
+}
+
+bool CMakeSetupDialog::doConfigureInternal()
+{
+ this->Output->clear();
+ this->CacheValues->selectionModel()->clear();
+
+ QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
+ "setProperties", Qt::QueuedConnection,
+ Q_ARG(QCMakePropertyList,
+ this->CacheValues->cacheModel()->properties()));
+ QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
+ "configure", Qt::QueuedConnection);
+
+ int err = this->LocalLoop.exec();
if(err != 0)
{
@@ -348,23 +377,31 @@ void CMakeSetupDialog::finishConfigure(int err)
tr("Error in configuration process, project files may be invalid"),
QMessageBox::Ok);
}
+
+ return 0 == err;
}
-void CMakeSetupDialog::finishGenerate(int err)
+void CMakeSetupDialog::doInstallForCommandLine()
{
- this->enterState(ReadyConfigure);
+ QMacInstallDialog setupdialog(0);
+ setupdialog.exec();
+}
+
+bool CMakeSetupDialog::doGenerateInternal()
+{
+ QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
+ "generate", Qt::QueuedConnection);
+
+ int err = this->LocalLoop.exec();
+
if(err != 0)
{
QMessageBox::critical(this, tr("Error"),
tr("Error in generation process, project files may be invalid"),
QMessageBox::Ok);
}
-}
-void CMakeSetupDialog::doInstallForCommandLine()
-{
- QMacInstallDialog setupdialog(0);
- setupdialog.exec();
+ return 0 == err;
}
void CMakeSetupDialog::doGenerate()
@@ -375,9 +412,43 @@ void CMakeSetupDialog::doGenerate()
doInterrupt();
return;
}
+
+ // see if we need to configure
+ // we'll need to configure if:
+ // the configure step hasn't been done yet
+ // generate was the last step done
+ if(this->ConfigureNeeded)
+ {
+ if(!prepareConfigure())
+ {
+ return;
+ }
+ }
+
this->enterState(Generating);
- QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
- "generate", Qt::QueuedConnection);
+
+ bool config_passed = true;
+ if(this->ConfigureNeeded)
+ {
+ this->CacheValues->cacheModel()->setShowNewProperties(false);
+ this->ProgressFactor = 0.5;
+ config_passed = doConfigureInternal();
+ this->ProgressOffset = 0.5;
+ }
+
+ if(config_passed)
+ {
+ doGenerateInternal();
+ }
+
+ this->ProgressOffset = 0.0;
+ this->ProgressFactor = 1.0;
+ this->CacheValues->cacheModel()->setShowNewProperties(true);
+
+ this->enterState(ReadyConfigure);
+ this->ProgressBar->reset();
+
+ this->ConfigureNeeded = true;
}
void CMakeSetupDialog::closeEvent(QCloseEvent* e)
@@ -542,6 +613,7 @@ void CMakeSetupDialog::setSourceDirectory(const QString& dir)
void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
{
+ percent = (percent * ProgressFactor) + ProgressOffset;
this->ProgressBar->setValue(qRound(percent * 100));
}
@@ -883,7 +955,6 @@ void CMakeSetupDialog::enterState(CMakeSetupDialog::State s)
}
else if(s == Configuring)
{
- this->Output->clear();
this->setEnabledState(false);
this->GenerateButton->setEnabled(false);
this->GenerateAction->setEnabled(false);
@@ -899,17 +970,15 @@ void CMakeSetupDialog::enterState(CMakeSetupDialog::State s)
}
else if(s == ReadyConfigure)
{
- this->ProgressBar->reset();
this->setEnabledState(true);
- this->GenerateButton->setEnabled(false);
- this->GenerateAction->setEnabled(false);
+ this->GenerateButton->setEnabled(true);
+ this->GenerateAction->setEnabled(true);
this->ConfigureButton->setEnabled(true);
this->ConfigureButton->setText(tr("&Configure"));
this->GenerateButton->setText(tr("&Generate"));
}
else if(s == ReadyGenerate)
{
- this->ProgressBar->reset();
this->setEnabledState(true);
this->GenerateButton->setEnabled(true);
this->GenerateAction->setEnabled(true);
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 0e3caec..1934795 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -16,6 +16,7 @@
#include "QCMake.h"
#include <QMainWindow>
#include <QThread>
+#include <QEventLoop>
#include "ui_CMakeSetupDialog.h"
class QCMakeThread;
@@ -43,8 +44,6 @@ protected slots:
void doHelp();
void doAbout();
void doInterrupt();
- void finishConfigure(int error);
- void finishGenerate(int error);
void error(const QString& message);
void message(const QString& message);
@@ -74,6 +73,10 @@ protected slots:
void setGroupedView(bool);
void showUserChanges();
void setSearchFilter(const QString& str);
+ bool prepareConfigure();
+ bool doConfigureInternal();
+ bool doGenerateInternal();
+ void exitLoop(int);
protected:
@@ -87,6 +90,7 @@ protected:
QCMakeThread* CMakeThread;
bool ExitAfterGenerate;
bool CacheModified;
+ bool ConfigureNeeded;
QAction* ReloadCacheAction;
QAction* DeleteCacheAction;
QAction* ExitAction;
@@ -99,6 +103,10 @@ protected:
QTextCharFormat ErrorFormat;
QTextCharFormat MessageFormat;
+ QEventLoop LocalLoop;
+
+ float ProgressOffset;
+ float ProgressFactor;
};
// QCMake instance on a thread
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index d90307a..562396d 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -200,6 +200,7 @@ QCMakeCacheModel::QCMakeCacheModel(QObject* p)
NewPropertyCount(0),
View(FlatView)
{
+ this->ShowNewProperties = true;
QStringList labels;
labels << tr("Name") << tr("Value");
this->setHorizontalHeaderLabels(labels);
@@ -214,6 +215,11 @@ static uint qHash(const QCMakeProperty& p)
return qHash(p.Key);
}
+void QCMakeCacheModel::setShowNewProperties(bool f)
+{
+ this->ShowNewProperties = f;
+}
+
void QCMakeCacheModel::clear()
{
this->QStandardItemModel::clear();
@@ -226,13 +232,21 @@ void QCMakeCacheModel::clear()
void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
{
- QSet<QCMakeProperty> newProps = props.toSet();
- QSet<QCMakeProperty> newProps2 = newProps;
- QSet<QCMakeProperty> oldProps = this->properties().toSet();
-
- oldProps.intersect(newProps);
- newProps.subtract(oldProps);
- newProps2.subtract(newProps);
+ QSet<QCMakeProperty> newProps, newProps2;
+
+ if(this->ShowNewProperties)
+ {
+ newProps = props.toSet();
+ newProps2 = newProps;
+ QSet<QCMakeProperty> oldProps = this->properties().toSet();
+ oldProps.intersect(newProps);
+ newProps.subtract(oldProps);
+ newProps2.subtract(newProps);
+ }
+ else
+ {
+ newProps2 = props.toSet();
+ }
bool b = this->blockSignals(true);
diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h
index 401e07e..58bbd2d 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -78,6 +78,9 @@ public slots:
// become new properties and be marked red.
void setProperties(const QCMakePropertyList& props);
+ // set whether to show new properties in red
+ void setShowNewProperties(bool);
+
// clear everything from the model
void clear();
@@ -115,6 +118,7 @@ public:
protected:
bool EditEnabled;
int NewPropertyCount;
+ bool ShowNewProperties;
ViewType View;
// set the data in the model for this property
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index f6b3234..7af6ec8 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -161,6 +161,7 @@ bool cmAddCustomCommandCommand
filename += "/";
}
filename += copy;
+ cmSystemTools::ConvertToUnixSlashes(filename);
break;
case doing_source:
// We do not want to convert the argument to SOURCE because
diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h
index 6c5e1af..490e043 100644
--- a/Source/cmAddCustomCommandCommand.h
+++ b/Source/cmAddCustomCommandCommand.h
@@ -13,6 +13,7 @@
#define cmAddCustomCommandCommand_h
#include "cmCommand.h"
+#include "cmDocumentGeneratorExpressions.h"
/** \class cmAddCustomCommandCommand
* \brief
@@ -146,8 +147,15 @@ public:
"target-level dependency will be added so that the executable target "
"will be built before any target using this custom command. However "
"this does NOT add a file-level dependency that would cause the "
- "custom command to re-run whenever the executable is recompiled.\n"
-
+ "custom command to re-run whenever the executable is recompiled."
+ "\n"
+ "Arguments to COMMAND may use \"generator expressions\" with the "
+ "syntax \"$<...>\". "
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
+ "References to target names in generator expressions imply "
+ "target-level dependencies, but NOT file-level dependencies. "
+ "List target names with the DEPENDS option to add file dependencies."
+ "\n"
"The DEPENDS option specifies files on which the command depends. "
"If any dependency is an OUTPUT of another custom command in the "
"same directory (CMakeLists.txt file) CMake automatically brings the "
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index 1205f07..a77140d 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -24,11 +24,7 @@ bool cmAddDependenciesCommand
}
std::string target_name = args[0];
-
- cmTarget* target =
- this->GetMakefile()->GetLocalGenerator()->
- GetGlobalGenerator()->FindTarget(0, target_name.c_str());
- if(target)
+ if(cmTarget* target = this->Makefile->FindTargetToUse(target_name.c_str()))
{
std::vector<std::string>::const_iterator s = args.begin();
++s; // skip over target_name
diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h
index 6a981c3..fee011c 100644
--- a/Source/cmAddDependenciesCommand.h
+++ b/Source/cmAddDependenciesCommand.h
@@ -62,6 +62,8 @@ public:
"top-level target is one created by ADD_EXECUTABLE, ADD_LIBRARY, "
"or ADD_CUSTOM_TARGET. Adding dependencies with this command "
"can be used to make sure one target is built before another target. "
+ "Dependencies added to an IMPORTED target are followed transitively "
+ "in its place since the target itself does not build. "
"See the DEPENDS option of ADD_CUSTOM_TARGET "
"and ADD_CUSTOM_COMMAND for adding file-level dependencies in custom "
"rules. See the OBJECT_DEPENDS option in "
diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 923206d..11ca9e7 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -74,6 +74,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
{
std::string name;
std::vector<std::string> configurations;
+ std::string working_directory;
std::vector<std::string> command;
// Read the arguments.
@@ -81,6 +82,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
DoingName,
DoingCommand,
DoingConfigs,
+ DoingWorkingDirectory,
DoingNone
};
Doing doing = DoingName;
@@ -104,6 +106,15 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
}
doing = DoingConfigs;
}
+ else if(args[i] == "WORKING_DIRECTORY")
+ {
+ if(!working_directory.empty())
+ {
+ this->SetError(" may be given at most one WORKING_DIRECTORY.");
+ return false;
+ }
+ doing = DoingWorkingDirectory;
+ }
else if(doing == DoingName)
{
name = args[i];
@@ -117,6 +128,11 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
{
configurations.push_back(args[i]);
}
+ else if(doing == DoingWorkingDirectory)
+ {
+ working_directory = args[i];
+ doing = DoingNone;
+ }
else
{
cmOStringStream e;
@@ -154,6 +170,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
cmTest* test = this->Makefile->CreateTest(name.c_str());
test->SetOldStyle(false);
test->SetCommand(command);
+ test->SetProperty("WORKING_DIRECTORY", working_directory.c_str());
this->Makefile->AddTestGenerator(new cmTestGenerator(test, configurations));
return true;
diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h
index 79fb481..edaf12c 100644
--- a/Source/cmAddTestCommand.h
+++ b/Source/cmAddTestCommand.h
@@ -13,6 +13,7 @@
#define cmAddTestCommand_h
#include "cmCommand.h"
+#include "cmDocumentGeneratorExpressions.h"
/** \class cmAddTestCommand
* \brief Add a test to the lists of tests to run.
@@ -68,28 +69,19 @@ public:
"in the binary tree.\n"
"\n"
" add_test(NAME <name> [CONFIGURATIONS [Debug|Release|...]]\n"
+ " [WORKING_DIRECTORY dir]\n"
" COMMAND <command> [arg1 [arg2 ...]])\n"
"If COMMAND specifies an executable target (created by "
"add_executable) it will automatically be replaced by the location "
"of the executable created at build time. "
"If a CONFIGURATIONS option is given then the test will be executed "
- "only when testing under one of the named configurations."
+ "only when testing under one of the named configurations. "
+ "If a WORKING_DIRECTORY option is given then the test will be executed "
+ "in the given directory."
"\n"
"Arguments after COMMAND may use \"generator expressions\" with the "
"syntax \"$<...>\". "
- "These expressions are evaluted during build system generation and "
- "produce information specific to each generated build configuration. "
- "Valid expressions are:\n"
- " $<CONFIGURATION> = configuration name\n"
- " $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n"
- " $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n"
- " $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n"
- "where \"tgt\" is the name of a target. "
- "Target file expressions produce a full path, but _DIR and _NAME "
- "versions can produce the directory and file name components:\n"
- " $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>\n"
- " $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>\n"
- " $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>\n"
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
"Example usage:\n"
" add_test(NAME mytest\n"
" COMMAND testDriver --config $<CONFIGURATION>\n"
diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx
index db01688..554f452 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -32,6 +32,7 @@
#include "cmCreateTestSourceList.cxx"
#include "cmDefinePropertyCommand.cxx"
#include "cmElseCommand.cxx"
+#include "cmEnableLanguageCommand.cxx"
#include "cmEnableTestingCommand.cxx"
#include "cmEndForEachCommand.cxx"
#include "cmEndFunctionCommand.cxx"
@@ -109,6 +110,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
commands.push_back(new cmCreateTestSourceList);
commands.push_back(new cmDefinePropertyCommand);
commands.push_back(new cmElseCommand);
+ commands.push_back(new cmEnableLanguageCommand);
commands.push_back(new cmEnableTestingCommand);
commands.push_back(new cmEndForEachCommand);
commands.push_back(new cmEndFunctionCommand);
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 2aa6236..c8374db 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -93,14 +93,14 @@ bool cmCacheManager::LoadCache(const char* path,
return this->LoadCache(path, internal, emptySet, emptySet);
}
-bool cmCacheManager::ParseEntry(const char* entry,
- std::string& var,
- std::string& value)
+static bool ParseEntryWithoutType(const char* entry,
+ std::string& var,
+ std::string& value)
{
- // input line is: key:type=value
+ // input line is: key=value
static cmsys::RegularExpression reg(
- "^([^:]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
- // input line is: "key":type=value
+ "^([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
+ // input line is: "key"=value
static cmsys::RegularExpression regQuoted(
"^\"([^\"]*)\"=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
bool flag = false;
@@ -169,6 +169,11 @@ bool cmCacheManager::ParseEntry(const char* entry,
value.size() - 2);
}
+ if (!flag)
+ {
+ return ParseEntryWithoutType(entry, var, value);
+ }
+
return flag;
}
@@ -336,7 +341,7 @@ bool cmCacheManager::LoadCache(const char* path,
std::string("The current CMakeCache.txt directory ") +
currentcwd + std::string(" is different than the directory ") +
std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) +
- std::string(" where CMackeCache.txt was created. This may result "
+ std::string(" where CMakeCache.txt was created. This may result "
"in binaries being created in the wrong place. If you "
"are not sure, reedit the CMakeCache.txt");
cmSystemTools::Error(message.c_str());
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index da14966..314017b 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -139,10 +139,6 @@ public:
std::string& value,
CacheEntryType& type);
- static bool ParseEntry(const char* entry,
- std::string& var,
- std::string& value);
-
///! Get a value from the cache given a key
const char* GetCacheValue(const char* key) const;
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 1950871..bb1e4e2 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -14,7 +14,6 @@
#include "cmAuxSourceDirectoryCommand.cxx"
#include "cmBuildNameCommand.cxx"
#include "cmElseIfCommand.cxx"
-#include "cmEnableLanguageCommand.cxx"
#include "cmEndWhileCommand.cxx"
#include "cmExportCommand.cxx"
#include "cmExportLibraryDependencies.cxx"
@@ -54,7 +53,6 @@ void GetPredefinedCommands(std::list<cmCommand*>&
commands.push_back(new cmAuxSourceDirectoryCommand);
commands.push_back(new cmBuildNameCommand);
commands.push_back(new cmElseIfCommand);
- commands.push_back(new cmEnableLanguageCommand);
commands.push_back(new cmEndWhileCommand);
commands.push_back(new cmExportCommand);
commands.push_back(new cmExportLibraryDependenciesCommand);
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 1cabed2..d53200c 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -923,7 +923,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
//----------------------------------------------------------------------------
void cmComputeLinkInformation::AddLinkPrefix(const char* p)
{
- if(p)
+ if(p && *p)
{
this->LinkPrefixes.insert(p);
}
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 313c680..a4ca363 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -144,7 +144,7 @@ bool cmComputeTargetDepends::Compute()
//----------------------------------------------------------------------------
void
cmComputeTargetDepends::GetTargetDirectDepends(cmTarget* t,
- std::set<cmTarget*>& deps)
+ cmTargetDependSet& deps)
{
// Lookup the index for this target. All targets should be known by
// this point.
@@ -156,7 +156,9 @@ cmComputeTargetDepends::GetTargetDirectDepends(cmTarget* t,
EdgeList const& nl = this->FinalGraph[i];
for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
{
- deps.insert(this->Targets[*ni]);
+ cmTarget* dep = this->Targets[*ni];
+ cmTargetDependSet::iterator di = deps.insert(dep).first;
+ di->SetType(ni->IsStrong());
}
}
@@ -244,13 +246,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
// Check the target's makefile first.
cmTarget* dependee =
- depender->GetMakefile()->FindTarget(dependee_name);
-
- // Then search globally.
- if(!dependee)
- {
- dependee = this->GlobalGenerator->FindTarget(0, dependee_name);
- }
+ depender->GetMakefile()->FindTargetToUse(dependee_name);
// Skip targets that will not really be linked. This is probably a
// name conflict between an external library and an executable
@@ -262,25 +258,42 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
dependee = 0;
}
- // If not found then skip then the dependee.
- if(!dependee)
+ if(dependee)
{
- return;
+ this->AddTargetDepend(depender_index, dependee, linking);
}
+}
- // No imported targets should have been found.
- assert(!dependee->IsImported());
-
- // Lookup the index for this target. All targets should be known by
- // this point.
- std::map<cmTarget*, int>::const_iterator tii =
- this->TargetIndex.find(dependee);
- assert(tii != this->TargetIndex.end());
- int dependee_index = tii->second;
-
- // Add this entry to the dependency graph.
- this->InitialGraph[depender_index].push_back(
- cmGraphEdge(dependee_index, !linking));
+//----------------------------------------------------------------------------
+void cmComputeTargetDepends::AddTargetDepend(int depender_index,
+ cmTarget* dependee,
+ bool linking)
+{
+ if(dependee->IsImported())
+ {
+ // Skip imported targets but follow their utility dependencies.
+ std::set<cmStdString> const& utils = dependee->GetUtilities();
+ for(std::set<cmStdString>::const_iterator i = utils.begin();
+ i != utils.end(); ++i)
+ {
+ cmTarget* transitive_dependee =
+ dependee->GetMakefile()->FindTargetToUse(i->c_str());
+ this->AddTargetDepend(depender_index, transitive_dependee, false);
+ }
+ }
+ else
+ {
+ // Lookup the index for this target. All targets should be known by
+ // this point.
+ std::map<cmTarget*, int>::const_iterator tii =
+ this->TargetIndex.find(dependee);
+ assert(tii != this->TargetIndex.end());
+ int dependee_index = tii->second;
+
+ // Add this entry to the dependency graph.
+ this->InitialGraph[depender_index].push_back(
+ cmGraphEdge(dependee_index, !linking));
+ }
}
//----------------------------------------------------------------------------
@@ -445,7 +458,7 @@ cmComputeTargetDepends
int j = *ei;
if(cmap[j] == c && ei->IsStrong())
{
- this->FinalGraph[i].push_back(j);
+ this->FinalGraph[i].push_back(cmGraphEdge(j, true));
if(!this->IntraComponent(cmap, c, j, head, emitted, visited))
{
return false;
@@ -456,7 +469,7 @@ cmComputeTargetDepends
// Prepend to a linear linked-list of intra-component edges.
if(*head >= 0)
{
- this->FinalGraph[i].push_back(*head);
+ this->FinalGraph[i].push_back(cmGraphEdge(*head, false));
}
else
{
@@ -515,7 +528,7 @@ cmComputeTargetDepends
int dependee_component = *ni;
int dependee_component_head = this->ComponentHead[dependee_component];
this->FinalGraph[depender_component_tail]
- .push_back(dependee_component_head);
+ .push_back(cmGraphEdge(dependee_component_head, ni->IsStrong()));
}
}
return true;
diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h
index 240de76..67bce72 100644
--- a/Source/cmComputeTargetDepends.h
+++ b/Source/cmComputeTargetDepends.h
@@ -21,6 +21,7 @@
class cmComputeComponentGraph;
class cmGlobalGenerator;
class cmTarget;
+class cmTargetDependSet;
/** \class cmComputeTargetDepends
* \brief Compute global interdependencies among targets.
@@ -38,13 +39,14 @@ public:
bool Compute();
std::vector<cmTarget*> const& GetTargets() const { return this->Targets; }
- void GetTargetDirectDepends(cmTarget* t, std::set<cmTarget*>& deps);
+ void GetTargetDirectDepends(cmTarget* t, cmTargetDependSet& deps);
private:
void CollectTargets();
void CollectDepends();
void CollectTargetDepends(int depender_index);
void AddTargetDepend(int depender_index, const char* dependee_name,
bool linking);
+ void AddTargetDepend(int depender_index, cmTarget* dependee, bool linking);
bool ComputeFinalDepends(cmComputeComponentGraph const& ccg);
cmGlobalGenerator* GlobalGenerator;
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index b8a0c95..0fe64ad 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -169,8 +169,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
const char* lang =(this->Makefile->GetCMakeInstance()->GetGlobalGenerator()
->GetLanguageFromExtension(ext.c_str()));
const char* def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");
- fprintf(fout, "cmake_minimum_required(VERSION %u.%u)\n",
- cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion());
+ fprintf(fout, "cmake_minimum_required(VERSION %u.%u.%u.%u)\n",
+ cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion(),
+ cmVersion::GetPatchVersion(), cmVersion::GetTweakVersion());
if(def)
{
fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def);
@@ -396,28 +397,18 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
}
else
{
- if(!cmSystemTools::RemoveFile(fullPath.c_str()))
+ // Sometimes anti-virus software hangs on to new files so we
+ // cannot delete them immediately. Try a few times.
+ int tries = 5;
+ while(!cmSystemTools::RemoveFile(fullPath.c_str()) &&
+ --tries && cmSystemTools::FileExists(fullPath.c_str()))
{
- bool removed = false;
- int numAttempts = 0;
- // sometimes anti-virus software hangs on to
- // new files and we can not delete them, so try
- // 5 times with .5 second delay between tries.
- while(!removed && numAttempts < 5)
- {
- cmSystemTools::Delay(500);
- if(cmSystemTools::RemoveFile(fullPath.c_str()))
- {
- removed = true;
- }
- numAttempts++;
- }
- if(!removed)
- {
- std::string m = "Remove failed on file: ";
- m += fullPath;
- cmSystemTools::ReportLastSystemError(m.c_str());
- }
+ cmSystemTools::Delay(500);
+ }
+ if(tries == 0)
+ {
+ std::string m = "Remove failed on file: " + fullPath;
+ cmSystemTools::ReportLastSystemError(m.c_str());
}
}
}
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index 5db88fa..bd860ee 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -11,6 +11,8 @@
============================================================================*/
#include "cmCustomCommand.h"
+#include "cmMakefile.h"
+
//----------------------------------------------------------------------------
cmCustomCommand::cmCustomCommand()
{
@@ -28,12 +30,14 @@ cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
Comment(r.Comment),
WorkingDirectory(r.WorkingDirectory),
EscapeAllowMakeVars(r.EscapeAllowMakeVars),
- EscapeOldStyle(r.EscapeOldStyle)
+ EscapeOldStyle(r.EscapeOldStyle),
+ Backtrace(new cmListFileBacktrace(*r.Backtrace))
{
}
//----------------------------------------------------------------------------
-cmCustomCommand::cmCustomCommand(const std::vector<std::string>& outputs,
+cmCustomCommand::cmCustomCommand(cmMakefile* mf,
+ const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
const cmCustomCommandLines& commandLines,
const char* comment,
@@ -45,10 +49,21 @@ cmCustomCommand::cmCustomCommand(const std::vector<std::string>& outputs,
Comment(comment?comment:""),
WorkingDirectory(workingDirectory?workingDirectory:""),
EscapeAllowMakeVars(false),
- EscapeOldStyle(true)
+ EscapeOldStyle(true),
+ Backtrace(new cmListFileBacktrace)
{
this->EscapeOldStyle = true;
this->EscapeAllowMakeVars = false;
+ if(mf)
+ {
+ mf->GetBacktrace(*this->Backtrace);
+ }
+}
+
+//----------------------------------------------------------------------------
+cmCustomCommand::~cmCustomCommand()
+{
+ delete this->Backtrace;
}
//----------------------------------------------------------------------------
@@ -131,6 +146,12 @@ void cmCustomCommand::SetEscapeAllowMakeVars(bool b)
}
//----------------------------------------------------------------------------
+cmListFileBacktrace const& cmCustomCommand::GetBacktrace() const
+{
+ return *this->Backtrace;
+}
+
+//----------------------------------------------------------------------------
cmCustomCommand::ImplicitDependsList const&
cmCustomCommand::GetImplicitDepends() const
{
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
index c9adddf..dd92e34 100644
--- a/Source/cmCustomCommand.h
+++ b/Source/cmCustomCommand.h
@@ -13,6 +13,8 @@
#define cmCustomCommand_h
#include "cmStandardIncludes.h"
+class cmMakefile;
+class cmListFileBacktrace;
/** \class cmCustomCommand
* \brief A class to encapsulate a custom command
@@ -27,12 +29,15 @@ public:
cmCustomCommand(const cmCustomCommand& r);
/** Main constructor specifies all information for the command. */
- cmCustomCommand(const std::vector<std::string>& outputs,
+ cmCustomCommand(cmMakefile* mf,
+ const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
const cmCustomCommandLines& commandLines,
const char* comment,
const char* workingDirectory);
+ ~cmCustomCommand();
+
/** Get the output file produced by the command. */
const std::vector<std::string>& GetOutputs() const;
@@ -63,6 +68,9 @@ public:
bool GetEscapeAllowMakeVars() const;
void SetEscapeAllowMakeVars(bool b);
+ /** Backtrace of the command that created this custom command. */
+ cmListFileBacktrace const& GetBacktrace() const;
+
typedef std::pair<cmStdString, cmStdString> ImplicitDependsPair;
class ImplicitDependsList: public std::vector<ImplicitDependsPair> {};
void SetImplicitDepends(ImplicitDependsList const&);
@@ -78,6 +86,7 @@ private:
std::string WorkingDirectory;
bool EscapeAllowMakeVars;
bool EscapeOldStyle;
+ cmListFileBacktrace* Backtrace;
ImplicitDependsList ImplicitDepends;
};
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
new file mode 100644
index 0000000..a650129
--- /dev/null
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -0,0 +1,72 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2010 Kitware, Inc., Insight Software Consortium
+
+ 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.
+============================================================================*/
+#include "cmCustomCommandGenerator.h"
+
+#include "cmMakefile.h"
+#include "cmCustomCommand.h"
+#include "cmLocalGenerator.h"
+#include "cmGeneratorExpression.h"
+
+//----------------------------------------------------------------------------
+cmCustomCommandGenerator::cmCustomCommandGenerator(
+ cmCustomCommand const& cc, const char* config, cmMakefile* mf):
+ CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()),
+ OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
+ GE(new cmGeneratorExpression(mf, config, cc.GetBacktrace()))
+{
+}
+
+//----------------------------------------------------------------------------
+cmCustomCommandGenerator::~cmCustomCommandGenerator()
+{
+ delete this->GE;
+}
+
+//----------------------------------------------------------------------------
+unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const
+{
+ return static_cast<unsigned int>(this->CC.GetCommandLines().size());
+}
+
+//----------------------------------------------------------------------------
+std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
+{
+ std::string const& argv0 = this->CC.GetCommandLines()[c][0];
+ cmTarget* target = this->Makefile->FindTargetToUse(argv0.c_str());
+ if(target && target->GetType() == cmTarget::EXECUTABLE &&
+ (target->IsImported() || !this->Makefile->IsOn("CMAKE_CROSSCOMPILING")))
+ {
+ return target->GetLocation(this->Config);
+ }
+ return this->GE->Process(argv0);
+}
+
+//----------------------------------------------------------------------------
+void
+cmCustomCommandGenerator
+::AppendArguments(unsigned int c, std::string& cmd) const
+{
+ cmCustomCommandLine const& commandLine = this->CC.GetCommandLines()[c];
+ for(unsigned int j=1;j < commandLine.size(); ++j)
+ {
+ std::string arg = this->GE->Process(commandLine[j]);
+ cmd += " ";
+ if(this->OldStyle)
+ {
+ cmd += this->LG->EscapeForShellOldStyle(arg.c_str());
+ }
+ else
+ {
+ cmd += this->LG->EscapeForShell(arg.c_str(), this->MakeVars);
+ }
+ }
+}
diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h
new file mode 100644
index 0000000..4e89f27
--- /dev/null
+++ b/Source/cmCustomCommandGenerator.h
@@ -0,0 +1,40 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2010 Kitware, Inc., Insight Software Consortium
+
+ 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.
+============================================================================*/
+#ifndef cmCustomCommandGenerator_h
+#define cmCustomCommandGenerator_h
+
+#include "cmStandardIncludes.h"
+
+class cmCustomCommand;
+class cmMakefile;
+class cmLocalGenerator;
+class cmGeneratorExpression;
+
+class cmCustomCommandGenerator
+{
+ cmCustomCommand const& CC;
+ const char* Config;
+ cmMakefile* Makefile;
+ cmLocalGenerator* LG;
+ bool OldStyle;
+ bool MakeVars;
+ cmGeneratorExpression* GE;
+public:
+ cmCustomCommandGenerator(cmCustomCommand const& cc, const char* config,
+ cmMakefile* mf);
+ ~cmCustomCommandGenerator();
+ unsigned int GetNumberOfCommands() const;
+ std::string GetCommand(unsigned int c) const;
+ void AppendArguments(unsigned int c, std::string& cmd) const;
+};
+
+#endif
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 69ff858..19558fa 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -25,7 +25,7 @@ cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir):
Verbose(false),
FileComparison(0),
TargetDirectory(targetDir),
- MaxPath(cmSystemTools::GetMaximumFilePathLength()),
+ MaxPath(16384),
Dependee(new char[MaxPath]),
Depender(new char[MaxPath])
{
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
new file mode 100644
index 0000000..5359013
--- /dev/null
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -0,0 +1,30 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2010 Kitware, Inc., Insight Software Consortium
+
+ 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.
+============================================================================*/
+#ifndef cmDocumentGeneratorExpressions_h
+#define cmDocumentGeneratorExpressions_h
+
+#define CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS \
+ "Generator expressions are evaluted during build system generation " \
+ "to produce information specific to each build configuration. " \
+ "Valid expressions are:\n" \
+ " $<CONFIGURATION> = configuration name\n" \
+ " $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
+ " $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
+ " $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n" \
+ "where \"tgt\" is the name of a target. " \
+ "Target file expressions produce a full path, but _DIR and _NAME " \
+ "versions can produce the directory and file name components:\n" \
+ " $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>\n" \
+ " $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>\n" \
+ " $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>\n"
+
+#endif
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 8f89b5e..0ef771f 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -201,7 +201,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
"<projectDescription>\n"
"\t<name>" <<
this->GenerateProjectName(mf->GetProjectName(),
- mf->GetDefinition("CMAKE_BUILD_TYPE"),
+ mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
this->GetPathBasename(this->HomeOutputDirectory))
<< "</name>\n"
"\t<comment></comment>\n"
@@ -734,6 +734,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
;
emmited.clear();
const std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
+ const std::string makeArgs = mf->GetSafeDefinition(
+ "CMAKE_ECLIPSE_MAKE_ARGUMENTS");
cmGlobalGenerator* generator
= const_cast<cmGlobalGenerator*>(this->GlobalGenerator);
@@ -794,7 +796,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
}
if (insertTarget)
{
- this->AppendTarget(fout, ti->first, make, subdir, ": ");
+ this->AppendTarget(fout, ti->first, make, makeArgs, subdir, ": ");
}
}
break;
@@ -809,7 +811,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
break;
}
- this->AppendTarget(fout, ti->first, make, subdir, ": ");
+ this->AppendTarget(fout, ti->first, make, makeArgs, subdir, ": ");
break;
case cmTarget::EXECUTABLE:
case cmTarget::STATIC_LIBRARY:
@@ -818,10 +820,10 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{
const char* prefix = (ti->second.GetType()==cmTarget::EXECUTABLE ?
"[exe] " : "[lib] ");
- this->AppendTarget(fout, ti->first, make, subdir, prefix);
+ this->AppendTarget(fout, ti->first, make, makeArgs, subdir, prefix);
std::string fastTarget = ti->first;
fastTarget += "/fast";
- this->AppendTarget(fout, fastTarget, make, subdir, prefix);
+ this->AppendTarget(fout, fastTarget, make, makeArgs, subdir, prefix);
}
break;
// ignore these:
@@ -836,11 +838,11 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// insert the all and clean targets in every subdir
if (!allTarget.empty())
{
- this->AppendTarget(fout, allTarget, make, subdir, ": ");
+ this->AppendTarget(fout, allTarget, make, makeArgs, subdir, ": ");
}
if (!cleanTarget.empty())
{
- this->AppendTarget(fout, cleanTarget, make, subdir, ": ");
+ this->AppendTarget(fout, cleanTarget, make, makeArgs, subdir, ": ");
}
//insert rules for compiling, preprocessing and assembling individual files
@@ -860,7 +862,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{
prefix = "[pre] ";
}
- this->AppendTarget(fout, *fit, make, subdir, prefix);
+ this->AppendTarget(fout, *fit, make, makeArgs, subdir, prefix);
}
}
@@ -993,6 +995,7 @@ void cmExtraEclipseCDT4Generator
void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
const std::string& target,
const std::string& make,
+ const std::string& makeArgs,
const std::string& path,
const char* prefix)
{
@@ -1003,7 +1006,7 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
"<buildCommand>"
<< cmExtraEclipseCDT4Generator::GetEclipsePath(make)
<< "</buildCommand>\n"
- "<buildArguments/>\n"
+ "<buildArguments>" << makeArgs << "</buildArguments>\n"
"<buildTarget>" << target << "</buildTarget>\n"
"<stopOnError>true</stopOnError>\n"
"<useDefaultCommand>false</useDefaultCommand>\n"
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index 2ad599d..99e69c4 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -71,6 +71,7 @@ private:
static void AppendTarget (cmGeneratedFileStream& fout,
const std::string& target,
const std::string& make,
+ const std::string& makeArguments,
const std::string& path,
const char* prefix = "");
static void AppendScannerProfile (cmGeneratedFileStream& fout,
diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h
index e771092..b11dcde 100644
--- a/Source/cmFileCommand.h
+++ b/Source/cmFileCommand.h
@@ -116,7 +116,12 @@ public:
"expressions and store it into the variable. Globbing expressions "
"are similar to regular expressions, but much simpler. If RELATIVE "
"flag is specified for an expression, the results will be returned "
- "as a relative path to the given path.\n"
+ "as a relative path to the given path. "
+ "(We do not recommend using GLOB to collect a list of source files "
+ "from your source tree. If no CMakeLists.txt file changes when a "
+ "source is added or removed then the generated build system cannot "
+ "know when to ask CMake to regenerate.)"
+ "\n"
"Examples of globbing expressions include:\n"
" *.cxx - match all files with extension cxx\n"
" *.vt? - match all files with extension vta,...,vtz\n"
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index 0416538..d0fe99f 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -164,6 +164,11 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
}
}
}
+ if(args.size() < 2 )
+ {
+ this->SetError("called with incorrect number of arguments");
+ return false;
+ }
this->VariableName = args[0];
if(this->CheckForVariableInCache())
{
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index a61880f..8710dfc 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -17,8 +17,8 @@
//----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression(
cmMakefile* mf, const char* config,
- cmListFileBacktrace const& backtrace):
- Makefile(mf), Config(config), Backtrace(backtrace)
+ cmListFileBacktrace const& backtrace, bool quiet):
+ Makefile(mf), Config(config), Backtrace(backtrace), Quiet(quiet)
{
this->TargetInfo.compile("^\\$<TARGET"
"(|_SONAME|_LINKER)" // File with what purpose?
@@ -87,7 +87,7 @@ bool cmGeneratorExpression::Evaluate()
this->Data.insert(this->Data.end(), result.begin(), result.end());
return true;
}
- else
+ else if(!this->Quiet)
{
// Failure. Report the error message.
cmOStringStream e;
@@ -99,6 +99,7 @@ bool cmGeneratorExpression::Evaluate()
this->Backtrace);
return false;
}
+ return true;
}
//----------------------------------------------------------------------------
@@ -140,6 +141,7 @@ bool cmGeneratorExpression::EvaluateTargetInfo(std::string& result)
result = "Target \"" + name + "\" is not an executable or library.";
return false;
}
+ this->Targets.insert(target);
// Lookup the target file with the given purpose.
std::string purpose = this->TargetInfo.match(1);
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index aa36055..1a9d4c6 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -15,6 +15,7 @@
#include <cmsys/RegularExpression.hxx>
+class cmTarget;
class cmMakefile;
class cmListFileBacktrace;
@@ -32,18 +33,25 @@ class cmGeneratorExpression
public:
/** Construct with an evaluation context and configuration. */
cmGeneratorExpression(cmMakefile* mf, const char* config,
- cmListFileBacktrace const& backtrace);
+ cmListFileBacktrace const& backtrace,
+ bool quiet = false);
/** Evaluate generator expressions in a string. */
const char* Process(std::string const& input);
const char* Process(const char* input);
+
+ /** Get set of targets found during evaluations. */
+ std::set<cmTarget*> const& GetTargets() const
+ { return this->Targets; }
private:
cmMakefile* Makefile;
const char* Config;
cmListFileBacktrace const& Backtrace;
+ bool Quiet;
std::vector<char> Data;
std::stack<size_t> Barriers;
cmsys::RegularExpression TargetInfo;
+ std::set<cmTarget*> Targets;
bool Evaluate();
bool Evaluate(const char* expr, std::string& result);
bool EvaluateTargetInfo(std::string& result);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 15abd02..123ab5e 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -814,24 +814,11 @@ void cmGlobalGenerator::Generate()
// For each existing cmLocalGenerator
unsigned int i;
- // Consolidate global targets
+ // Put a copy of each global target in every directory.
cmTargets globalTargets;
this->CreateDefaultGlobalTargets(&globalTargets);
for (i = 0; i < this->LocalGenerators.size(); ++i)
{
- cmTargets* targets =
- &(this->LocalGenerators[i]->GetMakefile()->GetTargets());
- cmTargets::iterator tarIt;
- for ( tarIt = targets->begin(); tarIt != targets->end(); ++ tarIt )
- {
- if ( tarIt->second.GetType() == cmTarget::GLOBAL_TARGET )
- {
- globalTargets[tarIt->first] = tarIt->second;
- }
- }
- }
- for (i = 0; i < this->LocalGenerators.size(); ++i)
- {
cmMakefile* mf = this->LocalGenerators[i]->GetMakefile();
cmTargets* targets = &(mf->GetTargets());
cmTargets::iterator tit;
@@ -1881,8 +1868,7 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
const char* name, const char* message,
const cmCustomCommandLines* commandLines,
std::vector<std::string> depends,
- const char* workingDirectory,
- bool depends_on_all /* = false */)
+ const char* workingDirectory)
{
// Package
cmTarget target;
@@ -1893,14 +1879,10 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
std::vector<std::string> no_outputs;
std::vector<std::string> no_depends;
// Store the custom command in the target.
- cmCustomCommand cc(no_outputs, no_depends, *commandLines, 0,
+ cmCustomCommand cc(0, no_outputs, no_depends, *commandLines, 0,
workingDirectory);
target.GetPostBuildCommands().push_back(cc);
target.SetProperty("EchoString", message);
- if ( depends_on_all )
- {
- target.AddUtility("all");
- }
std::vector<std::string>::iterator dit;
for ( dit = depends.begin(); dit != depends.end(); ++ dit )
{
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index e68ed08..6a1aa53 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -16,6 +16,7 @@
#include "cmStandardIncludes.h"
#include "cmTarget.h" // For cmTargets
+#include "cmTargetDepend.h" // For cmTargetDependSet
class cmake;
class cmMakefile;
@@ -233,7 +234,7 @@ public:
virtual const char* GetCleanTargetName() { return 0; }
// Class to track a set of dependencies.
- class TargetDependSet: public std::set<cmTarget*> {};
+ typedef cmTargetDependSet TargetDependSet;
// what targets does the specified target depend on directly
// via a target_link_libraries or add_dependencies
@@ -290,8 +291,7 @@ protected:
void CreateDefaultGlobalTargets(cmTargets* targets);
cmTarget CreateGlobalTarget(const char* name, const char* message,
const cmCustomCommandLines* commandLines,
- std::vector<std::string> depends, const char* workingDir,
- bool depends_on_all = false);
+ std::vector<std::string> depends, const char* workingDir);
bool NeedSymbolicMark;
bool UseLinkScript;
diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx
index d324e59..820e7e6 100644
--- a/Source/cmGlobalMSYSMakefileGenerator.cxx
+++ b/Source/cmGlobalMSYSMakefileGenerator.cxx
@@ -69,9 +69,16 @@ void cmGlobalMSYSMakefileGenerator
{
gxx = tgxx;
}
+ std::string trc = cmSystemTools::FindProgram("windres", locations);
+ std::string rc = "windres.exe";
+ if(trc.size())
+ {
+ rc = trc;
+ }
mf->AddDefinition("MSYS", "1");
mf->AddDefinition("CMAKE_GENERATOR_CC", gcc.c_str());
mf->AddDefinition("CMAKE_GENERATOR_CXX", gxx.c_str());
+ mf->AddDefinition("CMAKE_GENERATOR_RC", rc.c_str());
this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
if(!mf->IsSet("CMAKE_AR") &&
diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx
index 9f9d1be..2f558dc 100644
--- a/Source/cmGlobalMinGWMakefileGenerator.cxx
+++ b/Source/cmGlobalMinGWMakefileGenerator.cxx
@@ -44,8 +44,15 @@ void cmGlobalMinGWMakefileGenerator
{
gxx = tgxx;
}
+ std::string trc = cmSystemTools::FindProgram("windres", locations);
+ std::string rc = "windres.exe";
+ if(trc.size())
+ {
+ rc = trc;
+ }
mf->AddDefinition("CMAKE_GENERATOR_CC", gcc.c_str());
mf->AddDefinition("CMAKE_GENERATOR_CXX", gxx.c_str());
+ mf->AddDefinition("CMAKE_GENERATOR_RC", rc.c_str());
this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
}
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 403507f..0b939af 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -19,6 +19,10 @@
cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator()
{
this->FindMakeProgramFile = "CMakeVS10FindMake.cmake";
+ std::string vc10Express;
+ this->ExpressEdition = cmSystemTools::ReadRegistryValue(
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0\\Setup\\VC;"
+ "ProductDir", vc10Express, cmSystemTools::KeyWOW64_32);
}
//----------------------------------------------------------------------------
@@ -63,6 +67,16 @@ void cmGlobalVisualStudio10Generator
}
//----------------------------------------------------------------------------
+const char* cmGlobalVisualStudio10Generator::GetPlatformToolset()
+{
+ if(!this->PlatformToolset.empty())
+ {
+ return this->PlatformToolset.c_str();
+ }
+ return 0;
+}
+
+//----------------------------------------------------------------------------
std::string cmGlobalVisualStudio10Generator::GetUserMacrosDirectory()
{
std::string base;
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 219c36e..bef5642 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -54,6 +54,12 @@ public:
cmMakefile *, bool optional);
virtual void WriteSLNHeader(std::ostream& fout);
+ /** Is the installed VS an Express edition? */
+ bool IsExpressEdition() const { return this->ExpressEdition; }
+
+ /** The toolset name for the target platform. */
+ const char* GetPlatformToolset();
+
/**
* Where does this version of Visual Studio look for macros for the
* current user? Returns the empty string if this version of Visual
@@ -70,5 +76,9 @@ public:
{ return "$(Configuration)";}
protected:
virtual const char* GetIDEVersion() { return "10.0"; }
+
+ std::string PlatformToolset;
+private:
+ bool ExpressEdition;
};
#endif
diff --git a/Source/cmGlobalVisualStudio10Win64Generator.cxx b/Source/cmGlobalVisualStudio10Win64Generator.cxx
index 109b60d..8600777 100644
--- a/Source/cmGlobalVisualStudio10Win64Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Win64Generator.cxx
@@ -36,3 +36,52 @@ void cmGlobalVisualStudio10Win64Generator
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64");
}
+
+//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio10Win64Generator::Find64BitTools(cmMakefile* mf)
+{
+ if(!this->PlatformToolset.empty())
+ {
+ return true;
+ }
+ // This edition does not come with 64-bit tools. Look for them.
+ //
+ // TODO: Detect available tools? x64\v100 exists but does not work?
+ // KHLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\4.0;VCTargetsPath
+ // c:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/Platforms/
+ // {Itanium,Win32,x64}/PlatformToolsets/{v100,v90,Windows7.1SDK}
+ std::string winSDK_7_1;
+ if(cmSystemTools::ReadRegistryValue(
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\"
+ "Windows\\v7.1;InstallationFolder", winSDK_7_1))
+ {
+ cmOStringStream m;
+ m << "Found Windows SDK v7.1: " << winSDK_7_1;
+ mf->DisplayStatus(m.str().c_str(), -1);
+ this->PlatformToolset = "Windows7.1SDK";
+ return true;
+ }
+ else
+ {
+ cmOStringStream e;
+ e << "Cannot enable 64-bit tools with Visual Studio 2010 Express.\n"
+ << "Install the Microsoft Windows SDK v7.1 to get 64-bit tools:\n"
+ << " http://msdn.microsoft.com/en-us/windows/bb980924.aspx";
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+ cmSystemTools::SetFatalErrorOccured();
+ return false;
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmGlobalVisualStudio10Win64Generator
+::EnableLanguage(std::vector<std::string> const& languages,
+ cmMakefile* mf, bool optional)
+{
+ if(this->IsExpressEdition() && !this->Find64BitTools(mf))
+ {
+ return;
+ }
+ this->cmGlobalVisualStudio10Generator
+ ::EnableLanguage(languages, mf, optional);
+}
diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h
index 39c9d08..e6d3dc5 100644
--- a/Source/cmGlobalVisualStudio10Win64Generator.h
+++ b/Source/cmGlobalVisualStudio10Win64Generator.h
@@ -34,5 +34,8 @@ public:
virtual void AddPlatformDefinitions(cmMakefile* mf);
+ bool Find64BitTools(cmMakefile* mf);
+ virtual void EnableLanguage(std::vector<std::string>const& languages,
+ cmMakefile *, bool optional);
};
#endif
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 203ca77..fe44e20 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -197,8 +197,6 @@ void cmGlobalVisualStudio6Generator
this->GetTargetSets(projectTargets, originalTargets, root, generators);
OrderedTargetDependSet orderedProjectTargets(projectTargets);
- std::string rootdir = root->GetMakefile()->GetStartOutputDirectory();
- rootdir += "/";
for(OrderedTargetDependSet::const_iterator
tt = orderedProjectTargets.begin();
tt != orderedProjectTargets.end(); ++tt)
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index ba18687..adb5f2f 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -182,8 +182,8 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
std::string guid = this->GetGUID(dspname);
fout << project
<< dspname << "\", \""
- << this->ConvertToSolutionPath(dir)
- << "\\" << dspname << ext << "\", \"{" << guid << "}\"\n";
+ << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
+ << dspname << ext << "\", \"{" << guid << "}\"\n";
fout << "\tProjectSection(ProjectDependencies) = postProject\n";
this->WriteProjectDepends(fout, dspname, dir, t);
fout << "\tEndProjectSection\n";
@@ -196,8 +196,8 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
const char* uname = ui->second.c_str();
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
<< uname << "\", \""
- << this->ConvertToSolutionPath(dir)
- << "\\" << uname << ".vcproj" << "\", \"{"
+ << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
+ << uname << ".vcproj" << "\", \"{"
<< this->GetGUID(uname) << "}\"\n"
<< "\tProjectSection(ProjectDependencies) = postProject\n"
<< "\t\t{" << guid << "} = {" << guid << "}\n"
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 45d6a74..51b8918 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -273,8 +273,6 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
cmLocalGenerator* root,
OrderedTargetDependSet const& projectTargets)
{
- std::string rootdir = root->GetMakefile()->GetStartOutputDirectory();
- rootdir += "/";
for(OrderedTargetDependSet::const_iterator tt =
projectTargets.begin(); tt != projectTargets.end(); ++tt)
{
@@ -301,6 +299,10 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
std::string dir = tmf->GetStartOutputDirectory();
dir = root->Convert(dir.c_str(),
cmLocalGenerator::START_OUTPUT);
+ if(dir == ".")
+ {
+ dir = ""; // msbuild cannot handle ".\" prefix
+ }
this->WriteProject(fout, vcprojName, dir.c_str(),
*target);
written = true;
@@ -516,8 +518,8 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
fout << project
<< dspname << "\", \""
- << this->ConvertToSolutionPath(dir)
- << "\\" << dspname << ext << "\", \"{"
+ << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
+ << dspname << ext << "\", \"{"
<< this->GetGUID(dspname) << "}\"\nEndProject\n";
UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target);
@@ -526,8 +528,8 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
const char* uname = ui->second.c_str();
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
<< uname << "\", \""
- << this->ConvertToSolutionPath(dir)
- << "\\" << uname << ".vcproj" << "\", \"{"
+ << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
+ << uname << ".vcproj" << "\", \"{"
<< this->GetGUID(uname) << "}\"\n"
<< "EndProject\n";
}
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 76d01e7..2d080df 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -289,6 +289,14 @@ cmGlobalVisualStudio8Generator
}
//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio8Generator::ComputeTargetDepends()
+{
+ // Skip over the cmGlobalVisualStudioGenerator implementation!
+ // We do not need the support that VS <= 7.1 needs.
+ return this->cmGlobalGenerator::ComputeTargetDepends();
+}
+
+//----------------------------------------------------------------------------
void cmGlobalVisualStudio8Generator::WriteProjectDepends(
std::ostream& fout, const char*, const char*, cmTarget& t)
{
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index 95b6a17..e0913ed 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -78,6 +78,7 @@ protected:
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
bool partOfDefaultBuild);
+ virtual bool ComputeTargetDepends();
virtual void WriteProjectDepends(std::ostream& fout, const char* name,
const char* path, cmTarget &t);
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index bae18a3..449d090 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -237,6 +237,59 @@ std::string cmGlobalVisualStudioGenerator::GetUserMacrosRegKeyBase()
}
//----------------------------------------------------------------------------
+void cmGlobalVisualStudioGenerator::FillLinkClosure(cmTarget* target,
+ TargetSet& linked)
+{
+ if(linked.insert(target).second)
+ {
+ TargetDependSet const& depends = this->GetTargetDirectDepends(*target);
+ for(TargetDependSet::const_iterator di = depends.begin();
+ di != depends.end(); ++di)
+ {
+ if(di->IsLink())
+ {
+ this->FillLinkClosure(*di, linked);
+ }
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
+cmGlobalVisualStudioGenerator::TargetSet const&
+cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmTarget* target)
+{
+ TargetSetMap::iterator i = this->TargetLinkClosure.find(target);
+ if(i == this->TargetLinkClosure.end())
+ {
+ TargetSetMap::value_type entry(target, TargetSet());
+ i = this->TargetLinkClosure.insert(entry).first;
+ this->FillLinkClosure(target, i->second);
+ }
+ return i->second;
+}
+
+//----------------------------------------------------------------------------
+void cmGlobalVisualStudioGenerator::FollowLinkDepends(
+ cmTarget* target, std::set<cmTarget*>& linked)
+{
+ if(linked.insert(target).second &&
+ target->GetType() == cmTarget::STATIC_LIBRARY)
+ {
+ // Static library targets do not list their link dependencies so
+ // we must follow them transitively now.
+ TargetDependSet const& depends = this->GetTargetDirectDepends(*target);
+ for(TargetDependSet::const_iterator di = depends.begin();
+ di != depends.end(); ++di)
+ {
+ if(di->IsLink())
+ {
+ this->FollowLinkDepends(*di, linked);
+ }
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
{
if(!this->cmGlobalGenerator::ComputeTargetDepends())
@@ -269,51 +322,94 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
return;
}
VSDependSet& vsTargetDepend = this->VSTargetDepends[&target];
+ // VS <= 7.1 has two behaviors that affect solution dependencies.
+ //
+ // (1) Solution-level dependencies between a linkable target and a
+ // library cause that library to be linked. We use an intermedite
+ // empty utility target to express the dependency. (VS 8 and above
+ // provide a project file "LinkLibraryDependencies" setting to
+ // choose whether to activate this behavior. We disable it except
+ // when linking external project files.)
+ //
+ // (2) We cannot let static libraries depend directly on targets to
+ // which they "link" because the librarian tool will copy the
+ // targets into the static library. While the work-around for
+ // behavior (1) would also avoid this, it would create a large
+ // number of extra utility targets for little gain. Instead, use
+ // the above work-around only for dependencies explicitly added by
+ // the add_dependencies() command. Approximate link dependencies by
+ // leaving them out for the static library itself but following them
+ // transitively for other targets.
+
+ bool allowLinkable = (target.GetType() != cmTarget::STATIC_LIBRARY &&
+ target.GetType() != cmTarget::SHARED_LIBRARY &&
+ target.GetType() != cmTarget::MODULE_LIBRARY &&
+ target.GetType() != cmTarget::EXECUTABLE);
+
+ TargetDependSet const& depends = this->GetTargetDirectDepends(target);
+
+ // Collect implicit link dependencies (target_link_libraries).
+ // Static libraries cannot depend on their link implementation
+ // due to behavior (2), but they do not really need to.
+ std::set<cmTarget*> linkDepends;
if(target.GetType() != cmTarget::STATIC_LIBRARY)
{
- cmTarget::LinkLibraryVectorType const& libs = target.GetLinkLibraries();
- for(cmTarget::LinkLibraryVectorType::const_iterator j = libs.begin();
- j != libs.end(); ++j)
+ for(TargetDependSet::const_iterator di = depends.begin();
+ di != depends.end(); ++di)
{
- if(j->first != target.GetName() &&
- this->FindTarget(0, j->first.c_str()))
+ cmTargetDepend dep = *di;
+ if(dep.IsLink())
{
- vsTargetDepend.insert(j->first);
+ this->FollowLinkDepends(dep, linkDepends);
}
}
}
- std::set<cmStdString> const& utils = target.GetUtilities();
- for(std::set<cmStdString>::const_iterator i = utils.begin();
- i != utils.end(); ++i)
+
+ // Collext explicit util dependencies (add_dependencies).
+ std::set<cmTarget*> utilDepends;
+ for(TargetDependSet::const_iterator di = depends.begin();
+ di != depends.end(); ++di)
{
- if(*i != target.GetName())
+ cmTargetDepend dep = *di;
+ if(dep.IsUtil())
{
- std::string name = this->GetUtilityForTarget(target, i->c_str());
- vsTargetDepend.insert(name);
+ this->FollowLinkDepends(dep, utilDepends);
}
}
-}
-//----------------------------------------------------------------------------
-bool cmGlobalVisualStudioGenerator::CheckTargetLinks(cmTarget& target,
- const char* name)
-{
- // Return whether the given target links to a target with the given name.
- if(target.GetType() == cmTarget::STATIC_LIBRARY)
+ // Collect all targets linked by this target so we can avoid
+ // intermediate targets below.
+ TargetSet linked;
+ if(target.GetType() != cmTarget::STATIC_LIBRARY)
{
- // Static libraries never link to anything.
- return false;
+ linked = this->GetTargetLinkClosure(&target);
}
- cmTarget::LinkLibraryVectorType const& libs = target.GetLinkLibraries();
- for(cmTarget::LinkLibraryVectorType::const_iterator i = libs.begin();
- i != libs.end(); ++i)
+
+ // Emit link dependencies.
+ for(std::set<cmTarget*>::iterator di = linkDepends.begin();
+ di != linkDepends.end(); ++di)
+ {
+ cmTarget* dep = *di;
+ vsTargetDepend.insert(dep->GetName());
+ }
+
+ // Emit util dependencies. Possibly use intermediate targets.
+ for(std::set<cmTarget*>::iterator di = utilDepends.begin();
+ di != utilDepends.end(); ++di)
{
- if(i->first == name)
+ cmTarget* dep = *di;
+ if(allowLinkable || !dep->IsLinkable() || linked.count(dep))
{
- return true;
+ // Direct dependency allowed.
+ vsTargetDepend.insert(dep->GetName());
+ }
+ else
+ {
+ // Direct dependency on linkable target not allowed.
+ // Use an intermediate utility target.
+ vsTargetDepend.insert(this->GetUtilityDepend(dep));
}
}
- return false;
}
//----------------------------------------------------------------------------
@@ -330,45 +426,6 @@ std::string cmGlobalVisualStudioGenerator::GetUtilityDepend(cmTarget* target)
}
//----------------------------------------------------------------------------
-std::string
-cmGlobalVisualStudioGenerator::GetUtilityForTarget(cmTarget& target,
- const char* name)
-{
- if(!this->VSLinksDependencies())
- {
- return name;
- }
-
- // Possibly depend on an intermediate utility target to avoid
- // linking.
- if(target.GetType() == cmTarget::STATIC_LIBRARY ||
- target.GetType() == cmTarget::SHARED_LIBRARY ||
- target.GetType() == cmTarget::MODULE_LIBRARY ||
- target.GetType() == cmTarget::EXECUTABLE)
- {
- // The depender is a target that links.
- if(cmTarget* depTarget = this->FindTarget(0, name))
- {
- if(depTarget->GetType() == cmTarget::STATIC_LIBRARY ||
- depTarget->GetType() == cmTarget::SHARED_LIBRARY ||
- depTarget->GetType() == cmTarget::MODULE_LIBRARY)
- {
- // This utility dependency will cause an attempt to link. If
- // the depender does not already link the dependee we need an
- // intermediate target.
- if(!this->CheckTargetLinks(target, name))
- {
- return this->GetUtilityDepend(depTarget);
- }
- }
- }
- }
-
- // No special case. Just use the original dependency name.
- return name;
-}
-
-//----------------------------------------------------------------------------
#include <windows.h>
//----------------------------------------------------------------------------
@@ -554,8 +611,9 @@ void WriteVSMacrosFileRegistryEntry(
{
// Create the subkey and set the values of interest:
HKEY hsubkey = NULL;
- result = RegCreateKeyEx(hkey, nextAvailableSubKeyName.c_str(), 0, "", 0,
- KEY_READ|KEY_WRITE, 0, &hsubkey, 0);
+ char lpClass[] = "";
+ result = RegCreateKeyEx(hkey, nextAvailableSubKeyName.c_str(), 0,
+ lpClass, 0, KEY_READ|KEY_WRITE, 0, &hsubkey, 0);
if (ERROR_SUCCESS == result)
{
DWORD dw = 0;
@@ -706,11 +764,22 @@ cmGlobalVisualStudioGenerator::TargetCompare
//----------------------------------------------------------------------------
cmGlobalVisualStudioGenerator::OrderedTargetDependSet
-::OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const& targets)
+::OrderedTargetDependSet(TargetDependSet const& targets)
{
- for(cmGlobalGenerator::TargetDependSet::const_iterator ti =
+ for(TargetDependSet::const_iterator ti =
targets.begin(); ti != targets.end(); ++ti)
{
this->insert(*ti);
}
}
+
+//----------------------------------------------------------------------------
+cmGlobalVisualStudioGenerator::OrderedTargetDependSet
+::OrderedTargetDependSet(TargetSet const& targets)
+{
+ for(TargetSet::const_iterator ti = targets.begin();
+ ti != targets.end(); ++ti)
+ {
+ this->insert(*ti);
+ }
+}
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index c8ea339..bc96f4e 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -69,15 +69,12 @@ public:
i.e. "Can I build Debug and Release in the same tree?" */
virtual bool IsMultiConfig() { return true; }
+ class TargetSet: public std::set<cmTarget*> {};
struct TargetCompare
{
bool operator()(cmTarget const* l, cmTarget const* r) const;
};
- class OrderedTargetDependSet: public std::multiset<cmTarget*, TargetCompare>
- {
- public:
- OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&);
- };
+ class OrderedTargetDependSet;
protected:
// Does this VS version link targets to each other if there are
@@ -99,6 +96,24 @@ protected:
std::string GetUtilityDepend(cmTarget* target);
typedef std::map<cmTarget*, cmStdString> UtilityDependsMap;
UtilityDependsMap UtilityDepends;
+private:
+ void FollowLinkDepends(cmTarget* target, std::set<cmTarget*>& linked);
+
+ class TargetSetMap: public std::map<cmTarget*, TargetSet> {};
+ TargetSetMap TargetLinkClosure;
+ void FillLinkClosure(cmTarget* target, TargetSet& linked);
+ TargetSet const& GetTargetLinkClosure(cmTarget* target);
+};
+
+class cmGlobalVisualStudioGenerator::OrderedTargetDependSet:
+ public std::multiset<cmTargetDepend,
+ cmGlobalVisualStudioGenerator::TargetCompare>
+{
+public:
+ typedef cmGlobalGenerator::TargetDependSet TargetDependSet;
+ typedef cmGlobalVisualStudioGenerator::TargetSet TargetSet;
+ OrderedTargetDependSet(TargetDependSet const&);
+ OrderedTargetDependSet(TargetSet const&);
};
#endif
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 2f7bc44..59ca38f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -18,6 +18,7 @@
#include "cmGeneratedFileStream.h"
#include "cmComputeLinkInformation.h"
#include "cmSourceFile.h"
+#include "cmCustomCommandGenerator.h"
#include <cmsys/auto_ptr.hxx>
@@ -1314,8 +1315,7 @@ void cmGlobalXCodeGenerator
cmCustomCommand const& cc = *i;
if(!cc.GetCommandLines().empty())
{
- bool escapeOldStyle = cc.GetEscapeOldStyle();
- bool escapeAllowMakeVars = cc.GetEscapeAllowMakeVars();
+ cmCustomCommandGenerator ccg(cc, configName, this->CurrentMakefile);
makefileStream << "\n";
const std::vector<std::string>& outputs = cc.GetOutputs();
if(!outputs.empty())
@@ -1334,11 +1334,13 @@ void cmGlobalXCodeGenerator
cc.GetDepends().begin();
d != cc.GetDepends().end(); ++d)
{
- std::string dep =
- this->CurrentLocalGenerator->GetRealDependency(d->c_str(),
- configName);
- makefileStream << "\\\n" << this
- ->ConvertToRelativeForMake(dep.c_str());
+ std::string dep;
+ if(this->CurrentLocalGenerator
+ ->GetRealDependency(d->c_str(), configName, dep))
+ {
+ makefileStream << "\\\n" <<
+ this->ConvertToRelativeForMake(dep.c_str());
+ }
}
makefileStream << "\n";
@@ -1346,20 +1348,15 @@ void cmGlobalXCodeGenerator
{
std::string echo_cmd = "echo ";
echo_cmd += (this->CurrentLocalGenerator->
- EscapeForShell(comment, escapeAllowMakeVars));
+ EscapeForShell(comment, cc.GetEscapeAllowMakeVars()));
makefileStream << "\t" << echo_cmd.c_str() << "\n";
}
// Add each command line to the set of commands.
- for(cmCustomCommandLines::const_iterator cl =
- cc.GetCommandLines().begin();
- cl != cc.GetCommandLines().end(); ++cl)
+ for(unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c)
{
// Build the command line in a single string.
- const cmCustomCommandLine& commandLine = *cl;
- std::string cmd2 = this->CurrentLocalGenerator
- ->GetRealLocation(commandLine[0].c_str(), configName);
-
+ std::string cmd2 = ccg.GetCommand(c);
cmSystemTools::ReplaceString(cmd2, "/./", "/");
cmd2 = this->ConvertToRelativeForMake(cmd2.c_str());
std::string cmd;
@@ -1370,21 +1367,7 @@ void cmGlobalXCodeGenerator
cmd += " && ";
}
cmd += cmd2;
- for(unsigned int j=1; j < commandLine.size(); ++j)
- {
- cmd += " ";
- if(escapeOldStyle)
- {
- cmd += (this->CurrentLocalGenerator
- ->EscapeForShellOldStyle(commandLine[j].c_str()));
- }
- else
- {
- cmd += (this->CurrentLocalGenerator->
- EscapeForShell(commandLine[j].c_str(),
- escapeAllowMakeVars));
- }
- }
+ ccg.AppendArguments(c, cmd);
makefileStream << "\t" << cmd.c_str() << "\n";
}
}
@@ -2634,7 +2617,10 @@ void cmGlobalXCodeGenerator
group->AddAttribute("BuildIndependentTargetsInParallel",
this->CreateString("YES"));
this->RootObject->AddAttribute("attributes", group);
- if (this->XcodeVersion >= 31)
+ if (this->XcodeVersion >= 32)
+ this->RootObject->AddAttribute("compatibilityVersion",
+ this->CreateString("Xcode 3.2"));
+ else if (this->XcodeVersion >= 31)
this->RootObject->AddAttribute("compatibilityVersion",
this->CreateString("Xcode 3.1"));
else
@@ -3040,7 +3026,9 @@ cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout,
cmXCodeObject::Indent(1, fout);
if(this->XcodeVersion >= 21)
{
- if (this->XcodeVersion >= 31)
+ if (this->XcodeVersion >= 32)
+ fout << "objectVersion = 46;\n";
+ else if (this->XcodeVersion >= 31)
fout << "objectVersion = 45;\n";
else if (this->XcodeVersion >= 30)
fout << "objectVersion = 44;\n";
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
new file mode 100644
index 0000000..bdb33bc
--- /dev/null
+++ b/Source/cmGraphVizWriter.cxx
@@ -0,0 +1,435 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ 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.
+============================================================================*/
+#include "cmGraphVizWriter.h"
+#include "cmMakefile.h"
+#include "cmLocalGenerator.h"
+#include "cmGlobalGenerator.h"
+#include "cmGeneratedFileStream.h"
+
+#include <memory>
+
+
+
+static const char* getShapeForTarget(const cmTarget* target)
+{
+ if (!target)
+ {
+ return "ellipse";
+ }
+
+ switch ( target->GetType() )
+ {
+ case cmTarget::EXECUTABLE:
+ return "house";
+ case cmTarget::STATIC_LIBRARY:
+ return "diamond";
+ case cmTarget::SHARED_LIBRARY:
+ return "polygon";
+ case cmTarget::MODULE_LIBRARY:
+ return "octagon";
+ default:
+ break;
+ }
+
+ return "box";
+}
+
+
+cmGraphVizWriter::cmGraphVizWriter(const std::vector<cmLocalGenerator*>&
+ localGenerators)
+:GraphType("digraph")
+,GraphName("GG")
+,GraphHeader("node [\n fontsize = \"12\"\n];")
+,GraphNodePrefix("node")
+,GenerateForExecutables(true)
+,GenerateForStaticLibs(true)
+,GenerateForSharedLibs(true)
+,GenerateForModuleLibs(true)
+,LocalGenerators(localGenerators)
+,HaveTargetsAndLibs(false)
+{
+}
+
+
+void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
+ const char* fallbackSettingsFileName)
+{
+ cmake cm;
+ cmGlobalGenerator ggi;
+ ggi.SetCMakeInstance(&cm);
+ std::auto_ptr<cmLocalGenerator> lg(ggi.CreateLocalGenerator());
+ cmMakefile *mf = lg->GetMakefile();
+
+ const char* inFileName = settingsFileName;
+
+ if ( !cmSystemTools::FileExists(inFileName) )
+ {
+ inFileName = fallbackSettingsFileName;
+ if ( !cmSystemTools::FileExists(inFileName) )
+ {
+ return;
+ }
+ }
+
+ if ( !mf->ReadListFile(0, inFileName) )
+ {
+ cmSystemTools::Error("Problem opening GraphViz options file: ",
+ inFileName);
+ return;
+ }
+
+ std::cout << "Reading GraphViz options file: " << inFileName << std::endl;
+
+#define __set_if_set(var, cmakeDefinition) \
+ { \
+ const char* value = mf->GetDefinition(cmakeDefinition); \
+ if ( value ) \
+ { \
+ var = value; \
+ } \
+ }
+
+ __set_if_set(this->GraphType, "GRAPHVIZ_GRAPH_TYPE");
+ __set_if_set(this->GraphName, "GRAPHVIZ_GRAPH_NAME");
+ __set_if_set(this->GraphHeader, "GRAPHVIZ_GRAPH_HEADER");
+ __set_if_set(this->GraphNodePrefix, "GRAPHVIZ_NODE_PREFIX");
+
+#define __set_bool_if_set(var, cmakeDefinition) \
+ { \
+ const char* value = mf->GetDefinition(cmakeDefinition); \
+ if ( value ) \
+ { \
+ var = mf->IsOn(cmakeDefinition); \
+ } \
+ }
+
+ __set_bool_if_set(this->GenerateForExecutables, "GRAPHVIZ_EXECUTABLES");
+ __set_bool_if_set(this->GenerateForStaticLibs, "GRAPHVIZ_STATIC_LIBS");
+ __set_bool_if_set(this->GenerateForSharedLibs, "GRAPHVIZ_SHARED_LIBS");
+ __set_bool_if_set(this->GenerateForModuleLibs , "GRAPHVIZ_MODULE_LIBS");
+
+ cmStdString tmpRegexString;
+ __set_if_set(tmpRegexString, "GRAPHVIZ_TARGET_IGNORE_REGEX");
+ if (tmpRegexString.size() > 0)
+ {
+ if (!this->TargetIgnoreRegex.compile(tmpRegexString.c_str()))
+ {
+ std::cerr << "Could not compile bad regex \"" << tmpRegexString << "\""
+ << std::endl;
+ }
+ }
+
+ this->TargetsToIgnore.clear();
+ const char* ignoreTargets = mf->GetDefinition("GRAPHVIZ_IGNORE_TARGETS");
+ if ( ignoreTargets )
+ {
+ std::vector<std::string> ignoreTargetsVector;
+ cmSystemTools::ExpandListArgument(ignoreTargets,ignoreTargetsVector);
+ for(std::vector<std::string>::iterator itvIt = ignoreTargetsVector.begin();
+ itvIt != ignoreTargetsVector.end();
+ ++ itvIt )
+ {
+ this->TargetsToIgnore.insert(itvIt->c_str());
+ }
+ }
+
+}
+
+
+void cmGraphVizWriter::WritePerTargetFiles(const char* fileName)
+{
+ this->CollectTargetsAndLibs();
+
+ for(std::map<cmStdString, const cmTarget*>::const_iterator ptrIt =
+ this->TargetPtrs.begin();
+ ptrIt != this->TargetPtrs.end();
+ ++ptrIt)
+ {
+ if (ptrIt->second == NULL)
+ {
+ continue;
+ }
+
+ if (this->GenerateForTargetType(ptrIt->second->GetType()) == false)
+ {
+ continue;
+ }
+
+ std::set<std::string> insertedConnections;
+ std::set<std::string> insertedNodes;
+
+ std::string currentFilename = fileName;
+ currentFilename += ".";
+ currentFilename += ptrIt->first;
+ cmGeneratedFileStream str(currentFilename.c_str());
+ if ( !str )
+ {
+ return;
+ }
+
+ std::cout << "Writing " << currentFilename << "..." << std::endl;
+ this->WriteHeader(str);
+
+ this->WriteConnections(ptrIt->first.c_str(),
+ insertedNodes, insertedConnections, str);
+ this->WriteFooter(str);
+ }
+
+}
+
+
+void cmGraphVizWriter::WriteGlobalFile(const char* fileName)
+{
+ this->CollectTargetsAndLibs();
+
+ cmGeneratedFileStream str(fileName);
+ if ( !str )
+ {
+ return;
+ }
+ this->WriteHeader(str);
+
+ std::cout << "Writing " << fileName << "..." << std::endl;
+
+ std::set<std::string> insertedConnections;
+ std::set<std::string> insertedNodes;
+
+ for(std::map<cmStdString, const cmTarget*>::const_iterator ptrIt =
+ this->TargetPtrs.begin();
+ ptrIt != this->TargetPtrs.end();
+ ++ptrIt)
+ {
+ if (ptrIt->second == NULL)
+ {
+ continue;
+ }
+
+ if (this->GenerateForTargetType(ptrIt->second->GetType()) == false)
+ {
+ continue;
+ }
+
+ this->WriteConnections(ptrIt->first.c_str(),
+ insertedNodes, insertedConnections, str);
+ }
+ this->WriteFooter(str);
+}
+
+
+void cmGraphVizWriter::WriteHeader(cmGeneratedFileStream& str) const
+{
+ str << this->GraphType << " " << this->GraphName << " {" << std::endl;
+ str << this->GraphHeader << std::endl;
+}
+
+
+void cmGraphVizWriter::WriteFooter(cmGeneratedFileStream& str) const
+{
+ str << "}" << std::endl;
+}
+
+
+void cmGraphVizWriter::WriteConnections(const char* targetName,
+ std::set<std::string>& insertedNodes,
+ std::set<std::string>& insertedConnections,
+ cmGeneratedFileStream& str) const
+{
+ std::map<cmStdString, const cmTarget* >::const_iterator targetPtrIt =
+ this->TargetPtrs.find(targetName);
+
+ if (targetPtrIt == this->TargetPtrs.end()) // not found at all
+ {
+ return;
+ }
+
+ this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str);
+
+ if (targetPtrIt->second == NULL) // it's an external library
+ {
+ return;
+ }
+
+
+ std::string myNodeName = this->TargetNamesNodes.find(targetName)->second;
+
+ const cmTarget::LinkLibraryVectorType* ll =
+ &(targetPtrIt->second->GetOriginalLinkLibraries());
+
+ for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
+ llit != ll->end();
+ ++ llit )
+ {
+ const char* libName = llit->first.c_str();
+ std::map<cmStdString, cmStdString>::const_iterator libNameIt =
+ this->TargetNamesNodes.find(libName);
+
+ std::string connectionName = myNodeName;
+ connectionName += "-";
+ connectionName += libNameIt->second;
+ if (insertedConnections.find(connectionName) == insertedConnections.end())
+ {
+ insertedConnections.insert(connectionName);
+ this->WriteNode(libName, this->TargetPtrs.find(libName)->second,
+ insertedNodes, str);
+
+ str << " \"" << myNodeName.c_str() << "\" -> \""
+ << libNameIt->second.c_str() << "\"";
+ str << " // " << targetName << " -> " << libName << std::endl;
+ this->WriteConnections(libName, insertedNodes, insertedConnections, str);
+ }
+ }
+
+}
+
+
+void cmGraphVizWriter::WriteNode(const char* targetName,
+ const cmTarget* target,
+ std::set<std::string>& insertedNodes,
+ cmGeneratedFileStream& str) const
+{
+ if (insertedNodes.find(targetName) == insertedNodes.end())
+ {
+ insertedNodes.insert(targetName);
+ std::map<cmStdString, cmStdString>::const_iterator nameIt =
+ this->TargetNamesNodes.find(targetName);
+
+ str << " \"" << nameIt->second.c_str() << "\" [ label=\""
+ << targetName << "\" shape=\"" << getShapeForTarget(target)
+ << "\"];" << std::endl;
+ }
+}
+
+
+void cmGraphVizWriter::CollectTargetsAndLibs()
+{
+ if (this->HaveTargetsAndLibs == false)
+ {
+ this->HaveTargetsAndLibs = true;
+ int cnt = this->CollectAllTargets();
+ this->CollectAllExternalLibs(cnt);
+ }
+}
+
+
+int cmGraphVizWriter::CollectAllTargets()
+{
+ int cnt = 0;
+ // First pass get the list of all cmake targets
+ for (std::vector<cmLocalGenerator*>::const_iterator lit =
+ this->LocalGenerators.begin();
+ lit != this->LocalGenerators.end();
+ ++ lit )
+ {
+ const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
+ for ( cmTargets::const_iterator tit = targets->begin();
+ tit != targets->end();
+ ++ tit )
+ {
+ const char* realTargetName = tit->first.c_str();
+ if(this->IgnoreThisTarget(realTargetName))
+ {
+ // Skip ignored targets
+ continue;
+ }
+ //std::cout << "Found target: " << tit->first.c_str() << std::endl;
+ cmOStringStream ostr;
+ ostr << this->GraphNodePrefix << cnt++;
+ this->TargetNamesNodes[realTargetName] = ostr.str();
+ this->TargetPtrs[realTargetName] = &tit->second;
+ }
+ }
+
+ return cnt;
+}
+
+
+int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
+{
+ // Ok, now find all the stuff we link to that is not in cmake
+ for (std::vector<cmLocalGenerator*>::const_iterator lit =
+ this->LocalGenerators.begin();
+ lit != this->LocalGenerators.end();
+ ++ lit )
+ {
+ const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
+ for ( cmTargets::const_iterator tit = targets->begin();
+ tit != targets->end();
+ ++ tit )
+ {
+ const char* realTargetName = tit->first.c_str();
+ if (this->IgnoreThisTarget(realTargetName))
+ {
+ // Skip ignored targets
+ continue;
+ }
+ const cmTarget::LinkLibraryVectorType* ll =
+ &(tit->second.GetOriginalLinkLibraries());
+ for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
+ llit != ll->end();
+ ++ llit )
+ {
+ const char* libName = llit->first.c_str();
+ if (this->IgnoreThisTarget(libName))
+ {
+ // Skip ignored targets
+ continue;
+ }
+
+ std::map<cmStdString, const cmTarget*>::const_iterator tarIt =
+ this->TargetPtrs.find(libName);
+ if ( tarIt == this->TargetPtrs.end() )
+ {
+ cmOStringStream ostr;
+ ostr << this->GraphNodePrefix << cnt++;
+ this->TargetNamesNodes[libName] = ostr.str();
+ this->TargetPtrs[libName] = NULL;
+ //str << " \"" << ostr.c_str() << "\" [ label=\"" << libName
+ //<< "\" shape=\"ellipse\"];" << std::endl;
+ }
+ }
+ }
+ }
+ return cnt;
+}
+
+
+bool cmGraphVizWriter::IgnoreThisTarget(const char* name)
+{
+ if (this->TargetIgnoreRegex.is_valid())
+ {
+ if (this->TargetIgnoreRegex.find(name))
+ {
+ return true;
+ }
+ }
+ return (this->TargetsToIgnore.find(name) != this->TargetsToIgnore.end());
+}
+
+
+bool cmGraphVizWriter::GenerateForTargetType(cmTarget::TargetType targetType)
+ const
+{
+ switch (targetType)
+ {
+ case cmTarget::EXECUTABLE:
+ return this->GenerateForExecutables;
+ case cmTarget::STATIC_LIBRARY:
+ return this->GenerateForStaticLibs;
+ case cmTarget::SHARED_LIBRARY:
+ return this->GenerateForSharedLibs;
+ case cmTarget::MODULE_LIBRARY:
+ return this->GenerateForModuleLibs;
+ default:
+ break;
+ }
+ return false;
+}
diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h
new file mode 100644
index 0000000..105eb96
--- /dev/null
+++ b/Source/cmGraphVizWriter.h
@@ -0,0 +1,84 @@
+#ifndef CMGRAPHVIZWRITER_H
+#define CMGRAPHVIZWRITER_H
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ 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.
+============================================================================*/
+#include "cmStandardIncludes.h"
+#include "cmLocalGenerator.h"
+#include "cmGeneratedFileStream.h"
+#include "cmTarget.h"
+#include <cmsys/RegularExpression.hxx>
+
+
+/** This class implements writing files for graphviz (dot) for graphs
+ * representing the dependencies between the targets in the project. */
+class cmGraphVizWriter
+{
+public:
+
+ cmGraphVizWriter(const std::vector<cmLocalGenerator*>& localGenerators);
+
+ void ReadSettings(const char* settingsFileName,
+ const char* fallbackSettingsFileName);
+
+ void WritePerTargetFiles(const char* fileName);
+
+ void WriteGlobalFile(const char* fileName);
+
+protected:
+
+ void CollectTargetsAndLibs();
+
+ int CollectAllTargets();
+
+ int CollectAllExternalLibs(int cnt);
+
+ void WriteHeader(cmGeneratedFileStream& str) const;
+
+ void WriteConnections(const char* targetName,
+ std::set<std::string>& insertedNodes,
+ std::set<std::string>& insertedConnections,
+ cmGeneratedFileStream& str) const;
+
+ void WriteNode(const char* targetName, const cmTarget* target,
+ std::set<std::string>& insertedNodes,
+ cmGeneratedFileStream& str) const;
+
+ void WriteFooter(cmGeneratedFileStream& str) const;
+
+ bool IgnoreThisTarget(const char* name);
+
+ bool GenerateForTargetType(cmTarget::TargetType targetType) const;
+
+ cmStdString GraphType;
+ cmStdString GraphName;
+ cmStdString GraphHeader;
+ cmStdString GraphNodePrefix;
+
+ bool GenerateForExecutables;
+ bool GenerateForStaticLibs;
+ bool GenerateForSharedLibs;
+ bool GenerateForModuleLibs;
+
+ cmsys::RegularExpression TargetIgnoreRegex;
+
+ std::set<cmStdString> TargetsToIgnore;
+
+ const std::vector<cmLocalGenerator*>& LocalGenerators;
+
+ std::map<cmStdString, const cmTarget*> TargetPtrs;
+ // maps from the actual target names to node names in dot:
+ std::map<cmStdString, cmStdString> TargetNamesNodes;
+
+ bool HaveTargetsAndLibs;
+};
+
+#endif
diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx
index d2a07dc..a239e55 100644
--- a/Source/cmLoadCacheCommand.cxx
+++ b/Source/cmLoadCacheCommand.cxx
@@ -174,7 +174,8 @@ void cmLoadCacheCommand::CheckLine(const char* line)
// Check one line of the cache file.
std::string var;
std::string value;
- if(this->ParseEntry(line, var, value))
+ cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED;
+ if(cmCacheManager::ParseEntry(line, var, value, type))
{
// Found a real entry. See if this one was requested.
if(this->VariablesToRead.find(var) != this->VariablesToRead.end())
@@ -193,38 +194,3 @@ void cmLoadCacheCommand::CheckLine(const char* line)
}
}
}
-
-//----------------------------------------------------------------------------
-bool cmLoadCacheCommand::ParseEntry(const char* entry, std::string& var,
- std::string& value)
-{
- // input line is: key:type=value
- cmsys::RegularExpression reg("^([^:]*):([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
- // input line is: "key":type=value
- cmsys::RegularExpression
- regQuoted("^\"([^\"]*)\":([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
- bool flag = false;
- if(regQuoted.find(entry))
- {
- var = regQuoted.match(1);
- value = regQuoted.match(3);
- flag = true;
- }
- else if (reg.find(entry))
- {
- var = reg.match(1);
- value = reg.match(3);
- flag = true;
- }
-
- // if value is enclosed in single quotes ('foo') then remove them
- // it is used to enclose trailing space or tab
- if (flag &&
- value.size() >= 2 &&
- value[0] == '\'' &&
- value[value.size() - 1] == '\'')
- {
- value = value.substr(1, value.size() - 2);
- }
- return flag;
-}
diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h
index b06d94d..8ecee4a 100644
--- a/Source/cmLoadCacheCommand.h
+++ b/Source/cmLoadCacheCommand.h
@@ -83,7 +83,6 @@ protected:
bool ReadWithPrefix(std::vector<std::string> const& args);
void CheckLine(const char* line);
- bool ParseEntry(const char* entry, std::string& var, std::string& value);
};
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 5bffd52..d3cbc1f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1818,8 +1818,9 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
}
//----------------------------------------------------------------------------
-std::string cmLocalGenerator::GetRealDependency(const char* inName,
- const char* config)
+bool cmLocalGenerator::GetRealDependency(const char* inName,
+ const char* config,
+ std::string& dep)
{
// Older CMake code may specify the dependency using the target
// output file rather than the target name. Such code would have
@@ -1855,7 +1856,8 @@ std::string cmLocalGenerator::GetRealDependency(const char* inName,
// it is a full path to a depend that has the same name
// as a target but is in a different location so do not use
// the target as the depend
- return inName;
+ dep = inName;
+ return true;
}
}
switch (target->GetType())
@@ -1869,15 +1871,16 @@ std::string cmLocalGenerator::GetRealDependency(const char* inName,
// Get the location of the target's output file and depend on it.
if(const char* location = target->GetLocation(config))
{
- return location;
+ dep = location;
+ return true;
}
}
break;
case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
- // Depending on a utility target may not work but just trust
- // the user to have given a valid name.
- return inName;
+ // A utility target has no file on which to depend. This was listed
+ // only to get the target-level dependency.
+ return false;
case cmTarget::INSTALL_FILES:
case cmTarget::INSTALL_PROGRAMS:
case cmTarget::INSTALL_DIRECTORY:
@@ -1889,41 +1892,24 @@ std::string cmLocalGenerator::GetRealDependency(const char* inName,
if(cmSystemTools::FileIsFullPath(inName))
{
// This is a full path. Return it as given.
- return inName;
+ dep = inName;
+ return true;
}
// Check for a source file in this directory that matches the
// dependency.
if(cmSourceFile* sf = this->Makefile->GetSource(inName))
{
- name = sf->GetFullPath();
- return name;
+ dep = sf->GetFullPath();
+ return true;
}
// Treat the name as relative to the source directory in which it
// was given.
- name = this->Makefile->GetCurrentDirectory();
- name += "/";
- name += inName;
- return name;
-}
-
-//----------------------------------------------------------------------------
-std::string cmLocalGenerator::GetRealLocation(const char* inName,
- const char* config)
-{
- std::string outName=inName;
- // Look for a CMake target with the given name, which is an executable
- // and which can be run
- cmTarget* target = this->Makefile->FindTargetToUse(inName);
- if ((target != 0)
- && (target->GetType() == cmTarget::EXECUTABLE)
- && ((this->Makefile->IsOn("CMAKE_CROSSCOMPILING") == false)
- || (target->IsImported() == true)))
- {
- outName = target->GetLocation( config );
- }
- return outName;
+ dep = this->Makefile->GetCurrentDirectory();
+ dep += "/";
+ dep += inName;
+ return true;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 43bf1e7..35aab99 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -158,18 +158,15 @@ public:
/** Translate a dependency as given in CMake code to the name to
appear in a generated build file. If the given name is that of
+ a utility target, returns false. If the given name is that of
a CMake target it will be transformed to the real output
location of that target for the given configuration. If the
given name is the full path to a file it will be returned.
Otherwise the name is treated as a relative path with respect to
the source directory of this generator. This should only be
used for dependencies of custom commands. */
- std::string GetRealDependency(const char* name, const char* config);
-
- /** Translate a command as given in CMake code to the location of the
- executable if the command is the name of a CMake executable target.
- If that's not the case, just return the original name. */
- std::string GetRealLocation(const char* inName, const char* config);
+ bool GetRealDependency(const char* name, const char* config,
+ std::string& dep);
///! for existing files convert to output path and short path if spaces
std::string ConvertToOutputForExisting(const char* remote,
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index c5d8c0d..ff48009 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -19,6 +19,7 @@
#include "cmake.h"
#include "cmVersion.h"
#include "cmFileTimeComparison.h"
+#include "cmCustomCommandGenerator.h"
// Include dependency scanners for supported languages. Only the
// C/C++ scanner is needed for bootstrapping CMake.
@@ -902,9 +903,12 @@ cmLocalUnixMakefileGenerator3
d != cc.GetDepends().end(); ++d)
{
// Lookup the real name of the dependency in case it is a CMake target.
- std::string dep = this->GetRealDependency
- (d->c_str(), this->ConfigurationName.c_str());
- depends.push_back(dep);
+ std::string dep;
+ if(this->GetRealDependency(d->c_str(), this->ConfigurationName.c_str(),
+ dep))
+ {
+ depends.push_back(dep);
+ }
}
}
@@ -958,18 +962,15 @@ cmLocalUnixMakefileGenerator3
{
*content << dir;
}
- bool escapeOldStyle = cc.GetEscapeOldStyle();
- bool escapeAllowMakeVars = cc.GetEscapeAllowMakeVars();
+ cmCustomCommandGenerator ccg(cc, this->ConfigurationName.c_str(),
+ this->Makefile);
// Add each command line to the set of commands.
std::vector<std::string> commands1;
- for(cmCustomCommandLines::const_iterator cl = cc.GetCommandLines().begin();
- cl != cc.GetCommandLines().end(); ++cl)
+ for(unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c)
{
// Build the command line in a single string.
- const cmCustomCommandLine& commandLine = *cl;
- std::string cmd = GetRealLocation(commandLine[0].c_str(),
- this->ConfigurationName.c_str());
+ std::string cmd = ccg.GetCommand(c);
if (cmd.size())
{
// Use "call " before any invocations of .bat or .cmd files
@@ -1022,19 +1023,8 @@ cmLocalUnixMakefileGenerator3
std::string launcher =
this->MakeLauncher(cc, target, workingDir? NONE : START_OUTPUT);
cmd = launcher + this->Convert(cmd.c_str(),NONE,SHELL);
- for(unsigned int j=1; j < commandLine.size(); ++j)
- {
- cmd += " ";
- if(escapeOldStyle)
- {
- cmd += this->EscapeForShellOldStyle(commandLine[j].c_str());
- }
- else
- {
- cmd += this->EscapeForShell(commandLine[j].c_str(),
- escapeAllowMakeVars);
- }
- }
+
+ ccg.AppendArguments(c, cmd);
if(content)
{
// Rule content does not include the launcher.
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 57d8653..de2a837 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -117,3 +117,9 @@ void cmLocalVisualStudio10Generator
"Stored GUID",
cmCacheManager::INTERNAL);
}
+
+//----------------------------------------------------------------------------
+std::string cmLocalVisualStudio10Generator::CheckForErrorLine()
+{
+ return "if errorlevel 1 goto :VCEnd";
+}
diff --git a/Source/cmLocalVisualStudio10Generator.h b/Source/cmLocalVisualStudio10Generator.h
index 5694220..06b8b09 100644
--- a/Source/cmLocalVisualStudio10Generator.h
+++ b/Source/cmLocalVisualStudio10Generator.h
@@ -36,6 +36,10 @@ public:
virtual void Generate();
virtual void ReadAndStoreExternalGUID(const char* name,
const char* path);
+
+protected:
+ virtual std::string CheckForErrorLine();
+
private:
};
#endif
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index eb4e4a4..7aabf4d 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -65,13 +65,7 @@ public:
{
this->Code += "\\\n\t";
}
- this->Code +=
- this->LG->ConstructScript(cc.GetCommandLines(),
- cc.GetWorkingDirectory(),
- this->Config,
- cc.GetEscapeOldStyle(),
- cc.GetEscapeAllowMakeVars(),
- "\\\n\t");
+ this->Code += this->LG->ConstructScript(cc, this->Config, "\\\n\t");
}
private:
cmLocalVisualStudio6Generator* LG;
@@ -659,12 +653,7 @@ cmLocalVisualStudio6Generator
{
std::string config = this->GetConfigName(*i);
std::string script =
- this->ConstructScript(command.GetCommandLines(),
- command.GetWorkingDirectory(),
- config.c_str(),
- command.GetEscapeOldStyle(),
- command.GetEscapeAllowMakeVars(),
- "\\\n\t");
+ this->ConstructScript(command, config.c_str(), "\\\n\t");
if (i == this->Configurations.begin())
{
@@ -686,10 +675,12 @@ cmLocalVisualStudio6Generator
++d)
{
// Lookup the real name of the dependency in case it is a CMake target.
- std::string dep = this->GetRealDependency(d->c_str(),
- config.c_str());
- fout << "\\\n\t" <<
- this->ConvertToOptionallyRelativeOutputPath(dep.c_str());
+ std::string dep;
+ if(this->GetRealDependency(d->c_str(), config.c_str(), dep))
+ {
+ fout << "\\\n\t" <<
+ this->ConvertToOptionallyRelativeOutputPath(dep.c_str());
+ }
}
fout << "\n";
@@ -847,7 +838,7 @@ cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target,
std::vector<std::string> no_depends;
cmCustomCommandLines commands;
commands.push_back(command);
- pcc.reset(new cmCustomCommand(no_output, no_depends, commands, 0, 0));
+ pcc.reset(new cmCustomCommand(0, no_output, no_depends, commands, 0, 0));
pcc->SetEscapeOldStyle(false);
pcc->SetEscapeAllowMakeVars(true);
return pcc;
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7fd7fd2..21f6460 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -427,7 +427,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] =
// The YX and Yu options are in a per-global-generator table because
// their values differ based on the VS IDE version.
{"ForcedIncludeFiles", "FI", "Forced include files", "",
- cmVS7FlagTable::UserValueRequired},
+ cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SemicolonAppendable},
// boolean flags
{"BufferSecurityCheck", "GS", "Buffer security check", "TRUE", 0},
@@ -546,12 +546,7 @@ public:
{
this->Stream << this->LG->EscapeForXML("\n");
}
- std::string script =
- this->LG->ConstructScript(cc.GetCommandLines(),
- cc.GetWorkingDirectory(),
- this->Config,
- cc.GetEscapeOldStyle(),
- cc.GetEscapeAllowMakeVars());
+ std::string script = this->LG->ConstructScript(cc, this->Config);
this->Stream << this->LG->EscapeForXML(script.c_str());
}
private:
@@ -802,7 +797,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
tool = "VFMIDLTool";
}
fout << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"\n";
- targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n");
fout << "\t\t\t\tMkTypLibCompatible=\"FALSE\"\n";
if( this->PlatformName == "x64" )
{
@@ -1033,7 +1027,12 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
temp += "/";
temp += targetNameImport;
fout << "\t\t\t\tImportLibrary=\""
- << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"/>\n";
+ << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"";
+ if(this->FortranProject)
+ {
+ fout << "\n\t\t\t\tLinkDLL=\"true\"";
+ }
+ fout << "/>\n";
}
break;
case cmTarget::EXECUTABLE:
@@ -1591,12 +1590,7 @@ WriteCustomRule(std::ostream& fout,
<< this->EscapeForXML(fc.CompileFlags.c_str()) << "\"/>\n";
}
- std::string script =
- this->ConstructScript(command.GetCommandLines(),
- command.GetWorkingDirectory(),
- i->c_str(),
- command.GetEscapeOldStyle(),
- command.GetEscapeAllowMakeVars());
+ std::string script = this->ConstructScript(command, i->c_str());
fout << "\t\t\t\t\t<Tool\n"
<< "\t\t\t\t\tName=\"" << customTool << "\"\n"
<< "\t\t\t\t\tDescription=\""
@@ -1624,9 +1618,12 @@ WriteCustomRule(std::ostream& fout,
++d)
{
// Get the real name of the dependency in case it is a CMake target.
- std::string dep = this->GetRealDependency(d->c_str(), i->c_str());
- fout << this->ConvertToXMLOutputPath(dep.c_str())
- << ";";
+ std::string dep;
+ if(this->GetRealDependency(d->c_str(), i->c_str(), dep))
+ {
+ fout << this->ConvertToXMLOutputPath(dep.c_str())
+ << ";";
+ }
}
}
fout << "\"\n";
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index ed0b07f..9164beb 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -14,6 +14,7 @@
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
+#include "cmCustomCommandGenerator.h"
#include "windows.h"
//----------------------------------------------------------------------------
@@ -52,7 +53,7 @@ cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target,
std::vector<std::string> no_depends;
cmCustomCommandLines commands;
commands.push_back(command);
- pcc.reset(new cmCustomCommand(no_output, no_depends, commands, 0, 0));
+ pcc.reset(new cmCustomCommand(0, no_output, no_depends, commands, 0, 0));
pcc->SetEscapeOldStyle(false);
pcc->SetEscapeAllowMakeVars(true);
return pcc;
@@ -149,15 +150,29 @@ void cmLocalVisualStudioGenerator::ComputeObjectNameRequirements
}
//----------------------------------------------------------------------------
+std::string cmLocalVisualStudioGenerator::CheckForErrorLine()
+{
+ return "if errorlevel 1 goto :VCReportError";
+}
+
+//----------------------------------------------------------------------------
+std::string cmLocalVisualStudioGenerator::GetCheckForErrorLine()
+{
+ return this->CheckForErrorLine();
+}
+
+//----------------------------------------------------------------------------
std::string
cmLocalVisualStudioGenerator
-::ConstructScript(const cmCustomCommandLines& commandLines,
- const char* workingDirectory,
+::ConstructScript(cmCustomCommand const& cc,
const char* configName,
- bool escapeOldStyle,
- bool escapeAllowMakeVars,
const char* newline_text)
{
+ const cmCustomCommandLines& commandLines = cc.GetCommandLines();
+ const char* workingDirectory = cc.GetWorkingDirectory();
+ cmCustomCommandGenerator ccg(cc, configName, this->Makefile);
+ RelativeRoot relativeRoot = workingDirectory? NONE : START_OUTPUT;
+
// Avoid leading or trailing newlines.
const char* newline = "";
@@ -196,40 +211,16 @@ cmLocalVisualStudioGenerator
}
}
// Write each command on a single line.
- for(cmCustomCommandLines::const_iterator cl = commandLines.begin();
- cl != commandLines.end(); ++cl)
+ for(unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c)
{
// Start a new line.
script += newline;
newline = newline_text;
- // Start with the command name.
- const cmCustomCommandLine& commandLine = *cl;
- std::string commandName = this->GetRealLocation(commandLine[0].c_str(),
- configName);
- if(!workingDirectory)
- {
- script += this->Convert(commandName.c_str(),START_OUTPUT,SHELL);
- }
- else
- {
- script += this->Convert(commandName.c_str(),NONE,SHELL);
- }
-
- // Add the arguments.
- for(unsigned int j=1;j < commandLine.size(); ++j)
- {
- script += " ";
- if(escapeOldStyle)
- {
- script += this->EscapeForShellOldStyle(commandLine[j].c_str());
- }
- else
- {
- script += this->EscapeForShell(commandLine[j].c_str(),
- escapeAllowMakeVars);
- }
- }
+ // Add this command line.
+ std::string cmd = ccg.GetCommand(c);
+ script += this->Convert(cmd.c_str(), relativeRoot, SHELL);
+ ccg.AppendArguments(c, script);
// After each custom command, check for an error result.
// If there was an error, jump to the VCReportError label,
@@ -237,7 +228,7 @@ cmLocalVisualStudioGenerator
// sequence.
//
script += newline_text;
- script += "if errorlevel 1 goto VCReportError";
+ script += this->GetCheckForErrorLine();
}
return script;
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 6034b22..1954ac5 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -18,6 +18,7 @@
class cmSourceFile;
class cmSourceGroup;
+class cmCustomCommand;
/** \class cmLocalVisualStudioGenerator
* \brief Base class for Visual Studio generators.
@@ -30,15 +31,19 @@ class cmLocalVisualStudioGenerator : public cmLocalGenerator
public:
cmLocalVisualStudioGenerator();
virtual ~cmLocalVisualStudioGenerator();
+
/** Construct a script from the given list of command lines. */
- std::string ConstructScript(const cmCustomCommandLines& commandLines,
- const char* workingDirectory,
+ std::string ConstructScript(cmCustomCommand const& cc,
const char* configName,
- bool escapeOldStyle,
- bool escapeAllowMakeVars,
const char* newline = "\n");
+ /** Line of batch file text that skips to the end after
+ * a failed step in a sequence of custom commands.
+ */
+ std::string GetCheckForErrorLine();
+
protected:
+ virtual std::string CheckForErrorLine();
/** Construct a custom command to make exe import lib dir. */
cmsys::auto_ptr<cmCustomCommand>
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ccf4d7a..53f4c3c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -827,7 +827,8 @@ cmMakefile::AddCustomCommandToTarget(const char* target,
{
// Add the command to the appropriate build step for the target.
std::vector<std::string> no_output;
- cmCustomCommand cc(no_output, depends, commandLines, comment, workingDir);
+ cmCustomCommand cc(this, no_output, depends,
+ commandLines, comment, workingDir);
cc.SetEscapeOldStyle(escapeOldStyle);
cc.SetEscapeAllowMakeVars(true);
switch(type)
@@ -947,7 +948,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
if(file)
{
cmCustomCommand* cc =
- new cmCustomCommand(outputs, depends2, commandLines,
+ new cmCustomCommand(this, outputs, depends2, commandLines,
comment, workingDir);
cc->SetEscapeOldStyle(escapeOldStyle);
cc->SetEscapeAllowMakeVars(true);
@@ -1364,8 +1365,8 @@ void cmMakefile::AddLinkLibraryForTarget(const char *target,
cmOStringStream e;
e << "Attempt to add link library \""
<< lib << "\" to target \""
- << target << "\" which is not built by this project.";
- cmSystemTools::Error(e.str().c_str());
+ << target << "\" which is not built in this directory.";
+ this->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
}
}
@@ -2340,17 +2341,19 @@ void cmMakefile::AddDefaultDefinitions()
working, these variables are still also set here in this place, but they
will be reset in CMakeSystemSpecificInformation.cmake before the platform
files are executed. */
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
this->AddDefinition("WIN32", "1");
this->AddDefinition("CMAKE_HOST_WIN32", "1");
#else
this->AddDefinition("UNIX", "1");
this->AddDefinition("CMAKE_HOST_UNIX", "1");
#endif
- // Cygwin is more like unix so enable the unix commands
#if defined(__CYGWIN__)
- this->AddDefinition("UNIX", "1");
- this->AddDefinition("CMAKE_HOST_UNIX", "1");
+ if(cmSystemTools::IsOn(cmSystemTools::GetEnv("CMAKE_LEGACY_CYGWIN_WIN32")))
+ {
+ this->AddDefinition("WIN32", "1");
+ this->AddDefinition("CMAKE_HOST_WIN32", "1");
+ }
#endif
#if defined(__APPLE__)
this->AddDefinition("APPLE", "1");
@@ -3655,6 +3658,12 @@ cmTarget* cmMakefile::FindTargetToUse(const char* name)
return imported->second;
}
+ // Look for a target built in this directory.
+ if(cmTarget* t = this->FindTarget(name))
+ {
+ return t;
+ }
+
// Look for a target built in this project.
return this->LocalGenerator->GetGlobalGenerator()->FindTarget(0, name);
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 6b290ab..9dcd8f1 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -849,7 +849,7 @@ cmMakefileTargetGenerator
p_depends.push_back(relativeObj);
this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
temp.c_str(), p_depends, no_commands,
- true);
+ false);
}
//----------------------------------------------------------------------------
@@ -1527,6 +1527,12 @@ void cmMakefileTargetGenerator
this->LocalGenerator->AppendRuleDepend(depends,
this->BuildFileNameFull.c_str());
+ // Add a dependency on the link definitions file, if any.
+ if(!this->ModuleDefinitionFile.empty())
+ {
+ depends.push_back(this->ModuleDefinitionFile);
+ }
+
// Add dependencies on the external object files.
for(std::vector<std::string>::const_iterator obj
= this->ExternalObjects.begin();
@@ -1723,8 +1729,6 @@ const char* cmMakefileTargetGenerator::GetFortranModuleDirectory()
this->Target->GetProperty("Fortran_MODULE_DIRECTORY");
const char* moddir_flag =
this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG");
- const char* moddir_default =
- this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_DEFAULT");
if(target_mod_dir && moddir_flag)
{
// Compute the full path to the module directory.
@@ -1745,10 +1749,6 @@ const char* cmMakefileTargetGenerator::GetFortranModuleDirectory()
// Make sure the module output directory exists.
cmSystemTools::MakeDirectory(this->FortranModuleDirectory.c_str());
}
- else if(moddir_default && moddir_flag)
- {
- this->FortranModuleDirectory = moddir_default;
- }
this->FortranModuleDirectoryComputed = true;
}
@@ -1774,7 +1774,12 @@ void cmMakefileTargetGenerator::AddFortranFlags(std::string& flags)
}
// Add a module output directory flag if necessary.
- if(const char* mod_dir = this->GetFortranModuleDirectory())
+ const char* mod_dir = this->GetFortranModuleDirectory();
+ if(!mod_dir)
+ {
+ mod_dir = this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_DEFAULT");
+ }
+ if(mod_dir)
{
const char* moddir_flag =
this->Makefile->GetRequiredDefinition("CMAKE_Fortran_MODDIR_FLAG");
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index b793cd5..26328cf 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -472,7 +472,9 @@ void cmSourceFile::DefineProperties(cmake *cm)
"What programming language is the file.",
"A property that can be set to indicate what programming language "
"the source file is. If it is not set the language is determined "
- "based on the file extension. Typical values are CXX C etc.");
+ "based on the file extension. Typical values are CXX C etc. Setting "
+ "this property for a file means this file will be compiled. "
+ "Do not set this for header or files that should not be compiled.");
cm->DefineProperty
("LOCATION", cmProperty::SOURCE_FILE,
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 19f5c0f..2b4414d 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -606,7 +606,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const&
return false;
}
int leftOverLength = intStringLength - begin;
- if ( end < 0 || end > leftOverLength )
+ if ( end < -1 || end > leftOverLength )
{
cmOStringStream ostr;
ostr << "end index: " << end << " is out of range " << 0 << " - "
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ca61b1f..9a698c0 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -17,6 +17,7 @@
#include "cmGlobalGenerator.h"
#include "cmComputeLinkInformation.h"
#include "cmListFileCache.h"
+#include "cmGeneratorExpression.h"
#include <cmsys/RegularExpression.hxx>
#include <map>
#include <set>
@@ -1357,8 +1358,8 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
util = cmSystemTools::GetFilenameWithoutLastExtension(util);
}
- // Check for a non-imported target with this name.
- if(cmTarget* t = this->GlobalGenerator->FindTarget(0, util.c_str()))
+ // Check for a target with this name.
+ if(cmTarget* t = this->Makefile->FindTargetToUse(util.c_str()))
{
// If we find the target and the dep was given as a full path,
// then make sure it was not a full path to something else, and
@@ -1402,12 +1403,13 @@ cmTargetTraceDependencies
{
// Transform command names that reference targets built in this
// project to corresponding target-level dependencies.
+ cmGeneratorExpression ge(this->Makefile, 0, cc.GetBacktrace(), true);
for(cmCustomCommandLines::const_iterator cit = cc.GetCommandLines().begin();
cit != cc.GetCommandLines().end(); ++cit)
{
std::string const& command = *cit->begin();
- // Look for a non-imported target with this name.
- if(cmTarget* t = this->GlobalGenerator->FindTarget(0, command.c_str()))
+ // Check for a target with this name.
+ if(cmTarget* t = this->Makefile->FindTargetToUse(command.c_str()))
{
if(t->GetType() == cmTarget::EXECUTABLE)
{
@@ -1418,6 +1420,21 @@ cmTargetTraceDependencies
this->Target->AddUtility(command.c_str());
}
}
+
+ // Check for target references in generator expressions.
+ for(cmCustomCommandLine::const_iterator cli = cit->begin();
+ cli != cit->end(); ++cli)
+ {
+ ge.Process(*cli);
+ }
+ }
+
+ // Add target-level dependencies referenced by generator expressions.
+ std::set<cmTarget*> targets = ge.GetTargets();
+ for(std::set<cmTarget*>::iterator ti = targets.begin();
+ ti != targets.end(); ++ti)
+ {
+ this->Target->AddUtility((*ti)->GetName());
}
// Queue the custom command dependencies.
@@ -1450,6 +1467,15 @@ cmTargetTraceDependencies
//----------------------------------------------------------------------------
void cmTarget::TraceDependencies(const char* vsProjectFile)
{
+ // CMake-generated targets have no dependencies to trace. Normally tracing
+ // would find nothing anyway, but when building CMake itself the "install"
+ // target command ends up referencing the "cmake" target but we do not
+ // really want the dependency because "install" depend on "all" anyway.
+ if(this->GetType() == cmTarget::GLOBAL_TARGET)
+ {
+ return;
+ }
+
// Use a helper object to trace the dependencies.
cmTargetTraceDependencies tracer(this, this->Internal.Get(), vsProjectFile);
tracer.Trace();
@@ -3196,6 +3222,7 @@ void cmTarget::GetLibraryNames(std::string& name,
// the library version as the soversion.
soversion = version;
}
+ bool isApple = this->Makefile->IsOn("APPLE");
// Get the components of the library name.
std::string prefix;
@@ -3207,26 +3234,33 @@ void cmTarget::GetLibraryNames(std::string& name,
name = prefix+base+suffix;
// The library's soname.
-#if defined(__APPLE__)
- soName = prefix+base;
-#else
- soName = name;
-#endif
+ if(isApple)
+ {
+ soName = prefix+base;
+ }
+ else
+ {
+ soName = name;
+ }
if(soversion)
{
soName += ".";
soName += soversion;
}
-#if defined(__APPLE__)
- soName += suffix;
-#endif
+ if(isApple)
+ {
+ soName += suffix;
+ }
// The library's real name on disk.
-#if defined(__APPLE__)
- realName = prefix+base;
-#else
+ if(isApple)
+ {
+ realName = prefix+base;
+ }
+ else
+ {
realName = name;
-#endif
+ }
if(version)
{
realName += ".";
@@ -3237,9 +3271,10 @@ void cmTarget::GetLibraryNames(std::string& name,
realName += ".";
realName += soversion;
}
-#if defined(__APPLE__)
- realName += suffix;
-#endif
+ if(isApple)
+ {
+ realName += suffix;
+ }
// The import library name.
if(this->GetType() == cmTarget::SHARED_LIBRARY ||
diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h
new file mode 100644
index 0000000..258bacd
--- /dev/null
+++ b/Source/cmTargetDepend.h
@@ -0,0 +1,48 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2010 Kitware, Inc., Insight Software Consortium
+
+ 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.
+============================================================================*/
+#ifndef cmTargetDepend_h
+#define cmTargetDepend_h
+
+#include "cmStandardIncludes.h"
+
+class cmTarget;
+
+/** One edge in the global target dependency graph.
+ It may be marked as a 'link' or 'util' edge or both. */
+class cmTargetDepend
+{
+ cmTarget* Target;
+
+ // The set order depends only on the Target, so we use
+ // mutable members to acheive a map with set syntax.
+ mutable bool Link;
+ mutable bool Util;
+public:
+ cmTargetDepend(cmTarget* t): Target(t), Link(false), Util(false) {}
+ operator cmTarget*() const { return this->Target; }
+ cmTarget* operator->() const { return this->Target; }
+ cmTarget& operator*() const { return *this->Target; }
+ friend bool operator < (cmTargetDepend const& l, cmTargetDepend const& r)
+ { return l.Target < r.Target; }
+ void SetType(bool strong) const
+ {
+ if(strong) { this->Util = true; }
+ else { this->Link = true; }
+ }
+ bool IsLink() const { return this->Link; }
+ bool IsUtil() const { return this->Util; }
+};
+
+/** Unordered set of (direct) dependencies of a target. */
+class cmTargetDependSet: public std::set<cmTargetDepend> {};
+
+#endif
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index 43a0d7c..ce57df7 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -62,6 +62,10 @@ public:
" target_link_libraries(<target> [item1 [item2 [...]]]\n"
" [[debug|optimized|general] <item>] ...)\n"
"Specify libraries or flags to use when linking a given target. "
+ "The named <target> must have been created in the current directory "
+ "by a command such as add_executable or add_library. "
+ "The remaining arguments specify library names or flags."
+ "\n"
"If a library name matches that of another target in the project "
"a dependency will automatically be added in the build system to make "
"sure the library being linked is up-to-date before the target links. "
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index 4e9b973..c25a8b6 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -196,4 +196,10 @@ void cmTest::DefineProperties(cmake *cm)
"If set to true, this will invert the pass/fail flag of the test.",
"This property can be used for tests that are expected to fail and "
"return a non zero return code.");
+
+ cm->DefineProperty
+ ("WORKING_DIRECTORY", cmProperty::TEST,
+ "The directory from which the test executable will be called.",
+ "If this is not set it is called from the directory the test executable "
+ "is located in.");
}
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 524be8b..ab282b0 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -244,6 +244,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurations()
void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
{
+ cmGlobalVisualStudio10Generator* gg =
+ static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
std::vector<std::string> *configs =
static_cast<cmGlobalVisualStudio7Generator *>
(this->GlobalGenerator)->GetConfigurations();
@@ -291,6 +293,13 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
{
this->WriteString("<CharacterSet>MultiByte</CharacterSet>\n", 2);
}
+ if(const char* toolset = gg->GetPlatformToolset())
+ {
+ std::string pts = "<PlatformToolset>";
+ pts += toolset;
+ pts += "</PlatformToolset>\n";
+ this->WriteString(pts.c_str(), 2);
+ }
this->WriteString("</PropertyGroup>\n", 1);
}
}
@@ -367,13 +376,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
i != configs->end(); ++i)
{
std::string script =
- cmVS10EscapeXML(
- lg->ConstructScript(command.GetCommandLines(),
- command.GetWorkingDirectory(),
- i->c_str(),
- command.GetEscapeOldStyle(),
- command.GetEscapeAllowMakeVars())
- );
+ cmVS10EscapeXML(lg->ConstructScript(command, i->c_str()));
this->WritePlatformConfigTag("Message",i->c_str(), 3);
(*this->BuildFileStream ) << cmVS10EscapeXML(comment) << "</Message>\n";
this->WritePlatformConfigTag("Command", i->c_str(), 3);
@@ -386,10 +389,12 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
d != command.GetDepends().end();
++d)
{
- std::string dep = this->LocalGenerator->
- GetRealDependency(d->c_str(), i->c_str());
- this->ConvertToWindowsSlash(dep);
- (*this->BuildFileStream ) << ";" << dep;
+ std::string dep;
+ if(this->LocalGenerator->GetRealDependency(d->c_str(), i->c_str(), dep))
+ {
+ this->ConvertToWindowsSlash(dep);
+ (*this->BuildFileStream ) << ";" << dep;
+ }
}
(*this->BuildFileStream ) << ";%(AdditionalInputs)</AdditionalInputs>\n";
this->WritePlatformConfigTag("Outputs", i->c_str(), 3);
@@ -431,6 +436,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
std::vector<cmSourceFile*> customBuild;
std::vector<cmSourceFile*> none;
std::vector<cmSourceFile*> headers;
+ std::vector<cmSourceFile*> idls;
std::vector<cmSourceFile*> resource;
for(std::vector<cmSourceFile*>::const_iterator s = classes.begin();
@@ -453,7 +459,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
{
clCompile.push_back(sf);
}
- if(strcmp(lang, "RC") == 0)
+ else if(strcmp(lang, "RC") == 0)
{
resource.push_back(sf);
}
@@ -465,6 +471,10 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
{
headers.push_back(sf);
}
+ else if(sf->GetExtension() == "idl")
+ {
+ idls.push_back(sf);
+ }
else
{
none.push_back(sf);
@@ -493,6 +503,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
this->WriteGroupSources("ClCompile", clCompile, sourceGroups);
this->WriteGroupSources("ClInclude", headers, sourceGroups);
this->WriteGroupSources("ResourceCompile", resource, sourceGroups);
+ this->WriteGroupSources("Midl", idls, sourceGroups);
this->WriteGroupSources("CustomBuild", customBuild, sourceGroups);
this->WriteString("<ItemGroup>\n", 1);
@@ -646,7 +657,7 @@ void cmVisualStudio10TargetGenerator::WriteObjSources()
void cmVisualStudio10TargetGenerator::WriteCLSources()
{
- if(this->Target->GetType() > cmTarget::MODULE_LIBRARY)
+ if(this->Target->GetType() > cmTarget::UTILITY)
{
return;
}
@@ -665,6 +676,7 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
const char* lang = (*source)->GetLanguage();
bool cl = lang && (strcmp(lang, "C") == 0 || strcmp(lang, "CXX") ==0);
bool rc = lang && (strcmp(lang, "RC") == 0);
+ bool idl = (*source)->GetExtension() == "idl";
std::string sourceFile = (*source)->GetFullPath();
sourceFile = cmSystemTools::RelativePath(
this->Makefile->GetCurrentOutputDirectory(),
@@ -683,13 +695,17 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
{
this->WriteString("<ResourceCompile Include=\"", 2);
}
+ else if(idl)
+ {
+ this->WriteString("<Midl Include=\"", 2);
+ }
else
{
this->WriteString("<None Include=\"", 2);
}
(*this->BuildFileStream ) << sourceFile << "\"";
// ouput any flags specific to this source file
- if(cl && this->OutputSourceSpecificFlags(*source))
+ if(!header && cl && this->OutputSourceSpecificFlags(*source))
{
// if the source file has specific flags the tag
// is ended on a new line
@@ -1128,10 +1144,13 @@ OutputIncludes(std::vector<std::string> const & includes)
void cmVisualStudio10TargetGenerator::
-WriteRCOptions(std::string const& ,
+WriteRCOptions(std::string const& configName,
std::vector<std::string> const & includes)
{
this->WriteString("<ResourceCompile>\n", 2);
+ Options& clOptions = *(this->ClOptions[configName]);
+ clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
+ "\n");
this->OutputIncludes(includes);
this->WriteString("</ResourceCompile>\n", 2);
}
@@ -1389,11 +1408,20 @@ WriteMidlOptions(std::string const& /*config*/,
{
this->WriteString("<Midl>\n", 2);
this->OutputIncludes(includes);
+ this->WriteString("<OutputDirectory>$(IntDir)</OutputDirectory>\n", 3);
+ this->WriteString("<HeaderFileName>%(Filename).h</HeaderFileName>\n", 3);
+ this->WriteString(
+ "<TypeLibraryName>%(Filename).tlb</TypeLibraryName>\n", 3);
+ this->WriteString(
+ "<InterfaceIdentifierFileName>"
+ "%(Filename)_i.c</InterfaceIdentifierFileName>\n", 3);
+ this->WriteString("<ProxyFileName>%(Filename)_p.c</ProxyFileName>\n",3);
this->WriteString("</Midl>\n", 2);
}
-
+
+
void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
-{
+{
std::vector<std::string> *configs =
static_cast<cmGlobalVisualStudio7Generator *>
(this->GlobalGenerator)->GetConfigurations();
@@ -1458,13 +1486,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
script += pre;
pre = "\n";
script +=
- cmVS10EscapeXML(
- lg->ConstructScript(command.GetCommandLines(),
- command.GetWorkingDirectory(),
- configName.c_str(),
- command.GetEscapeOldStyle(),
- command.GetEscapeAllowMakeVars())
- );
+ cmVS10EscapeXML(lg->ConstructScript(command, configName.c_str()));
}
comment = cmVS10EscapeComment(comment);
this->WriteString("<Message>",3);
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index f1bad9c..9acae0d 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -85,17 +85,15 @@ void cmVisualStudioGeneratorOptions::SetVerboseMakefile(bool verbose)
// was not given explicitly in the flags we want to add an attribute
// to the generated project to disable logo suppression. Otherwise
// the GUI default is to enable suppression.
+ //
+ // Avoid this on Visual Studio 10 (and later!) because it results in:
+ // "cl ... warning D9035: option 'nologo-' has been deprecated"
+ //
if(verbose &&
+ this->Version != 10 &&
this->FlagMap.find("SuppressStartupBanner") == this->FlagMap.end())
{
- if(this->Version == 10)
- {
- this->FlagMap["SuppressStartupBanner"] = "false";
- }
- else
- {
- this->FlagMap["SuppressStartupBanner"] = "FALSE";
- }
+ this->FlagMap["SuppressStartupBanner"] = "FALSE";
}
}
diff --git a/Source/cmWin32ProcessExecution.cxx b/Source/cmWin32ProcessExecution.cxx
index d9bd26c..f37e0ff 100644
--- a/Source/cmWin32ProcessExecution.cxx
+++ b/Source/cmWin32ProcessExecution.cxx
@@ -290,7 +290,8 @@ static BOOL RealPopenCreateProcess(const char *cmdstring,
{
PROCESS_INFORMATION piProcInfo;
STARTUPINFO siStartInfo;
- char *s1=0,*s2=0, *s3 = " /c ";
+ char *s1=0,*s2=0;
+ const char *s3 = " /c ";
int i = GetEnvironmentVariable("COMSPEC",NULL,0);
if (i)
{
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 2ebd165..1b49837 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -26,6 +26,7 @@
#include "cmDocumentationFormatterText.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
+# include "cmGraphVizWriter.h"
# include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback.
# include "cmVariableWatch.h"
# include <cmsys/Terminal.h>
@@ -169,7 +170,7 @@ cmake::cmake()
this->ProgressCallback = 0;
this->ProgressCallbackClientData = 0;
this->ScriptMode = false;
-
+
#ifdef CMAKE_BUILD_WITH_CMAKE
this->VariableWatch = new cmVariableWatch;
this->VariableWatch->AddWatch("CMAKE_WORDS_BIGENDIAN",
@@ -362,8 +363,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
std::string var, value;
cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED;
- if(cmCacheManager::ParseEntry(entry.c_str(), var, value, type) ||
- cmCacheManager::ParseEntry(entry.c_str(), var, value))
+ if(cmCacheManager::ParseEntry(entry.c_str(), var, value, type))
{
this->CacheManager->AddCacheEntry(var.c_str(), value.c_str(),
"No help, variable specified on the command line.", type);
@@ -382,7 +382,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
this->DoSuppressDevWarnings = true;
}
else if(arg.find("-Wdev",0) == 0)
- {
+ {
this->SuppressDevWarnings = false;
this->DoSuppressDevWarnings = true;
}
@@ -406,7 +406,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
cmsys::Glob::PatternToRegex(entryPattern.c_str(), true, true).c_str());
//go through all cache entries and collect the vars which will be removed
std::vector<std::string> entriesToDelete;
- cmCacheManager::CacheIterator it =
+ cmCacheManager::CacheIterator it =
this->CacheManager->GetCacheIterator();
for ( it.Begin(); !it.IsAtEnd(); it.Next() )
{
@@ -422,8 +422,8 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
// now remove them from the cache
- for(std::vector<std::string>::const_iterator currentEntry =
- entriesToDelete.begin();
+ for(std::vector<std::string>::const_iterator currentEntry =
+ entriesToDelete.begin();
currentEntry != entriesToDelete.end();
++currentEntry)
{
@@ -791,7 +791,7 @@ int cmake::AddCMakePaths()
cMakeSelf += "/cmake";
std::cerr << cMakeSelf.c_str() << "\n";
}
-#endif
+#endif
if(!cmSystemTools::FileExists(cMakeSelf.c_str()))
{
cmSystemTools::Error("CMake executable cannot be found at ",
@@ -802,12 +802,12 @@ int cmake::AddCMakePaths()
this->CacheManager->AddCacheEntry
("CMAKE_COMMAND",cMakeSelf.c_str(), "Path to CMake executable.",
cmCacheManager::INTERNAL);
- // if the edit command is not yet in the cache,
+ // if the edit command is not yet in the cache,
// or if CMakeEditCommand has been set on this object,
// then set the CMAKE_EDIT_COMMAND in the cache
// This will mean that the last gui to edit the cache
// will be the one that make edit_cache uses.
- if(!this->GetCacheDefinition("CMAKE_EDIT_COMMAND")
+ if(!this->GetCacheDefinition("CMAKE_EDIT_COMMAND")
|| !this->CMakeEditCommand.empty())
{
// Find and save the command to edit the cache
@@ -815,8 +815,8 @@ int cmake::AddCMakePaths()
if(!this->CMakeEditCommand.empty())
{
editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf)
- + std::string("/")
- + this->CMakeEditCommand
+ + std::string("/")
+ + this->CMakeEditCommand
+ cmSystemTools::GetFilenameExtension(cMakeSelf);
}
if( !cmSystemTools::FileExists(editCacheCommand.c_str()))
@@ -936,7 +936,7 @@ void CMakeCommandUsage(const char* program)
errorStream
<< "cmake bootstrap\n";
#endif
- // If you add new commands, change here,
+ // If you add new commands, change here,
// and in cmakemain.cxx in the options table
errorStream
<< "Usage: " << program << " -E [command] [arguments ...]\n"
@@ -1091,7 +1091,7 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
return 0;
}
#endif
-
+
else if (args[1] == "make_directory" && args.size() == 3)
{
if(!cmSystemTools::MakeDirectory(args[2].c_str()))
@@ -1342,7 +1342,7 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
}
return 0;
}
-
+
// Command to create a symbolic link. Fails on platforms not
// supporting them.
else if (args[1] == "create_symlink" && args.size() == 4)
@@ -1410,7 +1410,7 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
// Use the make system's VERBOSE environment variable to enable
// verbose output. This can be skipped by also setting CMAKE_NO_VERBOSE
// (which is set by the Eclipse and KDevelop generators).
- bool verbose = ((cmSystemTools::GetEnv("VERBOSE") != 0)
+ bool verbose = ((cmSystemTools::GetEnv("VERBOSE") != 0)
&& (cmSystemTools::GetEnv("CMAKE_NO_VERBOSE") == 0));
// Create a cmake object instance to process dependencies.
@@ -1635,14 +1635,14 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
return 1;
}
-void cmake::AddExtraGenerator(const char* name,
+void cmake::AddExtraGenerator(const char* name,
CreateExtraGeneratorFunctionType newFunction)
{
cmExternalMakefileProjectGenerator* extraGenerator = newFunction();
const std::vector<std::string>& supportedGlobalGenerators =
extraGenerator->GetSupportedGlobalGenerators();
- for(std::vector<std::string>::const_iterator
+ for(std::vector<std::string>::const_iterator
it = supportedGlobalGenerators.begin();
it != supportedGlobalGenerators.end();
++it )
@@ -1670,11 +1670,11 @@ void cmake::AddDefaultExtraGenerators()
#endif
#ifdef CMAKE_USE_KDEVELOP
- this->AddExtraGenerator(cmGlobalKdevelopGenerator::GetActualName(),
+ this->AddExtraGenerator(cmGlobalKdevelopGenerator::GetActualName(),
&cmGlobalKdevelopGenerator::New);
- // for kdevelop also add the generator with just the name of the
+ // for kdevelop also add the generator with just the name of the
// extra generator, since it was this way since cmake 2.2
- this->ExtraGenerators[cmGlobalKdevelopGenerator::GetActualName()]
+ this->ExtraGenerators[cmGlobalKdevelopGenerator::GetActualName()]
= &cmGlobalKdevelopGenerator::New;
#endif
@@ -1690,7 +1690,7 @@ void cmake::GetRegisteredGenerators(std::vector<std::string>& names)
{
names.push_back(i->first);
}
- for(RegisteredExtraGeneratorsMap::const_iterator
+ for(RegisteredExtraGeneratorsMap::const_iterator
i = this->ExtraGenerators.begin();
i != this->ExtraGenerators.end(); ++i)
{
@@ -1828,7 +1828,7 @@ int cmake::DoPreConfigureChecks()
// do a sanity check on some values
if(this->CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY"))
{
- std::string cacheStart =
+ std::string cacheStart =
this->CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY");
cacheStart += "/CMakeLists.txt";
std::string currentStart = this->GetHomeDirectory();
@@ -1872,13 +1872,13 @@ int cmake::HandleDeleteCacheVariables(const char* var)
cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator();
std::vector<SaveCacheEntry> saved;
cmOStringStream warning;
- warning
+ warning
<< "You have changed variables that require your cache to be deleted.\n"
<< "Configure will be re-run and you may have to reset some variables.\n"
<< "The following variables have changed:\n";
for(std::vector<std::string>::iterator i = argsSplit.begin();
i != argsSplit.end(); ++i)
- {
+ {
SaveCacheEntry save;
save.key = *i;
warning << *i << "= ";
@@ -1892,7 +1892,7 @@ int cmake::HandleDeleteCacheVariables(const char* var)
}
saved.push_back(save);
}
-
+
// remove the cache
this->CacheManager->DeleteCache(this->GetStartOutputDirectory());
// load the empty cache
@@ -1964,7 +1964,7 @@ int cmake::ActualConfigure()
if ( !res )
{
this->CacheManager->AddCacheEntry
- ("CMAKE_HOME_DIRECTORY",
+ ("CMAKE_HOME_DIRECTORY",
this->GetHomeDirectory(),
"Start directory with the top level CMakeLists.txt file for this "
"project",
@@ -1974,9 +1974,9 @@ int cmake::ActualConfigure()
// no generator specified on the command line
if(!this->GlobalGenerator)
{
- const char* genName =
+ const char* genName =
this->CacheManager->GetCacheValue("CMAKE_GENERATOR");
- const char* extraGenName =
+ const char* extraGenName =
this->CacheManager->GetCacheValue("CMAKE_EXTRA_GENERATOR");
if(genName)
{
@@ -1998,7 +1998,7 @@ int cmake::ActualConfigure()
this->SetGlobalGenerator(new cmGlobalBorlandMakefileGenerator);
#elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW)
std::string installedCompiler;
- // Try to find the newest VS installed on the computer and
+ // Try to find the newest VS installed on the computer and
// use that as a default if -G is not specified
std::string vsregBase =
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\";
@@ -2062,11 +2062,11 @@ int cmake::ActualConfigure()
}
if(!this->CacheManager->GetCacheValue("CMAKE_GENERATOR"))
{
- this->CacheManager->AddCacheEntry("CMAKE_GENERATOR",
+ this->CacheManager->AddCacheEntry("CMAKE_GENERATOR",
this->GlobalGenerator->GetName(),
"Name of generator.",
cmCacheManager::INTERNAL);
- this->CacheManager->AddCacheEntry("CMAKE_EXTRA_GENERATOR",
+ this->CacheManager->AddCacheEntry("CMAKE_EXTRA_GENERATOR",
this->GlobalGenerator->GetExtraGeneratorName(),
"Name of external makefile project generator.",
cmCacheManager::INTERNAL);
@@ -2205,7 +2205,7 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
// set the cmake command
this->CMakeCommand = args[0];
-
+
if ( !this->ScriptMode )
{
// load the cache
@@ -2330,7 +2330,7 @@ void cmake::AddCacheEntry(const char* key, const char* value,
const char* helpString,
int type)
{
- this->CacheManager->AddCacheEntry(key, value,
+ this->CacheManager->AddCacheEntry(key, value,
helpString,
cmCacheManager::CacheEntryType(type));
}
@@ -2445,8 +2445,8 @@ void cmake::UpdateProgress(const char *msg, float prog)
}
}
-void cmake::GetCommandDocumentation(std::vector<cmDocumentationEntry>& v,
- bool withCurrentCommands,
+void cmake::GetCommandDocumentation(std::vector<cmDocumentationEntry>& v,
+ bool withCurrentCommands,
bool withCompatCommands) const
{
for(RegisteredCommandsMap::const_iterator j = this->Commands.begin();
@@ -2457,7 +2457,7 @@ void cmake::GetCommandDocumentation(std::vector<cmDocumentationEntry>& v,
{
continue;
}
-
+
cmDocumentationEntry e((*j).second->GetName(),
(*j).second->GetTerseDocumentation(),
(*j).second->GetFullDocumentation());
@@ -2493,7 +2493,7 @@ void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v)
delete generator;
v.push_back(e);
}
- for(RegisteredExtraGeneratorsMap::const_iterator
+ for(RegisteredExtraGeneratorsMap::const_iterator
i = this->ExtraGenerators.begin(); i != this->ExtraGenerators.end(); ++i)
{
cmDocumentationEntry e;
@@ -2508,7 +2508,7 @@ void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v)
void cmake::UpdateConversionPathTable()
{
// Update the path conversion table with any specified file:
- const char* tablepath =
+ const char* tablepath =
this->CacheManager->GetCacheValue("CMAKE_PATH_TRANSLATION_FILE");
if(tablepath)
@@ -2540,7 +2540,7 @@ int cmake::CheckBuildSystem()
// the make system's VERBOSE environment variable to enable verbose
// output. This can be skipped by setting CMAKE_NO_VERBOSE (which is set
// by the Eclipse and KDevelop generators).
- bool verbose = ((cmSystemTools::GetEnv("VERBOSE") != 0)
+ bool verbose = ((cmSystemTools::GetEnv("VERBOSE") != 0)
&& (cmSystemTools::GetEnv("CMAKE_NO_VERBOSE") == 0));
// This method will check the integrity of the build system if the
@@ -2549,7 +2549,7 @@ int cmake::CheckBuildSystem()
// If no file is provided for the check, we have to rerun.
if(this->CheckBuildSystemArgument.size() == 0)
- {
+ {
if(verbose)
{
cmOStringStream msg;
@@ -2565,7 +2565,7 @@ int cmake::CheckBuildSystem()
if(verbose)
{
cmOStringStream msg;
- msg << "Re-run cmake missing file: "
+ msg << "Re-run cmake missing file: "
<< this->CheckBuildSystemArgument.c_str() << "\n";
cmSystemTools::Stdout(msg.str().c_str());
}
@@ -2585,7 +2585,7 @@ int cmake::CheckBuildSystem()
if(verbose)
{
cmOStringStream msg;
- msg << "Re-run cmake error reading : "
+ msg << "Re-run cmake error reading : "
<< this->CheckBuildSystemArgument.c_str() << "\n";
cmSystemTools::Stdout(msg.str().c_str());
}
@@ -2835,253 +2835,27 @@ const char* cmake::GetCPackCommand()
return this->CPackCommand.c_str();
}
+
void cmake::GenerateGraphViz(const char* fileName) const
{
- cmGeneratedFileStream str(fileName);
- if ( !str )
- {
- return;
- }
- cmake cm;
- cmGlobalGenerator ggi;
- ggi.SetCMakeInstance(&cm);
- std::auto_ptr<cmLocalGenerator> lg(ggi.CreateLocalGenerator());
- cmMakefile *mf = lg->GetMakefile();
-
- std::string infile = this->GetHomeOutputDirectory();
- infile += "/CMakeGraphVizOptions.cmake";
- if ( !cmSystemTools::FileExists(infile.c_str()) )
- {
- infile = this->GetHomeDirectory();
- infile += "/CMakeGraphVizOptions.cmake";
- if ( !cmSystemTools::FileExists(infile.c_str()) )
- {
- infile = "";
- }
- }
-
- if ( !infile.empty() )
- {
- if ( !mf->ReadListFile(0, infile.c_str()) )
- {
- cmSystemTools::Error("Problem opening GraphViz options file: ",
- infile.c_str());
- return;
- }
- std::cout << "Read GraphViz options file: " << infile.c_str()
- << std::endl;
- }
-
-#define __set_if_not_set(var, value, cmakeDefinition) \
- const char* var = mf->GetDefinition(cmakeDefinition); \
- if ( !var ) \
- { \
- var = value; \
- }
- __set_if_not_set(graphType, "digraph", "GRAPHVIZ_GRAPH_TYPE");
- __set_if_not_set(graphName, "GG", "GRAPHVIZ_GRAPH_NAME");
- __set_if_not_set(graphHeader, "node [\n fontsize = \"12\"\n];",
- "GRAPHVIZ_GRAPH_HEADER");
- __set_if_not_set(graphNodePrefix, "node", "GRAPHVIZ_NODE_PREFIX");
- const char* ignoreTargets = mf->GetDefinition("GRAPHVIZ_IGNORE_TARGETS");
- std::set<cmStdString> ignoreTargetsSet;
- if ( ignoreTargets )
- {
- std::vector<std::string> ignoreTargetsVector;
- cmSystemTools::ExpandListArgument(ignoreTargets,ignoreTargetsVector);
- std::vector<std::string>::iterator itvIt;
- for ( itvIt = ignoreTargetsVector.begin();
- itvIt != ignoreTargetsVector.end();
- ++ itvIt )
- {
- ignoreTargetsSet.insert(itvIt->c_str());
- }
- }
-
- str << graphType << " " << graphName << " {" << std::endl;
- str << graphHeader << std::endl;
-
- const cmGlobalGenerator* gg = this->GetGlobalGenerator();
- const std::vector<cmLocalGenerator*>& localGenerators =
- gg->GetLocalGenerators();
- std::vector<cmLocalGenerator*>::const_iterator lit;
- // for target deps
- // 1 - cmake target
- // 2 - external target
- // 0 - no deps
- std::map<cmStdString, int> targetDeps;
- std::map<cmStdString, const cmTarget*> targetPtrs;
- std::map<cmStdString, cmStdString> targetNamesNodes;
- int cnt = 0;
- // First pass get the list of all cmake targets
- for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
- {
- const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
- cmTargets::const_iterator tit;
- for ( tit = targets->begin(); tit != targets->end(); ++ tit )
- {
- const char* realTargetName = tit->first.c_str();
- if ( ignoreTargetsSet.find(realTargetName) != ignoreTargetsSet.end() )
- {
- // Skip ignored targets
- continue;
- }
- //std::cout << "Found target: " << tit->first.c_str() << std::endl;
- cmOStringStream ostr;
- ostr << graphNodePrefix << cnt++;
- targetNamesNodes[realTargetName] = ostr.str();
- targetPtrs[realTargetName] = &tit->second;
- }
- }
- // Ok, now find all the stuff we link to that is not in cmake
- for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
- {
- const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
- cmTargets::const_iterator tit;
- for ( tit = targets->begin(); tit != targets->end(); ++ tit )
- {
- const cmTarget::LinkLibraryVectorType* ll
- = &(tit->second.GetOriginalLinkLibraries());
- cmTarget::LinkLibraryVectorType::const_iterator llit;
- const char* realTargetName = tit->first.c_str();
- if ( ignoreTargetsSet.find(realTargetName) != ignoreTargetsSet.end() )
- {
- // Skip ignored targets
- continue;
- }
- if ( ll->size() > 0 )
- {
- targetDeps[realTargetName] = 1;
- }
- for ( llit = ll->begin(); llit != ll->end(); ++ llit )
- {
- const char* libName = llit->first.c_str();
- std::map<cmStdString, cmStdString>::const_iterator tarIt
- = targetNamesNodes.find(libName);
- if ( ignoreTargetsSet.find(libName) != ignoreTargetsSet.end() )
- {
- // Skip ignored targets
- continue;
- }
- if ( tarIt == targetNamesNodes.end() )
- {
- cmOStringStream ostr;
- ostr << graphNodePrefix << cnt++;
- targetDeps[libName] = 2;
- targetNamesNodes[libName] = ostr.str();
- //str << " \"" << ostr.c_str() << "\" [ label=\"" << libName
- //<< "\" shape=\"ellipse\"];" << std::endl;
- }
- else
- {
- std::map<cmStdString, int>::const_iterator depIt
- = targetDeps.find(libName);
- if ( depIt == targetDeps.end() )
- {
- targetDeps[libName] = 1;
- }
- }
- }
- }
- }
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ std::auto_ptr<cmGraphVizWriter> gvWriter(
+ new cmGraphVizWriter(this->GetGlobalGenerator()->GetLocalGenerators()));
- // Write out nodes
- std::map<cmStdString, int>::const_iterator depIt;
- for ( depIt = targetDeps.begin(); depIt != targetDeps.end(); ++ depIt )
- {
- const char* newTargetName = depIt->first.c_str();
- std::map<cmStdString, cmStdString>::const_iterator tarIt
- = targetNamesNodes.find(newTargetName);
- if ( tarIt == targetNamesNodes.end() )
- {
- // We should not be here.
- std::cout << __LINE__ << " Cannot find library: " << newTargetName
- << " even though it was added in the previous pass" << std::endl;
- abort();
- }
+ std::string settingsFile = this->GetHomeOutputDirectory();
+ settingsFile += "/CMakeGraphVizOptions.cmake";
+ std::string fallbackSettingsFile = this->GetHomeDirectory();
+ fallbackSettingsFile += "/CMakeGraphVizOptions.cmake";
- str << " \"" << tarIt->second.c_str() << "\" [ label=\""
- << newTargetName << "\" shape=\"";
- if ( depIt->second == 1 )
- {
- std::map<cmStdString, const cmTarget*>::const_iterator tarTypeIt =
- targetPtrs.find(newTargetName);
- if ( tarTypeIt == targetPtrs.end() )
- {
- // We should not be here.
- std::cout << __LINE__ << " Cannot find library: " << newTargetName
- << " even though it was added in the previous pass" << std::endl;
- abort();
- }
- const cmTarget* tg = tarTypeIt->second;
- switch ( tg->GetType() )
- {
- case cmTarget::EXECUTABLE:
- str << "house";
- break;
- case cmTarget::STATIC_LIBRARY:
- str << "diamond";
- break;
- case cmTarget::SHARED_LIBRARY:
- str << "polygon";
- break;
- case cmTarget::MODULE_LIBRARY:
- str << "octagon";
- break;
- default:
- str << "box";
- }
- }
- else
- {
- str << "ellipse";
- }
- str << "\"];" << std::endl;
- }
+ gvWriter->ReadSettings(settingsFile.c_str(), fallbackSettingsFile.c_str());
- // Now generate the connectivity
- for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
- {
- const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
- cmTargets::const_iterator tit;
- for ( tit = targets->begin(); tit != targets->end(); ++ tit )
- {
- std::map<cmStdString, int>::iterator dependIt
- = targetDeps.find(tit->first.c_str());
- if ( dependIt == targetDeps.end() )
- {
- continue;
- }
- std::map<cmStdString, cmStdString>::iterator cmakeTarIt
- = targetNamesNodes.find(tit->first.c_str());
- const cmTarget::LinkLibraryVectorType* ll
- = &(tit->second.GetOriginalLinkLibraries());
- cmTarget::LinkLibraryVectorType::const_iterator llit;
- for ( llit = ll->begin(); llit != ll->end(); ++ llit )
- {
- const char* libName = llit->first.c_str();
- std::map<cmStdString, cmStdString>::const_iterator tarIt
- = targetNamesNodes.find(libName);
- if ( tarIt == targetNamesNodes.end() )
- {
- // We should not be here.
- std::cout << __LINE__ << " Cannot find library: " << libName
- << " even though it was added in the previous pass" << std::endl;
- abort();
- }
- str << " \"" << cmakeTarIt->second.c_str() << "\" -> \""
- << tarIt->second.c_str() << "\"" << std::endl;
- }
- }
- }
+ gvWriter->WritePerTargetFiles(fileName);
+ gvWriter->WriteGlobalFile(fileName);
- // TODO: Use dotted or something for external libraries
- //str << " \"node0\":f4 -> \"node12\"[color=\"#0000ff\" style=dotted]"
- //<< std::endl;
- //
- str << "}" << std::endl;
+#endif
}
+
//----------------------------------------------------------------------------
int cmake::SymlinkLibrary(std::vector<std::string>& args)
{
@@ -3336,7 +3110,7 @@ int cmake::ExecuteLinkScript(std::vector<std::string>& args)
void cmake::DefineProperties(cmake *cm)
{
cm->DefineProperty
- ("REPORT_UNDEFINED_PROPERTIES", cmProperty::GLOBAL,
+ ("REPORT_UNDEFINED_PROPERTIES", cmProperty::GLOBAL,
"If set, report any undefined properties to this file.",
"If this property is set to a filename then when CMake runs "
"it will report any properties or variables that were accessed "
@@ -3344,7 +3118,7 @@ void cmake::DefineProperties(cmake *cm)
);
cm->DefineProperty
- ("TARGET_SUPPORTS_SHARED_LIBS", cmProperty::GLOBAL,
+ ("TARGET_SUPPORTS_SHARED_LIBS", cmProperty::GLOBAL,
"Does the target platform support shared libraries.",
"TARGET_SUPPORTS_SHARED_LIBS is a boolean specifying whether the target "
"platform supports shared libraries. Basically all current general "
@@ -3381,7 +3155,7 @@ void cmake::DefineProperties(cmake *cm)
"this list.This property is used by the macros in FeatureSummary.cmake.");
cm->DefineProperty
("DISABLED_FEATURES", cmProperty::GLOBAL,
- "List of features which are disabled during the CMake run.",
+ "List of features which are disabled during the CMake run.",
"List of features which are disabled during the CMake run. Be default "
"it contains the names of all packages which were not found. This is "
"determined using the <NAME>_FOUND variables. Packages which are "
@@ -3531,13 +3305,13 @@ void cmake::DefineProperty(const char *name, cmProperty::ScopeType scope,
bool chained, const char *docSection)
{
this->PropertyDefinitions[scope].DefineProperty(name,scope,ShortDescription,
- FullDescription,
+ FullDescription,
docSection,
chained);
}
cmPropertyDefinition *cmake
-::GetPropertyDefinition(const char *name,
+::GetPropertyDefinition(const char *name,
cmProperty::ScopeType scope)
{
if (this->IsPropertyDefined(name,scope))
@@ -3547,7 +3321,7 @@ cmPropertyDefinition *cmake
return 0;
}
-void cmake::RecordPropertyAccess(const char *name,
+void cmake::RecordPropertyAccess(const char *name,
cmProperty::ScopeType scope)
{
this->AccessedProperties.insert
@@ -3619,13 +3393,13 @@ void cmake::ReportUndefinedPropertyAccesses(const char *filename)
{
if (!this->IsPropertyDefined(ap->first.c_str(),ap->second) &&
aliasedProperties.find(std::pair<cmStdString,cmProperty::ScopeType>
- (ap->first,ap->second)) ==
+ (ap->first,ap->second)) ==
aliasedProperties.end())
{
const char *scopeStr = "";
switch (ap->second)
{
- case cmProperty::TARGET:
+ case cmProperty::TARGET:
scopeStr = "TARGET";
break;
case cmProperty::SOURCE_FILE:
@@ -3727,7 +3501,7 @@ const char *cmake::GetProperty(const char* prop, cmProperty::ScopeType scope)
}
else if ( propname == "COMMANDS" )
{
- cmake::RegisteredCommandsMap::iterator cmds
+ cmake::RegisteredCommandsMap::iterator cmds
= this->GetCommands()->begin();
for (unsigned int cc=0 ; cmds != this->GetCommands()->end(); ++ cmds )
{
@@ -3835,14 +3609,14 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
// we have to find the module directory, so we can copy the files
this->AddCMakePaths();
- std::string modulesPath =
+ std::string modulesPath =
this->CacheManager->GetCacheValue("CMAKE_ROOT");
modulesPath += "/Modules";
std::string inFile = modulesPath;
inFile += "/SystemInformation.cmake";
std::string outFile = destPath;
outFile += "/CMakeLists.txt";
-
+
// Copy file
if(!cmSystemTools::cmCopyFile(inFile.c_str(), outFile.c_str()))
{
@@ -3850,7 +3624,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
<< "\" to \"" << outFile.c_str() << "\".\n";
return 1;
}
-
+
// do we write to a file or to stdout?
if (resultFile.size() == 0)
{
@@ -3876,7 +3650,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
// change back to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str());
-
+
// echo results to stdout if needed
if (writeToStdout)
{
@@ -3897,7 +3671,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
fclose(fin);
}
}
-
+
// clean up the directory
cmSystemTools::RemoveADirectory(destPath.c_str());
return 0;
@@ -4016,7 +3790,7 @@ int cmake::VisualStudioLink(std::vector<std::string>& args, int type)
for(std::vector<std::string>::iterator i = args.begin();
i != args.end(); ++i)
{
- // check for nmake temporary files
+ // check for nmake temporary files
if((*i)[0] == '@' && i->find("@CMakeFiles") != 0 )
{
std::ifstream fin(i->substr(1).c_str());
@@ -4041,6 +3815,10 @@ int cmake::VisualStudioLink(std::vector<std::string>& args, int type)
{
hasIncremental = true;
}
+ if(cmSystemTools::Strucmp(i->c_str(), "/INCREMENTAL") == 0)
+ {
+ hasIncremental = true;
+ }
if(cmSystemTools::Strucmp(i->c_str(), "/MANIFEST:NO") == 0)
{
hasManifest = false;
@@ -4069,7 +3847,7 @@ int cmake::VisualStudioLink(std::vector<std::string>& args, int type)
type, hasManifest, verbose);
}
-int cmake::ParseVisualStudioLinkCommand(std::vector<std::string>& args,
+int cmake::ParseVisualStudioLinkCommand(std::vector<std::string>& args,
std::vector<cmStdString>& command,
std::string& targetName)
{
@@ -4120,7 +3898,7 @@ bool cmake::RunCommand(const char* comment,
&retCode, 0, false);
// always print the output of the command, unless
// it is the dumb rc command banner, but if the command
- // returned an error code then print the output anyway as
+ // returned an error code then print the output anyway as
// the banner may be mixed with some other important information.
if(output.find("Resource Compiler Version") == output.npos
|| retCode !=0)
@@ -4141,12 +3919,12 @@ bool cmake::RunCommand(const char* comment,
return retCode == 0;
}
-int cmake::VisualStudioLinkIncremental(std::vector<std::string>& args,
+int cmake::VisualStudioLinkIncremental(std::vector<std::string>& args,
int type, bool verbose)
{
// This follows the steps listed here:
// http://blogs.msdn.com/zakramer/archive/2006/05/22/603558.aspx
-
+
// 1. Compiler compiles the application and generates the *.obj files.
// 2. An empty manifest file is generated if this is a clean build and if
// not the previous one is reused.
@@ -4158,10 +3936,10 @@ int cmake::VisualStudioLinkIncremental(std::vector<std::string>& args,
// on.
// 5. The manifest tool (mt.exe) is then used to generate the final
// manifest.
-
+
// If the final manifest is changed, then 6 and 7 are run, if not
// they are skipped, and it is done.
-
+
// 6. The resource compiler is invoked one more time.
// 7. Finally, the Linker does another incremental link, but since the
// only thing that has changed is the *.res file that contains the
@@ -4220,7 +3998,7 @@ int cmake::VisualStudioLinkIncremental(std::vector<std::string>& args,
outputOpt += resourceFile;
rcCommand.push_back(outputOpt);
rcCommand.push_back(resourceInputFile);
- // Run rc command to create resource
+ // Run rc command to create resource
if(!cmake::RunCommand("RC Pass 1", rcCommand, verbose))
{
return -1;
@@ -4230,7 +4008,7 @@ int cmake::VisualStudioLinkIncremental(std::vector<std::string>& args,
{
return -1;
}
- // create mt command
+ // create mt command
std::string outArg("/out:");
outArg+= manifestFile;
mtCommand.push_back("/nologo");
@@ -4281,7 +4059,7 @@ int cmake::VisualStudioLinkNonIncremental(std::vector<std::string>& args,
{
return -1;
}
- // Run the link command as given
+ // Run the link command as given
linkCommand.push_back("/MANIFEST");
if(!cmake::RunCommand("LINK", linkCommand, verbose))
{
@@ -4472,7 +4250,7 @@ int cmake::Build(const std::string& dir,
makeProgram = it.GetValue();
return gen->Build(0, dir.c_str(),
projName.c_str(), target.c_str(),
- &output,
+ &output,
makeProgram.c_str(),
config.c_str(), clean, false, 0, true,
0, nativeOptions);
diff --git a/Source/cmake.h b/Source/cmake.h
index 8312795..435d38b 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -21,14 +21,14 @@
// command line arguments.
// 3) Load the cache by calling LoadCache (duh)
// 4) if you are using command line arguments with -D or -C flags then
-// call SetCacheArgs (or if for some other reason you want to modify the
+// call SetCacheArgs (or if for some other reason you want to modify the
// cache, do it now.
// 5) Finally call Configure
// 6) Let the user change values and go back to step 5
// 7) call Generate
//
// If your GUI allows the user to change the start & home directories then
-// you must at a minimum redo steps 2 through 7.
+// you must at a minimum redo steps 2 through 7.
//
@@ -50,6 +50,8 @@ class cmExternalMakefileProjectGenerator;
class cmDocumentationSection;
class cmPolicies;
class cmListFileBacktrace;
+class cmTarget;
+class cmGeneratedFileStream;
class cmake
{
@@ -73,14 +75,14 @@ class cmake
static const char *GetCMakeFilesDirectory() {return "/CMakeFiles";};
static const char *GetCMakeFilesDirectoryPostSlash() {
return "CMakeFiles/";};
-
+
//@{
/**
* Set/Get the home directory (or output directory) in the project. The
* home directory is the top directory of the project. It is where
* cmake was run. Remember that CMake processes
* CMakeLists files by recursing up the tree starting at the StartDirectory
- * and going up until it reaches the HomeDirectory.
+ * and going up until it reaches the HomeDirectory.
*/
void SetHomeDirectory(const char* dir);
const char* GetHomeDirectory() const
@@ -100,9 +102,9 @@ class cmake
* is the directory of the CMakeLists.txt file that started the current
* round of processing. Remember that CMake processes CMakeLists files by
* recursing up the tree starting at the StartDirectory and going up until
- * it reaches the HomeDirectory.
+ * it reaches the HomeDirectory.
*/
- void SetStartDirectory(const char* dir)
+ void SetStartDirectory(const char* dir)
{
this->cmStartDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
@@ -158,7 +160,7 @@ class cmake
///! Return the global generator assigned to this instance of cmake
cmGlobalGenerator* GetGlobalGenerator() { return this->GlobalGenerator; }
///! Return the global generator assigned to this instance of cmake, const
- const cmGlobalGenerator* GetGlobalGenerator() const
+ const cmGlobalGenerator* GetGlobalGenerator() const
{ return this->GlobalGenerator; }
///! Return the global generator assigned to this instance of cmake
@@ -169,25 +171,25 @@ class cmake
///! get the cmCachemManager used by this invocation of cmake
cmCacheManager *GetCacheManager() { return this->CacheManager; }
-
+
///! set the cmake command this instance of cmake should use
void SetCMakeCommand(const char* cmd) { this->CMakeCommand = cmd; }
-
+
/**
* Given a variable name, return its value (as a string).
*/
const char* GetCacheDefinition(const char*) const;
///! Add an entry into the cache
- void AddCacheEntry(const char* key, const char* value,
- const char* helpString,
+ void AddCacheEntry(const char* key, const char* value,
+ const char* helpString,
int type);
- /**
+ /**
* Execute commands during the build process. Supports options such
* as echo, remove file etc.
*/
static int ExecuteCMakeCommand(std::vector<std::string>&);
- /**
+ /**
* Get the system information and write it to the file specified
*/
int GetSystemInformation(std::vector<std::string>&);
@@ -210,16 +212,16 @@ class cmake
/** Check if a command exists. */
bool CommandExists(const char* name) const;
-
+
///! Parse command line arguments
void SetArgs(const std::vector<std::string>&);
///! Is this cmake running as a result of a TRY_COMPILE command
bool GetIsInTryCompile() { return this->InTryCompile; }
-
+
///! Is this cmake running as a result of a TRY_COMPILE command
void SetIsInTryCompile(bool i) { this->InTryCompile = i; }
-
+
///! Parse command line arguments that might set cache values
bool SetCacheArgs(const std::vector<std::string>&);
@@ -227,9 +229,9 @@ class cmake
(const char*msg, float progress, void *);
/**
* Set the function used by GUI's to receive progress updates
- * Function gets passed: message as a const char*, a progress
+ * Function gets passed: message as a const char*, a progress
* amount ranging from 0 to 1.0 and client data. The progress
- * number provided may be negative in cases where a message is
+ * number provided may be negative in cases where a message is
* to be displayed without any progress percentage.
*/
void SetProgressCallback(ProgressCallbackType f, void* clientData=0);
@@ -244,14 +246,14 @@ class cmake
cmVariableWatch* GetVariableWatch() { return this->VariableWatch; }
/** Get the documentation entries for the supported commands.
- * If withCurrentCommands is true, the documentation for the
+ * If withCurrentCommands is true, the documentation for the
* recommended set of commands is included.
* If withCompatCommands is true, the documentation for discouraged
* (compatibility) commands is included.
* You probably don't want to set both to false.
*/
- void GetCommandDocumentation(std::vector<cmDocumentationEntry>& entries,
- bool withCurrentCommands = true,
+ void GetCommandDocumentation(std::vector<cmDocumentationEntry>& entries,
+ bool withCurrentCommands = true,
bool withCompatCommands = true) const;
void GetPropertiesDocumentation(std::map<std::string,
cmDocumentationSection *>&);
@@ -278,7 +280,7 @@ class cmake
*/
void SetScriptMode(bool mode) { this->ScriptMode = mode; }
bool GetScriptMode() { return this->ScriptMode; }
-
+
///! Debug the try compile stuff by not delelting the files
bool GetDebugTryCompile(){return this->DebugTryCompile;}
void DebugTryCompileOn(){this->DebugTryCompile = true;}
@@ -310,7 +312,7 @@ class cmake
void DefineProperty(const char *name, cmProperty::ScopeType scope,
const char *ShortDescription,
const char *FullDescription,
- bool chain = false,
+ bool chain = false,
const char *variableGroup = 0);
// get property definition
@@ -338,7 +340,7 @@ class cmake
}
void SetSuppressDevWarnings(bool v)
{
- this->SuppressDevWarnings = v;
+ this->SuppressDevWarnings = v;
this->DoSuppressDevWarnings = true;
}
@@ -357,10 +359,10 @@ protected:
cmPropertyMap Properties;
std::set<std::pair<cmStdString,cmProperty::ScopeType> > AccessedProperties;
- std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>
+ std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>
PropertyDefinitions;
- typedef
+ typedef
cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)();
typedef std::map<cmStdString,
CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap;
@@ -374,15 +376,15 @@ protected:
void AddDefaultCommands();
void AddDefaultGenerators();
void AddDefaultExtraGenerators();
- void AddExtraGenerator(const char* name,
+ void AddExtraGenerator(const char* name,
CreateExtraGeneratorFunctionType newFunction);
- cmPolicies *Policies;
+ cmPolicies *Policies;
cmGlobalGenerator *GlobalGenerator;
cmCacheManager *CacheManager;
- std::string cmHomeDirectory;
+ std::string cmHomeDirectory;
std::string HomeOutputDirectory;
- std::string cmStartDirectory;
+ std::string cmStartDirectory;
std::string StartOutputDirectory;
bool SuppressDevWarnings;
bool DoSuppressDevWarnings;
@@ -393,7 +395,7 @@ protected:
///! Check if CMAKE_CACHEFILE_DIR is set. If it is not, delete the log file.
/// If it is set, truncate it to 50kb
void TruncateOutputLog(const char* fname);
-
+
/**
* Method called to check build system integrity at build time.
* Returns 1 if CMake should rerun and 0 otherwise.
@@ -416,24 +418,24 @@ protected:
static int ExecuteLinkScript(std::vector<std::string>& args);
static int VisualStudioLink(std::vector<std::string>& args, int type);
static int VisualStudioLinkIncremental(std::vector<std::string>& args,
- int type,
+ int type,
bool verbose);
static int VisualStudioLinkNonIncremental(std::vector<std::string>& args,
int type,
bool hasManifest,
bool verbose);
- static int ParseVisualStudioLinkCommand(std::vector<std::string>& args,
- std::vector<cmStdString>& command,
+ static int ParseVisualStudioLinkCommand(std::vector<std::string>& args,
+ std::vector<cmStdString>& command,
std::string& targetName);
static bool RunCommand(const char* comment,
std::vector<cmStdString>& command,
bool verbose,
int* retCodeOut = 0);
cmVariableWatch* VariableWatch;
-
+
///! Find the full path to one of the cmake programs like ctest, cpack, etc.
std::string FindCMakeProgram(const char* name) const;
-private:
+private:
cmake(const cmake&); // Not implemented.
void operator=(const cmake&); // Not implemented.
ProgressCallbackType ProgressCallback;
@@ -458,7 +460,7 @@ private:
cmFileTimeComparison* FileComparison;
std::string GraphVizFile;
std::vector<std::string> DebugConfigs;
-
+
void UpdateConversionPathTable();
};
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index bcc7a96..a35a01f 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -61,6 +61,8 @@
# If not given the install rules
# will not be in any component.
#
+# KWSYS_INSTALL_EXPORT_NAME = The EXPORT option value for install(TARGETS) calls.
+#
# Example:
#
# SET(KWSYS_INSTALL_BIN_DIR bin)
@@ -236,6 +238,9 @@ IF(COMMAND INSTALL)
# Setup library install rules.
SET(KWSYS_INSTALL_LIBRARY_RULE)
IF(KWSYS_INSTALL_LIB_DIR)
+ IF(KWSYS_INSTALL_EXPORT_NAME)
+ LIST(APPEND KWSYS_INSTALL_LIBRARY_RULE EXPORT ${KWSYS_INSTALL_EXPORT_NAME})
+ ENDIF()
# Install the shared library to the lib directory.
SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE}
LIBRARY DESTINATION ${KWSYS_INSTALL_LIB_DIR}
diff --git a/Source/kwsys/Registry.cxx b/Source/kwsys/Registry.cxx
index 284e8ad..cd521c9 100644
--- a/Source/kwsys/Registry.cxx
+++ b/Source/kwsys/Registry.cxx
@@ -401,8 +401,9 @@ bool RegistryHelper::Open(const char *toplevel, const char *subkey,
}
else
{
+ char lpClass[] = "";
res = ( RegCreateKeyEx(scope, str.str().c_str(),
- 0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
+ 0, lpClass, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
NULL, &this->HKey, &dwDummy) == ERROR_SUCCESS );
}
if ( res != 0 )
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 4818ce9..9bc659e 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -66,7 +66,6 @@
#endif
#ifdef __linux
-# include <sys/procfs.h>
# include <sys/types.h>
# include <unistd.h>
# include <fcntl.h>
@@ -151,10 +150,6 @@ public:
void RunMemoryCheck();
public:
-#define VENDOR_STRING_LENGTH (12 + 1)
-#define CHIPNAME_STRING_LENGTH (48 + 1)
-#define SERIALNUMBER_STRING_LENGTH (29 + 1)
-
typedef struct tagID
{
int Type;
@@ -163,9 +158,9 @@ public:
int Revision;
int ExtendedFamily;
int ExtendedModel;
- char ProcessorName[CHIPNAME_STRING_LENGTH];
- char Vendor[VENDOR_STRING_LENGTH];
- char SerialNumber[SERIALNUMBER_STRING_LENGTH];
+ kwsys_stl::string ProcessorName;
+ kwsys_stl::string Vendor;
+ kwsys_stl::string SerialNumber;
} ID;
typedef struct tagCPUPowerManagement
@@ -269,6 +264,10 @@ protected:
//For Haiku OS
bool QueryHaikuInfo();
+ //For QNX
+ bool QueryQNXMemory();
+ bool QueryQNXProcessor();
+
// Evaluate the memory information.
int QueryMemory();
size_t TotalVirtualMemory;
@@ -530,7 +529,12 @@ SystemInformationImplementation::SystemInformationImplementation()
this->CurrentPositionInFile = 0;
this->ChipManufacturer = UnknownManufacturer;
memset(&this->Features, 0, sizeof(CPUFeatures));
- memset(&this->ChipID, 0, sizeof(ID));
+ this->ChipID.Type = 0;
+ this->ChipID.Family = 0;
+ this->ChipID.Model = 0;
+ this->ChipID.Revision = 0;
+ this->ChipID.ExtendedFamily = 0;
+ this->ChipID.ExtendedModel = 0;
this->CPUSpeedInMHz = 0;
this->NumberOfLogicalCPU = 0;
this->NumberOfPhysicalCPU = 0;
@@ -597,6 +601,8 @@ void SystemInformationImplementation::RunCPUCheck()
this->QuerySolarisInfo();
#elif defined(__HAIKU__)
this->QueryHaikuInfo();
+#elif defined(__QNX__)
+ this->QueryQNXProcessor();
#else
this->RetreiveInformationFromCpuInfoFile();
#endif
@@ -615,6 +621,8 @@ void SystemInformationImplementation::RunMemoryCheck()
this->QuerySolarisInfo();
#elif defined(__HAIKU__)
this->QueryHaikuInfo();
+#elif defined(__QNX__)
+ this->QueryQNXMemory();
#else
this->QueryMemory();
#endif
@@ -623,7 +631,7 @@ void SystemInformationImplementation::RunMemoryCheck()
/** Get the vendor string */
const char * SystemInformationImplementation::GetVendorString()
{
- return this->ChipID.Vendor;
+ return this->ChipID.Vendor.c_str();
}
/** Get the OS Name */
@@ -726,14 +734,14 @@ kwsys_stl::string SystemInformationImplementation::GetSteppingCode()
/** Return the stepping code of the CPU present. */
const char * SystemInformationImplementation::GetExtendedProcessorName()
{
- return this->ChipID.ProcessorName;
+ return this->ChipID.ProcessorName.c_str();
}
/** Return the serial number of the processor
* in hexadecimal: xxxx-xxxx-xxxx-xxxx-xxxx-xxxx. */
const char * SystemInformationImplementation::GetProcessorSerialNumber()
{
- return this->ChipID.SerialNumber;
+ return this->ChipID.SerialNumber.c_str();
}
/** Return the logical processors per physical */
@@ -1022,21 +1030,21 @@ bool SystemInformationImplementation::RetrieveCPUFeatures()
/** Find the manufacturer given the vendor id */
void SystemInformationImplementation::FindManufacturer()
{
- if (strcmp (this->ChipID.Vendor, "GenuineIntel") == 0) this->ChipManufacturer = Intel; // Intel Corp.
- else if (strcmp (this->ChipID.Vendor, "UMC UMC UMC ") == 0) this->ChipManufacturer = UMC; // United Microelectronics Corp.
- else if (strcmp (this->ChipID.Vendor, "AuthenticAMD") == 0) this->ChipManufacturer = AMD; // Advanced Micro Devices
- else if (strcmp (this->ChipID.Vendor, "AMD ISBETTER") == 0) this->ChipManufacturer = AMD; // Advanced Micro Devices (1994)
- else if (strcmp (this->ChipID.Vendor, "CyrixInstead") == 0) this->ChipManufacturer = Cyrix; // Cyrix Corp., VIA Inc.
- else if (strcmp (this->ChipID.Vendor, "NexGenDriven") == 0) this->ChipManufacturer = NexGen; // NexGen Inc. (now AMD)
- else if (strcmp (this->ChipID.Vendor, "CentaurHauls") == 0) this->ChipManufacturer = IDT; // IDT/Centaur (now VIA)
- else if (strcmp (this->ChipID.Vendor, "RiseRiseRise") == 0) this->ChipManufacturer = Rise; // Rise
- else if (strcmp (this->ChipID.Vendor, "GenuineTMx86") == 0) this->ChipManufacturer = Transmeta; // Transmeta
- else if (strcmp (this->ChipID.Vendor, "TransmetaCPU") == 0) this->ChipManufacturer = Transmeta; // Transmeta
- else if (strcmp (this->ChipID.Vendor, "Geode By NSC") == 0) this->ChipManufacturer = NSC; // National Semiconductor
- else if (strcmp (this->ChipID.Vendor, "Sun") == 0) this->ChipManufacturer = Sun; // Sun Microelectronics
- else if (strcmp (this->ChipID.Vendor, "IBM") == 0) this->ChipManufacturer = IBM; // IBM Microelectronics
- else if (strcmp (this->ChipID.Vendor, "Motorola") == 0) this->ChipManufacturer = Motorola; // Motorola Microelectronics
- else this->ChipManufacturer = UnknownManufacturer; // Unknown manufacturer
+ if (this->ChipID.Vendor == "GenuineIntel") this->ChipManufacturer = Intel; // Intel Corp.
+ else if (this->ChipID.Vendor == "UMC UMC UMC ") this->ChipManufacturer = UMC; // United Microelectronics Corp.
+ else if (this->ChipID.Vendor == "AuthenticAMD") this->ChipManufacturer = AMD; // Advanced Micro Devices
+ else if (this->ChipID.Vendor == "AMD ISBETTER") this->ChipManufacturer = AMD; // Advanced Micro Devices (1994)
+ else if (this->ChipID.Vendor == "CyrixInstead") this->ChipManufacturer = Cyrix; // Cyrix Corp., VIA Inc.
+ else if (this->ChipID.Vendor == "NexGenDriven") this->ChipManufacturer = NexGen; // NexGen Inc. (now AMD)
+ else if (this->ChipID.Vendor == "CentaurHauls") this->ChipManufacturer = IDT; // IDT/Centaur (now VIA)
+ else if (this->ChipID.Vendor == "RiseRiseRise") this->ChipManufacturer = Rise; // Rise
+ else if (this->ChipID.Vendor == "GenuineTMx86") this->ChipManufacturer = Transmeta; // Transmeta
+ else if (this->ChipID.Vendor == "TransmetaCPU") this->ChipManufacturer = Transmeta; // Transmeta
+ else if (this->ChipID.Vendor == "Geode By NSC") this->ChipManufacturer = NSC; // National Semiconductor
+ else if (this->ChipID.Vendor == "Sun") this->ChipManufacturer = Sun; // Sun Microelectronics
+ else if (this->ChipID.Vendor == "IBM") this->ChipManufacturer = IBM; // IBM Microelectronics
+ else if (this->ChipID.Vendor == "Motorola") this->ChipManufacturer = Motorola; // Motorola Microelectronics
+ else this->ChipManufacturer = UnknownManufacturer; // Unknown manufacturer
}
@@ -1094,10 +1102,12 @@ bool SystemInformationImplementation::RetrieveCPUIdentity()
}
// Process the returned information.
- memcpy (this->ChipID.Vendor, &(localCPUVendor[0]), sizeof (int));
- memcpy (&(this->ChipID.Vendor[4]), &(localCPUVendor[1]), sizeof (int));
- memcpy (&(this->ChipID.Vendor[8]), &(localCPUVendor[2]), sizeof (int));
- this->ChipID.Vendor[12] = '\0';
+ char vbuf[13];
+ memcpy (&(vbuf[0]), &(localCPUVendor[0]), sizeof (int));
+ memcpy (&(vbuf[4]), &(localCPUVendor[1]), sizeof (int));
+ memcpy (&(vbuf[8]), &(localCPUVendor[2]), sizeof (int));
+ vbuf[12] = '\0';
+ this->ChipID.Vendor = vbuf;
this->FindManufacturer();
@@ -1546,17 +1556,17 @@ bool SystemInformationImplementation::RetrieveClassicalCPUClockSpeed()
if (this->ChipID.Family == 3)
{
// 80386 processors.... Loop time is 115 cycles!
- dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 115) / dDifference) / 1048576);
+ dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 115) / dDifference) / 1000000);
}
else if (this->ChipID.Family == 4)
{
// 80486 processors.... Loop time is 47 cycles!
- dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 47) / dDifference) / 1048576);
+ dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 47) / dDifference) / 1000000);
}
else if (this->ChipID.Family == 5)
{
// Pentium processors.... Loop time is 43 cycles!
- dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 43) / dDifference) / 1048576);
+ dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 43) / dDifference) / 1000000);
}
// Save the clock speed.
@@ -1792,7 +1802,8 @@ bool SystemInformationImplementation::RetrieveProcessorSerialNumber()
}
// Process the returned information.
- sprintf (this->ChipID.SerialNumber, "%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x",
+ char sn[128];
+ sprintf (sn, "%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x",
((SerialNumber[0] & 0xff000000) >> 24),
((SerialNumber[0] & 0x00ff0000) >> 16),
((SerialNumber[0] & 0x0000ff00) >> 8),
@@ -1805,7 +1816,7 @@ bool SystemInformationImplementation::RetrieveProcessorSerialNumber()
((SerialNumber[2] & 0x00ff0000) >> 16),
((SerialNumber[2] & 0x0000ff00) >> 8),
((SerialNumber[2] & 0x000000ff) >> 0));
-
+ this->ChipID.SerialNumber = sn;
return true;
#else
@@ -1873,6 +1884,15 @@ bool SystemInformationImplementation::RetrieveCPUPowerManagement()
#endif
}
+void SystemInformationStripLeadingSpace(kwsys_stl::string& str)
+{
+ // Because some manufacturers have leading white space - we have to post-process the name.
+ kwsys_stl::string::size_type pos = str.find_first_not_of(" ");
+ if(pos != kwsys_stl::string::npos)
+ {
+ str = str.substr(pos);
+ }
+}
/** */
bool SystemInformationImplementation::RetrieveExtendedCPUIdentity()
@@ -1886,7 +1906,6 @@ bool SystemInformationImplementation::RetrieveExtendedCPUIdentity()
return false;
#if USE_ASM_INSTRUCTIONS
- int ProcessorNameStartPos = 0;
int CPUExtendedIdentity[12];
// Use assembly to detect CPUID information...
@@ -1942,47 +1961,25 @@ bool SystemInformationImplementation::RetrieveExtendedCPUIdentity()
}
// Process the returned information.
- memcpy (this->ChipID.ProcessorName, &(CPUExtendedIdentity[0]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[4]), &(CPUExtendedIdentity[1]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[8]), &(CPUExtendedIdentity[2]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[12]), &(CPUExtendedIdentity[3]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[16]), &(CPUExtendedIdentity[4]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[20]), &(CPUExtendedIdentity[5]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[24]), &(CPUExtendedIdentity[6]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[28]), &(CPUExtendedIdentity[7]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[32]), &(CPUExtendedIdentity[8]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[36]), &(CPUExtendedIdentity[9]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[40]), &(CPUExtendedIdentity[10]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[44]), &(CPUExtendedIdentity[11]), sizeof (int));
- this->ChipID.ProcessorName[48] = '\0';
+ char nbuf[49];
+ memcpy (&(nbuf[0]), &(CPUExtendedIdentity[0]), sizeof (int));
+ memcpy (&(nbuf[4]), &(CPUExtendedIdentity[1]), sizeof (int));
+ memcpy (&(nbuf[8]), &(CPUExtendedIdentity[2]), sizeof (int));
+ memcpy (&(nbuf[12]), &(CPUExtendedIdentity[3]), sizeof (int));
+ memcpy (&(nbuf[16]), &(CPUExtendedIdentity[4]), sizeof (int));
+ memcpy (&(nbuf[20]), &(CPUExtendedIdentity[5]), sizeof (int));
+ memcpy (&(nbuf[24]), &(CPUExtendedIdentity[6]), sizeof (int));
+ memcpy (&(nbuf[28]), &(CPUExtendedIdentity[7]), sizeof (int));
+ memcpy (&(nbuf[32]), &(CPUExtendedIdentity[8]), sizeof (int));
+ memcpy (&(nbuf[36]), &(CPUExtendedIdentity[9]), sizeof (int));
+ memcpy (&(nbuf[40]), &(CPUExtendedIdentity[10]), sizeof (int));
+ memcpy (&(nbuf[44]), &(CPUExtendedIdentity[11]), sizeof (int));
+ nbuf[48] = '\0';
+ this->ChipID.ProcessorName = nbuf;
// Because some manufacturers have leading white space - we have to post-process the name.
- if (this->ChipManufacturer == Intel)
- {
- for (int nCounter = 0; nCounter < CHIPNAME_STRING_LENGTH; nCounter ++)
- {
- // There will either be NULL (\0) or spaces ( ) as the leading characters.
- if ((this->ChipID.ProcessorName[nCounter] != '\0') && (this->ChipID.ProcessorName[nCounter] != ' '))
- {
- // We have found the starting position of the name.
- ProcessorNameStartPos = nCounter;
- // Terminate the loop.
- break;
- }
- }
-
- // Check to see if there is any white space at the start.
- if (ProcessorNameStartPos == 0)
- {
- return true;
- }
-
- // Now move the name forward so that there is no white space.
- memmove(this->ChipID.ProcessorName, &(this->ChipID.ProcessorName[ProcessorNameStartPos]), (CHIPNAME_STRING_LENGTH - ProcessorNameStartPos));
- }
-
+ SystemInformationStripLeadingSpace(this->ChipID.ProcessorName);
return true;
-
#else
return false;
#endif
@@ -1999,53 +1996,53 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
// Check the family / model / revision to determine the CPU ID.
switch (this->ChipID.Family) {
case 3:
- sprintf (this->ChipID.ProcessorName, "Newer i80386 family");
+ this->ChipID.ProcessorName = "Newer i80386 family";
break;
case 4:
switch (this->ChipID.Model) {
- case 0: sprintf (this->ChipID.ProcessorName,"i80486DX-25/33"); break;
- case 1: sprintf (this->ChipID.ProcessorName,"i80486DX-50"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"i80486SX"); break;
- case 3: sprintf (this->ChipID.ProcessorName,"i80486DX2"); break;
- case 4: sprintf (this->ChipID.ProcessorName,"i80486SL"); break;
- case 5: sprintf (this->ChipID.ProcessorName,"i80486SX2"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"i80486DX2 WriteBack"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"i80486DX4"); break;
- case 9: sprintf (this->ChipID.ProcessorName,"i80486DX4 WriteBack"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown 80486 family"); return false;
+ case 0: this->ChipID.ProcessorName = "i80486DX-25/33"; break;
+ case 1: this->ChipID.ProcessorName = "i80486DX-50"; break;
+ case 2: this->ChipID.ProcessorName = "i80486SX"; break;
+ case 3: this->ChipID.ProcessorName = "i80486DX2"; break;
+ case 4: this->ChipID.ProcessorName = "i80486SL"; break;
+ case 5: this->ChipID.ProcessorName = "i80486SX2"; break;
+ case 7: this->ChipID.ProcessorName = "i80486DX2 WriteBack"; break;
+ case 8: this->ChipID.ProcessorName = "i80486DX4"; break;
+ case 9: this->ChipID.ProcessorName = "i80486DX4 WriteBack"; break;
+ default: this->ChipID.ProcessorName = "Unknown 80486 family"; return false;
}
break;
case 5:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"P5 A-Step"); break;
- case 1: sprintf (this->ChipID.ProcessorName,"P5"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"P54C"); break;
- case 3: sprintf (this->ChipID.ProcessorName,"P24T OverDrive"); break;
- case 4: sprintf (this->ChipID.ProcessorName,"P55C"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"P54C"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"P55C (0.25micron)"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Pentium family"); return false;
+ case 0: this->ChipID.ProcessorName = "P5 A-Step"; break;
+ case 1: this->ChipID.ProcessorName = "P5"; break;
+ case 2: this->ChipID.ProcessorName = "P54C"; break;
+ case 3: this->ChipID.ProcessorName = "P24T OverDrive"; break;
+ case 4: this->ChipID.ProcessorName = "P55C"; break;
+ case 7: this->ChipID.ProcessorName = "P54C"; break;
+ case 8: this->ChipID.ProcessorName = "P55C (0.25micron)"; break;
+ default: this->ChipID.ProcessorName = "Unknown Pentium family"; return false;
}
break;
case 6:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"P6 A-Step"); break;
- case 1: sprintf (this->ChipID.ProcessorName,"P6"); break;
- case 3: sprintf (this->ChipID.ProcessorName,"Pentium II (0.28 micron)"); break;
- case 5: sprintf (this->ChipID.ProcessorName,"Pentium II (0.25 micron)"); break;
- case 6: sprintf (this->ChipID.ProcessorName,"Pentium II With On-Die L2 Cache"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"Pentium III (0.25 micron)"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"Pentium III (0.18 micron) With 256 KB On-Die L2 Cache "); break;
- case 0xa: sprintf (this->ChipID.ProcessorName,"Pentium III (0.18 micron) With 1 Or 2 MB On-Die L2 Cache "); break;
- case 0xb: sprintf (this->ChipID.ProcessorName,"Pentium III (0.13 micron) With 256 Or 512 KB On-Die L2 Cache "); break;
- case 23: sprintf (this->ChipID.ProcessorName, "Intel(R) Core(TM)2 Duo CPU T9500 @ 2.60GHz"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown P6 family"); return false;
+ case 0: this->ChipID.ProcessorName = "P6 A-Step"; break;
+ case 1: this->ChipID.ProcessorName = "P6"; break;
+ case 3: this->ChipID.ProcessorName = "Pentium II (0.28 micron)"; break;
+ case 5: this->ChipID.ProcessorName = "Pentium II (0.25 micron)"; break;
+ case 6: this->ChipID.ProcessorName = "Pentium II With On-Die L2 Cache"; break;
+ case 7: this->ChipID.ProcessorName = "Pentium III (0.25 micron)"; break;
+ case 8: this->ChipID.ProcessorName = "Pentium III (0.18 micron) With 256 KB On-Die L2 Cache "; break;
+ case 0xa: this->ChipID.ProcessorName = "Pentium III (0.18 micron) With 1 Or 2 MB On-Die L2 Cache "; break;
+ case 0xb: this->ChipID.ProcessorName = "Pentium III (0.13 micron) With 256 Or 512 KB On-Die L2 Cache "; break;
+ case 23: this->ChipID.ProcessorName = "Intel(R) Core(TM)2 Duo CPU T9500 @ 2.60GHz"; break;
+ default: this->ChipID.ProcessorName = "Unknown P6 family"; return false;
}
break;
case 7:
- sprintf (this->ChipID.ProcessorName,"Intel Merced (IA-64)");
+ this->ChipID.ProcessorName = "Intel Merced (IA-64)";
break;
case 0xf:
// Check the extended family bits...
@@ -2054,21 +2051,21 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 0:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"Pentium IV (0.18 micron)"); break;
- case 1: sprintf (this->ChipID.ProcessorName,"Pentium IV (0.18 micron)"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"Pentium IV (0.13 micron)"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Pentium 4 family"); return false;
+ case 0: this->ChipID.ProcessorName = "Pentium IV (0.18 micron)"; break;
+ case 1: this->ChipID.ProcessorName = "Pentium IV (0.18 micron)"; break;
+ case 2: this->ChipID.ProcessorName = "Pentium IV (0.13 micron)"; break;
+ default: this->ChipID.ProcessorName = "Unknown Pentium 4 family"; return false;
}
break;
case 1:
- sprintf (this->ChipID.ProcessorName,"Intel McKinley (IA-64)");
+ this->ChipID.ProcessorName = "Intel McKinley (IA-64)";
break;
default:
- sprintf (this->ChipID.ProcessorName,"Pentium");
+ this->ChipID.ProcessorName = "Pentium";
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown Intel family");
+ this->ChipID.ProcessorName = "Unknown Intel family";
return false;
}
break;
@@ -2080,49 +2077,49 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 4:
switch (this->ChipID.Model)
{
- case 3: sprintf (this->ChipID.ProcessorName,"80486DX2"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"80486DX2 WriteBack"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"80486DX4"); break;
- case 9: sprintf (this->ChipID.ProcessorName,"80486DX4 WriteBack"); break;
- case 0xe: sprintf (this->ChipID.ProcessorName,"5x86"); break;
- case 0xf: sprintf (this->ChipID.ProcessorName,"5x86WB"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown 80486 family"); return false;
+ case 3: this->ChipID.ProcessorName = "80486DX2"; break;
+ case 7: this->ChipID.ProcessorName = "80486DX2 WriteBack"; break;
+ case 8: this->ChipID.ProcessorName = "80486DX4"; break;
+ case 9: this->ChipID.ProcessorName = "80486DX4 WriteBack"; break;
+ case 0xe: this->ChipID.ProcessorName = "5x86"; break;
+ case 0xf: this->ChipID.ProcessorName = "5x86WB"; break;
+ default: this->ChipID.ProcessorName = "Unknown 80486 family"; return false;
}
break;
case 5:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"SSA5 (PR75, PR90, PR100)"); break;
- case 1: sprintf (this->ChipID.ProcessorName,"5k86 (PR120, PR133)"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"5k86 (PR166)"); break;
- case 3: sprintf (this->ChipID.ProcessorName,"5k86 (PR200)"); break;
- case 6: sprintf (this->ChipID.ProcessorName,"K6 (0.30 micron)"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"K6 (0.25 micron)"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"K6-2"); break;
- case 9: sprintf (this->ChipID.ProcessorName,"K6-III"); break;
- case 0xd: sprintf (this->ChipID.ProcessorName,"K6-2+ or K6-III+ (0.18 micron)"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown 80586 family"); return false;
+ case 0: this->ChipID.ProcessorName = "SSA5 (PR75, PR90 = PR100)"; break;
+ case 1: this->ChipID.ProcessorName = "5k86 (PR120 = PR133)"; break;
+ case 2: this->ChipID.ProcessorName = "5k86 (PR166)"; break;
+ case 3: this->ChipID.ProcessorName = "5k86 (PR200)"; break;
+ case 6: this->ChipID.ProcessorName = "K6 (0.30 micron)"; break;
+ case 7: this->ChipID.ProcessorName = "K6 (0.25 micron)"; break;
+ case 8: this->ChipID.ProcessorName = "K6-2"; break;
+ case 9: this->ChipID.ProcessorName = "K6-III"; break;
+ case 0xd: this->ChipID.ProcessorName = "K6-2+ or K6-III+ (0.18 micron)"; break;
+ default: this->ChipID.ProcessorName = "Unknown 80586 family"; return false;
}
break;
case 6:
switch (this->ChipID.Model)
{
- case 1: sprintf (this->ChipID.ProcessorName,"Athlon- (0.25 micron)"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"Athlon- (0.18 micron)"); break;
- case 3: sprintf (this->ChipID.ProcessorName,"Duron- (SF core)"); break;
- case 4: sprintf (this->ChipID.ProcessorName,"Athlon- (Thunderbird core)"); break;
- case 6: sprintf (this->ChipID.ProcessorName,"Athlon- (Palomino core)"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"Duron- (Morgan core)"); break;
+ case 1: this->ChipID.ProcessorName = "Athlon- (0.25 micron)"; break;
+ case 2: this->ChipID.ProcessorName = "Athlon- (0.18 micron)"; break;
+ case 3: this->ChipID.ProcessorName = "Duron- (SF core)"; break;
+ case 4: this->ChipID.ProcessorName = "Athlon- (Thunderbird core)"; break;
+ case 6: this->ChipID.ProcessorName = "Athlon- (Palomino core)"; break;
+ case 7: this->ChipID.ProcessorName = "Duron- (Morgan core)"; break;
case 8:
if (this->Features.ExtendedFeatures.SupportsMP)
- sprintf (this->ChipID.ProcessorName,"Athlon - MP (Thoroughbred core)");
- else sprintf (this->ChipID.ProcessorName,"Athlon - XP (Thoroughbred core)");
+ this->ChipID.ProcessorName = "Athlon - MP (Thoroughbred core)";
+ else this->ChipID.ProcessorName = "Athlon - XP (Thoroughbred core)";
break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown K7 family"); return false;
+ default: this->ChipID.ProcessorName = "Unknown K7 family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown AMD family");
+ this->ChipID.ProcessorName = "Unknown AMD family";
return false;
}
break;
@@ -2133,12 +2130,12 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 5:
switch (this->ChipID.Model)
{
- case 4: sprintf (this->ChipID.ProcessorName,"Crusoe TM3x00 and TM5x00"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Crusoe family"); return false;
+ case 4: this->ChipID.ProcessorName = "Crusoe TM3x00 and TM5x00"; break;
+ default: this->ChipID.ProcessorName = "Unknown Crusoe family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown Transmeta family");
+ this->ChipID.ProcessorName = "Unknown Transmeta family";
return false;
}
break;
@@ -2149,13 +2146,13 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 5:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"mP6 (0.25 micron)"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"mP6 (0.18 micron)"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Rise family"); return false;
+ case 0: this->ChipID.ProcessorName = "mP6 (0.25 micron)"; break;
+ case 2: this->ChipID.ProcessorName = "mP6 (0.18 micron)"; break;
+ default: this->ChipID.ProcessorName = "Unknown Rise family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown Rise family");
+ this->ChipID.ProcessorName = "Unknown Rise family";
return false;
}
break;
@@ -2166,13 +2163,13 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 4:
switch (this->ChipID.Model)
{
- case 1: sprintf (this->ChipID.ProcessorName,"U5D"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"U5S"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown UMC family"); return false;
+ case 1: this->ChipID.ProcessorName = "U5D"; break;
+ case 2: this->ChipID.ProcessorName = "U5S"; break;
+ default: this->ChipID.ProcessorName = "Unknown UMC family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown UMC family");
+ this->ChipID.ProcessorName = "Unknown UMC family";
return false;
}
break;
@@ -2183,21 +2180,21 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 5:
switch (this->ChipID.Model)
{
- case 4: sprintf (this->ChipID.ProcessorName,"C6"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"C2"); break;
- case 9: sprintf (this->ChipID.ProcessorName,"C3"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown IDT\\Centaur family"); return false;
+ case 4: this->ChipID.ProcessorName = "C6"; break;
+ case 8: this->ChipID.ProcessorName = "C2"; break;
+ case 9: this->ChipID.ProcessorName = "C3"; break;
+ default: this->ChipID.ProcessorName = "Unknown IDT\\Centaur family"; return false;
}
break;
case 6:
switch (this->ChipID.Model)
{
- case 6: sprintf (this->ChipID.ProcessorName,"VIA Cyrix III - Samuel"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown IDT\\Centaur family"); return false;
+ case 6: this->ChipID.ProcessorName = "VIA Cyrix III - Samuel"; break;
+ default: this->ChipID.ProcessorName = "Unknown IDT\\Centaur family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown IDT\\Centaur family");
+ this->ChipID.ProcessorName = "Unknown IDT\\Centaur family";
return false;
}
break;
@@ -2208,32 +2205,32 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 4:
switch (this->ChipID.Model)
{
- case 4: sprintf (this->ChipID.ProcessorName,"MediaGX GX, GXm"); break;
- case 9: sprintf (this->ChipID.ProcessorName,"5x86"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Cx5x86 family"); return false;
+ case 4: this->ChipID.ProcessorName = "MediaGX GX = GXm"; break;
+ case 9: this->ChipID.ProcessorName = "5x86"; break;
+ default: this->ChipID.ProcessorName = "Unknown Cx5x86 family"; return false;
}
break;
case 5:
switch (this->ChipID.Model)
{
- case 2: sprintf (this->ChipID.ProcessorName,"Cx6x86"); break;
- case 4: sprintf (this->ChipID.ProcessorName,"MediaGX GXm"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Cx6x86 family"); return false;
+ case 2: this->ChipID.ProcessorName = "Cx6x86"; break;
+ case 4: this->ChipID.ProcessorName = "MediaGX GXm"; break;
+ default: this->ChipID.ProcessorName = "Unknown Cx6x86 family"; return false;
}
break;
case 6:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"6x86MX"); break;
- case 5: sprintf (this->ChipID.ProcessorName,"Cyrix M2 Core"); break;
- case 6: sprintf (this->ChipID.ProcessorName,"WinChip C5A Core"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"WinChip C5B\\C5C Core"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"WinChip C5C-T Core"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown 6x86MX\\Cyrix III family"); return false;
+ case 0: this->ChipID.ProcessorName = "6x86MX"; break;
+ case 5: this->ChipID.ProcessorName = "Cyrix M2 Core"; break;
+ case 6: this->ChipID.ProcessorName = "WinChip C5A Core"; break;
+ case 7: this->ChipID.ProcessorName = "WinChip C5B\\C5C Core"; break;
+ case 8: this->ChipID.ProcessorName = "WinChip C5C-T Core"; break;
+ default: this->ChipID.ProcessorName = "Unknown 6x86MX\\Cyrix III family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown Cyrix family");
+ this->ChipID.ProcessorName = "Unknown Cyrix family";
return false;
}
break;
@@ -2244,21 +2241,21 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 5:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"Nx586 or Nx586FPU"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown NexGen family"); return false;
+ case 0: this->ChipID.ProcessorName = "Nx586 or Nx586FPU"; break;
+ default: this->ChipID.ProcessorName = "Unknown NexGen family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown NexGen family");
+ this->ChipID.ProcessorName = "Unknown NexGen family";
return false;
}
break;
case NSC:
- sprintf (this->ChipID.ProcessorName,"Cx486SLC \\ DLC \\ Cx486S A-Step");
+ this->ChipID.ProcessorName = "Cx486SLC \\ DLC \\ Cx486S A-Step";
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown family"); // We cannot identify the processor.
+ this->ChipID.ProcessorName = "Unknown family"; // We cannot identify the processor.
return false;
}
@@ -2365,7 +2362,7 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
this->ChipID.Family = atoi(this->ExtractValueFromCpuInfoFile(buffer,"cpu family").c_str());
// Chip Vendor
- strcpy(this->ChipID.Vendor,this->ExtractValueFromCpuInfoFile(buffer,"vendor_id").c_str());
+ this->ChipID.Vendor = this->ExtractValueFromCpuInfoFile(buffer,"vendor_id");
this->FindManufacturer();
// Chip Model
@@ -2945,7 +2942,7 @@ bool SystemInformationImplementation::ParseSysCtl()
len = sizeof(value);
sysctlbyname("hw.cpufrequency", &value, &len, NULL, 0);
- this->CPUSpeedInMHz = static_cast< float >( value )/ 1048576;
+ this->CPUSpeedInMHz = static_cast< float >( value )/ 1000000;
// Chip family
@@ -2964,7 +2961,7 @@ bool SystemInformationImplementation::ParseSysCtl()
kwsys_stl::string machineBuf(retBuf);
if (machineBuf.find_first_of("Power") != kwsys_stl::string::npos)
{
- strcpy(this->ChipID.Vendor, "IBM");
+ this->ChipID.Vendor = "IBM";
len = 4;
err = sysctlbyname("hw.cputype", &this->ChipID.Family, &len, NULL, 0);
err = sysctlbyname("hw.cpusubtype", &this->ChipID.Model, &len, NULL, 0);
@@ -2982,13 +2979,14 @@ bool SystemInformationImplementation::ParseSysCtl()
len = 128;
err = sysctlbyname("machdep.cpu.vendor", retBuf, &len, NULL, 0);
// Chip Vendor
- strcpy(this->ChipID.Vendor,retBuf);
+ this->ChipID.Vendor = retBuf;
this->FindManufacturer();
- len=CHIPNAME_STRING_LENGTH;
+ ::memset(retBuf, 0, 128);
err =
sysctlbyname("machdep.cpu.brand_string",
- this->ChipID.ProcessorName, &len, NULL, 0);
+ retBuf, &len, NULL, 0);
+ this->ChipID.ProcessorName = retBuf;
// Chip Model
len = sizeof(value);
@@ -3175,11 +3173,11 @@ bool SystemInformationImplementation::QuerySolarisInfo()
this->ChipID.Family = 0;
// Chip Vendor
- strcpy(this->ChipID.Vendor,"Sun");
+ this->ChipID.Vendor = "Sun";
this->FindManufacturer();
// Chip Model
- sprintf(this->ChipID.ProcessorName,"%s",this->ParseValueFromKStat("-s cpu_type").c_str());
+ this->ChipID.ProcessorName = this->ParseValueFromKStat("-s cpu_type");
this->ChipID.Model = 0;
// Cache size
@@ -3233,7 +3231,7 @@ bool SystemInformationImplementation::QueryHaikuInfo()
char vbuf[13];
strncpy(vbuf, cpu_info.eax_0.vendor_id, 12);
vbuf[12] = '\0';
- strcpy(this->ChipID.Vendor,vbuf);
+ this->ChipID.Vendor = vbuf;
this->FindManufacturer();
@@ -3274,6 +3272,89 @@ bool SystemInformationImplementation::QueryHaikuInfo()
#endif
}
+bool SystemInformationImplementation::QueryQNXMemory()
+{
+#if defined(__QNX__)
+ kwsys_stl::string buffer;
+ kwsys_stl::vector<const char*> args;
+ args.clear();
+
+ args.push_back("showmem");
+ args.push_back("-S");
+ args.push_back(0);
+ buffer = this->RunProcess(args);
+ args.clear();
+
+ size_t pos = buffer.find("System RAM:");
+ if (pos == buffer.npos)
+ return false;
+ pos = buffer.find(":", pos);
+ size_t pos2 = buffer.find("M (", pos);
+ if (pos2 == buffer.npos)
+ return false;
+
+ pos++;
+ while (buffer[pos] == ' ')
+ pos++;
+
+ this->TotalPhysicalMemory = atoi(buffer.substr(pos, pos2 - pos).c_str());
+ return true;
+#endif
+ return false;
+}
+
+bool SystemInformationImplementation::QueryQNXProcessor()
+{
+#if defined(__QNX__)
+ // the output on my QNX 6.4.1 looks like this:
+ // Processor1: 686 Pentium II Stepping 3 2175MHz FPU
+ kwsys_stl::string buffer;
+ kwsys_stl::vector<const char*> args;
+ args.clear();
+
+ args.push_back("pidin");
+ args.push_back("info");
+ args.push_back(0);
+ buffer = this->RunProcess(args);
+ args.clear();
+
+ size_t pos = buffer.find("Processor1:");
+ if (pos == buffer.npos)
+ return false;
+
+ size_t pos2 = buffer.find("MHz", pos);
+ if (pos2 == buffer.npos)
+ return false;
+
+ size_t pos3 = pos2;
+ while (buffer[pos3] != ' ')
+ --pos3;
+
+ this->CPUSpeedInMHz = atoi(buffer.substr(pos3 + 1, pos2 - pos3 - 1).c_str());
+
+ pos2 = buffer.find(" Stepping", pos);
+ if (pos2 != buffer.npos)
+ {
+ pos2 = buffer.find(" ", pos2 + 1);
+ if (pos2 != buffer.npos && pos2 < pos3)
+ {
+ this->ChipID.Revision = atoi(buffer.substr(pos2 + 1, pos3 - pos2).c_str());
+ }
+ }
+
+ this->NumberOfPhysicalCPU = 0;
+ do
+ {
+ pos = buffer.find("\nProcessor", pos + 1);
+ ++this->NumberOfPhysicalCPU;
+ } while (pos != buffer.npos);
+ this->NumberOfLogicalCPU = 1;
+
+ return true;
+#else
+ return false;
+#endif
+}
/** Query the operating system information */
bool SystemInformationImplementation::QueryOSInformation()
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 8aa99eb..eefa7f5 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -378,9 +378,7 @@ void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char
kwsys_stl::string::size_type endpos = pathEnv.find(pathSep, start);
if(endpos != kwsys_stl::string::npos)
{
- kwsys_stl::string convertedPath;
- Realpath(pathEnv.substr(start, endpos-start).c_str(), convertedPath);
- path.push_back(convertedPath);
+ path.push_back(pathEnv.substr(start, endpos-start));
start = endpos+1;
}
else
@@ -565,6 +563,14 @@ void SystemTools::ReplaceString(kwsys_stl::string& source,
static DWORD SystemToolsMakeRegistryMode(DWORD mode,
SystemTools::KeyWOW64 view)
{
+ // only add the modes when on a system that supports Wow64.
+ static FARPROC wow64p = GetProcAddress(GetModuleHandle("kernel32"),
+ "IsWow64Process");
+ if(wow64p == NULL)
+ {
+ return mode;
+ }
+
if(view == SystemTools::KeyWOW64_32)
{
return mode | KWSYS_ST_KEY_WOW64_32KEY;
@@ -736,10 +742,11 @@ bool SystemTools::WriteRegistryValue(const char *key, const char *value,
HKEY hKey;
DWORD dwDummy;
+ char lpClass[] = "";
if(RegCreateKeyEx(primaryKey,
second.c_str(),
0,
- "",
+ lpClass,
REG_OPTION_NON_VOLATILE,
SystemToolsMakeRegistryMode(KEY_WRITE, view),
NULL,
@@ -1642,7 +1649,7 @@ kwsys_stl::string SystemTools::ConvertToUnixOutputPath(const char* path)
kwsys_stl::string ret = path;
// remove // except at the beginning might be a cygwin drive
- kwsys_stl::string::size_type pos=0;
+ kwsys_stl::string::size_type pos=1;
while((pos = ret.find("//", pos)) != kwsys_stl::string::npos)
{
ret.erase(pos, 1);
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 0cb98f1..4bc8769 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -12,10 +12,10 @@
#=============================================================================
# KWSys version date year component. Format is CCYY.
-SET(KWSYS_DATE_STAMP_YEAR 2010)
+SET(KWSYS_DATE_STAMP_YEAR 2011)
# KWSys version date month component. Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 11)
+SET(KWSYS_DATE_STAMP_MONTH 01)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 17)
+SET(KWSYS_DATE_STAMP_DAY 11)
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index ad35c34..c0e74af 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -297,7 +297,7 @@ bool CheckStringOperations()
if (kwsys::SystemTools::ConvertToUnixOutputPath
("//Local Mojo/Hex Power Pack/Iffy Voodoo") !=
- "/Local\\ Mojo/Hex\\ Power\\ Pack/Iffy\\ Voodoo")
+ "//Local\\ Mojo/Hex\\ Power\\ Pack/Iffy\\ Voodoo")
{
kwsys_ios::cerr
<< "Problem with ConvertToUnixOutputPath "
diff --git a/Tests/CMakeInstall.cmake b/Tests/CMakeInstall.cmake
index dabc852..5f814d9 100644
--- a/Tests/CMakeInstall.cmake
+++ b/Tests/CMakeInstall.cmake
@@ -41,6 +41,9 @@ if(CMake_TEST_INSTALL)
--build-noclean
--build-target install)
+ # Avoid running this test simultaneously with other tests:
+ set_tests_properties(CMake.Install PROPERTIES RUN_SERIAL ON)
+
# TODO: Make all other tests depend on this one, and then drive them
# with the installed CTest.
else()
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 04f0774..4109184 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -45,18 +45,18 @@ IF(BUILD_TESTING)
SET(TEST_BUILD_DIRS)
# Should the long tests be run?
- OPTION(CMAKE_RUN_LONG_TESTS
+ OPTION(CMAKE_RUN_LONG_TESTS
"Should the long tests be run (such as Bootstrap)." ON)
MARK_AS_ADVANCED(CMAKE_RUN_LONG_TESTS)
IF (CMAKE_RUN_LONG_TESTS)
- OPTION(CTEST_TEST_CTEST
- "Should the tests that run a full sub ctest process be run?"
+ OPTION(CTEST_TEST_CTEST
+ "Should the tests that run a full sub ctest process be run?"
OFF)
MARK_AS_ADVANCED(CTEST_TEST_CTEST)
OPTION(TEST_KDE4_STABLE_BRANCH
- "Should the KDE4 stable branch test be run?"
+ "Should the KDE4 stable branch test be run?"
OFF)
MARK_AS_ADVANCED(TEST_KDE4_STABLE_BRANCH)
ENDIF (CMAKE_RUN_LONG_TESTS)
@@ -131,6 +131,20 @@ IF(BUILD_TESTING)
ADD_TEST_MACRO(TarTest TarTest)
ADD_TEST_MACRO(SystemInformation SystemInformation)
ADD_TEST_MACRO(MathTest MathTest)
+ # assume no resources building to test
+ SET(TEST_RESOURCES FALSE)
+ # for windows and cygwin assume we have resources
+ IF(WIN32 OR CYGWIN)
+ SET(TEST_RESOURCES TRUE)
+ ENDIF()
+ # for borland and watcom there is no resource support
+ IF(("${CMAKE_TEST_GENERATOR}" MATCHES "WMake") OR
+ ("${CMAKE_TEST_GENERATOR}" MATCHES "Borland"))
+ SET(TEST_RESOURCES FALSE)
+ ENDIF()
+ IF(TEST_RESOURCES)
+ ADD_TEST_MACRO(VSResource VSResource)
+ ENDIF()
ADD_TEST_MACRO(Simple Simple)
ADD_TEST_MACRO(PreOrder PreOrder)
ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
@@ -214,7 +228,7 @@ IF(BUILD_TESTING)
# If we are running right now with a UnixMakefiles based generator,
# build the "Simple" test with the ExtraGenerators, if available
- # This doesn't test whether the generated project files work (unfortunately),
+ # This doesn't test whether the generated project files work (unfortunately),
# mainly it tests that cmake doesn't crash when generating these project files.
IF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
# check which generators we have
@@ -246,7 +260,6 @@ IF(BUILD_TESTING)
--test-command Simple)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
ENDIF ("${cmakeOutput}" MATCHES CodeBlocks)
-
# check for the KDevelop3 generator
IF ("${cmakeOutput}" MATCHES KDevelop3)
ADD_TEST(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND}
@@ -286,10 +299,10 @@ IF(BUILD_TESTING)
ADD_TEST(SubProject-Stage2 ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/SubProject/foo"
- "${CMake_BINARY_DIR}/Tests/SubProject/foo"
+ "${CMake_BINARY_DIR}/Tests/SubProject/foo"
--build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-nocmake
+ --build-nocmake
--build-project foo
--build-target foo
--test-command foo
@@ -347,7 +360,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project TargetName
- --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files
+ --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files
${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName")
@@ -359,7 +372,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-two-config
--build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project LibName
+ --build-project LibName
--build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib"
--test-command foobar
)
@@ -372,7 +385,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-two-config
--build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project CustComDepend
+ --build-project CustComDepend
--build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin"
--test-command foo bar.c
)
@@ -451,7 +464,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends")
-
+
SET(SimpleInstallInstallDir
"${CMake_BINARY_DIR}/Tests/SimpleInstall/InstallDirectory")
ADD_TEST(SimpleInstall ${CMAKE_CTEST_COMMAND}
@@ -486,6 +499,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
#
set(CTEST_RUN_CPackComponents ${CTEST_TEST_CPACK})
set(CTEST_package_X11_TEST ${CTEST_TEST_CPACK})
+ set(CTEST_RUN_CPackComponentsForAll ${CTEST_TEST_CPACK})
find_program(NSIS_MAKENSIS_EXECUTABLE NAMES makensis
PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS]
@@ -534,6 +548,34 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents")
ENDIF(CTEST_RUN_CPackComponents)
+ IF(CTEST_RUN_CPackComponentsForAll)
+ set(CPackComponentsForAll_EXTRA_OPTIONS)
+
+ set(CPackRun_CPackGen "-DCPackGen=ZIP")
+ set(CPackRun_CPackCommand "-DCPackCommand=${CMAKE_CPACK_COMMAND}")
+ set(CPackRun_CPackComponentWay "-DCPackComponentWay=default")
+
+ ADD_TEST(CPackComponentsForAll-ZIP-default ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll"
+ "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project CPackComponentsForAll
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-options
+ -DCPACK_BINARY_ZIP:BOOL=ON
+ ${CPackComponentsForAll_EXTRA_OPTIONS}
+ --graphviz=CPackComponentsForAll.dot
+ --test-command ${CMAKE_CMAKE_COMMAND}
+ "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent"
+ "${CPackRun_CPackCommand}"
+ "${CPackRun_CPackGen}"
+ "${CPackRun_CPackComponentWay}"
+ -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake")
+
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll")
+ ENDIF(CTEST_RUN_CPackComponentsForAll)
+
# By default, turn this test off (because it takes a long time...)
#
if(NOT DEFINED CTEST_RUN_CPackTestAllGenerators)
@@ -779,6 +821,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
)
+ SET_TESTS_PROPERTIES(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed")
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing")
ADD_TEST(wrapping ${CMAKE_CTEST_COMMAND}
@@ -854,7 +897,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# RPATH isn't supported under Syllable, so the tests don't
# find their libraries. In order to fix that LIBRARY_OUTPUT_DIR
# in the tests would have to be adjusted to ${EXECUTABLE_OUTPUT_DIR}/lib .
-# For now we just require on Syllable that the user adjusts the DLL_PATH
+# For now we just require on Syllable that the user adjusts the DLL_PATH
# environment variable, so except the two tests below all other tests will succeed.
SET(_DLL_PATH "$ENV{DLL_PATH}")
@@ -963,14 +1006,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# only add this test on platforms that support it
# some old versions of make simply cannot handle spaces in paths
- IF (MAKE_IS_GNU OR
+ IF (MAKE_IS_GNU OR
"${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland")
ADD_TEST(SubDirSpaces ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/SubDirSpaces"
"${CMake_BINARY_DIR}/Tests/SubDirSpaces"
- --build-exe-dir
+ --build-exe-dir
"${CMake_BINARY_DIR}/Tests/SubDirSpaces/Executable Sources"
--build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
@@ -1014,6 +1057,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir")
IF(CMAKE_TEST_MSVC)
+ ADD_TEST_MACRO(ForceInclude foo)
ADD_TEST_MACRO(PrecompiledHeader foo)
ADD_TEST_MACRO(ModuleDefinition example_exe)
ENDIF(CMAKE_TEST_MSVC)
@@ -1045,6 +1089,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command VSExternalInclude)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude")
+
+ ADD_TEST(VSMidl ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/VSMidl"
+ "${CMake_BINARY_DIR}/Tests/VSMidl"
+ --build-two-config
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project VSMidl
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --test-command VSMidl)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl")
ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
IF (APPLE AND CMAKE_COMPILER_IS_GNUCXX)
@@ -1076,7 +1131,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
"${CMake_BINARY_DIR}/Tests/BundleGeneratorTest"
--build-two-config
--build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project BundleGeneratorTest
--build-target package
--build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory"
@@ -1084,6 +1139,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest")
ENDIF(APPLE AND CTEST_TEST_CPACK)
+ ADD_TEST(TestsWorkingDirectory ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/TestsWorkingDirectory"
+ "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project TestsWorkingDirectoryProj
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory"
+ --force-new-ctest-process
+ --test-command ${CMAKE_CTEST_COMMAND} -V
+ )
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory")
+
# Make sure CTest can handle a test with no newline in output.
ADD_TEST(CTest.NoNewline
${CMAKE_CMAKE_COMMAND} -E echo_append "This line has no newline!")
@@ -1298,7 +1366,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
SET_TESTS_PROPERTIES(CTestTestCrash PROPERTIES
PASS_REGULAR_EXPRESSION "SegFault")
ENDIF(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
-
+
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestBadExe/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestBadExe/test.cmake"
@@ -1348,7 +1416,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/testOutput.log"
)
SET_TESTS_PROPERTIES(CTestTestScheduler PROPERTIES
- PASS_REGULAR_EXPRESSION "Start 1.*Start 2.*Start 3.*Start 4.*Start 4.*Start 3.*Start 2.*Start 1")
+ PASS_REGULAR_EXPRESSION "Start 1.*Start 2.*Start 3.*Start 4.*Start 4.*Start 3.*Start 2.*Start 1"
+ RESOURCE_LOCK "CostData")
+
+ CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestCostSerial/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ ADD_TEST(CTestTestCostSerial ${CMAKE_CTEST_COMMAND}
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/test.cmake" -V
+ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/testOutput.log"
+ )
+ SET_TESTS_PROPERTIES(CTestTestCostSerial PROPERTIES
+ PASS_REGULAR_EXPRESSION "Start 2.*Start 3.*Start 1.*Start 2.*Start 3.*Start 1"
+ RESOURCE_LOCK "CostData")
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestStopTime/test.cmake.in"
@@ -1376,7 +1457,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
#make sure all 3 subdirs were added
SET_TESTS_PROPERTIES(CTestTestSubdir PROPERTIES
PASS_REGULAR_EXPRESSION "0 tests failed out of 3")
-
+
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestTimeout/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake"
@@ -1390,6 +1471,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed")
CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestZeroTimeout/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ ADD_TEST(CTestTestZeroTimeout ${CMAKE_CTEST_COMMAND}
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake" -V
+ --output-log
+ "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/testOutput.log")
+ SET_TESTS_PROPERTIES(CTestTestZeroTimeout PROPERTIES
+ FAIL_REGULAR_EXPRESSION "\\*\\*\\*Timeout")
+
+ CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake"
@ONLY ESCAPE_QUOTES)
@@ -1571,7 +1663,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
ENDIF(UNIX)
ENDIF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
-
+
IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
@@ -1598,7 +1690,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-noclean
--build-makeprogram ${bootstrap}
--build-generator "${CMAKE_TEST_GENERATOR}"
- --test-command
+ --test-command
${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest")
# Make this test run early during parallel execution
@@ -1692,8 +1784,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
"-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
ENDIF(SDCC_EXECUTABLE)
-
-
+
+
FIND_PROGRAM(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc)
FIND_PROGRAM(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++)
MARK_AS_ADVANCED(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE)
@@ -1711,8 +1803,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
"-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}")
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win")
ENDIF(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE)
-
-
+
+
ENDIF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")
IF(UNIX)
diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
index 0ab2a67..3fb4652 100644
--- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
+++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
@@ -77,6 +77,13 @@ set(linux64_pgf90_libs "pgf90;pgf90_rpm1;pgf902;pgf90rtl;pgftnrtl;nspgc;pgc;rt;p
set(linux64_pgf90_dirs "/opt/compiler/pgi/linux86-64/8.0-3/lib;/usr/lib64;/usr/lib64/gcc/x86_64-suse-linux/4.1.2")
list(APPEND platforms linux64_pgf90)
+# nagfor dummy.f -Wl,-v
+set(linux64_nagfor_text " /usr/libexec/gcc/x86_64-redhat-linux/4.4.5/collect2 --no-add-needed --eh-frame-hdr --build-id -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.4.5/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/4.4.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../.. /usr/local/NAG/lib/f90_init.o /usr/local/NAG/lib/quickfit.o dummy.o -rpath /usr/local/NAG/lib /usr/local/NAG/lib/libf53.so /usr/local/NAG/lib/libf53.a -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/4.4.5/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../../../lib64/crtn.o")
+set(linux64_nagfor_libs "/usr/local/NAG/lib/f90_init.o;/usr/local/NAG/lib/quickfit.o;/usr/local/NAG/lib/libf53.a;m;c")
+set(linux64_nagfor_dirs "/usr/lib/gcc/x86_64-redhat-linux/4.4.5;/usr/lib64;/lib64;/usr/lib")
+set(linux64_nagfor_obj_regex "^/usr/local/NAG/lib")
+list(APPEND platforms linux64_nagfor)
+
# gcc dummy.c -v # in strange path
set(linux64_test1_text "
/this/might/match/as/a/linker/ld/but/it/is/not because the ld is not the last path component
@@ -380,7 +387,7 @@ list(APPEND platforms msys_g77)
# Test parsing for all above examples.
foreach(p IN LISTS platforms)
- cmake_parse_implicit_link_info("${${p}_text}" libs dirs log)
+ cmake_parse_implicit_link_info("${${p}_text}" libs dirs log "${${p}_obj_regex}")
foreach(v libs dirs)
if(NOT "${${v}}" STREQUAL "${${p}_${v}}")
diff --git a/Tests/CPackComponents/CMakeLists.txt b/Tests/CPackComponents/CMakeLists.txt
index 3ef8083..58f5bdf 100644
--- a/Tests/CPackComponents/CMakeLists.txt
+++ b/Tests/CPackComponents/CMakeLists.txt
@@ -68,6 +68,19 @@ set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
+# Settings used when building NSIS installers
+set(CPACK_NSIS_MENU_LINKS
+ "ftp://ftpserver" "Test Ftp Link"
+ "ftps://ftpsserver" "Test Ftps Link"
+ "http://www.cmake.org" "CMake Web Site"
+ "https://github.com/" "Test Https Link"
+ "mailto:kitware@kitware.com" "Test MailTo Link"
+ "news://newsserver" "Test News Link"
+ )
+
+# Suggested default root for end users of the installer:
+set(CPACK_NSIS_INSTALL_ROOT "C:\\Program Files\\CMake Tests Install Root")
+
# Include CPack to introduce the appropriate targets
include(CPack)
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
new file mode 100644
index 0000000..971b2dc
--- /dev/null
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -0,0 +1,120 @@
+# CPack Example: User-selectable Installation Components
+#
+# In this example, we have a simple library (mylib) with an example
+# application (mylibapp). We create a binary installer (a CPack Generator)
+# which supports CPack components.
+#
+# Depending on the CPack generator and on some CPACK_xxx var values
+# the generator may produce a single (NSIS, PackageMaker)
+# or several package files (Archive Generators, RPM, DEB)
+cmake_minimum_required(VERSION 2.8.3.20101130 FATAL_ERROR)
+project(CPackComponentsForAll)
+
+# Create the mylib library
+add_library(mylib mylib.cpp)
+
+# Create the mylibapp application
+add_executable(mylibapp mylibapp.cpp)
+target_link_libraries(mylibapp mylib)
+
+# Duplicate of mylibapp application
+# which won't be put in any component (?mistake?)
+add_executable(mylibapp2 mylibapp.cpp)
+target_link_libraries(mylibapp2 mylib)
+
+# Create installation targets. Note that we put each kind of file
+# into a different component via COMPONENT. These components will
+# be used to create the installation components.
+install(TARGETS mylib
+ ARCHIVE
+ DESTINATION lib
+ COMPONENT libraries)
+install(TARGETS mylibapp
+ RUNTIME
+ DESTINATION bin
+ COMPONENT applications)
+
+# This application does not belong to any component
+# thus (as of cmake 2.8.2) it will be left "uninstalled"
+# by a component-aware installer unless a
+# CPACK_MONOLITHIC_INSTALL=1 is set (at cmake time).
+install(TARGETS mylibapp2
+ RUNTIME
+ DESTINATION bin)
+
+install(FILES mylib.h
+ DESTINATION include
+ COMPONENT headers)
+
+# CPack boilerplate for this project
+set(CPACK_PACKAGE_NAME "MyLib")
+set(CPACK_PACKAGE_CONTACT "None")
+set(CPACK_PACKAGE_VENDOR "CMake.org")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyLib - CPack Component Installation Example")
+set(CPACK_PACKAGE_VERSION "1.0.2")
+set(CPACK_PACKAGE_VERSION_MAJOR "1")
+set(CPACK_PACKAGE_VERSION_MINOR "0")
+set(CPACK_PACKAGE_VERSION_PATCH "2")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
+
+# Tell CPack all of the components to install. The "ALL"
+# refers to the fact that this is the set of components that
+# will be included when CPack is instructed to put everything
+# into the binary installer (the default behavior).
+set(CPACK_COMPONENTS_ALL applications libraries headers Unspecified)
+
+# Set the displayed names for each of the components to install.
+# These will be displayed in the list of components inside the installer.
+set(CPACK_COMPONENT_APPLICATIONS_DISPLAY_NAME "MyLib Application")
+set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
+set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers")
+
+# Provide descriptions for each of the components to install.
+# When the user hovers the mouse over the name of a component,
+# the description will be shown in the "Description" box in the
+# installer. If no descriptions are provided, the "Description"
+# box will be removed.
+set(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION
+ "An extremely useful application that makes use of MyLib")
+set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
+ "Static libraries used to build programs with MyLib")
+set(CPACK_COMPONENT_HEADERS_DESCRIPTION
+ "C/C++ header files for use with MyLib")
+
+# Put the components into two different groups: "Runtime" and "Development"
+set(CPACK_COMPONENT_APPLICATIONS_GROUP "Runtime")
+set(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
+set(CPACK_COMPONENT_HEADERS_GROUP "Development")
+
+# Expand the "Development" group by default, since we have so few components.
+# Also, provide this group with a description.
+set(CPACK_COMPONENT_GROUP_DEVELOPMENT_EXPANDED ON)
+set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
+ "All of the tools you'll ever need to develop software")
+
+# It doesn't make sense to install the headers without the libraries
+# (because you could never use the headers!), so make the headers component
+# depend on the libraries component.
+set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
+
+# Create two installation types with pre-selected components.
+# The "Developer" installation has just the library and headers,
+# while the "Full" installation has everything.
+set(CPACK_ALL_INSTALL_TYPES Full Developer)
+set(CPACK_INSTALL_TYPE_FULL_DISPLAY_NAME "Everything")
+set(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Developer Full)
+set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
+set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full)
+
+# We may use the CPack specific config file in order
+# to tailor CPack behavio on a CPack generator specific way
+# (Behavior would be different for RPM or TGZ or DEB ...)
+if (USE_CPACK_PROJECT_CONFIG)
+ # Setup project specific CPack-time CPack Config file.
+ configure_file(${MyLib_SOURCE_DIR}/MyLibCPackConfig.cmake.in
+ ${MyLib_BINARY_DIR}/MyLibCPackConfig.cmake
+ @ONLY)
+ set(CPACK_PROJECT_CONFIG_FILE ${MyLib_BINARY_DIR}/MyLibCPackConfig.cmake)
+endif (USE_CPACK_PROJECT_CONFIG)
+# Include CPack to introduce the appropriate targets
+include(CPack) \ No newline at end of file
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in
new file mode 100644
index 0000000..7ffafae
--- /dev/null
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in
@@ -0,0 +1,7 @@
+if(CPACK_GENERATOR MATCHES "ZIP")
+# set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
+endif(CPACK_GENERATOR MATCHES "ZIP")
+
+if(CPACK_GENERATOR MATCHES "TGZ")
+ set(CPACK_MONOLITHIC_INSTALL 1)
+endif(CPACK_GENERATOR MATCHES "TGZ")
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
new file mode 100644
index 0000000..11f72ec
--- /dev/null
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -0,0 +1,73 @@
+message(STATUS "=============================================================================")
+message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
+message(STATUS "")
+
+if(NOT CPackComponentsForAll_BINARY_DIR)
+ message(FATAL_ERROR "CPackComponentsForAll_BINARY_DIR not set")
+endif(NOT CPackComponentsForAll_BINARY_DIR)
+
+if(NOT CPackGen)
+ message(FATAL_ERROR "CPackGen not set")
+endif(NOT CPackGen)
+get_filename_component(CPACK_LOCATION ${CMAKE_COMMAND} PATH)
+set(CPackCommand "${CPACK_LOCATION}/cpack")
+message("cpack = ${CPackCommand}")
+if(NOT CPackCommand)
+ message(FATAL_ERROR "CPackCommand not set")
+endif(NOT CPackCommand)
+
+if(NOT CPackComponentWay)
+ message(FATAL_ERROR "CPackComponentWay not set")
+endif(NOT CPackComponentWay)
+
+set(expected_file_mask "")
+# The usual default behavior is to expect a single file
+# Then some specific generators (Archive, RPM, ...)
+# May produce several numbers of files depending on
+# CPACK_COMPONENT_xxx values
+set(expected_count 1)
+set(config_type $ENV{CMAKE_CONFIG_TYPE})
+set(config_args )
+if(config_type)
+ set(config_args -C ${config_type})
+endif()
+message(" ${config_args}")
+execute_process(COMMAND ${CPackCommand} -G ${CPackGen} ${config_args}
+ RESULT_VARIABLE CPack_result
+ OUTPUT_VARIABLE CPack_output
+ ERROR_VARIABLE CPack_error
+ WORKING_DIRECTORY ${CPackComponentsForAll_BINARY_DIR})
+
+if (CPack_result)
+ message(FATAL_ERROR "error: CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}")
+else (CPack_result)
+ message(STATUS "CPack_output=${CPack_output}")
+endif(CPack_result)
+
+if(CPackGen MATCHES "ZIP")
+ set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/MyLib-*.zip")
+ if (${CPackComponentWay} STREQUAL "default")
+ set(expected_count 1)
+ endif(${CPackComponentWay} STREQUAL "default")
+endif(CPackGen MATCHES "ZIP")
+
+# Now verify if the number of expected file is OK
+# - using expected_file_mask and
+# - expected_count
+if(expected_file_mask)
+ file(GLOB expected_file "${expected_file_mask}")
+
+ message(STATUS "expected_count='${expected_count}'")
+ message(STATUS "expected_file='${expected_file}'")
+ message(STATUS "expected_file_mask='${expected_file_mask}'")
+
+ if(NOT expected_file)
+ message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}")
+ endif(NOT expected_file)
+
+ list(LENGTH expected_file actual_count)
+ message(STATUS "actual_count='${actual_count}'")
+ if(NOT actual_count EQUAL expected_count)
+ message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})")
+ endif(NOT actual_count EQUAL expected_count)
+endif(expected_file_mask)
diff --git a/Tests/CPackComponentsForAll/mylib.cpp b/Tests/CPackComponentsForAll/mylib.cpp
new file mode 100644
index 0000000..8ddac19
--- /dev/null
+++ b/Tests/CPackComponentsForAll/mylib.cpp
@@ -0,0 +1,7 @@
+#include "mylib.h"
+#include "stdio.h"
+
+void mylib_function()
+{
+ printf("This is mylib");
+}
diff --git a/Tests/CPackComponentsForAll/mylib.h b/Tests/CPackComponentsForAll/mylib.h
new file mode 100644
index 0000000..5d0a822
--- /dev/null
+++ b/Tests/CPackComponentsForAll/mylib.h
@@ -0,0 +1 @@
+void mylib_function();
diff --git a/Tests/CPackComponentsForAll/mylibapp.cpp b/Tests/CPackComponentsForAll/mylibapp.cpp
new file mode 100644
index 0000000..a438ac7
--- /dev/null
+++ b/Tests/CPackComponentsForAll/mylibapp.cpp
@@ -0,0 +1,6 @@
+#include "mylib.h"
+
+int main()
+{
+ mylib_function();
+}
diff --git a/Tests/CTestTestCostSerial/CMakeLists.txt b/Tests/CTestTestCostSerial/CMakeLists.txt
new file mode 100644
index 0000000..a9a5c25
--- /dev/null
+++ b/Tests/CTestTestCostSerial/CMakeLists.txt
@@ -0,0 +1,13 @@
+CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
+PROJECT (CTestTestCostSerial)
+INCLUDE (CTest)
+
+ADD_EXECUTABLE (Sleep sleep.c)
+
+FOREACH (index RANGE 1 3)
+ ADD_TEST (TestSleep${index} Sleep)
+ENDFOREACH (index RANGE 1 3)
+
+SET_TESTS_PROPERTIES(TestSleep1 PROPERTIES COST -500)
+SET_TESTS_PROPERTIES(TestSleep2 PROPERTIES COST 12)
+SET_TESTS_PROPERTIES(TestSleep3 PROPERTIES COST 0)
diff --git a/Tests/CTestTestCostSerial/CTestConfig.cmake b/Tests/CTestTestCostSerial/CTestConfig.cmake
new file mode 100644
index 0000000..05c20eb
--- /dev/null
+++ b/Tests/CTestTestCostSerial/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set(CTEST_PROJECT_NAME "CTestTestCostSerial")
+set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set(CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestCostSerial/sleep.c b/Tests/CTestTestCostSerial/sleep.c
new file mode 100644
index 0000000..cb9f87a
--- /dev/null
+++ b/Tests/CTestTestCostSerial/sleep.c
@@ -0,0 +1,16 @@
+#if defined(_WIN32)
+# include <windows.h>
+#else
+# include <unistd.h>
+#endif
+
+/* sleeps for 1 second */
+int main(int argc, char** argv)
+{
+#if defined(_WIN32)
+ Sleep(1000);
+#else
+ sleep(1);
+#endif
+ return 0;
+}
diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in
new file mode 100644
index 0000000..ce4d60a
--- /dev/null
+++ b/Tests/CTestTestCostSerial/test.cmake.in
@@ -0,0 +1,31 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-CostSerial")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCostSerial")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCostSerial")
+SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@")
+SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@")
+SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+# Remove old cost data file if it exists
+IF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+ FILE(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+ENDIF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+# Run test set a second time to make sure they run in same specified order
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestZeroTimeout/CMakeLists.txt b/Tests/CTestTestZeroTimeout/CMakeLists.txt
new file mode 100644
index 0000000..8a5246d
--- /dev/null
+++ b/Tests/CTestTestZeroTimeout/CMakeLists.txt
@@ -0,0 +1,8 @@
+CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
+PROJECT (CTestTestZeroTimeout)
+INCLUDE (CTest)
+
+ADD_EXECUTABLE (Sleep sleep.c)
+
+ADD_TEST (TestExplicitZeroTimeout Sleep)
+SET_TESTS_PROPERTIES(TestExplicitZeroTimeout PROPERTIES TIMEOUT 0)
diff --git a/Tests/CTestTestZeroTimeout/CTestConfig.cmake b/Tests/CTestTestZeroTimeout/CTestConfig.cmake
new file mode 100644
index 0000000..f8e0609
--- /dev/null
+++ b/Tests/CTestTestZeroTimeout/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set(CTEST_PROJECT_NAME "CTestTestZeroTimeout")
+set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set(CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestZeroTimeout/sleep.c b/Tests/CTestTestZeroTimeout/sleep.c
new file mode 100644
index 0000000..d40d59d
--- /dev/null
+++ b/Tests/CTestTestZeroTimeout/sleep.c
@@ -0,0 +1,16 @@
+#if defined(_WIN32)
+# include <windows.h>
+#else
+# include <unistd.h>
+#endif
+
+/* sleeps for 5 seconds */
+int main(int argc, char** argv)
+{
+#if defined(_WIN32)
+ Sleep(5000);
+#else
+ sleep(5);
+#endif
+ return 0;
+}
diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in
new file mode 100644
index 0000000..0ff32a4
--- /dev/null
+++ b/Tests/CTestTestZeroTimeout/test.cmake.in
@@ -0,0 +1,23 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ZeroTimeout")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestZeroTimeout")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout")
+SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@")
+SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@")
+SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+SET(CTEST_TEST_TIMEOUT 2)
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt
index 98b29bb..08cc7d4 100644
--- a/Tests/Complex/Executable/CMakeLists.txt
+++ b/Tests/Complex/Executable/CMakeLists.txt
@@ -49,10 +49,17 @@ LINK_LIBRARIES(${COMPLEX_LIBS})
SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES
HEADER_FILE_ONLY 1)
+# Test forcing a .c file to not build.
+# This makes sure a mixed language library is created
+# with header file only sources
+SET_SOURCE_FILES_PROPERTIES(complex_nobuild.c PROPERTIES
+ HEADER_FILE_ONLY 1)
+
ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt)
ADD_EXECUTABLE(complex complex testcflags.c )
# Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
-ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx)
+ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx
+ complex_nobuild.c)
IF(COMPLEX_TEST_CMAKELIB)
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmlibarchive cmbzip2 cmcurl)
ENDIF(COMPLEX_TEST_CMAKELIB)
diff --git a/Tests/Complex/Executable/complex_nobuild.c b/Tests/Complex/Executable/complex_nobuild.c
new file mode 100644
index 0000000..6b3c2c1
--- /dev/null
+++ b/Tests/Complex/Executable/complex_nobuild.c
@@ -0,0 +1 @@
+#error "This file should not be compiled."
diff --git a/Tests/Contracts/Trilinos-10-6/CMakeLists.txt b/Tests/Contracts/Trilinos-10-6/CMakeLists.txt
new file mode 100644
index 0000000..79ed669
--- /dev/null
+++ b/Tests/Contracts/Trilinos-10-6/CMakeLists.txt
@@ -0,0 +1,103 @@
+cmake_minimum_required(VERSION 2.8)
+project(Trilinos-10-6)
+
+include(ExternalProject)
+
+include("${CMAKE_CURRENT_SOURCE_DIR}/LocalOverrides.cmake" OPTIONAL)
+include("${CMAKE_CURRENT_BINARY_DIR}/LocalOverrides.cmake" OPTIONAL)
+
+if(NOT DEFINED HOME)
+ if(DEFINED ENV{CTEST_REAL_HOME})
+ set(HOME "$ENV{CTEST_REAL_HOME}")
+ else()
+ set(HOME "$ENV{HOME}")
+ endif()
+
+ if(NOT HOME AND WIN32)
+ # Try for USERPROFILE as HOME equivalent:
+ string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}")
+
+ # But just use root of SystemDrive if USERPROFILE contains any spaces:
+ # (Default on XP and earlier...)
+ if(HOME MATCHES " ")
+ string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}")
+ endif()
+ endif()
+endif()
+message(STATUS "HOME='${HOME}'")
+
+if(NOT DEFINED url)
+ set(url "http://www.cmake.org/files/contracts/trilinos-10.6.1.tar.gz")
+endif()
+message(STATUS "url='${url}'")
+
+if(NOT DEFINED md5)
+ set(md5 "690230465dd21a76e3c6636fd07bd2f0")
+endif()
+message(STATUS "md5='${md5}'")
+
+string(SUBSTRING "${md5}" 0 8 shorttag)
+set(shorttag "m${shorttag}")
+
+set(download_dir "${HOME}/.cmake/Downloads")
+
+set(base_dir "${HOME}/.cmake/Contracts/${PROJECT_NAME}/${shorttag}")
+set(binary_dir "${base_dir}/build")
+set(script_dir "${base_dir}")
+set(source_dir "${base_dir}/src")
+
+if(NOT DEFINED BUILDNAME)
+ set(BUILDNAME "CMakeContract-${shorttag}")
+endif()
+message(STATUS "BUILDNAME='${BUILDNAME}'")
+
+if(NOT DEFINED SITE)
+ site_name(SITE)
+endif()
+message(STATUS "SITE='${SITE}'")
+
+configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/Dashboard.cmake.in"
+ "${script_dir}/Dashboard.cmake"
+ @ONLY)
+
+configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/ValidateBuild.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/ValidateBuild.cmake"
+ @ONLY)
+
+# Source dir for this project exists outside the CMake build tree because it
+# is absolutely huge. Source dir is therefore cached under a '.cmake/Contracts'
+# dir in your HOME directory. Downloads are cached under '.cmake/Downloads'
+#
+if(EXISTS "${source_dir}/cmake/ctest/TrilinosCTestDriverCore.cmake")
+ # If it exists already, download is a complete no-op:
+ ExternalProject_Add(download-${PROJECT_NAME}
+ DOWNLOAD_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ )
+else()
+ # If it does not yet exist, download pulls the tarball from the web (or
+ # no-ops if it already exists with the given md5 sum):
+ #
+ ExternalProject_Add(download-${PROJECT_NAME}
+ DOWNLOAD_DIR "${download_dir}"
+ URL "${url}"
+ URL_MD5 "${md5}"
+ SOURCE_DIR "${source_dir}"
+ PATCH_COMMAND ${CMAKE_COMMAND} -Dsource_dir=${source_dir} -P "${CMAKE_CURRENT_SOURCE_DIR}/Patch.cmake"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ )
+endif()
+
+ExternalProject_Add(build-${PROJECT_NAME}
+ DOWNLOAD_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ${CMAKE_COMMAND} -P "${script_dir}/Dashboard.cmake"
+ INSTALL_COMMAND ""
+ DEPENDS download-${PROJECT_NAME}
+ )
diff --git a/Tests/Contracts/Trilinos-10-6/Dashboard.cmake.in b/Tests/Contracts/Trilinos-10-6/Dashboard.cmake.in
new file mode 100644
index 0000000..cc29502
--- /dev/null
+++ b/Tests/Contracts/Trilinos-10-6/Dashboard.cmake.in
@@ -0,0 +1,63 @@
+# This "cmake -P" script may be configured to drive a dashboard on any machine.
+#
+set(CTEST_BINARY_DIRECTORY "@binary_dir@")
+set(CTEST_BUILD_NAME "@BUILDNAME@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_SOURCE_DIRECTORY "@source_dir@")
+
+# Set the environment:
+#
+set(ENV{CTEST_BUILD_NAME} "${CTEST_BUILD_NAME}")
+set(ENV{CTEST_CMAKE_GENERATOR} "${CTEST_CMAKE_GENERATOR}")
+set(ENV{CTEST_SITE} "${CTEST_SITE}")
+
+# Allow override of the environment on a per-client basis:
+#
+set(ENV_SCRIPT "$ENV{CMAKE_CONTRACT_Trilinos_10_6_ENV_SCRIPT}")
+if(ENV_SCRIPT AND EXISTS "${ENV_SCRIPT}")
+ include("${ENV_SCRIPT}")
+endif()
+
+# Empty build dir to start with:
+#
+message("Cleaning binary dir '${CTEST_BINARY_DIRECTORY}'")
+file(REMOVE_RECURSE "${CTEST_BINARY_DIRECTORY}")
+
+# Generate 'do-configure' script:
+#
+file(WRITE "${CTEST_BINARY_DIRECTORY}/do-configure" "
+\"${CMAKE_COMMAND}\" -G \"${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"
+")
+
+# Make the 'do-configure' script executable and execute it:
+#
+if(WIN32)
+ configure_file(
+ "${CTEST_BINARY_DIRECTORY}/do-configure"
+ "${CTEST_BINARY_DIRECTORY}/do-configure.cmd"
+ COPYONLY)
+ execute_process(COMMAND "${CTEST_BINARY_DIRECTORY}/do-configure.cmd"
+ WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
+else()
+ execute_process(COMMAND chmod +x "${CTEST_BINARY_DIRECTORY}/do-configure")
+ execute_process(COMMAND "${CTEST_BINARY_DIRECTORY}/do-configure"
+ WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
+endif()
+
+# Run an experimental Trilinos dashboard:
+#
+execute_process(COMMAND
+ "${CMAKE_CTEST_COMMAND}"
+ -S "${CTEST_SOURCE_DIRECTORY}/cmake/ctest/experimental_build_test.cmake"
+ -VV
+ WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}"
+ RESULT_VARIABLE rv
+ )
+
+if(NOT "${rv}" STREQUAL "0")
+ message("error(s) (or warnings or test failures) running Trilinos dashboard
+script experimental_build_test.cmake...
+ctest returned rv='${rv}'
+")
+endif()
diff --git a/Tests/Contracts/Trilinos-10-6/EnvScript.cmake b/Tests/Contracts/Trilinos-10-6/EnvScript.cmake
new file mode 100644
index 0000000..dacb704
--- /dev/null
+++ b/Tests/Contracts/Trilinos-10-6/EnvScript.cmake
@@ -0,0 +1,32 @@
+# Site specific settings:
+#
+if(CTEST_SITE MATCHES "faraway")
+ set(CTEST_SITE "faraway.kitware")
+ set(ENV{CTEST_SITE} "${CTEST_SITE}")
+endif()
+
+if(CTEST_SITE STREQUAL "HUT11")
+ set(CTEST_SITE "hut11.kitware")
+ set(ENV{CTEST_SITE} "${CTEST_SITE}")
+
+ set(ENV{CLAPACK_DIR} "C:/T/clapack/b/clapack-prefix/src/clapack-build")
+endif()
+
+if(CTEST_SITE MATCHES "qwghlm")
+ set(CTEST_SITE "qwghlm.kitware")
+ set(ENV{CTEST_SITE} "${CTEST_SITE}")
+
+ set(ENV{PATH} "/opt/local/bin:$ENV{PATH}")
+ set(ENV{CC} "gcc-mp-4.3")
+ set(ENV{CXX} "g++-mp-4.3")
+ set(ENV{FC} "gfortran-mp-4.3")
+endif()
+
+# Submit to alternate CDash server:
+#
+#set(ENV{CTEST_DROP_SITE} "localhost")
+#set(ENV{CTEST_DROP_LOCATION} "/CDash/submit.php?project=Trilinos")
+
+# Limit packages built:
+#
+set(ENV{Trilinos_PACKAGES} "Teuchos;Kokkos")
diff --git a/Tests/Contracts/Trilinos-10-6/Patch.cmake b/Tests/Contracts/Trilinos-10-6/Patch.cmake
new file mode 100644
index 0000000..a7aae27
--- /dev/null
+++ b/Tests/Contracts/Trilinos-10-6/Patch.cmake
@@ -0,0 +1,20 @@
+if(NOT DEFINED source_dir)
+ message(FATAL_ERROR "variable 'source_dir' not defined")
+endif()
+
+if(NOT EXISTS "${source_dir}/CMakeLists.txt")
+ message(FATAL_ERROR "error: No CMakeLists.txt file to patch!")
+endif()
+
+set(text "
+
+#
+# Reference variables typically given as experimental_build_test configure
+# options to avoid CMake warnings about unused variables
+#
+
+MESSAGE(\"Trilinos_ALLOW_NO_PACKAGES='\${Trilinos_ALLOW_NO_PACKAGES}'\")
+MESSAGE(\"Trilinos_WARNINGS_AS_ERRORS_FLAGS='\${Trilinos_WARNINGS_AS_ERRORS_FLAGS}'\")
+")
+
+file(APPEND "${source_dir}/CMakeLists.txt" "${text}")
diff --git a/Tests/Contracts/Trilinos-10-6/RunTest.cmake b/Tests/Contracts/Trilinos-10-6/RunTest.cmake
new file mode 100644
index 0000000..30124d8
--- /dev/null
+++ b/Tests/Contracts/Trilinos-10-6/RunTest.cmake
@@ -0,0 +1,7 @@
+# ValidateBuild.cmake is configured into this location when the test is built:
+set(dir "${CMAKE_CURRENT_BINARY_DIR}/Contracts/${project}")
+
+set(exe "${CMAKE_COMMAND}")
+set(args -P "${dir}/ValidateBuild.cmake")
+
+set(Trilinos-10-6_RUN_TEST ${exe} ${args})
diff --git a/Tests/Contracts/Trilinos-10-6/ValidateBuild.cmake.in b/Tests/Contracts/Trilinos-10-6/ValidateBuild.cmake.in
new file mode 100644
index 0000000..04bbf21
--- /dev/null
+++ b/Tests/Contracts/Trilinos-10-6/ValidateBuild.cmake.in
@@ -0,0 +1,39 @@
+#
+# This code validates that the Trilinos build was "successful enough" (since it
+# is difficult to detect this from the caller of the experimental_build_test
+# dashboard script...)
+#
+set(binary_dir "@binary_dir@")
+message("binary_dir='${binary_dir}'")
+
+
+# Count *.exe files:
+#
+file(GLOB_RECURSE exes "${binary_dir}/*.exe")
+message(STATUS "exes='${exes}'")
+list(LENGTH exes len)
+if(len LESS 47)
+ message(FATAL_ERROR "len='${len}' is less than minimum expected='47' (count of executables)")
+endif()
+message(STATUS "Found len='${len}' *.exe files")
+
+
+# Try to find the Teuchos unit tests executable:
+#
+file(GLOB_RECURSE exe "${binary_dir}/Teuchos_UnitTest_UnitTests.exe")
+list(LENGTH exe len)
+if(NOT len EQUAL 1)
+ message(FATAL_ERROR "len='${len}' is not the expected='1' (count of Teuchos_UnitTest_UnitTests.exe)")
+endif()
+message(STATUS "Found exe='${exe}'")
+
+
+# Try to run it:
+execute_process(COMMAND ${exe} RESULT_VARIABLE rv)
+if(NOT "${rv}" STREQUAL "0")
+ message(FATAL_ERROR "rv='${rv}' is not the expected='0' (result of running Teuchos_UnitTest_UnitTests.exe)")
+endif()
+message(STATUS "Ran exe='${exe}' rv='${rv}'")
+
+
+message(STATUS "All Trilinos build validation tests pass.")
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index 76208d4..19e3c2c 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -55,7 +55,7 @@ ADD_CUSTOM_COMMAND(
# Test creating files from a custom target
#
################################################################
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.dvi
+ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}//doc1.dvi # test 2 slashes
DEPENDS ${PROJECT_SOURCE_DIR}/doc1.tex
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${PROJECT_SOURCE_DIR}/doc1.tex
@@ -130,6 +130,7 @@ ADD_CUSTOM_COMMAND(
################################################################
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.pre
DEPENDS ${PROJECT_SOURCE_DIR}/foo.in
+ TDocument # Ensure doc1.h generates before this target
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${PROJECT_SOURCE_DIR}/foo.in
${PROJECT_BINARY_DIR}/foo.pre
@@ -181,10 +182,6 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/generated.c
TARGET_LINK_LIBRARIES(CustomCommand GeneratedHeader)
-# must add a dependency on TDocument otherwise it might never build and
-# the CustomCommand executable really needs doc1.h
-ADD_DEPENDENCIES(CustomCommand TDocument)
-
##############################################################################
# Test for using just the target name as executable in the COMMAND
# section. Has to be recognized and replaced by CMake with the output
@@ -426,3 +423,16 @@ ADD_CUSTOM_TARGET(DifferentName ALL
)
#
# </SameNameTest>
+
+# Per-config target name and generator expressions.
+ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig)
+ADD_CUSTOM_COMMAND(
+ OUTPUT perconfig.out
+ COMMAND ${PerConfig_COMMAND}
+ DEPENDS ${PerConfig_DEPENDS}
+ VERBATIM
+ )
+SET_PROPERTY(SOURCE perconfig.out PROPERTY SYMBOLIC 1)
+ADD_CUSTOM_TARGET(perconfig_target ALL
+ COMMAND ${CMAKE_COMMAND} -E echo "perconfig=$<TARGET_FILE:perconfig>" "config=$<CONFIGURATION>"
+ DEPENDS perconfig.out)
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 34b8717..e65e362 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -75,8 +75,64 @@ foreach(c DEBUG RELWITHDEBINFO)
set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
endforeach(c)
+#-----------------------------------------------------------------------------
+# Create a custom target to generate a header for the libraries below.
+# Drive the header generation through an indirect chain of imported
+# target dependencies.
+
+# testLib2tmp1.h
+add_custom_command(
+ OUTPUT testLib2tmp1.h
+ VERBATIM COMMAND
+ ${CMAKE_COMMAND} -E echo "extern int testLib2(void);" > testLib2tmp1.h
+ )
+
+# hdr_testLib2tmp1 needs testLib2tmp1.h
+add_custom_target(hdr_testLib2tmp1 DEPENDS testLib2tmp1.h)
+
+# exp_testExe2 needs hdr_testLib2tmp1
+add_dependencies(exp_testExe2 hdr_testLib2tmp1)
+
+# testLib2tmp.h needs exp_testExe2
+add_custom_command(
+ OUTPUT testLib2tmp.h
+ VERBATIM COMMAND exp_testExe2
+ COMMAND ${CMAKE_COMMAND} -E copy testLib2tmp1.h testLib2tmp.h
+ )
+
+# hdr_testLib2tmp needs testLib2tmp.h
+add_custom_target(hdr_testLib2tmp DEPENDS testLib2tmp.h)
+
+add_library(dep_testLib2tmp UNKNOWN IMPORTED)
+set_property(TARGET dep_testLib2tmp PROPERTY
+ IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/testLib2tmp.h)
+
+# dep_testLib2tmp needs hdr_testLib2tmp
+add_dependencies(dep_testLib2tmp hdr_testLib2tmp)
+
+# testLib2.h needs dep_testLib2tmp
+add_custom_command(
+ OUTPUT testLib2.h
+ VERBATIM COMMAND ${CMAKE_COMMAND} -E copy testLib2tmp.h testLib2.h
+ DEPENDS dep_testLib2tmp
+ )
+
+# hdr_testLib2 needs testLib2.h
+add_custom_target(hdr_testLib2 DEPENDS testLib2.h)
+
+add_library(dep_testLib2 UNKNOWN IMPORTED)
+
+# dep_testLib2 needs hdr_testLib2
+add_dependencies(dep_testLib2 hdr_testLib2)
+
+# exp_testLib2 and bld_testLib2 both need dep_testLib2
+add_dependencies(bld_testLib2 dep_testLib2)
+add_dependencies(exp_testLib2 dep_testLib2)
+
+#-----------------------------------------------------------------------------
# Create a library to be linked by another directory in this project
# to test transitive linking to otherwise invisible imported targets.
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_library(imp_lib1 STATIC imp_lib1.c)
target_link_libraries(imp_lib1 exp_testLib2)
add_library(imp_lib1b STATIC imp_lib1.c)
diff --git a/Tests/ExportImport/Import/A/imp_lib1.c b/Tests/ExportImport/Import/A/imp_lib1.c
index d8c66e6..5b3215e 100644
--- a/Tests/ExportImport/Import/A/imp_lib1.c
+++ b/Tests/ExportImport/Import/A/imp_lib1.c
@@ -1,4 +1,4 @@
-extern int testLib2(void);
+#include "testLib2.h"
int imp_lib1(void)
{
diff --git a/Tests/ForceInclude/CMakeLists.txt b/Tests/ForceInclude/CMakeLists.txt
new file mode 100644
index 0000000..5c02ebb
--- /dev/null
+++ b/Tests/ForceInclude/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 2.8.3.20110103)
+project(ForceInclude C)
+
+# Make sure the proper compiler is in use.
+if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
+ message(FATAL_ERROR "The ForceInclude test works only with MSVC or Intel")
+endif()
+
+add_executable(foo foo.c)
+set_property(SOURCE foo.c PROPERTY COMPILE_FLAGS "/FIfoo1.h /FIfoo2.h")
diff --git a/Tests/ForceInclude/foo.c b/Tests/ForceInclude/foo.c
new file mode 100644
index 0000000..af898f4
--- /dev/null
+++ b/Tests/ForceInclude/foo.c
@@ -0,0 +1,7 @@
+#ifndef FOO_1
+# error "foo1.h not included by /FI"
+#endif
+#ifndef FOO_2
+# error "foo2.h not included by /FI"
+#endif
+int main(void) { return 0; }
diff --git a/Tests/ForceInclude/foo1.h b/Tests/ForceInclude/foo1.h
new file mode 100644
index 0000000..2c1cb7b
--- /dev/null
+++ b/Tests/ForceInclude/foo1.h
@@ -0,0 +1 @@
+#define FOO_1
diff --git a/Tests/ForceInclude/foo2.h b/Tests/ForceInclude/foo2.h
new file mode 100644
index 0000000..e47524d
--- /dev/null
+++ b/Tests/ForceInclude/foo2.h
@@ -0,0 +1 @@
+#define FOO_2
diff --git a/Tests/Jump/Library/Shared/CMakeLists.txt b/Tests/Jump/Library/Shared/CMakeLists.txt
index 46d4d36..4440577 100644
--- a/Tests/Jump/Library/Shared/CMakeLists.txt
+++ b/Tests/Jump/Library/Shared/CMakeLists.txt
@@ -1,8 +1,8 @@
ADD_LIBRARY(jumpShared SHARED jumpShared.cxx)
-IF(WIN32)
+IF(WIN32 OR CYGWIN)
SET(SHARED_MUST_BE_IN_EXE_DIR 1)
-ENDIF(WIN32)
+ENDIF()
IF(APPLE)
SET(SHARED_MUST_BE_IN_EXE_DIR 1)
diff --git a/Tests/PerConfig/CMakeLists.txt b/Tests/PerConfig/CMakeLists.txt
new file mode 100644
index 0000000..3a473b8
--- /dev/null
+++ b/Tests/PerConfig/CMakeLists.txt
@@ -0,0 +1,34 @@
+project(PerConfig C)
+
+# Targets with per-configuration names.
+ADD_LIBRARY(pcStatic STATIC pcStatic.c)
+SET_PROPERTY(TARGET pcStatic PROPERTY RELEASE_POSTFIX -opt)
+SET_PROPERTY(TARGET pcStatic PROPERTY DEBUG_POSTFIX -dbg)
+ADD_LIBRARY(pcShared SHARED pcShared.c)
+SET_PROPERTY(TARGET pcShared PROPERTY RELEASE_POSTFIX -opt)
+SET_PROPERTY(TARGET pcShared PROPERTY DEBUG_POSTFIX -dbg)
+SET_PROPERTY(TARGET pcShared PROPERTY VERSION 1.2)
+SET_PROPERTY(TARGET pcShared PROPERTY SOVERSION 3)
+IF(UNIX AND NOT CYGWIN)
+ SET(soname_file -DpcShared_soname_file=$<TARGET_SONAME_FILE:pcShared>)
+ENDIF()
+ADD_EXECUTABLE(perconfig perconfig.c)
+TARGET_LINK_LIBRARIES(perconfig pcStatic pcShared)
+SET_PROPERTY(TARGET perconfig PROPERTY RELEASE_POSTFIX -opt)
+SET_PROPERTY(TARGET perconfig PROPERTY DEBUG_POSTFIX -dbg)
+
+SET(PerConfig_COMMAND
+ ${CMAKE_COMMAND}
+ -Dconfiguration=$<CONFIGURATION>
+ -Dperconfig_file_dir=$<TARGET_FILE_DIR:perconfig>
+ -Dperconfig_file_name=$<TARGET_FILE_NAME:perconfig>
+ -Dperconfig_file=$<TARGET_FILE:perconfig>
+ -DpcStatic_file=$<TARGET_FILE:pcStatic>
+ -DpcStatic_linker_file=$<TARGET_LINKER_FILE:pcStatic>
+ -DpcShared_file=$<TARGET_FILE:pcShared>
+ -DpcShared_linker_file=$<TARGET_LINKER_FILE:pcShared>
+ ${soname_file}
+ -P ${PerConfig_SOURCE_DIR}/perconfig.cmake
+ )
+SET(PerConfig_COMMAND "${PerConfig_COMMAND}" PARENT_SCOPE)
+SET(PerConfig_DEPENDS ${PerConfig_SOURCE_DIR}/perconfig.cmake perconfig pcStatic pcShared)
diff --git a/Tests/Testing/pcShared.c b/Tests/PerConfig/pcShared.c
index b08fadc..b08fadc 100644
--- a/Tests/Testing/pcShared.c
+++ b/Tests/PerConfig/pcShared.c
diff --git a/Tests/Testing/pcShared.h b/Tests/PerConfig/pcShared.h
index 59a6ef4..59a6ef4 100644
--- a/Tests/Testing/pcShared.h
+++ b/Tests/PerConfig/pcShared.h
diff --git a/Tests/Testing/pcStatic.c b/Tests/PerConfig/pcStatic.c
index 7e1bf51..7e1bf51 100644
--- a/Tests/Testing/pcStatic.c
+++ b/Tests/PerConfig/pcStatic.c
diff --git a/Tests/Testing/perconfig.c b/Tests/PerConfig/perconfig.c
index d942d45..d942d45 100644
--- a/Tests/Testing/perconfig.c
+++ b/Tests/PerConfig/perconfig.c
diff --git a/Tests/Testing/driver.cmake b/Tests/PerConfig/perconfig.cmake
index 4a93acc..6a710ca 100644
--- a/Tests/Testing/driver.cmake
+++ b/Tests/PerConfig/perconfig.cmake
@@ -10,7 +10,7 @@ foreach(v
pcShared_linker_file
pcShared_soname_file
)
- message("${v}=${${v}}")
+ message(STATUS "${v}=${${v}}")
endforeach()
# Verify that file names match as expected.
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index 2e052bf..7792a35 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -256,3 +256,27 @@ endif()
if(NOT "${var_b}" STREQUAL "x")
message(FATAL_ERROR "count incorrect \"b\": [${var_b}]")
endif()
+
+# Test SUBSTRING command
+SET(ST_INPUTSTRING "0123456789")
+STRING(SUBSTRING ${ST_INPUTSTRING} 3 0 ST_EMPTY)
+STRING(SUBSTRING ${ST_INPUTSTRING} 1 1 ST_ONE)
+STRING(SUBSTRING ${ST_INPUTSTRING} 0 10 ST_ALL)
+STRING(SUBSTRING ${ST_INPUTSTRING} 0 -1 ST_ALL_MINUS)
+STRING(SUBSTRING ${ST_INPUTSTRING} 9 -1 ST_NINE)
+
+IF(ST_EMPTY)
+ MESSAGE(SEND_ERROR "SUBSTRING with length 0 does not return an empty string")
+ENDIF(ST_EMPTY)
+IF(NOT ST_ONE STREQUAL "1")
+ MESSAGE(SEND_ERROR "SUBSTING command does not cut the correct selected character, was \"" ${ST_ONE} "\", should be \"1\"")
+ENDIF(NOT ST_ONE STREQUAL "1")
+IF(NOT ST_INPUTSTRING STREQUAL ST_ALL)
+ MESSAGE(SEND_ERROR "SUBSTRING does not return the whole string when selected with length")
+ENDIF(NOT ST_INPUTSTRING STREQUAL ST_ALL)
+IF(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS)
+ MESSAGE(SEND_ERROR "SUBSTRING does not return the whole string when selected with -1")
+ENDIF(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS)
+IF(NOT ST_NINE STREQUAL "9")
+ MESSAGE(SEND_ERROR "SUBSTRING does not return the tail when selected with -1")
+ENDIF(NOT ST_NINE STREQUAL "9")
diff --git a/Tests/Testing/CMakeLists.txt b/Tests/Testing/CMakeLists.txt
index f857407..815b52b 100644
--- a/Tests/Testing/CMakeLists.txt
+++ b/Tests/Testing/CMakeLists.txt
@@ -53,35 +53,7 @@ ADD_TEST(testing.1 ${Testing_BINARY_DIR}/bin/testing)
#
ADD_SUBDIRECTORY(Sub/Sub2)
-# Per-config target name test.
-ADD_LIBRARY(pcStatic STATIC pcStatic.c)
-SET_PROPERTY(TARGET pcStatic PROPERTY RELEASE_POSTFIX -opt)
-SET_PROPERTY(TARGET pcStatic PROPERTY DEBUG_POSTFIX -dbg)
-ADD_LIBRARY(pcShared SHARED pcShared.c)
-SET_PROPERTY(TARGET pcShared PROPERTY RELEASE_POSTFIX -opt)
-SET_PROPERTY(TARGET pcShared PROPERTY DEBUG_POSTFIX -dbg)
-SET_PROPERTY(TARGET pcShared PROPERTY VERSION 1.2)
-SET_PROPERTY(TARGET pcShared PROPERTY SOVERSION 3)
-IF(NOT WIN32)
- SET(soname_file -DpcShared_soname_file=$<TARGET_SONAME_FILE:pcShared>)
-ENDIF()
-ADD_EXECUTABLE(perconfig perconfig.c)
-TARGET_LINK_LIBRARIES(perconfig pcStatic pcShared)
-SET_PROPERTY(TARGET perconfig PROPERTY RELEASE_POSTFIX -opt)
-SET_PROPERTY(TARGET perconfig PROPERTY DEBUG_POSTFIX -dbg)
+# Per-config target name and generator expressions.
+ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig)
ADD_TEST(NAME testing.perconfig COMMAND perconfig)
-
-# Test using a driver script with generator expressions.
-ADD_TEST(NAME testing.driver
- COMMAND ${CMAKE_COMMAND}
- -Dconfiguration=$<CONFIGURATION>
- -Dperconfig_file_dir=$<TARGET_FILE_DIR:perconfig>
- -Dperconfig_file_name=$<TARGET_FILE_NAME:perconfig>
- -Dperconfig_file=$<TARGET_FILE:perconfig>
- -DpcStatic_file=$<TARGET_FILE:pcStatic>
- -DpcStatic_linker_file=$<TARGET_LINKER_FILE:pcStatic>
- -DpcShared_file=$<TARGET_FILE:pcShared>
- -DpcShared_linker_file=$<TARGET_LINKER_FILE:pcShared>
- ${soname_file}
- -P ${Testing_SOURCE_DIR}/driver.cmake
- )
+ADD_TEST(NAME testing.driver COMMAND ${PerConfig_COMMAND})
diff --git a/Tests/Testing/Sub/Sub2/CMakeLists.txt b/Tests/Testing/Sub/Sub2/CMakeLists.txt
index 3a7295d..fb9e861 100644
--- a/Tests/Testing/Sub/Sub2/CMakeLists.txt
+++ b/Tests/Testing/Sub/Sub2/CMakeLists.txt
@@ -3,3 +3,15 @@
#
ADD_EXECUTABLE(testing2 testing2.cxx)
ADD_TEST(testing.2 ${Testing_BINARY_DIR}/bin/testing2)
+
+add_test(NotCycle.a ${CMAKE_COMMAND} -E echo a)
+add_test(NotCycle.test1 ${CMAKE_COMMAND} -E echo test1)
+set_property(TEST NotCycle.test1 PROPERTY DEPENDS NotCycle.a)
+
+add_test(NotCycle.b ${CMAKE_COMMAND} -E echo b)
+add_test(NotCycle.test2 ${CMAKE_COMMAND} -E echo test2)
+set_property(TEST NotCycle.test2 PROPERTY DEPENDS NotCycle.b NotCycle.test1)
+
+add_test(NotCycle.c ${CMAKE_COMMAND} -E echo c)
+add_test(NotCycle.test3 ${CMAKE_COMMAND} -E echo test3)
+set_property(TEST NotCycle.test3 PROPERTY DEPENDS NotCycle.c NotCycle.test1 NotCycle.test2)
diff --git a/Tests/TestsWorkingDirectory/CMakeLists.txt b/Tests/TestsWorkingDirectory/CMakeLists.txt
new file mode 100644
index 0000000..0fef19d
--- /dev/null
+++ b/Tests/TestsWorkingDirectory/CMakeLists.txt
@@ -0,0 +1,38 @@
+cmake_minimum_required(VERSION 2.6)
+project(TestsWorkingDirectoryProj)
+
+add_executable(WorkingDirectory main.c)
+
+enable_testing()
+
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
+
+add_test(NAME WorkingDirectory1 COMMAND WorkingDirectory "${CMAKE_BINARY_DIR}")
+set_tests_properties(WorkingDirectory1 PROPERTIES
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+)
+
+string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory2 COMMAND WorkingDirectory "${_parent_dir}")
+set_tests_properties(WorkingDirectory2 PROPERTIES
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/.."
+)
+
+get_filename_component(_default_cwd "${EXECUTABLE_OUTPUT_PATH}" PATH)
+
+# FIXME: How to deal with /debug, /release, etc. with VS or XCode?
+if(${CMAKE_GENERATOR} MATCHES "Makefiles")
+add_test(WorkingDirectory3 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd})
+endif()
+
+add_test(NAME WorkingDirectory4 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND WorkingDirectory ${CMAKE_BINARY_DIR})
+
+string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory5 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/.. COMMAND WorkingDirectory ${_parent_dir})
+
+# FIXME: How to deal with /debug, /release, etc. with VS or XCode?
+if(${CMAKE_GENERATOR} MATCHES "Makefiles")
+add_test(WorkingDirectory6 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/..)
+endif()
diff --git a/Tests/TestsWorkingDirectory/main.c b/Tests/TestsWorkingDirectory/main.c
new file mode 100644
index 0000000..19f2f14
--- /dev/null
+++ b/Tests/TestsWorkingDirectory/main.c
@@ -0,0 +1,64 @@
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
+
+#include <io.h>
+#include <direct.h>
+
+#if defined(__WATCOMC__)
+#include <direct.h>
+#define _getcwd getcwd
+#endif
+
+static const char* Getcwd(char* buf, unsigned int len)
+{
+ const char* ret = _getcwd(buf, len);
+ char* p = NULL;
+ if(!ret)
+ {
+ fprintf(stderr, "No current working directory.\n");
+ abort();
+ }
+ // make sure the drive letter is capital
+ if(strlen(buf) > 1 && buf[1] == ':')
+ {
+ buf[0] = toupper(buf[0]);
+ }
+ for(p = buf; *p; ++p)
+ {
+ if(*p == '\\')
+ {
+ *p = '/';
+ }
+ }
+ return ret;
+}
+
+#else
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+static const char* Getcwd(char* buf, unsigned int len)
+{
+ const char* ret = getcwd(buf, len);
+ if(!ret)
+ {
+ fprintf(stderr, "No current working directory\n");
+ abort();
+ }
+ return ret;
+}
+
+#endif
+
+int main(int argc, char *argv[])
+{
+ char buf[2048];
+ const char *cwd = Getcwd(buf, sizeof(buf));
+
+ return strcmp(cwd, argv[1]);
+}
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index a57498f..90c2cfc 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -226,3 +226,9 @@ UNSET(CXX_BOGUS_FLAG CACHE)
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(${CXX_DD}-_this_is_not_a_flag_ CXX_BOGUS_FLAG)
TEST_FAIL(CXX_BOGUS_FLAG "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed")
+
+IF("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+ UNSET(C_STRICT_PROTOTYPES CACHE)
+ CHECK_C_COMPILER_FLAG("-Werror;-Wstrict-prototypes" C_STRICT_PROTOTYPES)
+ TEST_ASSERT(C_STRICT_PROTOTYPES "CHECK_C_COMPILER_FLAG failed -Werror -Wstrict-prototypes")
+ENDIF()
diff --git a/Tests/VSMidl/CMakeLists.txt b/Tests/VSMidl/CMakeLists.txt
new file mode 100644
index 0000000..432506c
--- /dev/null
+++ b/Tests/VSMidl/CMakeLists.txt
@@ -0,0 +1,81 @@
+# This CMakeLists.txt file exists solely to drive the one found in the "src"
+# subdir as an ExternalProject build. The project in "src" cannot build when
+# there is a space in the directory name, so we copy that directory to a place
+# guaranteed not to have a space in the name, build it there, and then copy the
+# resulting output directory back up here into this CMake test's build tree.
+#
+if(NOT DEFINED CMAKE_BUILDNAME)
+ string(REGEX REPLACE "^.*/([^/]+)/[^/]+/([^/]+)$" "\\1" CMAKE_BUILDNAME "${CMAKE_CURRENT_BINARY_DIR}")
+ string(REGEX REPLACE "^.*/([^/]+)/[^/]+/([^/]+)$" "\\2" THIS_TESTNAME "${CMAKE_CURRENT_BINARY_DIR}")
+ string(REPLACE " " "_" CMAKE_BUILDNAME "${CMAKE_BUILDNAME}")
+endif()
+message(STATUS "CMAKE_BUILDNAME='${CMAKE_BUILDNAME}'")
+message(STATUS "THIS_TESTNAME='${THIS_TESTNAME}'")
+
+cmake_minimum_required(VERSION 2.8)
+project(${THIS_TESTNAME})
+
+include(ExternalProject)
+
+if(NOT DEFINED HOME)
+ if(DEFINED ENV{CTEST_REAL_HOME})
+ set(HOME "$ENV{CTEST_REAL_HOME}")
+ else()
+ set(HOME "$ENV{HOME}")
+ endif()
+
+ if(NOT HOME AND WIN32)
+ # Try for USERPROFILE as HOME equivalent:
+ string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}")
+ endif()
+
+ # But just use root of SystemDrive if HOME contains any spaces:
+ # (Default on XP and earlier...)
+ if(HOME MATCHES " " AND WIN32)
+ string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}")
+ endif()
+ if(HOME MATCHES " ")
+ set(HOME "")
+ endif()
+endif()
+message(STATUS "HOME='${HOME}'")
+
+if(NOT DEFINED url)
+ set(url "${CMAKE_CURRENT_SOURCE_DIR}/src")
+endif()
+message(STATUS "url='${url}'")
+
+set(base_dir "${HOME}/.cmake/Dashboards/${CMAKE_BUILDNAME}/${THIS_TESTNAME}")
+set(binary_dir "${base_dir}/build")
+set(source_dir "${base_dir}/src")
+
+# Source dir for this project exists in the CMake source tree, but we cannot
+# use it in-place since there might be a space in its directory name.
+# Source dir is therefore copied under a '.cmake/Dashboards'
+# dir in your HOME directory to give it a name with no spaces.
+#
+ExternalProject_Add(clean-${PROJECT_NAME}
+ DOWNLOAD_COMMAND ""
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${source_dir}"
+ BUILD_COMMAND ${CMAKE_COMMAND} -E remove_directory "${binary_dir}"
+ INSTALL_COMMAND ""
+ )
+
+ExternalProject_Add(download-${PROJECT_NAME}
+ URL "${url}"
+ SOURCE_DIR "${source_dir}"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ DEPENDS clean-${PROJECT_NAME}
+ )
+
+ExternalProject_Add(build-${PROJECT_NAME}
+ DOWNLOAD_COMMAND ""
+ SOURCE_DIR "${source_dir}"
+ BINARY_DIR "${binary_dir}"
+ INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
+ "${binary_dir}/${CMAKE_CFG_INTDIR}"
+ "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
+ DEPENDS download-${PROJECT_NAME}
+ )
diff --git a/Tests/VSMidl/src/CMakeLists.txt b/Tests/VSMidl/src/CMakeLists.txt
new file mode 100644
index 0000000..86c04ed
--- /dev/null
+++ b/Tests/VSMidl/src/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 2.8)
+project(VSMidl)
+
+if(MSVC_VERSION GREATER 1200)
+ include_directories("${CMAKE_CURRENT_BINARY_DIR}/\$(IntDir)")
+else()
+ # midl generated headers end up directly in CMAKE_CURRENT_BINARY_DIR with
+ # VS6 builds.
+ include_directories("${CMAKE_CURRENT_BINARY_DIR}")
+endif()
+
+add_executable(VSMidl main.cpp test.idl)
diff --git a/Tests/VSMidl/src/main.cpp b/Tests/VSMidl/src/main.cpp
new file mode 100644
index 0000000..6b78fcc
--- /dev/null
+++ b/Tests/VSMidl/src/main.cpp
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <test.h>
+#include <test_i.c>
+
+int main(int argc, char** argv)
+{
+ IID libid = LIBID_CMakeMidlTestLib;
+ CLSID clsid = CLSID_CMakeMidlTest;
+ IID iid = IID_ICMakeMidlTest;
+
+ printf("Running '%s'\n", argv[0]);
+ printf(" libid starts with '0x%08lx'\n", (long) libid.Data1);
+ printf(" clsid starts with '0x%08lx'\n", (long) clsid.Data1);
+ printf(" iid starts with '0x%08lx'\n", (long) iid.Data1);
+
+ return 0;
+}
diff --git a/Tests/VSMidl/src/test.idl b/Tests/VSMidl/src/test.idl
new file mode 100644
index 0000000..fd755c7
--- /dev/null
+++ b/Tests/VSMidl/src/test.idl
@@ -0,0 +1,30 @@
+import "oaidl.idl";
+import "ocidl.idl";
+
+[
+ object,
+ uuid(258CCEBE-8EE4-4A48-B78C-AC53BCD59E28),
+ dual,
+ nonextensible,
+ helpstring("ICMakeTest Interface"),
+ pointer_default(unique)
+]
+interface ICMakeMidlTest : IUnknown
+{
+ [id(1), helpstring("method Method")] HRESULT Method();
+}
+
+[
+ uuid(0537BA59-7EEC-48F8-BD4B-369BC7D9807E),
+]
+library CMakeMidlTestLib
+{
+ [
+ uuid(D2A90807-019A-46E5-BF47-FF4FA4352D2A),
+ helpstring("CMakeMidlTest Class")
+ ]
+ coclass CMakeMidlTest
+ {
+ [default] interface ICMakeMidlTest;
+ };
+}
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt
new file mode 100644
index 0000000..e842955
--- /dev/null
+++ b/Tests/VSResource/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required (VERSION 2.6)
+project (VSResource)
+add_definitions(/DCMAKE_RCDEFINE="test.txt")
+string(REPLACE "/INCREMENTAL:YES" ""
+ CMAKE_EXE_LINKER_FLAGS_DEBUG
+ "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
+add_executable(VSResource main.cpp test.rc)
diff --git a/Tests/VSResource/main.cpp b/Tests/VSResource/main.cpp
new file mode 100644
index 0000000..6f68df3
--- /dev/null
+++ b/Tests/VSResource/main.cpp
@@ -0,0 +1,10 @@
+#include <windows.h>
+
+int main(int argc, char** argv) {
+ HRSRC hello = ::FindResource(0, "hello", "TEXT");
+ if(hello) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
diff --git a/Tests/VSResource/test.rc b/Tests/VSResource/test.rc
new file mode 100644
index 0000000..8aab8b7
--- /dev/null
+++ b/Tests/VSResource/test.rc
@@ -0,0 +1,5 @@
+#ifdef CMAKE_RCDEFINE
+hello TEXT DISCARDABLE CMAKE_RCDEFINE
+#else
+#error "resource compiler did not get defines from command line!"
+#endif \ No newline at end of file
diff --git a/Tests/VSResource/test.txt b/Tests/VSResource/test.txt
new file mode 100644
index 0000000..980a0d5
--- /dev/null
+++ b/Tests/VSResource/test.txt
@@ -0,0 +1 @@
+Hello World!
diff --git a/Utilities/Release/Cygwin/CMakeLists.txt b/Utilities/Release/Cygwin/CMakeLists.txt
index 0c274f3..2420c97 100644
--- a/Utilities/Release/Cygwin/CMakeLists.txt
+++ b/Utilities/Release/Cygwin/CMakeLists.txt
@@ -1,8 +1,8 @@
-FILE(GLOB INSTALLED_CURSES /usr/bin/cygncurses*.dll)
+FILE(GLOB INSTALLED_CURSES /usr/bin/cygncurses-*.dll)
SET(MAX 0)
FOREACH(f ${INSTALLED_CURSES})
IF(NOT "${f}" MATCHES "\\+")
- STRING(REGEX REPLACE ".*([0-9]).dll" "\\1" NUMBER "${f}")
+ STRING(REGEX REPLACE ".*-([0-9]*).dll" "\\1" NUMBER "${f}")
IF(NUMBER GREATER MAX)
SET(MAX ${NUMBER})
ENDIF(NUMBER GREATER MAX)
diff --git a/Utilities/cmcurl/CMake/OtherTests.cmake b/Utilities/cmcurl/CMake/OtherTests.cmake
index ea1613d..7d2c66f 100644
--- a/Utilities/cmcurl/CMake/OtherTests.cmake
+++ b/Utilities/cmcurl/CMake/OtherTests.cmake
@@ -193,14 +193,6 @@ SET(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
CURL_CHECK_C_SOURCE_COMPILES("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
-INCLUDE(CurlCheckCSourceRuns)
-SET(EXTRA_DEFINES)
-SET(HEADER_INCLUDES)
-IF(HAVE_SYS_POLL_H)
- SET(HEADER_INCLUDES "sys/poll.h")
-ENDIF(HAVE_SYS_POLL_H)
-CURL_CHECK_C_SOURCE_RUNS("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
-
SET(HAVE_SIG_ATOMIC_T 1)
SET(EXTRA_DEFINES)
SET(HEADER_INCLUDES)
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 0f98e5a..454d2d1 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -521,42 +521,6 @@ MACRO(CURL_INTERNAL_TEST CURL_TEST)
ENDIF("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
ENDMACRO(CURL_INTERNAL_TEST)
-MACRO(CURL_INTERNAL_TEST_RUN CURL_TEST)
- IF("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
- SET(MACRO_CHECK_FUNCTION_DEFINITIONS
- "-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
- IF(CMAKE_REQUIRED_LIBRARIES)
- SET(CURL_TEST_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
-
- MESSAGE(STATUS "Performing Curl Test ${CURL_TEST}")
- TRY_RUN(${CURL_TEST} ${CURL_TEST}_COMPILE
- ${CMAKE_BINARY_DIR}
- ${LIBCURL_SOURCE_DIR}/CMake/CurlTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- "${CURL_TEST_ADD_LIBRARIES}"
- OUTPUT_VARIABLE OUTPUT)
- IF(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
- SET(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
- MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Success")
- ELSE(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
- MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
- SET(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
- FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
- "Performing Curl Test ${CURL_TEST} failed with the following output:\n"
- "${OUTPUT}")
- IF(${CURL_TEST}_COMPILE)
- FILE(APPEND
- "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
- "There was a running problem of this test\n")
- ENDIF(${CURL_TEST}_COMPILE)
- FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
- "\n\n")
- ENDIF(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
- ENDIF("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
-ENDMACRO(CURL_INTERNAL_TEST_RUN)
-
# Do curl specific tests
#OPTION(CURL_HAVE_DISABLED_NONBLOCKING "Disable non-blocking socket detection" OFF)
SET(CURL_NONBLOCKING_TESTS)
@@ -599,13 +563,6 @@ IF(HAVE_FILE_OFFSET_BITS)
SET(_FILE_OFFSET_BITS 64)
ENDIF(HAVE_FILE_OFFSET_BITS)
-FOREACH(CURL_TEST
- HAVE_GLIBC_STRERROR_R
- HAVE_POSIX_STRERROR_R
- )
- CURL_INTERNAL_TEST_RUN(${CURL_TEST})
-ENDFOREACH(CURL_TEST)
-
# Check for reentrant
FOREACH(CURL_TEST
HAVE_GETHOSTBYADDR_R_5
diff --git a/Utilities/cmcurl/config.h.in b/Utilities/cmcurl/config.h.in
index e3efdc1..6e74935 100644
--- a/Utilities/cmcurl/config.h.in
+++ b/Utilities/cmcurl/config.h.in
@@ -171,9 +171,6 @@
/* Define to 1 if you have the `gettimeofday' function. */
#cmakedefine HAVE_GETTIMEOFDAY ${HAVE_GETTIMEOFDAY}
-/* we have a glibc-style strerror_r() */
-#cmakedefine HAVE_GLIBC_STRERROR_R ${HAVE_GLIBC_STRERROR_R}
-
/* Define to 1 if you have the `gmtime_r' function. */
#cmakedefine HAVE_GMTIME_R ${HAVE_GMTIME_R}
@@ -348,12 +345,6 @@
/* Define to 1 if you have the `poll' function. */
#cmakedefine HAVE_POLL ${HAVE_POLL}
-/* If you have a fine poll */
-#cmakedefine HAVE_POLL_FINE ${HAVE_POLL_FINE}
-
-/* we have a POSIX-style strerror_r() */
-#cmakedefine HAVE_POSIX_STRERROR_R ${HAVE_POSIX_STRERROR_R}
-
/* Define to 1 if you have the <process.h> header file. */
#cmakedefine HAVE_PROCESS_H ${HAVE_PROCESS_H}
@@ -444,9 +435,6 @@
/* Define to 1 if you have the `strdup' function. */
#cmakedefine HAVE_STRDUP ${HAVE_STRDUP}
-/* Define to 1 if you have the `strerror_r' function. */
-#cmakedefine HAVE_STRERROR_R ${HAVE_STRERROR_R}
-
/* Define to 1 if you have the `stricmp' function. */
#cmakedefine HAVE_STRICMP ${HAVE_STRICMP}
diff --git a/Utilities/cmcurl/select.c b/Utilities/cmcurl/select.c
index d3967ed..51adbcf 100644
--- a/Utilities/cmcurl/select.c
+++ b/Utilities/cmcurl/select.c
@@ -78,7 +78,7 @@
*/
int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
{
-#if defined(HAVE_POLL_FINE) || defined(CURL_HAVE_WSAPOLL)
+#if (defined(HAVE_POLL) && !defined(_POLL_EMUL_H_)) || defined(CURL_HAVE_WSAPOLL)
struct pollfd pfd[2];
int num;
int r;
@@ -96,7 +96,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
num++;
}
-#ifdef HAVE_POLL_FINE
+#if defined(HAVE_POLL) && !defined(_POLL_EMUL_H_)
do {
r = poll(pfd, num, timeout_ms);
} while((r == -1) && (errno == EINTR));
@@ -220,7 +220,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
{
int r;
-#ifdef HAVE_POLL_FINE
+#if defined(HAVE_POLL) && !defined(_POLL_EMUL_H_)
do {
r = poll(ufds, nfds, timeout_ms);
} while((r == -1) && (errno == EINTR));
diff --git a/bootstrap b/bootstrap
index 0da868d..b4e19ef 100755
--- a/bootstrap
+++ b/bootstrap
@@ -215,6 +215,7 @@ CMAKE_CXX_SOURCES="\
cmTarget \
cmTest \
cmCustomCommand \
+ cmCustomCommandGenerator \
cmDocumentVariables \
cmCacheManager \
cmListFileCache \