[CMake] make - cannot open output file . (dot)

Bill Hoffman bill.hoffman at kitware.com
Sun Jul 5 21:21:03 EDT 2009


tom at unforbidable.com wrote:
>> tom at unforbidable.com wrote:
>>> So I tried to set EXECUTABLE_OUTPUT_PATH to the same
>>> path as PROJECT_BINARY_DIR like so:
>>>
>>> SET(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}" CACHE
>>> PATH "Single output directory for building all
>>> executables." FORCE)
>>>
>>> This works on Windows (nmake makefiles) but when using
>>> cmake on Gentoo (standard unix makefiles) and calling
>>> make then I get the following:
>>>
>>> Scanning dependencies of target libfurc
>>> [ 50%] Building CXX object
>>>
>>>
>> libfurc/CMakeFiles/libfurc.dir/base/furcadiasettings.cpp.o
>> /home/tom/opendreamer/src/libfurc/base/furcadiasettings.cp
>>> p:26:2: warning: no newline at end of file
>>> Linking CXX static library liblibfurc.a
>>> [ 50%] Built target libfurc
>>> Scanning dependencies of target tstfurcsettings
>>> [100%] Building CXX object
>>>
>>>
>> tstfurcsettings/CMakeFiles/tstfurcsettings.dir/main.cpp.o
>>> Linking CXX executable .
>> /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../../i686-pc-l
>>> inux-gnu/bin/ld: cannot open output file .: Is a
>>> directory collect2: ld returned 1 exit status
>>> make[2]: *** [tstfurcsettings] Error 1
>>> make[1]: ***
>>> [tstfurcsettings/CMakeFiles/tstfurcsettings.dir/all]
>>> Error 2 make: *** [all] Error 2
>>>
>>> The dot is clearly there.  I got rid of the error by
>>> setting the path like so:
>>>
>>> SET(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin"
>>> CACHE PATH "Single output directory for building all
>>> executables." FORCE)
>>>
>>> Both cmakes are the same version (2.6-patch 4). 
>>>
>>> I don't think I am doing anything wrong although this is
>>> my first day with cmake.  I decided to post this in case
>>> it was not an known problem.  I obviously failed to
>>> google anything up because the key word is . (dot).
>>>
>> Sounds like you created an executable with the name "."
>> somehow...  What  does your add_executable line look like?
>>
>> -Bill
> 
> It's just that:
> ADD_EXECUTABLE(tstfurcsettings main.cpp)
> 
> Then again, the makefile is generated correctly on Windows:
> Linking CXX executable ..\tstfurcsettings.exe
> [100%] Built target tstfurcsettings
> 
> It could be a bug in the Gentoo port of cmake.
> 
Strange,  can you create a small project that shows this problem?

-Bill


More information about the CMake mailing list