CMake issueshttps://gitlab.kitware.com/cmake/cmake/-/issues2017-10-25T19:25:24-04:00https://gitlab.kitware.com/cmake/cmake/-/issues/16590CMake fails to determine dependencies of preprocessor wrapped Fortran use sta...2017-10-25T19:25:24-04:00carlorosatiCMake fails to determine dependencies of preprocessor wrapped Fortran use statementsAdding 5 lines to[test_preprocess.F90](/uploads/21265026d994d65d0fc3973fa96f037a/test_preprocess.F90)illustrates the behavior.
```
#if defined(NOTDEFINEDANYWHERE)
#define STILLNOTDEFINED
#endif
#ifndef STILLNOTDEFINED
USE PPAvail...Adding 5 lines to[test_preprocess.F90](/uploads/21265026d994d65d0fc3973fa96f037a/test_preprocess.F90)illustrates the behavior.
```
#if defined(NOTDEFINEDANYWHERE)
#define STILLNOTDEFINED
#endif
#ifndef STILLNOTDEFINED
USE PPAvailable
#endif
```https://gitlab.kitware.com/cmake/cmake/-/issues/16583Missing / inaccurate documentation of INSTALL and DESTDIR2017-10-13T13:17:55-04:00Kacper PlutaMissing / inaccurate documentation of INSTALL and DESTDIRThe documentation of INSTALL() should be improved by a section explaining the correct use of \$ENV{DESTDIR} during the installation time. This is important in order to avoid problems with incorrectly set paths during make install with a...The documentation of INSTALL() should be improved by a section explaining the correct use of \$ENV{DESTDIR} during the installation time. This is important in order to avoid problems with incorrectly set paths during make install with a user specified DESTDIR. The starting point would be: https://cmake.org/pipermail/cmake-developers/2013-January/017810.htmlhttps://gitlab.kitware.com/cmake/cmake/-/issues/16580Unexpected behaviour when using MAIN_DEPENDENCY2017-10-13T13:17:55-04:00Hendrik SattlerUnexpected behaviour when using MAIN_DEPENDENCYThe documentation says:
Specify the primary input source file to the command. This is treated just like any value given to the DEPENDS option but also suggests to Visual Studio generators where to hang the custom command. At most one cu...The documentation says:
Specify the primary input source file to the command. This is treated just like any value given to the DEPENDS option but also suggests to Visual Studio generators where to hang the custom command. At most one custom command may specify a given source file as its main dependency.
Then the following should work:
```cmake
cmake_minimum_required ( VERSION 3.6 )
project ( bug CXX )
add_custom_command ( OUTPUT main_copy.cpp
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/main.cpp main_copy.cpp
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/main.cpp
)
add_executable ( xyz
main.cpp
)
```
The main.cpp file just contains:
```c++
int main ()
{
return 0;
}
```
Output when trying to build:
D:\CMake-Bugs\1\build>cmake -G "NMake Makefiles" ..
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/CMake-Bugs/1/build
D:\CMake-Bugs\1\build>nmake
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 50%] Generating main_copy.cpp
Scanning dependencies of target xyz
[100%] Linking CXX executable xyz.exe
LINK : warning LNK4001: no object files specified; libraries used
[...]
It is totally unexpected that main.cpp is not added to xyz target. No error or warning message at cmake time.
The things works when using DEPENDS instead of MAIN_DEPENDENCY, so the statement in the documentation is just plain wrong.
https://gitlab.kitware.com/cmake/cmake/-/issues/16577Xcode generator: All source files with duplicate names are recompiled after a...2021-01-13T07:34:39-05:00Borislav StanimirovXcode generator: All source files with duplicate names are recompiled after a cmake callThis only happens with the Xcode generator. If I have source files with the same filenames (say `a.cpp` and `sub/a.cpp`) each time cmake is called, they are recompiled even if no changes are made. I suspect that CMake's Xcode generator g...This only happens with the Xcode generator. If I have source files with the same filenames (say `a.cpp` and `sub/a.cpp`) each time cmake is called, they are recompiled even if no changes are made. I suspect that CMake's Xcode generator generates bad (duplicate?) GUID's for such files, and Xcode assumes they are new, different files, then automatically fixes the GUID problem, Calling `cmake` again though, will "see" that the generated project has changed, and reinstate its bad GUIDs, forcing Xcode to do the previous thing again.
Repro steps:
* Have project with source files with the same name. Such a sample project is attached here: [cmake-xcode-bug.zip](/uploads/10ea9a6fd276656d86991f2955fe617c/cmake-xcode-bug.zip). (even two is enough, but the same thing happens with a project with hundreds of files - the ones with the same name are recompiled after every call to cmake)
* `$ cmake -G"Xcode"`
* `$ xcodebuild` - first build
* `$ xcodebuild` - as expected nothing is compiled, as no changes were made
* `$ cmake .` - nothing should be changed
* `$ xcodebuild` - notice as all files with same names are pointlessly compiled again
* `$ xcodebuild` - Xcode has "fixed" the problem, and, again nothing is compiledGregor JasnyGregor Jasnyhttps://gitlab.kitware.com/cmake/cmake/-/issues/16575With PKG_CONFIG_EXECUTABLE set, find_package(LibXml2) before using FindPkgCon...2017-10-13T13:17:55-04:00Patrick GriffithsWith PKG_CONFIG_EXECUTABLE set, find_package(LibXml2) before using FindPkgConfig causes pkg_search_module failureUsing CMake 3.7. Observed in a cross-compile (hence setting PKG_CONFIG_EXECUTABLE), but reproducible in a minimal example on my Ubuntu 14.04 box without all the cross-compile junk.
```
cmake_minimum_required(VERSION 3.0)
project(hell...Using CMake 3.7. Observed in a cross-compile (hence setting PKG_CONFIG_EXECUTABLE), but reproducible in a minimal example on my Ubuntu 14.04 box without all the cross-compile junk.
```
cmake_minimum_required(VERSION 3.0)
project(hello)
set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config")
find_package(LibXml2)
find_package(PkgConfig REQUIRED)
pkg_search_module(dbus REQUIRED dbus-1) # dbus is just an example
add_executable(hello main.c)
```
Results in:
```
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.1")
CMake Error at /home/patrick/opt/cmake-3.7.1/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) (found version
"0.26")
Call Stack (most recent call first):
/home/patrick/opt/cmake-3.7.1/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/home/patrick/opt/cmake-3.7.1/share/cmake-3.7/Modules/FindPkgConfig.cmake:36 (find_package_handle_standard_args)
CMakeLists.txt:13 (find_package)
-- Configuring incomplete, errors occurred!
```
However reversing the order of the find calls succeeds:
```
cmake_minimum_required(VERSION 3.0)
project(hello)
set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config")
find_package(PkgConfig REQUIRED)
pkg_search_module(dbus REQUIRED dbus-1) # dbus is just an example
find_package(LibXml2)
add_executable(hello main.c)
```https://gitlab.kitware.com/cmake/cmake/-/issues/16570CHECK_CXX_COMPILER_FLAG returns wrong results with std flag with VS20152017-10-13T13:17:55-04:00Dario MangoniCHECK_CXX_COMPILER_FLAG returns wrong results with std flag with VS2015With VS2015 Update 3
```cmake
CHECK_CXX_COMPILER_FLAG("-std=c++11" CHECK_CXX_FLAG)
CHECK_CXX_COMPILER_FLAG("-std=gnu++11" CHECK_GNUCXX_FLAG)
```
both the `CHECK_...` variables return `1` although the compiler does not support any of...With VS2015 Update 3
```cmake
CHECK_CXX_COMPILER_FLAG("-std=c++11" CHECK_CXX_FLAG)
CHECK_CXX_COMPILER_FLAG("-std=gnu++11" CHECK_GNUCXX_FLAG)
```
both the `CHECK_...` variables return `1` although the compiler does not support any of them.
(There is a -std:c++14 flag, but it's not the same!)
EDIT:
I realize that the MSVC compiler does NOT give any error. So actually the command respects its promises.https://gitlab.kitware.com/cmake/cmake/-/issues/16569ExternalProject: Extract and then rename crashes for source archive (extract-...2019-08-08T10:09:17-04:00Rashad KanavathExternalProject: Extract and then rename crashes for source archive (extract-<PROJECT>.cmake)here is a generated extract cmake file for boost: Extract-BOOST.cmake
```
# Extract it:
#
message(STATUS "extracting... [tar xfz]")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xfz ${filename}
WORKING_DIRECTORY ${ut_dir}
RESULT_...here is a generated extract cmake file for boost: Extract-BOOST.cmake
```
# Extract it:
#
message(STATUS "extracting... [tar xfz]")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xfz ${filename}
WORKING_DIRECTORY ${ut_dir}
RESULT_VARIABLE rv)
if(NOT rv EQUAL 0)
message(STATUS "extracting... [error clean up]")
file(REMOVE_RECURSE "${ut_dir}")
message(FATAL_ERROR "error: extract of '${filename}' failed")
endif()
# Analyze what came out of the tar file:
#
message(STATUS "extracting... [analysis]")
file(GLOB contents "${ut_dir}/*")
list(LENGTH contents n)
if(NOT n EQUAL 1 OR NOT IS_DIRECTORY "${contents}")
set(contents "${ut_dir}")
endif()
# Move "the one" directory to the final directory:
#
message(STATUS "extracting... [rename]")
file(REMOVE_RECURSE ${directory})
get_filename_component(contents ${contents} ABSOLUTE)
file(RENAME ${contents} ${directory})
# Clean up:
#
message(STATUS "extracting... [clean up]")
file(REMOVE_RECURSE "${ut_dir}")
message(STATUS "extracting... done")
```
Below file(RENAME ${contents} ${directory}) fails on windows. Issue has be occured wil large source archives such as boost, qt4, ITK
Smaller archives works without any issue.
can we not have a "file(RENAME..." command and simply extract the archive to a given name ?
cmake generator: visual studio 2015 x86
os info: windows 10, 12.0GB RAM, x64 based processor
cmake version: 3.5.2https://gitlab.kitware.com/cmake/cmake/-/issues/16567cmake with HPE NonStop c/c++ cross-compilers2021-06-23T09:11:59-04:00Twoflowercmake with HPE NonStop c/c++ cross-compilersHi, trying cmake with HPE NonStop c/c++ cross-compilers on Windows. Any help will be valued. (I'll also be a free tester/coder if we can check something into cmake so that this can be used in the std. cmake version.)
Windows cmd line ...Hi, trying cmake with HPE NonStop c/c++ cross-compilers on Windows. Any help will be valued. (I'll also be a free tester/coder if we can check something into cmake so that this can be used in the std. cmake version.)
Windows cmd line see errors in attached files:
CMakeOutput.log
CMakeError.log
[CMakeError.log](/uploads/d4a8d56308d4cca97c1bfbbee1e10b74/CMakeError.log)[CMakeOutput.log](/uploads/aa6120eb2bf9c4cf4ab79fef62c32e0c/CMakeOutput.log):https://gitlab.kitware.com/cmake/cmake/-/issues/16562CPack: DEB: Create src and debuginfo packages2017-10-13T13:17:55-04:00Egor ShokhinCPack: DEB: Create src and debuginfo packagesHi, Is there solution for this problem?
I would like to help to solve this issue, because I need this functionality to work properly in my project. Can you suggest something, which way to look at?Hi, Is there solution for this problem?
I would like to help to solve this issue, because I need this functionality to work properly in my project. Can you suggest something, which way to look at?https://gitlab.kitware.com/cmake/cmake/-/issues/16559find_path messes up in different ways2018-05-06T02:03:02-04:00Niccolò Mangiarottifind_path messes up in different waysI was trying to perform a very simple find_path, instead of getting the correct result i found out that this function is very buggy:
first of all doing this:
```
find_path(MY_PATH_1 "config.hpp" HINTS "D:")
find_path(MY_PATH_2 ...I was trying to perform a very simple find_path, instead of getting the correct result i found out that this function is very buggy:
first of all doing this:
```
find_path(MY_PATH_1 "config.hpp" HINTS "D:")
find_path(MY_PATH_2 "config.hpp" HINTS "D:")
message("MY_PATH_1: ${MY_PATH_1}")
message("MY_PATH_2 : ${MY_PATH_2}")
```
leads to this result:
```
MY_PATH_1: D:/
MY_PATH_2: MY_PATH_2-NOTFOUND
```
on both CMake 2.0.11 and 3.6
also even after finding out this bug and workarounding it , find_path is still unable to find my file even tough the path is definitely right and there's no doubt the instruction is typed correctly.
https://gitlab.kitware.com/cmake/cmake/-/issues/16557Improve docs in install(CODE) and install(SCRIPT) for handling DESTDIR properly2017-10-13T13:17:55-04:00Ben BoeckelImprove docs in install(CODE) and install(SCRIPT) for handling DESTDIR properlySee discussion in #11704.See discussion in #11704.https://gitlab.kitware.com/cmake/cmake/-/issues/16551CTest ignores the test exit code when PASS_REGULAR_EXPRESSION is set and matched2017-10-13T13:17:55-04:00Sylvain JoubertCTest ignores the test exit code when PASS_REGULAR_EXPRESSION is set and matchedWhen using the `PASS_REGULAR_EXPRESSION` property on a test, if that regex is matched on the output, `ctest` ignores the test exit code and will report a passed test even when the test's exit code is non-zero.
Here is a reduced test cas...When using the `PASS_REGULAR_EXPRESSION` property on a test, if that regex is matched on the output, `ctest` ignores the test exit code and will report a passed test even when the test's exit code is non-zero.
Here is a reduced test case:
```cmake
cmake_minimum_required(VERSION 3.0)
project(ExitCodeVsPassRegex)
include(CTest)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_script.cmake "
message(expected_output)
message(FATAL_ERROR non_zero_exit_code)
")
add_test(ExpectedFail ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/test_script.cmake)
add_test(ShouldFail ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/test_script.cmake)
set_tests_properties(ShouldFail PROPERTIES PASS_REGULAR_EXPRESSION "expected_output")
```
```
$ ctest
Test project /home/sylvain/test/cmtest/build
Start 1: ExpectedFail
1/2 Test #1: ExpectedFail .....................***Failed 0.01 sec
Start 2: ShouldFail
2/2 Test #2: ShouldFail ....................... Passed 0.01 sec
50% tests passed, 1 tests failed out of 2
Total Test time (real) = 0.02 sec
The following tests FAILED:
1 - ExpectedFail (Failed)
Errors while running CTest
```https://gitlab.kitware.com/cmake/cmake/-/issues/16550The test RunCMake.try_compile fails for Visual Studio 2012 builds2017-10-13T13:17:55-04:00Michael StürmerThe test RunCMake.try_compile fails for Visual Studio 2012 buildsBuilding CMake on Windows 7 64bit, using CMake 3.7.1 for building, built latest revision (aff368bb8456694e2550e2f69451456728ab31eb)
Sorry, I don't understand where this error comes from so I cannot provide a hint.
I tested it on severa...Building CMake on Windows 7 64bit, using CMake 3.7.1 for building, built latest revision (aff368bb8456694e2550e2f69451456728ab31eb)
Sorry, I don't understand where this error comes from so I cannot provide a hint.
I tested it on several machines with 32bit and 64bit builds, no success.
Visual Studio 2010, 2013 and 2015 run fine.
Here is the Logfile content:
```
Test Name: 354: RunCMake.try_compile
Test FullName: RunCMake.try_compile
Test Source: C:\cmake\Tests\RunCMake\CTestTestfile.cmake : line 976
Test Outcome: Failed
Test Duration: 0:00:32.7
Result Message:
-- CopyFileErrorNoCopyFile - PASSED
-- NoArgs - PASSED
-- OneArg - PASSED
-- TwoArgs - PASSED
-- NoCopyFile - PASSED
-- NoCopyFile2 - PASSED
-- NoCopyFileError - PASSED
-- NoOutputVariable - PASSED
-- NoOutputVariable2 - PASSED
-- NoSources - PASSED
-- BadLinkLibraries - PASSED
-- BadSources1 - PASSED
-- BadSources2 - PASSED
-- NonSourceCopyFile - PASSED
-- NonSourceCompileDefinitions - PASSED
-- PlatformVariables - PASSED
-- WarnDeprecated - PASSED
-- TargetTypeExe - PASSED
-- TargetTypeInvalid - PASSED
-- TargetTypeStatic - PASSED
-- CxxStandardNoDefault - PASSED
-- CMP0056 - PASSED
CMake Error at E:/cmake_orig/Tests/RunCMake/RunCMake.cmake:132 (message):
CMP0066 - FAILED:
Result is [1], not [0].
stdout does not match that expected.
stderr does not match that expected.
Expected stdout to match:
expect-out> -- try_compile with CMP0066 WARN-default worked as expected
expect-out> -- try_compile with CMP0066 WARN-enabled worked as expected
expect-out> -- try_compile with CMP0066 OLD worked as expected
expect-out> -- try_compile with CMP0066 NEW worked as expected
Actual stdout:
actual-out> Not searching for unused variables given on the command line.
actual-out> -- The C compiler identification is MSVC 17.0.61030.0
actual-out> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe
actual-out> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe -- works
actual-out> -- Detecting C compiler ABI info
actual-out> -- Detecting C compiler ABI info - done
actual-out> -- try_compile with CMP0066 WARN-default worked as expected
actual-out> -- try_compile with CMP0066 WARN-enabled worked as expected
actual-out> -- try_compile with CMP0066 OLD worked as expected
actual-out> -- Configuring incomplete, errors occurred!
actual-out> See also "C:/cmake/Tests/RunCMake/try_compile/CMP0066-build/CMakeFiles/CMakeOutput.log".
Expected stderr to match:
expect-err> before try_compile with CMP0066 WARN-default
expect-err> after try_compile with CMP0066 WARN-default
expect-err> *
expect-err> CMake Warning \(dev\) at CMP0066.cmake:[0-9]+ \(try_compile\):
expect-err> Policy CMP0066 is not set: Honor per-config flags in try_compile\(\)
expect-err> source-file signature. Run "cmake --help-policy CMP0066" for policy
expect-err> details. Use the cmake_policy command to set the policy and suppress this
expect-err> warning.
expect-err>
expect-err> For compatibility with older versions of CMake, try_compile is not honoring
expect-err> caller config-specific compiler flags \(e.g. CMAKE_C_FLAGS_DEBUG\) in the
expect-err> test project.
expect-err> Call Stack \(most recent call first\):
expect-err> CMakeLists.txt:[0-9]+ \(include\)
expect-err> This warning is for project developers. Use -Wno-dev to suppress it.$
Actual stderr:
actual-err> before try_compile with CMP0066 WARN-default
actual-err> after try_compile with CMP0066 WARN-default
actual-err> CMake Warning (dev) at CMP0066.cmake:21 (try_compile):
actual-err> Policy CMP0066 is not set: Honor per-config flags in try_compile()
actual-err> source-file signature. Run "cmake --help-policy CMP0066" for policy
actual-err> details. Use the cmake_policy command to set the policy and suppress this
actual-err> warning.
actual-err>
actual-err> For compatibility with older versions of CMake, try_compile is not honoring
actual-err> caller config-specific compiler flags (e.g. CMAKE_C_FLAGS_DEBUG) in the
actual-err> test project.
actual-err> Call Stack (most recent call first):
actual-err> CMakeLists.txt:3 (include)
actual-err> This warning is for project developers. Use -Wno-dev to suppress it.
actual-err>
actual-err> CMake Error at CMP0066.cmake:55 (message):
actual-err> try_compile with CMP0066 NEW did not fail with PP_ERROR:
actual-err>
actual-err> Change Dir: C:/cmake/Tests/RunCMake/try_compile/CMP0066-build/CMakeFiles/CMakeTmp
actual-err>
actual-err> Run Build Command:"C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe" "cmTC_3a3cf.vcxproj" "/p:Configuration=Release" "/p:VisualStudioVersion=11.0"
actual-err> Microsoft (R) Build Engine version 4.6.1590.0
actual-err> [Microsoft .NET Framework, version 4.0.30319.42000]
actual-err> Copyright (C) Microsoft Corporation. All rights reserved.
actual-err>
actual-err> Build started 1/10/2017 11:18:01 AM.
actual-err> Project "C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\cmTC_3a3cf.vcxproj" on node 1 (default targets).
actual-err> PrepareForBuild:
actual-err> Creating directory "cmTC_3a3cf.dir\Release\".
actual-err> Creating directory "C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\Release\".
actual-err> InitializeBuildStatus:
actual-err> Creating "cmTC_3a3cf.dir\Release\cmTC_3a3cf.unsuccessfulbuild" because "AlwaysCreate" was specified.
actual-err> ClCompile:
actual-err> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D PP_ERROR /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTC_3a3cf.dir\Release\\" /Fd"cmTC_3a3cf.dir\Release\vc110.pdb" /Gd /TC /analyze- /errorReport:queue E:\cmake_orig\Tests\RunCMake\try_compile\src.c
actual-err> Microsoft (R) C/C++ Optimizing Compiler Version 17.00.61030 for x86
actual-err> Copyright (C) Microsoft Corporation. All rights reserved.
actual-err>
actual-err> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D PP_ERROR /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTC_3a3cf.dir\Release\\" /Fd"cmTC_3a3cf.dir\Release\vc110.pdb" /Gd /TC /analyze- /errorReport:queue E:\cmake_orig\Tests\RunCMake\try_compile\src.c
actual-err>
actual-err> src.c
actual-err> E:\cmake_orig\Tests\RunCMake\try_compile\src.c(6): fatal error C1004: unexpected end-of-file found [C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\cmTC_3a3cf.vcxproj]
actual-err> Done Building Project "C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\cmTC_3a3cf.vcxproj" (default targets) -- FAILED.
actual-err>
actual-err> Build FAILED.
actual-err>
actual-err> "C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\cmTC_3a3cf.vcxproj" (default target) (1) ->
actual-err> (ClCompile target) ->
actual-err> E:\cmake_orig\Tests\RunCMake\try_compile\src.c(6): fatal error C1004: unexpected end-of-file found [C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\cmTC_3a3cf.vcxproj]
actual-err>
actual-err> 0 Warning(s)
actual-err> 1 Error(s)
actual-err>
actual-err> Time Elapsed 00:00:00.13
actual-err>
actual-err> Call Stack (most recent call first):
actual-err> CMakeLists.txt:3 (include)
Call Stack (most recent call first):
E:/cmake_orig/Tests/RunCMake/try_compile/RunCMakeTest.cmake:49 (run_cmake)
-- CMP0067 - PASSED
```https://gitlab.kitware.com/cmake/cmake/-/issues/16548Suggestion: OpenSearch XML on documentation website2017-10-24T08:54:14-04:00Harry MallonSuggestion: OpenSearch XML on documentation websiteFirefox (and I assume other browsers) allow websites to advertise site specific search to be added to the search bar. This involves adding an OpenSearch XML to the website (http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSear...Firefox (and I assume other browsers) allow websites to advertise site specific search to be added to the search bar. This involves adding an OpenSearch XML to the website (http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document).
I think it would be a useful feature if the online documentation had this option. Obviously I can use site:cmake.org at the moment so not high priority at all.
EDITED: for spellinghttps://gitlab.kitware.com/cmake/cmake/-/issues/16546VS: Cannot compile two `.asm` files with the same name2017-10-13T13:17:55-04:00Egor PuginVS: Cannot compile two `.asm` files with the same nameHi,
There's some mess with generated Object File property in VS solution for .asm files. The repro is in archive.
Unpack, then run:
```
mkdir win32 && cd win32 && cmake .. && cmake --build .
```
I see:
```
CustomBuild:
B...Hi,
There's some mess with generated Object File property in VS solution for .asm files. The repro is in archive.
Unpack, then run:
```
mkdir win32 && cd win32 && cmake .. && cmake --build .
```
I see:
```
CustomBuild:
Building Custom Rule H:/Temp/101/CMakeLists.txt
CMake does not need to re-run because H:\Temp\101\win32\CMakeFiles\generate.stamp is up-to-date.
_MASM:
Assembling H:\Temp\101\1.asm...
cmd.exe /C "C:\Users\egor\AppData\Local\Temp\tmp5dd0185685ca4204854801f7d64c5345.cmd"
ml.exe /c /nologo /Zi /Fo"x.dir\Debug\/1.obj" /D"_M_X86" /D"CMAKE_INTDIR="Debug"" /W3 /errorReport:prompt /safeseh /TaH:\Temp\101\1.asm
_MASM:
Assembling H:\Temp\101\b3e3654a.dir\1.asm...
cmd.exe /C "C:\Users\egor\AppData\Local\Temp\tmp9593c5d4a3f34d2baea0f10f674db120.cmd"
ml.exe /c /nologo /Zi /Fo"x.dir\Debug\/b3e3654a.dir/1.obj" /D"_M_X86" /D"CMAKE_INTDIR="Debug"" /W3 /errorReport:prompt /safeseh /TaH:\Temp\101\b3
e3654a.dir\1.asm
H:\Temp\101\b3e3654a.dir\1.asm(1): fatal error A1000: cannot open file : x.dir\Debug\/b3e365a. [H:\Temp\101\win32\x.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\masm.targets(50,5): error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"
x.dir\Debug\/b3e3654a.dir/1.obj" /D"_M_X86" /D"CMAKE_INTDIR="Debug"" /W3 /errorReport:prompt /safeseh /TaH:\Temp\101\b3e3654a.dir\1.asm" exited wit
h code 1. [H:\Temp\101\win32\x.vcxproj]
Done Building Project "H:\Temp\101\win32\x.vcxproj" (default targets) -- FAILED.
```
`/Fo` option for the second file (under tricky dir) is completely broken! `/Fo"x.dir\Debug\/b3e3654a.dir/1.obj"`
```
H:\Temp\101\b3e3654a.dir\1.asm(1): fatal error A1000: cannot open file : x.dir\Debug\/b3e365a.
```
[asm_repro.zip](/uploads/5ea1b29b6e4912426e3370b1e4470dab/asm_repro.zip)https://gitlab.kitware.com/cmake/cmake/-/issues/16533Xcode Generator: Custom Project Name2023-09-18T06:23:18-04:00AlexDenisovXcode Generator: Custom Project NameHi there.
I'd like to bring a small feature: custom name for a Xcode project.
Here is my motivation: on my machine I have few copies of LLVM, for each of them I have separate Xcode project.
The problem appears when I switch between di...Hi there.
I'd like to bring a small feature: custom name for a Xcode project.
Here is my motivation: on my machine I have few copies of LLVM, for each of them I have separate Xcode project.
The problem appears when I switch between different Xcode projects, or when I want to open another project: there is almost no way to determine which copy I'm working with. The only way to differentiate things now is to remember the target I worked with in each project.
But it's so annoying, error-prone, and counter-productive so I'd like CMake to generate me a project with a different, custom name.
i.e.:
```
cmake -G Xcode ~/Projects/LLVM/src
cmake -G Xcode -DCMAKE_XCODE_PROJECT_NAME=Mull ~/Projects/Mull/src
cmake -G Xcode -DCMAKE_XCODE_PROJECT_NAME=IRTests ~/Projects/Mull/Lab/src
```
where the commands will spit out xcode projects as the following: `LLVM.xcodeproj`, `Mull.xcodeproj`, `IRTests.xcodeproj`.
So far I looked into `cmGlobalXCodeGenerator` and found that this change can be done easily (see the patch below).
Now I have several questions:
1. Can such a feature be accepted into upstream?
2. What is the recommended way to write tests for this feature?
3. What else needs to be done to make this work besides the change below?
I will also appreciate any reference to more detailed contributing guidelines, if there are any.
P.S. the patch:
```diff
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 736aa91..4fea196 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3264,9 +3264,16 @@ void cmGlobalXCodeGenerator::OutputXCodeProject(
if (!this->CreateXCodeObjects(root, generators)) {
return;
}
+
+ const char *customProjectName = this->CurrentMakefile->GetDefinition("CMAKE_XCODE_PROJECT_NAME");
+ std::string projectName = root->GetProjectName();
+ if (customProjectName) {
+ projectName = std::string(customProjectName);
+ }
+
std::string xcodeDir = root->GetCurrentBinaryDirectory();
xcodeDir += "/";
- xcodeDir += root->GetProjectName();
+ xcodeDir += projectName;
xcodeDir += ".xcode";
if (this->XcodeVersion > 20) {
xcodeDir += "proj";
```Gregor JasnyGregor Jasnyhttps://gitlab.kitware.com/cmake/cmake/-/issues/16527Incorrect cyclic CTest configuration doesn't emit error code to the system2017-10-13T13:17:55-04:00Ruslan Baratovx@ruslo.devIncorrect cyclic CTest configuration doesn't emit error code to the systemHere is simple example of cyclic dependency:
```cmake
cmake_minimum_required(VERSION 3.7.1)
project(foo)
enable_testing()
add_test(NAME Foo COMMAND "${CMAKE_COMMAND}" -E echo "Foo")
add_test(NAME Boo COMMAND "${CMAKE_COMMAND}" -E echo "...Here is simple example of cyclic dependency:
```cmake
cmake_minimum_required(VERSION 3.7.1)
project(foo)
enable_testing()
add_test(NAME Foo COMMAND "${CMAKE_COMMAND}" -E echo "Foo")
add_test(NAME Boo COMMAND "${CMAKE_COMMAND}" -E echo "Boo")
set_tests_properties(
Foo
PROPERTIES
FIXTURES_CLEANUP B
FIXTURES_REQUIRED A
)
set_tests_properties(
Boo
PROPERTIES
FIXTURES_CLEANUP A
FIXTURES_REQUIRED B
)
```
The problem is that error message is printed but exit code from CTest is still zero:
```bash
> ctest
Error: a cycle exists in the test dependency graph for the test "Foo".
Please fix the cycle and run ctest again.
No tests were found!!!
> echo $?
0
```https://gitlab.kitware.com/cmake/cmake/-/issues/16520Implement a generator for the embedded IDE uVision2019-05-23T13:22:32-04:00Sebastian BøeImplement a generator for the embedded IDE uVisionKeil uVision is a windows-only IDE that is popular among embedded developers.Keil uVision is a windows-only IDE that is popular among embedded developers.https://gitlab.kitware.com/cmake/cmake/-/issues/16516Can't set archive file name per component2017-10-13T13:17:55-04:00Alex TurbovCan't set archive file name per componentI've got a trivial `CMakeLists.txt`:
```
cmake_minimum_required(VERSION 3.7)
project(CPackComponentsArchiveFilename VERSION 1.0.0 LANGUAGES NONE)
install(FILES goes-to-first-component.txt
DESTINATION bin COMPONENT First)...I've got a trivial `CMakeLists.txt`:
```
cmake_minimum_required(VERSION 3.7)
project(CPackComponentsArchiveFilename VERSION 1.0.0 LANGUAGES NONE)
install(FILES goes-to-first-component.txt
DESTINATION bin COMPONENT First)
install(FILES goes-to-second-component.txt
DESTINATION bin COMPONENT Second)
set(CPACK_GENERATOR "TGZ")
set(CPACK_PACKAGE_CONTACT "None") # mandatory for DEB generator
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
include(CPack)
#set(CPACK_COMPONENT_FIRST_ARCHIVE_FILE "${PROJECT_NAME}-First-${PROJECT_VERSION}.tar.gz")
#set(CPACK_COMPONENT_SECOND_ARCHIVE_FILE "${PROJECT_NAME}-Second-${PROJECT_VERSION}.tar.gz")
cpack_add_component(
First
ARCHIVE_FILE "${PROJECT_NAME}-First-${PROJECT_VERSION}.tar.gz"
)
cpack_add_component(
Second
ARCHIVE_FILE "${PROJECT_NAME}-Second-${PROJECT_VERSION}.tar.gz"
)
```
Both text files (` goes-to-first-component.txt` and ` goes-to-second-component.txt`) may have any content.
Trying to build packages for this trivial project, I've got unexpected results:
```
$ make package
Run CPack packaging tool...
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: CPackComponentsArchiveFilename
CPack: - Install project: CPackComponentsArchiveFilename
CPack: - Install component: First
CPack: - Install component: Second
CPack: Create package
CPack: - package: /tmp/CPackComponentsArchiveFilename/build/CPackComponentsArchiveFilename-0.1.1-Linux-First.tar.gz generated.
CPack: - package: /tmp/CPackComponentsArchiveFilename/build/CPackComponentsArchiveFilename-0.1.1-Linux-Second.tar.gz generated.
```
* First of all, please note that `CMakeLists.txt` has version explicitly specified by `project()` call. I have no idea why result packages have it `0.1.1` instead of `1.0.0`.
* **And the main trouble: archive file name is not set properly as it was requested by call to `cpack_add_component()`**
Attached tarball is the sample project: [CPackComponentsArchiveFilename.tar.gz](/uploads/369391046c306a679b701167f3b7869a/CPackComponentsArchiveFilename.tar.gz)Domen VrankarDomen Vrankarhttps://gitlab.kitware.com/cmake/cmake/-/issues/16512Cray: CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES is not populated2017-10-13T13:17:55-04:00Will BrownCray: CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES is not populated`CrayPrgEnv.cmake:__cray_extract_implicit` uses `${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG} -o ${BIN}` to invoke the compiler driver. When a source file is not provided the driver does not invoke the compiler and thus the in...`CrayPrgEnv.cmake:__cray_extract_implicit` uses `${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG} -o ${BIN}` to invoke the compiler driver. When a source file is not provided the driver does not invoke the compiler and thus the include options are not scraped.
It's possible this used to work with craype 1.x? We are using craype 2.2.1 currently. Adding a source file fixed the issue (tested gnu,cray, and intel PrgEnvs).Chuck AtkinsChuck Atkins