MantisBT - CMake
View Issue Details
0015444CMakeCMakepublic2015-03-13 13:402016-06-10 14:31
alean79 
Kitware Robot 
normalmajoralways
closedmoved 
clion IDELinuxUbuntu 14.10
CMake 3.1.2 
 
0015444: include_directories is case insensitive usually, but is case sensitive in files inside subfolders
I have a project that was developed in Windows environment, so the #include sentences was developed in case insensitive way (there are a LOT of differences between the name of the .hpp included, and the real name of the .hpp file).

I imported that project in a Linux environment, and configured cmake with the following clause:

include_directories(
    SYSTEM ${PROJECT_SOURCE_DIR}/inc)

Inside the "inc" folder there are .hpp files, but there are subfolders with aditional .hpp files. In my code, the .hpp files that are in the "inc" folder are recognized correctly, beside the case problems. But the files in the subfolders are NOT recognized if there are case differences.

Example:

${PROJECT_SOURCE_DIR}
  |
  |-- inc
        |
        |-- vpp => subfolder
        | |
        | |-- vpp.hpp => header file
        |
        |-- flags.hpp => header file


If I include the second header file with the following sentence, the file is recognized correctly:
#include <flags.hpp>

But, if I include the first header file with the following sentence, the file is NOT found:
#include <vpp/vpp.hpp>
No tags attached.
txt CMakeLists.txt (36,830) 2015-03-13 13:40
https://public.kitware.com/Bug/file/5402/CMakeLists.txt
Issue History
2015-03-13 13:40alean79New Issue
2015-03-13 13:40alean79File Added: CMakeLists.txt
2015-03-13 13:45Brad KingNote Added: 0038207
2015-03-13 14:10alean79Note Added: 0038208
2016-06-10 14:29Kitware RobotNote Added: 0042729
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0038207)
Brad King   
2015-03-13 13:45   
What do you mean by "NOT found"? What is the error message?

Compiler tools will not do case conversion regardless of what CMake does. Likely you'll have to fix your #include lines to be consistent with the case of the files on disk.
(0038208)
alean79   
2015-03-13 14:10   
I'm not running cmake from command line. I'm using the IDE Clion from JetBrains, that internally use cmake.

I have no way to fix the lines to be consistent with the file names, because is not my project. I need to navigate trough the project, using an IDE (to use as a reference for my own project), and all of the IDE I used have the case problem in Linux, except Clion that recognize almost all of the .hpp headers. But the .hpp headers that are in subfolders are not recognized by the IDE, because are not found by cmake itself.

The "error message" is that the #include sentence appear in red, and that cause multiple compile errors marked along all the project sources, just because can't found the headers.

I don't need to compile the project, only need the IDE recognize all the headers, and I can navigate and find references in the source of the project.

Clion use cmake version 3.1.2, and I can force the IDE to found or not found certain .hpp files, just editing the include_directories clause. Because that, I think is not an IDE problem, but some type of bug or constraint of cmake
(0042729)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.