Skip to content
Snippets Groups Projects
Commit ca2cef19 authored by Christian Dreher's avatar Christian Dreher
Browse files

fix: Use actual global include path prefix.

parent 891c3941
No related branches found
No related tags found
No related merge requests found
file(GLOB_RECURSE file_list ${DIR} LIST_DIRECTORIES FALSE RELATIVE ${DIR} ui_*.h)
foreach(header_file IN LISTS file_list)
if(NOT header_file MATCHES "${CORRECT_INCLUDE}")
get_filename_component(HEADER_FILE_DIR ${header_file} DIRECTORY)
if(NOT header_file MATCHES "^${GLOBAL_INCLUDE}/")
message(STATUS "String `${header_file}` does not start with `${CORRECT_INCLUDE}`")
get_filename_component(HEADER_FILE_DIR ${header_file} DIRECTORY)
file(MAKE_DIRECTORY "${DIR}${CORRECT_INCLUDE}/${HEADER_FILE_DIR}")
message("Moving ${DIR}${header_file} to ${DIR}${CORRECT_INCLUDE}/${header_file}")
file(RENAME "${DIR}${header_file}" "${DIR}${CORRECT_INCLUDE}/${header_file}")
#message("find ${PROJECT_SOURCE_DIR} -type f -exec sed -i 's~include \\\"${header_file}\\\"~include <${CORRECT_INCLUDE}/${header_file}>~g' {} +")
#execute_process(COMMAND bash "-c" "find ${PROJECT_SOURCE_DIR} -type f -exec sed -i 's~include \\\"${header_file}\\\"~include <${CORRECT_INCLUDE}/${header_file}>~g' {} +")
message(WARNING "The include for ${header_file} needs to use the full relative path, instead of a path without any directories. This is needed for correct installation. The correct include might be (or similar, subfolders might be missing in the proposed include) \n'#include <${CORRECT_INCLUDE}/${header_file}>'")
endif()
endforeach()
......@@ -124,12 +124,14 @@ function(armarx_add_qt_library TARGET)
add_custom_command(
TARGET ${TARGET}
POST_BUILD COMMAND ${CMAKE_COMMAND}
ARGS "-DPROJECT_NAME=${PROJECT_NAME}"
"-DDIR=${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/include/"
"-DCORRECT_INCLUDE=${CORRECT_INCLUDE}"
"-DPROJECT_SOURCE_DIR=${CMAKE_SOURCE_DIR}/source"
"-P" "${ArmarXGui_CMAKE_DIR}/check_qt_moc_includes.cmake"
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
"-DGLOBAL_INCLUDE=${ARMARX_PROJECT_INCLUDE_PATH}"
"-DDIR=${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/include/"
"-DCORRECT_INCLUDE=${CORRECT_INCLUDE}"
"-DPROJECT_SOURCE_DIR=${CMAKE_SOURCE_DIR}/source"
"-P" "${ArmarXGui_CMAKE_DIR}/check_qt_moc_includes.cmake"
COMMENT "Checking Qt MOC includes."
)
......
......@@ -64,14 +64,18 @@ function(armarx_gui_library PLUGIN_NAME SOURCES QT_MOC_HDRS QT_UIS QT_RESOURCES
file(RELATIVE_PATH CORRECT_INCLUDE "${CMAKE_SOURCE_DIR}/source" ${CMAKE_CURRENT_SOURCE_DIR})
message(STATUS "cmake: ${CMAKE_COMMAND} ${PLUGIN_NAME}")
add_custom_command(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND}
ARGS "-DPROJECT_NAME=${PROJECT_NAME}" "-DDIR=${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_NAME}_autogen/include/"
"-DCORRECT_INCLUDE=${CORRECT_INCLUDE}" "-DPROJECT_SOURCE_DIR=${CMAKE_SOURCE_DIR}/source"
"-P" "${ArmarXGui_CMAKE_DIR}/check_qt_moc_includes.cmake"
#COMMENT "Checking qt moc includes"
)
add_custom_command(
TARGET ${PLUGIN_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
"-DGLOBAL_INCLUDE=${ARMARX_PROJECT_INCLUDE_PATH}"
"-DDIR=${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_NAME}_autogen/include/"
"-DCORRECT_INCLUDE=${CORRECT_INCLUDE}"
"-DPROJECT_SOURCE_DIR=${CMAKE_SOURCE_DIR}/source"
"-P" "${ArmarXGui_CMAKE_DIR}/check_qt_moc_includes.cmake"
COMMENT "Checking qt moc includes"
)
if(${VERBOSE})
message(STATUS " Gui Library Directories:")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment