fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Contrib / ComputeBase / CMake / OSGContribComputeBase.SetupHelper.cmake
blob92597b4deaafba4acdac9871bd4c5dbfa1a01420
2 MACRO(SetupFiles fileList targetList sourceDir dstDir)
4   SET(_OSGSUPP_DST_DIR ${CMAKE_BINARY_DIR}/${dstDir})
6 #MESSAGE(STATUS "
7   FILE(MAKE_DIRECTORY ${_OSGSUPP_DST_DIR})
8 #")
10   FOREACH(_src_file ${${fileList}})
12     IF(NOT WIN32)
13 #MESSAGE(STATUS "
14       EXECUTE_PROCESS(
15         COMMAND "${CMAKE_COMMAND}" -E create_symlink ${sourceDir}/${_src_file} ${_OSGSUPP_DST_DIR}/${_src_file} )
16 #")
17     ELSE()
18 #MESSAGE(STATUS "
19       EXECUTE_PROCESS(
20         COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${sourceDir}/${_src_file}" "${_OSGSUPP_DST_DIR}/${_src_file}" )
21 #")
22     ENDIF()
24     LIST(APPEND ${targetList} ${_OSGSUPP_DST_DIR}/${_src_file})
25     
26   ENDFOREACH(_src_file ${fileList})
28 ENDMACRO(SetupFiles)
30 MACRO(ProcessFile fileList srcFile dstFile filter)
32   EXECUTE_PROCESS(
33         COMMAND "${CMAKE_COMMAND}" -DIN_FILE:FILE=${srcFile} 
34                                    -DOUT_FILE:FILE=${dstFile}.proc
35                                    -P ${filter})
37   EXECUTE_PROCESS(
38         COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${dstFile}.proc" "${dstFile}")
40   LIST(APPEND ${fileList} ${dstFile})
42 ENDMACRO(ProcessFile fileList srcFile dstFile filter)
45 MACRO(CopyOrLink srcFile dstFile)
46   IF(NOT WIN32)
47 #MESSAGE(STATUS "
48     EXECUTE_PROCESS(
49         COMMAND "${CMAKE_COMMAND}" -E create_symlink "${srcFile}" "${dstFile}" )
50 #")
51   ELSE()
52 #MESSAGE(STATUS "
53     EXECUTE_PROCESS(
54         COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${srcFile}" "${dstFile}" )
55 #")
56   ENDIF()
57 ENDMACRO(CopyOrLink srcFile dstFile)