diff options
| author | ruki <[email protected]> | 2019-02-13 22:37:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-02-13 09:42:01 +0800 |
| commit | b0ab905e2ae98b4ebb66eea9e0a635fc834019be (patch) | |
| tree | 54be72a83658d7e94417924826523f32e15c54c7 | |
| parent | e6b1a84a210d20f69f9987054c21ab64157f77d9 (diff) | |
add cmakelists plugin stub
| -rw-r--r-- | xmake/plugins/project/cmake/cmakelists.lua | 53 | ||||
| -rw-r--r-- | xmake/plugins/project/main.lua | 4 | ||||
| -rw-r--r-- | xmake/plugins/project/make/makefile.lua (renamed from xmake/plugins/project/makefile/makefile.lua) | 0 |
3 files changed, 56 insertions, 1 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua new file mode 100644 index 000000000..62bcae12b --- /dev/null +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -0,0 +1,53 @@ +--!A cross-platform build utility based on Lua +-- +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +-- Copyright (C) 2015 - 2019, TBOOX Open Source Group. +-- +-- @author ruki +-- @file cmakelists.lua +-- + +-- imports +import("core.tool.compiler") +import("core.project.project") +import("core.language.language") +import("core.platform.platform") + +-- make all +function _make_all(cmakelists) + +end + +-- make +function make(outputdir) + + -- enter project directory + local oldir = os.cd(os.projectdir()) + + -- open the cmakelists + local cmakelists = io.open(path.join(outputdir, "CMakeLists.txt"), "w") + + -- make all + _make_all(cmakelists) + + -- close the cmakelists + cmakelists:close() + + -- leave project directory + os.cd(oldir) +end diff --git a/xmake/plugins/project/main.lua b/xmake/plugins/project/main.lua index 787dafe92..75da9309f 100644 --- a/xmake/plugins/project/main.lua +++ b/xmake/plugins/project/main.lua @@ -26,7 +26,8 @@ import("core.base.option") import("core.base.task") import("core.platform.environment") -import("makefile.makefile") +import("make.makefile") +import("cmake.cmakelists") import("vstudio.vs2002") import("vstudio.vs2003") import("vstudio.vs2005") @@ -45,6 +46,7 @@ function _make(kind) local maps = { makefile = makefile.make + , cmakelists = cmakelists.make , vs2002 = vs2002.make , vs2003 = vs2003.make , vs2005 = vs2005.make diff --git a/xmake/plugins/project/makefile/makefile.lua b/xmake/plugins/project/make/makefile.lua index 9e2f2a51d..9e2f2a51d 100644 --- a/xmake/plugins/project/makefile/makefile.lua +++ b/xmake/plugins/project/make/makefile.lua |
