Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake error: cannot specify include directories #6

Open
ralpha opened this issue May 3, 2020 · 1 comment
Open

Cmake error: cannot specify include directories #6

ralpha opened this issue May 3, 2020 · 1 comment

Comments

@ralpha
Copy link

ralpha commented May 3, 2020

I got the error below while compiling: https://github.com/ragundo/DwarfExplorer
Reference: ragundo/DwarfExplorer#1

I got this error while compiling with cmake (v 3.10.2, Linux):

CMake Error at plugins/DwarfExplorer/dfhack-qt/CMakeLists.txt:4 (target_include_directories):
  Cannot specify include directories for imported target "dfhack-qt-common".

Was an error with the https://github.com/cvuchener/dfhack-qt/blob/58225d74672e1f870cc9b23c8a4c747900d7f3df/CMakeLists.txt file:

target_include_directories(dfhack-qt-common INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)

gave that error. But fixed it with some searching and changing it to this line:

set_property(TARGET dfhack-qt-common APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  )

Also one small compile warning:

../plugins/DwarfExplorer/dfhack-qt/qapplication/LogFilterProxyModel.cpp:104:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (ok && type >= 0 && type < accepted_types.size() && !accepted_types[type])
                            ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
@cvuchener
Copy link
Owner

I'm always lost with cmake versions. I think this command requires cmake 3.11 (https://gitlab.kitware.com/cmake/cmake/-/commit/fe4b25ec2fa09a50b6ffbfcf29e118afdfba0659). But you already found the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants