MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0008953 | CMake | CMake | public | 2009-04-30 12:44 | 2016-06-10 14:30 |
| Reporter | Rob Blake | ||||
| Assigned To | Bill Hoffman | ||||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | moved | ||
| Platform | OS | OS Version | |||
| Product Version | CMake-2-6 | ||||
| Target Version | Fixed in Version | ||||
| Summary | 0008953: LANGUAGE property ignored when set from parent directory. | ||||
| Description | I used file(GLOB_RECURSE...) to find all *.c files in my project and set their language property to CXX. This was advised to me to get around bug 0008851. When I set the LANGUAGE property on a .c file that lives in a subdirectory, Cmake still thinks the file is a C file. If I call get_property within the subdirectory's makefile, I see LANGUAGE is set to CXX. I've attached a test case that reproduces this behavior. | ||||
| Steps To Reproduce | |||||
| Additional Information | My test case has 3 files: CMakeLists.txt: cmake_minimum_required(VERSION 2.6) PROJECT(BuildCToCXXSubdir) file(GLOB_RECURSE C_FILES ${CMAKE_CURRENT_SOURCE_DIR} *.c) set_source_files_properties(${C_FILES} PROPERTIES LANGUAGE CXX) add_subdirectory(subdir) subdir/CMakeLists.txt: add_executable(test main.c) subdir/main.c #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } When I run cmake and try to compile the above project, I get: [100%] Building C object subdir/CMakeFiles/test.dir/main.c.o If I try to access the LANGUAGE property of main.c, I see that it's set to CXX. If I rewrite the entire project so that it lives in one directory, main.c is built as a CXX file. The bug only seems to appear when you have subdirectories. | ||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | https://public.kitware.com/Bug/file/2202/cmake_cpp_test.tgz | ||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2009-04-30 12:44 | Rob Blake | New Issue | |||
| 2009-04-30 12:44 | Rob Blake | File Added: cmake_cpp_test.tgz | |||
| 2009-09-14 13:00 | Bill Hoffman | Note Added: 0017443 | |||
| 2009-09-14 13:00 | Bill Hoffman | Status | new => assigned | ||
| 2009-09-14 13:00 | Bill Hoffman | Assigned To | => Bill Hoffman | ||
| 2016-06-10 14:27 | Kitware Robot | Note Added: 0041550 | |||
| 2016-06-10 14:27 | Kitware Robot | Status | assigned => resolved | ||
| 2016-06-10 14:27 | Kitware Robot | Resolution | open => moved | ||
| 2016-06-10 14:30 | Kitware Robot | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||