summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/genie/src/actions/cmake/cmake_workspace.lua
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/genie/src/actions/cmake/cmake_workspace.lua')
-rw-r--r--3rdparty/genie/src/actions/cmake/cmake_workspace.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/3rdparty/genie/src/actions/cmake/cmake_workspace.lua b/3rdparty/genie/src/actions/cmake/cmake_workspace.lua
index 3e0c526ff4b..b948f9194e5 100644
--- a/3rdparty/genie/src/actions/cmake/cmake_workspace.lua
+++ b/3rdparty/genie/src/actions/cmake/cmake_workspace.lua
@@ -5,6 +5,19 @@
--
function premake.cmake.workspace(sln)
+ if (sln.location ~= _WORKING_DIR) then
+ local name = string.format("%s/CMakeLists.txt", _WORKING_DIR)
+ local f, err = io.open(name, "wb")
+ if (not f) then
+ error(err, 0)
+ end
+ f:write('# CMakeLists autogenerated by GENie\n')
+ f:write('cmake_minimum_required(VERSION 2.8.4)\n')
+ f:write('\n')
+ f:write('add_subdirectory('.. path.getrelative(_WORKING_DIR, sln.location) ..')\n')
+ f:close()
+ end
+ _p('# CMakeLists autogenerated by GENie')
_p('cmake_minimum_required(VERSION 2.8.4)')
_p('')
for i,prj in ipairs(sln.projects) do