diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-06-20 11:24:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-06-20 11:24:06 +0300 |
commit | 72a2d22f039fde625ff5b7748d4b4af1b4a45090 (patch) | |
tree | 90adb5345cd18e26e90b72b0cde408ff4ac3f928 /build_files/cmake | |
parent | 5a69b93f57891d73379b731b52902ee47a34046d (diff) |
support ninja for netbeans projects
Diffstat (limited to 'build_files/cmake')
-rwxr-xr-x | build_files/cmake/cmake_netbeans_project.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/build_files/cmake/cmake_netbeans_project.py b/build_files/cmake/cmake_netbeans_project.py index 6575e8f8cf0..d4cce46434d 100755 --- a/build_files/cmake/cmake_netbeans_project.py +++ b/build_files/cmake/cmake_netbeans_project.py @@ -40,6 +40,7 @@ from project_info import ( # is_py, cmake_advanced_info, cmake_compiler_defines, + cmake_cache_var, project_name_get, ) @@ -71,6 +72,10 @@ def create_nb_project_main(): # be tricky, get the project name from git if we can! PROJECT_NAME = project_name_get() + + make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM") + make_exe_basename = os.path.basename(make_exe) + # --------------- NB spesific defines = [("%s=%s" % cdef) if cdef[1] else cdef[0] for cdef in defines] defines += [cdef.replace("#define", "").strip() for cdef in cmake_compiler_defines()] @@ -194,9 +199,18 @@ def create_nb_project_main(): f.write(' <makeTool>\n') f.write(' <buildCommandWorkingDir>.</buildCommandWorkingDir>\n') - f.write(' <buildCommand>${MAKE} -f Makefile</buildCommand>\n') - f.write(' <cleanCommand>${MAKE} -f Makefile clean</cleanCommand>\n') + + if make_exe_basename == "ninja": + build_cmd = "ninja" + clean_cmd = "ninja -t clean" + else: + build_cmd = "${MAKE} -f Makefile" + clean_cmd = "${MAKE} -f Makefile clean" + + f.write(' <buildCommand>%s</buildCommand>\n' % build_cmd) + f.write(' <cleanCommand>%s</cleanCommand>\n' % clean_cmd) f.write(' <executablePath>./bin/blender</executablePath>\n') + del build_cmd, clean_cmd def write_toolinfo(): f.write(' <incDir>\n') |