Merge branch 'release_candidate' into release
[CRYENGINE.git] / Tools / CMake / modules / Substance.cmake
blobd3a799aeed283c0d4d8b90895e83d4dad28c97ac
1 if(WINDOWS)
2    add_library(Substance SHARED IMPORTED GLOBAL)
3    SET(LIB_DIR "${SDK_DIR}/SubstanceEngines/lib/win32-msvc2015-64")
4    SET(DLL_DIR "${SDK_DIR}/SubstanceEngines/bin/win32-msvc2015-64")
5    SET(TINYXML_LIB_DIR "${SDK_DIR}/SubstanceEngines/3rdparty/tinyxml/lib/win32-msvc2015-64")
6    set_property(TARGET Substance APPEND PROPERTY IMPORTED_CONFIGURATIONS PROFILE)
7    set_property(TARGET Substance APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) 
8    set_target_properties(Substance PROPERTIES IMPORTED_IMPLIB_PROFILE "${LIB_DIR}/release_md/substance_framework.lib")
9    set_target_properties(Substance PROPERTIES IMPORTED_IMPLIB_DEBUG "${LIB_DIR}/debug_md/substance_framework.lib")
10    set_property(TARGET Substance PROPERTY INTERFACE_LINK_LIBRARIES  "${LIB_DIR}/$<$<NOT:$<CONFIG:Debug>>:release_md>$<$<CONFIG:Debug>:debug_md>/substance_linker.lib"
11                                                                     "${LIB_DIR}/$<$<NOT:$<CONFIG:Debug>>:release_md>$<$<CONFIG:Debug>:debug_md>/substance_sse2_blend.lib"
12                                                                     "${TINYXML_LIB_DIR}/$<$<NOT:$<CONFIG:Debug>>:release_md>$<$<CONFIG:Debug>:debug_md>/tinyxml.lib") 
14     
15     set_property(TARGET Substance APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SDK_DIR}/SubstanceEngines/include")
16     set_property(TARGET Substance APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SDK_DIR}/SubstanceEngines/3rdparty/tinyxml")
17 endif() # if(WINDOWS)
19 macro(copy_substance) 
20         if (WINDOWS)
21         file(TO_NATIVE_PATH "${OUTPUT_DIRECTORY}" NATIVE_OUTDIR)
22         file(TO_NATIVE_PATH "${DLL_DIR}" NATIVE_DLLDIR)
23         add_custom_command(TARGET ${THIS_PROJECT} PRE_BUILD
24         COMMAND copy /Y "${NATIVE_DLLDIR}\\$<$<NOT:$<CONFIG:Debug>>:release_md>$<$<CONFIG:Debug>:debug_md>\\substance_sse2_blend.dll" "${NATIVE_OUTDIR}"
25         COMMAND copy /Y "${NATIVE_DLLDIR}\\$<$<NOT:$<CONFIG:Debug>>:release_md>$<$<CONFIG:Debug>:debug_md>\\substance_linker.dll" "${NATIVE_OUTDIR}")
26     else()
27                 message(WARNING "PortAudio library copy not implemented for this platform!")
28         endif()
29 endmacro()