diff options
Diffstat (limited to 'CC/foreign/cmake')
-rw-r--r-- | CC/foreign/cmake/EXPRESSIONS | 20 | ||||
-rw-r--r-- | CC/foreign/cmake/RULES | 16 |
2 files changed, 30 insertions, 6 deletions
diff --git a/CC/foreign/cmake/EXPRESSIONS b/CC/foreign/cmake/EXPRESSIONS index be345c2..bdb05ce 100644 --- a/CC/foreign/cmake/EXPRESSIONS +++ b/CC/foreign/cmake/EXPRESSIONS @@ -1,6 +1,7 @@ { "cmake-build": { "vars": [ "source_dir" + , "cmake_subdir" , "cmake_options" , "cmake_defines" , "cmake_jobs" @@ -143,6 +144,12 @@ ] } ] + , [ "CMAKE_SUBDIR" + , { "type": "join" + , "separator": "/" + , "$1": {"type": "var", "name": "cmake_subdir", "default": []} + } + ] , [ "script" , { "type": "singleton_map" , "key": "run_cmake.sh" @@ -169,9 +176,10 @@ ] } } - , [ "readonly CMAKE_AR=$(which $1)" - , "shift" - , "cmake \"$@\" -Ssource -Bbuild -DCMAKE_AR=${CMAKE_AR} -DCMAKE_INSTALL_PREFIX=./install >configure.log || (cat configure.log && exit 1)" + , [ "readonly CMAKE_SUBDIR=\"$1\"" + , "readonly CMAKE_AR=$(which $2)" + , "shift 2" + , "cmake \"$@\" -S\"source/${CMAKE_SUBDIR}\" -Bbuild -DCMAKE_AR=${CMAKE_AR} -DCMAKE_INSTALL_PREFIX=./install >configure.log || (cat configure.log && exit 1)" ] , [ { "type": "join" , "separator": " " @@ -222,7 +230,11 @@ , "cmd": { "type": "++" , "$1": - [ ["/bin/sh", "run_cmake.sh", {"type": "var", "name": "AR"}] + [ [ "/bin/sh" + , "run_cmake.sh" + , {"type": "var", "name": "CMAKE_SUBDIR"} + , {"type": "var", "name": "AR"} + ] , {"type": "var", "name": "CMAKE_FLAGS"} ] } diff --git a/CC/foreign/cmake/RULES b/CC/foreign/cmake/RULES index 8651f4e..e5c7706 100644 --- a/CC/foreign/cmake/RULES +++ b/CC/foreign/cmake/RULES @@ -2,7 +2,8 @@ { "doc": ["Data produced by CMake configure, build, and install."] , "target_fields": ["project"] , "string_fields": - [ "options" + [ "subdir" + , "options" , "defines" , "jobs" , "pre_cmds" @@ -27,6 +28,10 @@ , "field_doc": { "project": ["The CMake project directory. It should contain a single tree artifact"] + , "subdir": + [ "The subdirectory that contains the entry CMakeLists.txt. Individual" + , "directory components are joined with \"/\"." + ] , "options": [ "CMake options for the configuration phase." , "(e.g., [\"-GNinja\", \"-Ax64\"])" @@ -162,6 +167,7 @@ } } ] + , ["cmake_subdir", {"type": "FIELD", "name": "subdir"}] , ["cmake_options", {"type": "FIELD", "name": "options"}] , ["cmake_defines", {"type": "FIELD", "name": "defines"}] , ["cmake_jobs", {"type": "FIELD", "name": "jobs"}] @@ -218,7 +224,8 @@ { "doc": ["Library produced by CMake configure, build, and install."] , "target_fields": ["project", "deps"] , "string_fields": - [ "name" + [ "subdir" + , "name" , "version" , "stage" , "options" @@ -256,6 +263,10 @@ , "field_doc": { "project": ["The CMake project directory. It should contain a single tree artifact"] + , "subdir": + [ "The subdirectory that contains the entry CMakeLists.txt. Individual" + , "directory components are joined with \"/\"." + ] , "name": [ "The name of the library (without leading \"lib\" or trailing file name" , "extension), also used as name for pkg-config files." @@ -509,6 +520,7 @@ ] } ] + , ["cmake_subdir", {"type": "FIELD", "name": "subdir"}] , ["cmake_options", {"type": "FIELD", "name": "options"}] , ["cmake_defines", {"type": "FIELD", "name": "defines"}] , ["cmake_jobs", {"type": "FIELD", "name": "jobs"}] |