diff options
-rw-r--r-- | Help/command/file.rst | 3 | ||||
-rw-r--r-- | Help/manual/cmake-file-api.7.rst | 4 | ||||
-rw-r--r-- | Help/release/3.18.rst | 6 | ||||
-rw-r--r-- | Source/cmFileCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmFindLibraryCommand.cxx | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/File_Configure/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/File_Configure/SubDir-check.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/File_Configure/SubDir.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/LibSymLink-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/LibSymLink.cmake | 17 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/RunCMakeTest.cmake | 3 |
13 files changed, 43 insertions, 7 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst index 3dbb3a5..c1a2032 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -508,8 +508,7 @@ The arguments are: ``OUTPUT <output-file>`` Specify the output file name to generate. A relative path is treated with - respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`. See policy - :policy:`CMP0070`. + respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`. ``<output-file>`` does not support generator expressions. ``CONTENT <content>`` diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst index 91be31d..cc50952 100644 --- a/Help/manual/cmake-file-api.7.rst +++ b/Help/manual/cmake-file-api.7.rst @@ -425,7 +425,7 @@ Version 1 does not exist to avoid confusion with that from { "kind": "codemodel", - "version": { "major": 2, "minor": 0 }, + "version": { "major": 2, "minor": 1 }, "paths": { "source": "/path/to/top-level-source-dir", "build": "/path/to/top-level-build-dir" @@ -915,6 +915,8 @@ with members: unsigned integer 0-based index into the ``backtraceGraph`` member's ``nodes`` array. + This field was added in codemodel version 2.1. + ``defines`` Optional member that is present when there are preprocessor definitions. The value is a JSON array with an entry for each definition. Each diff --git a/Help/release/3.18.rst b/Help/release/3.18.rst index ef4fa30..386b61b 100644 --- a/Help/release/3.18.rst +++ b/Help/release/3.18.rst @@ -312,3 +312,9 @@ Other Changes network communication via ``http(s)``, such as :command:`file(DOWNLOAD)`, :command:`file(UPLOAD)`, and :command:`ctest_submit`. The precompiled binaries provided on ``cmake.org`` now support HTTP/2. + +* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has + been updated to 2.1. + +* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained + a new ``precompileHeaders`` field in the ``compileGroups`` objects. diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 0f4b1db..7101e22 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2861,7 +2861,8 @@ bool HandleConfigureCommand(std::vector<std::string> const& args, // Check for generator expressions const std::string input = args[4]; - std::string outputFile = args[2]; + std::string outputFile = cmSystemTools::CollapseFullPath( + args[2], status.GetMakefile().GetCurrentBinaryDirectory()); std::string::size_type pos = input.find_first_of("<>"); if (pos != std::string::npos) { diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 31f1201..3242b6d 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -433,7 +433,8 @@ bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path, #endif if (name.Regex.find(testName)) { this->TestPath = cmStrCat(path, origName); - if (!cmSystemTools::FileIsDirectory(this->TestPath)) { + // Make sure the path is readable and is not a directory. + if (cmSystemTools::FileExists(this->TestPath, true)) { this->DebugLibraryFound(name.Raw, dir); // This is a matching file. Check if it is better than the diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 6c634b5..830566e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -317,7 +317,7 @@ add_RunCMake_test(ctest_upload) add_RunCMake_test(ctest_fixtures) add_RunCMake_test(file) add_RunCMake_test(find_file) -add_RunCMake_test(find_library) +add_RunCMake_test(find_library -DCYGWIN=${CYGWIN}) add_RunCMake_test(find_package) add_RunCMake_test(find_path) add_RunCMake_test(find_program -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) diff --git a/Tests/RunCMake/File_Configure/RunCMakeTest.cmake b/Tests/RunCMake/File_Configure/RunCMakeTest.cmake index d09d648..0337014 100644 --- a/Tests/RunCMake/File_Configure/RunCMakeTest.cmake +++ b/Tests/RunCMake/File_Configure/RunCMakeTest.cmake @@ -7,3 +7,4 @@ run_cmake(DirOutput) run_cmake(NewLineStyle-NoArg) run_cmake(NewLineStyle-ValidArg) run_cmake(NewLineStyle-WrongArg) +run_cmake(SubDir) diff --git a/Tests/RunCMake/File_Configure/SubDir-check.cmake b/Tests/RunCMake/File_Configure/SubDir-check.cmake new file mode 100644 index 0000000..1e82587 --- /dev/null +++ b/Tests/RunCMake/File_Configure/SubDir-check.cmake @@ -0,0 +1,4 @@ +set(expected "${RunCMake_TEST_BINARY_DIR}/SubDir/out.txt") +if(NOT EXISTS "${expected}") + set(RunCMake_TEST_FAILED "Expected file not created:\n ${expected}") +endif() diff --git a/Tests/RunCMake/File_Configure/SubDir.cmake b/Tests/RunCMake/File_Configure/SubDir.cmake new file mode 100644 index 0000000..fae60fa --- /dev/null +++ b/Tests/RunCMake/File_Configure/SubDir.cmake @@ -0,0 +1 @@ +add_subdirectory(SubDir) diff --git a/Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt b/Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt new file mode 100644 index 0000000..6bd962e --- /dev/null +++ b/Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt @@ -0,0 +1 @@ +file(CONFIGURE OUTPUT out.txt CONTENT "") diff --git a/Tests/RunCMake/find_library/LibSymLink-stderr.txt b/Tests/RunCMake/find_library/LibSymLink-stderr.txt new file mode 100644 index 0000000..8a2f088 --- /dev/null +++ b/Tests/RunCMake/find_library/LibSymLink-stderr.txt @@ -0,0 +1,2 @@ +^SYMLINK_LIBRARY='SYMLINK_LIBRARY-NOTFOUND' +SYMLINK_LIBRARY='[^']*/Tests/RunCMake/find_library/LibSymLink-build/lib/libsymlink.a'$ diff --git a/Tests/RunCMake/find_library/LibSymLink.cmake b/Tests/RunCMake/find_library/LibSymLink.cmake new file mode 100644 index 0000000..8ee4b75 --- /dev/null +++ b/Tests/RunCMake/find_library/LibSymLink.cmake @@ -0,0 +1,17 @@ +list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) +list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +file(CREATE_LINK "libsymlinked.a" "${CMAKE_CURRENT_BINARY_DIR}/lib/libsymlink.a" SYMBOLIC) +find_library(SYMLINK_LIBRARY + NAMES symlink + PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib + NO_DEFAULT_PATH + ) +message("SYMLINK_LIBRARY='${SYMLINK_LIBRARY}'") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libsymlinked.a" "symlinked") +find_library(SYMLINK_LIBRARY + NAMES symlink + PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib + NO_DEFAULT_PATH + ) +message("SYMLINK_LIBRARY='${SYMLINK_LIBRARY}'") diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake index b6aadce..c7d69e4 100644 --- a/Tests/RunCMake/find_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake @@ -3,8 +3,9 @@ include(RunCMake) run_cmake(Created) run_cmake(FromPrefixPath) run_cmake(FromPATHEnv) -if(CMAKE_HOST_UNIX) +if(UNIX AND NOT CYGWIN) run_cmake(LibArchLink) + run_cmake(LibSymLink) endif() run_cmake(PrefixInPATH) run_cmake(Required) |