0

I am trying copy certain dll's to Output folder where the generated binary resides and some of the dll's are visual studio version specific. I tried something similar to below template but it gives me errors.

INSTALL(FILES 
    ../x.dll
    ../y.dll
    ../z.dll
    IF(${CMAKE_GENERATOR} STREQUAL "Visual Studio 12 2013")
        ../xyz.dll          
    ELSE()
        ../xy.dll
    ENDIF()
    DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/Release)

Where am i going wrong? (I am new to CMAKE)

moooni moon
  • 333
  • 1
  • 5
  • 19
  • 1
    In CMake **commands cannot be nested**. Instead, one command could set some variable, and this variable can be dereferenced in the other command. You need to read manual about CMake. – Tsyvarev Feb 26 '16 at 19:22
  • Thanks for your suggestion , it helped. – moooni moon Mar 01 '16 at 19:27

1 Answers1

0

I solved my issue with below template.

IF(${CMAKE_GENERATOR} STREQUAL "Visual Studio 12 2013")
    SET (VS_DEPENDENT_DLL ../xyz.dll) 
ELSE()
    SET (VS_DEPENDENT_DLL ../xy.dll)
ENDIF()

INSTALL(FILES 
    ../x.dll
    ../y.dll
    ../z.dll
    ${VS_DEPENDENT_DLL}
    DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/Release)
moooni moon
  • 333
  • 1
  • 5
  • 19