source: nscp/scripts/CMakeLists.txt

Last change on this file was 3eebf6a, checked in by Michael Medin <michael@…>, 11 months ago

Applied fix for scripts not being copied to master branch

  • Property mode set to 100644
File size: 2.0 KB
Line 
1cmake_minimum_required(VERSION 2.6)
2
3PROJECT(copy_scripts)
4
5FILE (GLOB scripts_BAT "*.bat")
6FILE (GLOB scripts_VBS "*.vbs")
7FILE (GLOB scripts_PS1 "*.ps1")
8FILE (GLOB scripts_LIB "lib/*.vbs")
9#IF(WIN32)
10FILE (GLOB_RECURSE scripts_PYT "python/*.py")
11#ELSE(WIN32)
12#FILE (GLOB scripts_PYT "python/*.py" "python/lib/*.py")
13#ENDIF(WIN32)
14FILE (GLOB_RECURSE scripts_LUA "lua/*.lua")
15
16SET(script_ALL ${scripts_BAT} ${scripts_VBS} ${scripts_PS1})
17SET(ALL_FILES)
18
19FOREACH(file ${script_ALL})
20        get_filename_component(filename ${file} NAME)
21        #MESSAGE(STATUS " + ${filename} (${file})")
22        copy_single_file(ALL_FILES ${filename} scripts)
23ENDFOREACH(file ${script_ALL})
24
25
26FOREACH(file ${scripts_LIB})
27        get_filename_component(filename ${file} NAME)
28        #MESSAGE(STATUS " + lib - ${filename}")
29        copy_single_file(ALL_FILES lib/${filename} scripts/lib)
30ENDFOREACH(file ${scripts_LIB})
31
32FOREACH(file ${scripts_PYT})
33        get_filename_component(filename ${file} NAME)
34        get_filename_component(filepath ${file} PATH)
35        file(RELATIVE_PATH relpath ${CMAKE_CURRENT_SOURCE_DIR} "${filepath}")
36        STRING(REPLACE "/" "_" alias "${relpath}")
37        STRING(REPLACE "." "_" alias "${alias}")
38        #MESSAGE(STATUS " + python - ${filename} - ${relpath} - ${alias}")
39        copy_single_file(ALL_FILES ${relpath}/${filename} scripts/${relpath})
40ENDFOREACH(file ${scripts_PYT})
41
42FOREACH(file ${scripts_LUA})
43        get_filename_component(filename ${file} NAME)
44        get_filename_component(filepath ${file} PATH)
45        file(RELATIVE_PATH relpath ${CMAKE_CURRENT_SOURCE_DIR} "${filepath}")
46        STRING(REPLACE "/" "_" alias "${relpath}")
47        STRING(REPLACE "." "_" alias "${alias}")
48        #MESSAGE(STATUS " + lua - ${filename} - ${relpath} - ${alias}")
49        copy_single_file(ALL_FILES ${relpath}/${filename} scripts/${relpath})
50ENDFOREACH(file ${scripts_LUA})
51
52ADD_CUSTOM_TARGET(copy_scripts ALL DEPENDS ${ALL_FILES})
53SET_TARGET_PROPERTIES(copy_scripts PROPERTIES FOLDER "files")
54#INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES \"${source_file}\")")
Note: See TracBrowser for help on using the repository browser.