CMake error while configuring “install TARGETS given no RUNTIME DESTINATION for executable target ”assimp_simpletexturedogl“.”

牧云@^-^@ 提交于 2019-12-04 10:52:57
Dario_IV

You forgot to indicate a folder for the executable. Try this:

INSTALL( 

     TARGETS assimp_simpletexturedogl
     RUNTIME DESTINATION bin
     DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev
) 

I don't know why in cMake is a requirement to have a drop folder ( bin in my example ) for the executable, but this is the problem here.

I ran into this tonight and after a crash course in cmake I tried cmake --trace-expand which showed a bunch of variables were blank, including ${ASSIMP_BIN_INSTALL_DIR}.

At which point I just loaded the .sln file with vs2015 community, let it upgrade it, and then set the needed things by hand.

Building assimp 3.2 from sources was necessary and cmake worked fine for this. I also chose to edit the output file names to exclude the -mtd-130, i.e. set them to inherit from project defaults.

It works for me, hope that helps somebody until the sample cmakelist files are updated.

I got this to work simply by doing the following:

mkdir build
cd build
cmake .. -DASSIMP_BIN_INSTALL_DIR=`pwd`

For example:

install(TARGETS snappy
        EXPORT SnappyTargets
        # RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} # DESTINATION error
        RUNTIME DESTINATION bin ${CMAKE_INSTALL_BINDIR} # should add bin or other dir
        LIBRARY DESTINATION lib ${CMAKE_INSTALL_LIBDIR}
        # ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR # DESTINATION error
        ARCHIVE DESTINATION lib ${CMAKE_INSTALL_LIBDIR} # should add lib
)

Related to this question

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!