title: buildroot external cmake package makefile fails install
body: <p>I am trying to install my external package, which is built fine by the cross-compile toolchain but fails on the install step with the error</p>
  
  <pre><code>Install the project...
  -- Install configuration: "Release"
  -- Installing: /home/username/Projects/ProjectName/ProjectName_software/ProjectName_OS/build_ProjectName_os_raspberrypi3/target/home/username/Projects/ProjectName/ProjectName_software/ProjectName_
  OS/build_ProjectName_os_raspberrypi3/build/APPNAME/APPNAME
  APPNAME: installs files in /home/userName/Projects/ProjectName/ProjectName_software/ProjectName_OS/build_ProjectName_os_raspberrypi3/target//home/username/Projects/ProjectName/ProjectName
  _software/ProjectName_OS/build_ProjectName_os_raspberrypi3
  package/pkg-generic.mk:315: recipe for target '/home/alex/Projects/BlackBox/bbefx_software/BBEFX_OS/build_bbefx_os_raspberrypi3/build/BBEFX_CORE/.stamp_
  target_installed' failed
  </code></pre>
  
  <p>I am guessing that the path prefixed by --Installing is the one generated by the package makefile and the one prefixed by APPNAME is the one that buildroot is expecting APPNAME to install to. Hence why the .stamp_target_install fails</p>
  
  <p>The obvious issue is that the path buildroot expects is </p>
  
  <pre><code>/target//home/username/ 
  </code></pre>
  
  <p>This isn't the path that I would like to install to (usr/bin would be preferable). However I can't see how to specify a path within the package make file, which is as follows:</p>
  
  <pre><code>APPNAME_SITE = $(TOPDIR)/../../APPNAME
  APPNAME_SITE_METHOD = local
  APPNAME_INSTALL_TARGET = YES
  
  $(eval $(cmake-package))
  </code></pre>
  
  <p>With the CMakeLists.txt being:</p>
  
  <pre><code>#
  # CMake options
  #
  
  # CMake version
  cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
  set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
  
  option(BUILD_DOC "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})
  
  # project name
  project(APPNAME)
  
  
  IF(NOT CMAKE_BUILD_TYPE)
    MESSAGE(STATUS "No build type selected, default to Release")
    SET(CMAKE_BUILD_TYPE "Release")
  ENDIF()
  STRING(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
  IF(CMAKE_BUILD_TYPE AND
      NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE)$")
    MESSAGE(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
  ENDIF()
  
  if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    add_definitions(-DDEBUG)
  endif()
  
  if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++14")
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -std=c++14")
  
  endif()
  
  if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++14")
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -w -std=c++14")
  
  endif()
  
  # enable c++
  enable_language(C CXX)
  
  # project version
  set(VERSION_MAJOR 0)
  set(VERSION_MINOR 1)
  set(VERSION_PATCH 0)
  
  # Find all sources and headers in the source folder
  file(GLOB_RECURSE APPNAME_SOURCES "source/*.cpp")
  file(GLOB_RECURSE APPNAME_HEADERS "source/*.hpp" "source/*.h")
  
  # Add header directories, remove dupes
  set (APPNAME_INCLUDE_DIRS "")
  foreach (_headerFile ${APPNAME_HEADERS})
      get_filename_component(_dir ${_headerFile} PATH)
      list (APPEND APPNAME_INCLUDE_DIRS ${_dir})
  endforeach()
  list(REMOVE_DUPLICATES APPNAME_INCLUDE_DIRS)
  
  # Add sources and headers to exec
  add_executable (APPNAME ${APPNAME_SOURCES})
  target_include_directories(APPNAME PRIVATE ${APPNAME_INCLUDE_DIRS})
  
  # Add Libs to link
   find_package(libconfigpp REQUIRED)
   find_package(Boost COMPONENTS system log REQUIRED)
   include_directories(${LIBCONFIGPP_INCLUDE_DIR} $Boost_INCLUDE_DIRS)
   target_link_libraries(APPNAME ${Boost_LIBRARIES} ${LIBCONFIGPP_LIBRARIES})
   add_definitions(-DBOOST_LOG_DYN_LINK)
  
  
  # Add platform specific Libs and preproc macros
  if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
      add_definitions(-DSYSTEM_LINUX)
      add_definitions(-D__UNIX_JACK__ )
      find_package(libjack REQUIRED)
      target_link_libraries(APPNAME ${JACK_LIBRARIES})
      set(THREADS_PREFER_PTHREAD_FLAG ON)
      find_package(Threads REQUIRED)
      target_link_libraries(APPNAME Threads::Threads)
  endif()
  if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
      add_definitions(-DSYSTEM_DARWIN)
      add_definitions(-D__MACOSX_CORE__)
      find_library(COREMIDI_LIBRARY CoreMIDI)
      find_library(COREFOUNDATION_LIBRARY CoreFoundation)
      find_library(COREAUDIO_LIBRARY CoreAudio)
      target_link_libraries(APPNAME ${COREFOUNDATION_LIBRARY} ${COREMIDI_LIBRARY} ${COREAUDIO_LIBRARY})
  endif()
  
  set(CONFIGFILE source/APPNAME_CONFIG.cfg)
  
  #file(COPY ${CONFIGFILE} DESTINATION ${CMAKE_BINARY_DIR})
  install (TARGETS APPNAME DESTINATION ${CMAKE_BINARY_DIR})
  
  #
  # Build Documentation
  #
  
  find_package(Doxygen)
  if(BUILD_DOC)
      if(NOT DOXYGEN_FOUND)
          message(FATAL_ERROR "Doxygen is needed to build the documentation.")
      endif()
  
      set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/source/doc/Doxyfile.in)
      set(DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
      configure_file(${DOXYFILE_IN} ${DOXYFILE} @ONLY)
  
      add_custom_target(DOC
          COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
          WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
          COMMENT "Generating API documentation with Doxygen"
          VERBATIM)
  
          add_custom_command(TARGET DOC
                  POST_BUILD
                  COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/source/doc/Documentation.html ${CMAKE_SOURCE_DIR}/doc
          )
      install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
  endif()
  </code></pre>