source: nscp/scripts/CMakeLists.txt @ 73c816e

0.4.0
Last change on this file since 73c816e was 73c816e, checked in by Michael Medin <michael@…>, 10 months ago
  • Fixed some build related issues (such as missing nsclient.dist and order of scripts)
  • Property mode set to 100644
File size: 1.9 KB
Line 
1cmake_minimum_required(VERSION 2.6)
2
3FILE (GLOB scripts_BAT "*.bat")
4FILE (GLOB scripts_VBS "*.vbs")
5FILE (GLOB scripts_PS1 "*.ps1")
6FILE (GLOB scripts_LIB "lib/*.vbs")
7#IF(WIN32)
8FILE (GLOB_RECURSE scripts_PYT "python/*.py")
9#ELSE(WIN32)
10#FILE (GLOB scripts_PYT "python/*.py" "python/lib/*.py")
11#ENDIF(WIN32)
12FILE (GLOB_RECURSE scripts_LUA "lua/*.lua")
13
14SET(script_ALL ${scripts_BAT} ${scripts_VBS} ${scripts_PS1})
15SET(ALL_FILES)
16
17FOREACH(file ${script_ALL})
18        get_filename_component(filename ${file} NAME)
19        #MESSAGE(STATUS " + ${filename} (${file})")
20        copy_single_file(ALL_FILES ${filename} scripts)
21ENDFOREACH(file ${script_ALL})
22
23
24FOREACH(file ${scripts_LIB})
25        get_filename_component(filename ${file} NAME)
26        #MESSAGE(STATUS " + lib - ${filename}")
27        copy_single_file(ALL_FILES lib/${filename} scripts/lib)
28ENDFOREACH(file ${scripts_LIB})
29
30FOREACH(file ${scripts_PYT})
31        get_filename_component(filename ${file} NAME)
32        get_filename_component(filepath ${file} PATH)
33        file(RELATIVE_PATH relpath ${CMAKE_CURRENT_SOURCE_DIR} "${filepath}")
34        STRING(REPLACE "/" "_" alias "${relpath}")
35        STRING(REPLACE "." "_" alias "${alias}")
36        #MESSAGE(STATUS " + python - ${filename} - ${relpath} - ${alias}")
37        copy_single_file(ALL_FILES ${relpath}/${filename} scripts/${relpath})
38ENDFOREACH(file ${scripts_PYT})
39
40FOREACH(file ${scripts_LUA})
41        get_filename_component(filename ${file} NAME)
42        get_filename_component(filepath ${file} PATH)
43        file(RELATIVE_PATH relpath ${CMAKE_CURRENT_SOURCE_DIR} "${filepath}")
44        STRING(REPLACE "/" "_" alias "${relpath}")
45        STRING(REPLACE "." "_" alias "${alias}")
46        #MESSAGE(STATUS " + lua - ${filename} - ${relpath} - ${alias}")
47        copy_single_file(ALL_FILES ${relpath}/${filename} scripts/${relpath})
48ENDFOREACH(file ${scripts_LUA})
49
50ADD_CUSTOM_TARGET(copy_scripts DEPENDS ${ALL_FILES})
51SET_TARGET_PROPERTIES(copy_scripts PROPERTIES FOLDER "files")
52#INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES \"${source_file}\")")
Note: See TracBrowser for help on using the repository browser.