This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Why does KDevelop put *.d files in $HOME?

Tags: None
(comma "," separated)
User avatar
VictorL
Registered Member
Posts
14
Karma
0
OS
Hi,

I'm developing in C++ for a STM32 micro-controller using libopencm3.
I am using CMake to build the project. I use KDevelop 5.5.0

The project builds fine with CMake. It also is parsed correctly by KDevelop.
However when parsed with KDevelop all the make dependencies for the libopencm3 custom target are being put in my $HOME directory.

This does not happen with CMake, do you know how I can debug this?

Code: Select all
cmake_minimum_required(VERSION 3.0)
set(CMAKE_TOOLCHAIN_FILE cmake/toolchain-arm-none-eabi.cmake)
project(test_kdevelop)
include(cmake/blue-pill.cmake)
include(cmake/libopencm3.cmake)

add_executable(
  ${PROJECT_NAME}
  main.cpp
)
add_dependencies(
  ${PROJECT_NAME}
  libopencm3
)
target_link_libraries(
  ${PROJECT_NAME}
  ${LIBOPENCM3_BLUEPILL_LIBRARIES}
)


libopencm3 is a git submodule and the provided Makefile is used:
Code: Select all
# Make sure that git submodule is initialized and updated
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/libopencm3/Makefile")
  message(FATAL_ERROR "libopencm3 submodule not found. Initialize with 'git submodule update --init' in the source directory")
endif()

# Add a custom target to compile libopencm3
set(LIBOPENCM3_DIR ${CMAKE_SOURCE_DIR}/libopencm3)
message("LIBOPENCM3_DIR = " ${LIBOPENCM3_DIR})
add_custom_target(libopencm3 make -j4 WORKING_DIRECTORY ${LIBOPENCM3_DIR})
include_directories(${LIBOPENCM3_DIR}/include)
link_directories(${LIBOPENCM3_DIR}/lib)


Example project: https://gitlab.com/VictorLamoine/libope ... l_examples

Bye
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
I can only guess, but my guess is that somewhere, your CMake file depends on the current working directory. If you run CMake from CLI, that is set as you expected (to the build dir, probably), but in KDevelop, it's $HOME (if you start it from the menu, for example).

Pretty sure this has to be fixed in your specific CMake project.


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell