Dear Community,

I was trying to build the template project. The build was successful but 
when I run the exe It says few dll files are missing. I have included the 
output of my cmake build command in the text file below. Any help is highly 
appreciated.

Thanks,
Prabanjan

-- 
You received this message because you are subscribed to the Google Groups 
"ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/c188ddfa-bb37-4008-b7a2-05f715a4a5d4n%40googlegroups.com.
PS D:\chrono\chrono\template_project> cmake -S . -B build
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.29.30153.0
-- The CXX compiler identification is MSVC 19.29.30153.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual 
Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual 
Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Finding package Chrono...
--    Requested component Irrlicht (REQUIRED)
--    Requested component PardisoMKL (OPTIONAL)
Chrono was not configured with support for the OPTIONAL component PardisoMKL
-- Chrono libraries for configuration Debug have been successfully found.
-- Chrono libraries for configuration Release have been successfully found.
-- Configuration MinSizeRel will not work properly since some Chrono libraries 
are missing for this configuration:
  missing: ChronoEngine_irrlicht;ChronoModels_robot;ChronoEngine
-- Configuration RelWithDebInfo will not work properly since some Chrono 
libraries are missing for this configuration:
  missing: ChronoEngine_irrlicht;ChronoModels_robot;ChronoEngine
--    CHRONO_CXX_FLAGS         (Compiler flags): 
/DWIN32;/D_WINDOWS;/GR;/EHsc;-openmp;/arch:AVX2;/arch:AVX;/Zc:__cplusplus;/EHsc;/wd4251;/wd4275;/wd4250;/wd4275
--    CHRONO_C_FLAGS           (Compiler flags): 
/DWIN32;/D_WINDOWS;-openmp;/arch:AVX2;/arch:AVX;;/wd4251;/wd4275;/wd4250;/wd4275
--    CHRONO_LINKER_FLAGS      (Linker flags): 
/machine:x64;/NODEFAULTLIB:libcmt.lib;/NODEFAULTLIB:libcmtd.lib;/NODEFAULTLIB:msvcrt$<$<NOT:$<CONFIG:Debug>>:d>.lib
--    CHRONO_INCLUDE_DIRS      (Chrono include directories): 
D:/chrono/chrono/src;D:/chrono/chrono/src/chrono;D:/chrono/chrono/src/chrono/collision/bullet;D:/chrono/chrono/src/chrono/collision/gimpact;D:/chrono/chrono/src/chrono_thirdparty/HACD;D:/chrono/chrono/src/chrono_thirdparty/HACDv2;D:/chrono/chrono/build;D:/chrono/chrono/libraries/eigen-3.4.0/eigen-3.4.0;C:/Program
 Files/NVIDIA GPU Computing 
Toolkit/CUDA/v12.0/include;D:/chrono/chrono/libraries/irrlicht-1.8.5/irrlicht-1.8.5/include
--    CHRONO_LIB_NAMES         (Chrono library names): 
ChronoEngine_irrlicht;ChronoModels_robot;ChronoEngine
--    CHRONO_LIBRARIES         (Chrono libraries): 
Ws2_32.lib;$<$<CONFIG:Debug>:D:/chrono/chrono/build/lib/Debug/ChronoEngine_irrlicht.lib>;$<$<CONFIG:Debug>:D:/chrono/chrono/build/lib/Debug/ChronoModels_robot.lib>;$<$<CONFIG:Debug>:D:/chrono/chrono/build/lib/Debug/ChronoEngine.lib>;$<$<CONFIG:Release>:D:/chrono/chrono/build/lib/Release/ChronoEngine_irrlicht.lib>;$<$<CONFIG:Release>:D:/chrono/chrono/build/lib/Release/ChronoModels_robot.lib>;$<$<CONFIG:Release>:D:/chrono/chrono/build/lib/Release/ChronoEngine.lib>
--    CHRONO_DATA_DIR          (Path to Chrono data folder): 
D:/chrono/chrono/data/
--    CHRONO_VEHICLE_DATA_DIR  (Path to Chrono::Vehicle data folder): 
D:/chrono/chrono/data/vehicle/
--    CHRONO_FSI_DATA_DIR      (Path to Chrono::FSI data folder): 
D:/chrono/chrono/data/fsi/
--    CHRONO_DLL_NAMES         (Chrono DLL names): 
ChronoEngine.dll;ChronoModels_robot.dll;ChronoEngine_irrlicht.dll
--    CHRONO_DEPENDENCY_DLLS   (Dependency DLLs): 
D:/chrono/chrono/libraries/irrlicht-1.8.5/irrlicht-1.8.5/bin/Win64-VisualStudio/Irrlicht.dll
-- ------------------------------------
-- Add custom commands for copying DLLs
-- ------------------------------------
-- DLLs that will be copied (default lists):
-- 
...D:/chrono/chrono/libraries/irrlicht-1.8.5/irrlicht-1.8.5/bin/Win64-VisualStudio/Irrlicht.dll
-- ...D:/chrono/chrono/build/bin/Debug/ChronoEngine.dll
-- ...D:/chrono/chrono/build/bin/Release/ChronoEngine.dll
-- ...D:/chrono/chrono/build/bin/Release/ChronoModels_robot.dll
-- ...D:/chrono/chrono/build/bin/Release/ChronoEngine_irrlicht.dll
-- Configuring done (3.4s)
-- Generating done (0.0s)
-- Build files have been written to: D:/chrono/chrono/template_project/build
PS D:\chrono\chrono\template_project> cmake --build build
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>Checking Build System
  Creating DLL output directory D:/chrono/chrono/template_project/build/Debug/
  Building Custom Rule D:/chrono/chrono/template_project/CMakeLists.txt
  Copying Chrono DLL D:/chrono/chrono/build/bin/Debug/ChronoEngine.dll in 
D:/chrono/chrono/template_project/build/Debug
  /                Copying DLL dependency 
D:/chrono/chrono/libraries/irrlicht-1.8.5/irrlicht-1.8.5/bin/Win64-VisualStud
  io/Irrlicht.dll in D:/chrono/chrono/template_project/build/Debug/
  Building Custom Rule D:/chrono/chrono/template_project/CMakeLists.txt
  my_example.cpp
  my_demo.vcxproj -> D:\chrono\chrono\template_project\build\Debug\my_demo.exe
  Building Custom Rule D:/chrono/chrono/template_project/CMakeLists.txt
#--------------------------------------------------------------
# 
# Example of CMake configuration file to build an external 
# project depending on Chrono and on optional Chrono modules.
# 
# This minimal sample project can be used as a template for a
# user project.  Modify sections 1, 2, and 3 below as appropriate.
# 
#--------------------------------------------------------------
 

cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0091 NEW)
#--------------------------------------------------------------
# === 1 === 
# Set the project name
#--------------------------------------------------------------

project(my_project)
set(Chrono_DIR D:/chrono/chrono/build/cmake)
set(CHRONO_DATA_DIR D:/chrono/chrono/data)

#--------------------------------------------------------------
# === 2 ===
# Find the Chrono package and any REQUIRED or OPTIONAL modules
# by invoking the find_package function in CONFIG mode:
#    find_package(Chrono
#                 COMPONENTS req_module1 req_module1 ...
#                 OPTIONAL_COMPONENTS opt_module1 opt_module2 ...
#                 CONFIG)
# The following Chrono modules can be requested (case insensitive):
#   Cascade, Cosimulation, Irrlicht, OpenGL, Matlab, Multicore, Gpu,
#   PardisoMKL, PardisoProject, Postprocess, Python, Vehicle,
#   VehicleCosimm, VSG.
# A component can be requested either as required or optional
# (see the CMake documentation for find_package).
# 
# Note that you will have to set the variable Chrono_DIR to 
# specify the location of the chrono-config.cmake script, if
# it is not in its default install location.
# Chrono_DIR can be either a Chrono build tree or a Chrono install tree.
# 
# The following variables are set and can be used further down:
# Chrono_FOUND
#   set to true if Chrono and all required components were found
# CHRONO_C_FLAGS
# CHRONO_CXX_FLAGS
#   C and C++ compilation flags
# CHRONO_INCLUDE_DIRS
#   additional paths for included headers
# CHRONO_LIBRARIES
#   list of required libraries (with full path)
# CHRONO_LINKER_FLAGS
#   additional linker flags
# CHRONO_DATA_DIR
#   path to the Chrono data make_directory
# 
# In addition, for each requested component [COMPONENT], the
# following variable is set to true (ON) or false (OFF):
# CHRONO_[COMPONENT]_FOUND
# 
# In this example, we only request the Irrlicht module (required)
# and, for demonstration purposes, the PardisoMKL module (optional)
#--------------------------------------------------------------

LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}/../Chrono/lib")
find_package(Chrono
             COMPONENTS Irrlicht
             OPTIONAL_COMPONENTS PardisoMKL
             CONFIG)

#--------------------------------------------------------------
# Return now if Chrono or a required component was not found.
#--------------------------------------------------------------

if (NOT Chrono_FOUND)
  message("Could not find Chrono or one of its required modules")
  return()
endif()

#--------------------------------------------------------------
# Important! To ensure ABI compatibility, use the same C++ standard
# as the one used to build the Chrono libraries.
#--------------------------------------------------------------

set(CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD ${CHRONO_CXX_STANDARD})

#--------------------------------------------------------------
# Enable creation of "application bundles" on MacOSX.
#--------------------------------------------------------------

# This is necessary for any Irrlicht-based project (like the example here).
# For OpenGL-based or non-graphics projects, this is optional and the block
# below can be removed (or else explcitly set CMAKE_MACOSX_BUNDLE to 'OFF').
#
# If creating application bundles, the build output will be named 'myexe.app'.
# Use the convenience script 'run_app.sh' available under 
'contrib/appbundle-macosx/'
# to run:
#     start_demo.sh myexe.app

if(APPLE)
    set(CMAKE_MACOSX_BUNDLE ON)
endif()

#--------------------------------------------------------------
# Add path to Chrono headers and to headers of all dependencies
# of the requested modules.
#--------------------------------------------------------------

include_directories(${CHRONO_INCLUDE_DIRS})

#-----------------------------------------------------------------------------
# Fix for VS 2017 15.8 and newer to handle alignment specification with Eigen
#-----------------------------------------------------------------------------

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
  if(MSVC AND ${MSVC_VERSION} GREATER_EQUAL 1915)
    add_definitions( "-D_ENABLE_EXTENDED_ALIGNED_STORAGE" )
  endif()
endif()

#--------------------------------------------------------------
# Tweaks to disable some warnings with MSVC
#--------------------------------------------------------------
if(MSVC)
    add_definitions("-D_CRT_SECURE_NO_DEPRECATE")  # avoids deprecation warnings
    add_definitions("-D_SCL_SECURE_NO_DEPRECATE")  # avoids deprecation warnings
    add_definitions( "-DNOMINMAX" )                # do not use MSVC's min/max 
macros
endif()

#--------------------------------------------------------------
# === 3 ===
# Add the executable from your project and specify all C++ 
# files in your project. 
#--------------------------------------------------------------

add_executable(my_demo my_example.cpp)

#--------------------------------------------------------------
# Set properties for your executable target
# 
# Note that here we define a macro CHRONO_DATA_DIR which will
# contain the path to the Chrono data directory, either in its
# source tree (if using a build version of Chrono), or in its
# install tree (if using an installed version of Chrono).
#--------------------------------------------------------------

target_compile_definitions(my_demo PUBLIC 
"CHRONO_DATA_DIR=\"${CHRONO_DATA_DIR}\"") 
target_compile_options(my_demo PUBLIC ${CHRONO_CXX_FLAGS})
target_link_options(my_demo PUBLIC ${CHRONO_LINKER_FLAGS})

#--------------------------------------------------------------
# Link to Chrono libraries and dependency libraries
#--------------------------------------------------------------

target_link_libraries(my_demo ${CHRONO_LIBRARIES})

#--------------------------------------------------------------
# === 4 (OPTIONAL) ===
# 
# Optionally, add a custom command for copying all Chrono and
# dependency DLLs to the appropriate binary output folder.
# This function has effect only on Windows.
# 
# DLLs will be copied into ${PROJECT_BINARY_DIR}/${config} by default
# or in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${config} if only 
CMAKE_RUNTIME_OUTPUT_DIRECTORY is set
# or to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG>} if the specific 
CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG> has been set
#--------------------------------------------------------------

# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "<mycustompathforrelease>")
add_DLL_copy_command()

Reply via email to