2015-06-12 83 views
1

我試圖用CMake的配置assimp的樣品CMake的錯誤assimp_simpletexturedogl「給沒有運行時的目的地可執行目標安裝目標。‘’。」

但也有一些錯誤,同時配置

我試過的方法很多的,但沒有一個人的作品。

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 
) 

回答

1

您忘記指出可執行文件的文件夾。試試這個:

INSTALL( 

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

我不知道爲什麼在CMake的是具有可執行投遞文件夾(在我的例子倉)的要求,但在這裏,這就是問題所在。

3

我跑進今晚和cmake的速成班後,我試過的cmake --trace-擴大這表明了一堆的變量是空白,包括$ {} ASSIMP_BIN_INSTALL_DIR。

在這一點我只裝有vs2015社區.sln文件,讓它升級,再由專人設置所需的東西。

大廈assimp 3.2來源是必要和cmake的這個工作得很好。我還選擇編輯輸出文件名以排除-mtd-130,即將它們設置爲從項目默認值繼承。

它爲我,希望幫助別人,直到試樣cmakelist文件被更新。

1

我這做以下簡單的工作:

mkdir build 
cd build 
cmake .. -DASSIMP_BIN_INSTALL_DIR=`pwd` 
相關問題