forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (48 loc) · 1.53 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
remove_tool (pythongen "Deprecated and will be removed soon")
return ()
find_package (Python2Interp 2.7 QUIET)
if (PYTHON2INTERP_FOUND)
set (SETUP_PY ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
configure_file (setup.py.in ${SETUP_PY})
install (
CODE "execute_process(COMMAND
${PYTHON2_EXECUTABLE}
\"${CMAKE_CURRENT_SOURCE_DIR}/pythongen\"
-p tests/lift.ini
\"${CMAKE_CURRENT_SOURCE_DIR}/util/util.c\"
-o \"${CMAKE_CURRENT_BINARY_DIR}/util.py\")")
install (
CODE "execute_process(COMMAND
${PYTHON2_EXECUTABLE}
\"${CMAKE_CURRENT_SOURCE_DIR}/pythongen\"
-p tests/lift.ini
\"${CMAKE_CURRENT_SOURCE_DIR}/util/util.cpp\"
-o \"${CMAKE_CURRENT_BINARY_DIR}/cpp_util.py\")")
install (
CODE "execute_process(COMMAND
${PYTHON2_EXECUTABLE} \"${SETUP_PY}\"
--no-user-cfg
--quiet
install
--prefix=${CMAKE_INSTALL_PREFIX}
--root=\$ENV{DESTDIR}
--install-scripts=${CMAKE_INSTALL_PREFIX}/${TARGET_TOOL_EXEC_FOLDER}
${INSTALL_OPTIONS}
)")
function (pythongen_util TEMPLATE OUTPUT)
# file(GLOB SUPPORT RELATIVE support "*.py")
# call the gen tool
set (OUTPUT "${CMAKE_BINARY_DIR}/src/tools/pythongen/${OUTPUT}")
message (STATUS "doing command ${TEMPLATE} ${OUTPUT}")
endfunction (pythongen_util)
generate_manpage (kdb-gen FILENAME ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
# add_subdirectory(util)
# ~~~
# for future cmakification
# add_subdirectory(support)
# add_subdirectory(template)
# add_subdirectory(tests)
# ~~~
else ()
remove_tool (pythongen "Did not find python2 interpreter")
endif ()