View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015444CMakeCMakepublic2015-03-13 13:402016-06-10 14:31
Reporteralean79 
Assigned ToKitware Robot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
Platformclion IDEOSLinuxOS VersionUbuntu 14.10
Product VersionCMake 3.1.2 
Target VersionFixed in Version 
Summary0015444: include_directories is case insensitive usually, but is case sensitive in files inside subfolders
DescriptionI 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>
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (36,830 bytes) 2015-03-13 13:40 [Show Content]

 Relationships

  Notes
(0038207)
Brad King (manager)
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 (reporter)
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 (administrator)
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.

 Issue History
Date Modified Username Field Change
2015-03-13 13:40 alean79 New Issue
2015-03-13 13:40 alean79 File Added: CMakeLists.txt
2015-03-13 13:45 Brad King Note Added: 0038207
2015-03-13 14:10 alean79 Note Added: 0038208
2016-06-10 14:29 Kitware Robot Note Added: 0042729
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


Copyright © 2000 - 2018 MantisBT Team