configuration - 配置 "install TARGETS given no RUNTIME DESTINATION for executable target "assimp_simpletexturedogl 时出现 CMake 错误”。

标签 configuration cmake makefile assimp cmake-gui

我正在尝试使用 CMake 来配置 assimp 的示例

但是在配置时出现了一些错误

我尝试了很多方法,但没有一个有效。

CMake Error at CMakeLists.txt:41 (INSTALL):
      install TARGETS given no RUNTIME DESTINATION for executable target
      "assimp_simpletexturedogl".


    CMake Warning (dev) in CMakeLists.txt:
      No cmake_minimum_required command is present.  A line of code such as

        cmake_minimum_required(VERSION 3.2)

      should be added at the top of the file.  The version specified may be lower
      if you wish to support older CMake versions for this project.  For more
      information run "cmake --help-policy CMP0000".
    This warning is for project developers.  Use -Wno-dev to suppress it.

    Configuring incomplete, errors occurred!
    See also "D:/OpenGL/assimp-3.1.1-win-binaries/samples/SimpleTexturedOpenGL/made/CMakeFiles/CMakeOutput.log".

这是我的 CMakeLists.txt,任何想法将不胜感激。

我正在使用 MSVC2013 进行编译。
FIND_PACKAGE(OpenGL)
FIND_PACKAGE(GLUT)

IF ( NOT GLUT_FOUND )
    IF ( MSVC )
        SET ( GLUT_FOUND 1 )
        SET ( GLUT_INCLUDE_DIR ${Assimp_SOURCE_DIR}/samples/glut/ )
        SET ( GLUT_LIBRARIES ${Assimp_SOURCE_DIR}/samples/glut/glut32.lib )
    ELSE ( MSVC )
        MESSAGE( WARNING "Please install glut." )
    ENDIF ( MSVC )
ENDIF ( NOT GLUT_FOUND )

INCLUDE_DIRECTORIES(
    ${Assimp_SOURCE_DIR}/include
    ${Assimp_SOURCE_DIR}/code
    ${OPENGL_INCLUDE_DIR}
    ${GLUT_INCLUDE_DIR}
    ${Assimp_SOURCE_DIR}/samples/DevIL/include/
)

LINK_DIRECTORIES( 
    ${Assimp_BINARY_DIR} 
    ${Assimp_BINARY_DIR}/lib/
    ${Assimp_SOURCE_DIR}/samples/DevIL/lib/
)

ADD_EXECUTABLE( assimp_simpletexturedogl WIN32
    SimpleTexturedOpenGL/include/boost_includes.h
    SimpleTexturedOpenGL/src/model_loading.cpp
)

SET_PROPERTY(TARGET assimp_simpletexturedogl PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})

TARGET_LINK_LIBRARIES( assimp_simpletexturedogl assimp ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} DevIL.lib )

SET_TARGET_PROPERTIES( assimp_simpletexturedogl PROPERTIES
    OUTPUT_NAME assimp_simpletexturedogl
)

INSTALL( TARGETS assimp_simpletexturedogl
    DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev
) 

最佳答案

您忘记指定可执行文件的文件夹。尝试这个:

INSTALL( 

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

我不知道为什么在 cMake 中要求为可执行文件提供一个放置文件夹(在我的示例中为 bin),但这是这里的问题。

关于configuration - 配置 "install TARGETS given no RUNTIME DESTINATION for executable target "assimp_simpletexturedogl 时出现 CMake 错误”。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30794583/

相关文章:

python - 获取 nosetests 配置选项

c++ - CMake boost 导入的目标

c - Linux make 命令未定义对curl_global_init的引用

CMake:以用户可以更改的方式设置编译器标志。

c++ - 使用 Qt、MFC 和 CMake 尝试/捕捉

windows - Cygwin,编译和运行 C 程序时出现 "couldn' t get proc lock 错误

c - 如何正确使用 % 或 *(星号)符号作为 makefile 中的占位符?

configuration - 如何在不丢失配置的情况下升级openwrt?

java - 工作区设置与项目特定设置

php - 在 nginx 中为 symfony2 创建一个 block