Missing Assimp lib after install it via CMake

494 Views Asked by At

Is there a proper way to install and link assimp via CMake.

Graphics.cmake

...
message(STATUS "Building the ASSIMP")
set(ASSIMP_BUILD_ASSIMP_TOOLS OFF)
set(ASSIMP_BUILD_TESTS OFF)
set(ASSIMP_INSTALL OFF)
set(BUILD_SHARED_LIBS ON)
add_subdirectory(${CMAKE_SOURCE_DIR}/application/dependencies/ASSIMP)
install(
    TARGETS assimp
    RUNTIME DESTINATION ${CMAKE_BINARY_DIR}/bin 
    LIBRARY DESTINATION ${CMAKE_BINARY_DIR}/lib
    ARCHIVE DESTINATION ${CMAKE_BINARY_DIR}/lib 
)
message(STATUS "ASSIMP - Done!\n")
...

CMakeLists.txt looks like:

...
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
...
include(Graphics)
set(DEP_EMSDK_LIBS
    soil2
    assimp
)
...
add_executable(${PROJECT_NAME} 
                    ${${PROJECT_NAME}_MAIN} 
                    ${${PROJECT_NAME}_SOURCES}
                    ${${PROJECT_NAME}_INCLUDES}
                    ${CFG_FILES}
                )
target_link_libraries(${PROJECT_NAME} ${DEP_LIBS}) 
target_include_directories(
        ${PROJECT_NAME} PUBLIC
        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/application/includes>
        $<INSTALL_INTERFACE:${PROJECT_SOURCE_DIR}/application/includes>
) 
...

I've erased a bunch of redundant staff. Also I've been trying to do a lot of options install(...) however as the result I'm always missing the assimp-vc142-mt.dll in the bin. If it is essential, the compiler is msvc, and generator Visual Studio 2019. Where did I admit a mistake?

0

There are 0 best solutions below