View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011724CMakeCMakepublic2011-01-19 16:382011-01-31 16:10
ReporterDaniel Richard G. 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.3 
Target VersionCMake 2.8.4Fixed in VersionCMake 2.8.4 
Summary0011724: CMAKE_RUNTIME_OUTPUT_DIRECTORY breaks try_compile()'s COPY_FILE directive in 2.8.3
DescriptionI have a CMake project that was working fine with 2.8.1. When I upgraded CMake to 2.8.3, I began to see this error at configuration time:

********(cut here)********
-- Building for: NMake Makefiles
-- The C compiler identification is Intel
-- Using predefined Intel compiler flags
-- Check for working C compiler: C:/Program Files (x86)/Intel/Compiler/C++/9.1/EM64T/Bin/icl.exe
-- Check for working C compiler: C:/Program Files (x86)/Intel/Compiler/C++/9.1/EM64T/Bin/icl.exe -- works
-- Detecting C compiler ABI info
CMake Error: Could not COPY_FILE.
  OutputFile: ''
    copyFile: 'E:/build/test-283/CMakeFiles/CMakeDetermineCompilerABI_C.bin'


Unable to find executable for try_compile: tried "E:/build/test-283/CMakeFiles/CMakeTmp/cmTryCompileExec.exe" and "E:/build/test-283/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.exe" and "E:/build/test-283/CMakeFiles/CMakeTmp/Development/cmTryCompileExec.exe".

-- Detecting C compiler ABI info - done
CMake Error at X:/freeport/arch/win64_icl_mt/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake:40 (FILE):
  file STRINGS file
  "E:/build/test-283/CMakeFiles/CMakeDetermineCompilerABI_C.bin" cannot
  be read.
Call Stack (most recent call first):
  X:/freeport/arch/win64_icl_mt/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:71 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:16 (PROJECT)


-- Found Perl: C:/cygwin/bin/perl.exe
-- Configuring incomplete, errors occurred!
********(cut here)********

I am making use of CMAKE_RUNTIME_OUTPUT_DIRECTORY. If I comment out the directive that assigns to it, everything works peachy:

********(cut here)********
-- Building for: NMake Makefiles
-- The C compiler identification is Intel
-- Using predefined Intel compiler flags
-- Check for working C compiler: C:/Program Files (x86)/Intel/Compiler/C++/9.1/EM64T/Bin/icl.exe
-- Check for working C compiler: C:/Program Files (x86)/Intel/Compiler/C++/9.1/EM64T/Bin/icl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found Perl: C:/cygwin/bin/perl.exe
-- Configuring done
-- Generating done
-- Build files have been written to: E:/build/test-283
********(cut here)********
TagsNo tags attached.
Attached Files

 Relationships
related to 0011725closedBrad King CMAKE_USER_MAKE_RULES_OVERRIDE path no longer works if unqualified 
related to 0010902closedBrad King USER_MAKE_RULES_OVERRIDE variable is not used in initial try_compile 

  Notes
(0024938)
Brad King (manager)
2011-01-19 17:38

I cannot reproduce this:

  cmake_minimum_required(VERSION 2.8)
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${FOO_BINARY_DIR}/bin)
  project(FOO C)

The project configures correctly.

Please post a sample CMakeLists.txt file that reproduces the problem and also specify the CMake command line that you use.
(0024941)
Brad King (manager)
2011-01-19 17:50

You must be setting CMAKE_RUNTIME_OUTPUT_DIRECTORY in a file referenced by
CMAKE_USER_MAKE_RULES_OVERRIDE as you reported in issue 0011725. I'm closing this one as a duplicate because issue 0011725 is the cause of this.
(0024949)
Brad King (manager)
2011-01-20 07:38

I'm re-opening this because it is not really a duplicate of 0011725 as I originally thought. Although the cause is the same the solution will be different.
(0024951)
Brad King (manager)
2011-01-20 08:20

I made try_compile's COPY_FILE feature robust against CMAKE_USER_MAKE_RULES_OVERRIDE files that set CMAKE_RUNTIME_OUTPUT_DIRECTORY:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5792d3a3 [^]

This should fix your project's build. However, this is also a documentation bug:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5300f1d [^]

We've always considered this feature an obscure last resort for setting things like CMAKE_C_FLAGS_INIT. The change made for issue 0010902 was correct under expected use cases. We never expected it to be used for anything else.

Even though this fixes the build with your current code, please also fix your project according to the updated documentation.

 Issue History
Date Modified Username Field Change
2011-01-19 16:38 Daniel Richard G. New Issue
2011-01-19 17:34 Brad King Assigned To => Brad King
2011-01-19 17:34 Brad King Status new => assigned
2011-01-19 17:38 Brad King Note Added: 0024938
2011-01-19 17:48 Brad King Relationship added related to 0011725
2011-01-19 17:48 Brad King Relationship added related to 0010902
2011-01-19 17:50 Brad King Note Added: 0024941
2011-01-19 17:50 Brad King Status assigned => closed
2011-01-19 17:50 Brad King Resolution open => duplicate
2011-01-20 07:38 Brad King Note Added: 0024949
2011-01-20 07:38 Brad King Status closed => feedback
2011-01-20 07:38 Brad King Resolution duplicate => reopened
2011-01-20 07:39 Brad King Status feedback => assigned
2011-01-20 08:20 Brad King Note Added: 0024951
2011-01-20 08:20 Brad King Status assigned => closed
2011-01-20 08:20 Brad King Resolution reopened => fixed
2011-01-20 08:20 Brad King Target Version => CMake 2.8.4
2011-01-31 16:10 David Cole Fixed in Version => CMake 2.8.4


Copyright © 2000 - 2018 MantisBT Team