[CMake] CMAKE_SOURCE_DIR overwritten by CMake Fortran language support

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Mar 29 11:36:33 EDT 2010


On 2010-03-29 09:04-0400 Brad King wrote:

> Arjen Markus wrote:
>> Hi Alan,
>>
>> I have no time today to really dig into the output, but while
>> CMAKE_HOMEDIRECTORY points to the right directory, the outcome is
>> the same: the "wrong" information file gets loaded.
>>
>> I will send the detailed output from cmake --trace in a separate
>> mail (> 0.5 MB).
>
> The debug line that you added:
>
>  message("DEBUG: ${CMAKE_SOURCE_DIR}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran.cmake")
>
> seems to run only in the sub-project that executes inside a different
> cmake instance, executed by the outer cmake here:
>
>  F:/plplot-svn/plplot/cmake/modules/language_support.cmake(89):  execute_process(COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language} RESULT_VARIABLE return_code )
>
> The output of the message appears only once:
>
>  DEBUG: F:/plplot-svn/build-mingw-test-cmake/language_tests/Fortran/cmake/modules/language-support/cmake-2.6/Platform/Windows-GNU-Fortran.cmake
>
> That looks to me like CMAKE_SOURCE_DIR points exactly where it should:
>
>  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}
>
> This is different from the outer CMake's CMAKE_SOURCE_DIR because
> it is a different process.

Thanks, Brad, for that help.  It turns out we jumped to conclusions because
the above file could not be found, but that issue was due to something else
(misspelling what should have been "language_support" as
"language-support").  Arjen reports good results with MinGW now that
that typo has been fixed.

Sorry for the noise.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list