MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0015113 | CMake | CMake | public | 2014-08-27 10:26 | 2016-06-10 14:31 |
| Reporter | raspy | ||||
| Assigned To | Kitware Robot | ||||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | moved | ||
| Platform | x86_64 | OS | RedHat Enterprise Linux | OS Version | 6.4 |
| Product Version | CMake 3.0 | ||||
| Target Version | Fixed in Version | ||||
| Summary | 0015113: <TARGET_BASE> is generated wrong in case of up-leading path | ||||
| Description | We use <TARGET_BASE> in platform configuration to instruct linker to create map file named the same way as target with different extension: set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET_BASE>.map <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>") However, if <TARGET> is created in upper directory, <TARGET_BASE> is terminated on the last dot, which happens to be part of directory, i.e.: Linking C executable ../../out/binary cd /path/to/source && /path/to/cmake-3.0.0-Linux-i386/bin/cmake -E cmake_link_script CMakeFiles/binary.dir/link.txt --verbose=1 /path/to/cl6x --run_linker --output_file=../../out/binary --map_file=../..map CMakeFiles/binary.dir/tools/dictionary.c.obj --search_path=/path/to/lib | ||||
| Steps To Reproduce | Simple reproduction on Linux with gcc: $ cat CMakeLists.txt set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> -o <TARGET> -Wl,-Map,<TARGET_BASE>.map <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out) add_subdirectory(subdirectory) $ cat subdirectory/CMakeLists.txt add_executable(hello hello.c) $ cat subdirectory/hello.c #include <stdint.h> int main(int argc, char *argv[]) { return 0; } Result: cd /path/to/cmake-test/subdirectory && /usr/bin/cc -o CMakeFiles/hello.dir/hello.o -c /path/to/cmake-test/subdirectory/hello.c Linking C executable ../out/hello cd /path/to/cmake-test/subdirectory && /path/to/cmake-3.0.0-Linux-i386/bin/cmake -E cmake_link_script CMakeFiles/hello.dir/link.txt --verbose=1 /usr/bin/cc -o ../out/hello -Wl,-Map,..map CMakeFiles/hello.dir/hello.o -rdynamic | ||||
| Additional Information | |||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | |||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2014-08-27 10:26 | raspy | New Issue | |||
| 2014-08-27 10:52 | Brad King | Note Added: 0036684 | |||
| 2014-08-28 04:32 | raspy | Note Added: 0036685 | |||
| 2016-06-10 14:29 | Kitware Robot | Note Added: 0042614 | |||
| 2016-06-10 14:29 | Kitware Robot | Status | new => resolved | ||
| 2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
| 2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
| 2016-06-10 14:31 | Kitware Robot | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||