Error on build INSTALL.vcxproj project (debug) with cmake 3.7.2
Hi, when I build INSTALL project (debug mode) I have the following error:
CMake Error at cmake_install.cmake:64 (file): file INSTALL cannot find "D:/Dev/openmw/MSVC2017_64/Debug/openmw.cfg.install".
After some investiguation I found that this file should be copied in openmw/CMakeLists.txt at the line 311
if (NOT APPLE) configure_resource_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg.local "${OpenMW_BINARY_DIR}" "openmw.cfg") configure_resource_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg "${OpenMW_BINARY_DIR}" "openmw.cfg.install") # <--- HERE else () configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg "${OpenMW_BINARY_DIR}/openmw.cfg") endif ()
As I am on windows (so NOT APPLE)
The configure_resource_file macro is defined in openmw/cmake/OpenMWMacros.cmake (line 191):
macro (configure_resource_file source_path destination_dir_base dest_path_relative) get_generator_is_multi_config(multi_config) if (multi_config) foreach(cfgtype ${CMAKE_CONFIGURATION_TYPES}) configure_file(
{source_path} "
{destination_dir_base}/{cfgtype}/
{dest_path_relative}") endforeach(cfgtype) else (multi_config) configure_file({source_path} "
{destination_dir_base}/${dest_path_relative}") endif (multi_config) endmacro (configure_resource_file)
I added some logs and found that multi_config is not set after calling the get_generator_is_multi_config macro (defined at line 168):
macro (get_generator_is_multi_config VALUE) if (DEFINED generator_is_multi_config_var) set(${VALUE} ${generator_is_multi_config_var}) else (DEFINED generator_is_multi_config_var) if (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9) get_cmake_property(${VALUE} GENERATOR_IS_MULTI_CONFIG) else (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9) list(LENGTH "${CMAKE_CONFIGURATION_TYPES}" ${VALUE}) endif (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9) endif (DEFINED generator_is_multi_config_var) endmacro (get_generator_is_multi_config)
My cmake version is 3.7.2 so I am in the case list(LENGTH "${CMAKE_CONFIGURATION_TYPES}" ${VALUE})
I added some more logs and if I change to
list(LENGTH CMAKE_CONFIGURATION_TYPES ${VALUE}) the VALUE is set to the right value (4 in my case for Debug;MinSizeRel;Release;RelWithDebInfo).
I have made the changes on my fork; if you are ok I can create a PR with these changes.
(RM-4429 from redmine: created on 2018-05-29 by Cédric Mocquillon, , closed on 2018-06-08 by Cédric Mocquillon)