[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Using CMake for general scripting tasks?
From:       Sebastian Gniazdowski <psprint () zdharma ! org>
Date:       2017-11-18 17:28:48
Message-ID: etPan.5a106dd1.6c2945c6.137 () zdharma ! org
[Download RAW message or body]

On 14 Nov 2017 at 10:44:09, Konstantin Tokarev (annulen@yandex.ru) wrote:
> 14.11.2017, 03:46, "Sebastian Gniazdowski" :
> I'm writing Zsh plugin manager, Zplugin, and I want to integrate with CMake \
> somehow,   to get some swiss army knife features.
> 
> For general scripting tasks use general-purpose scripting language, e.g. Perl, \
> Python,   Ruby. You will avoid many issues of sub-par languages, make your programs \
> less verbose,   and will be able to use huge collections of 3rd party modules which \
> can do almost anything   you can think about

I'm a specific person, although I'm certain that many share my traits – getting fun \
from using something in surprising and difficult way, especially if it's low level. I \
have a good example – I've written HTML-like ncurses library for Zsh. So, buttons, \
list boxes, text fields, etc. created from simple input text (the "HTML"). I have to \
defend myself against criticism of not using high level languages, because low-level \
way is really good on it's own right and good things should be defended. A proof is \
this curses application written in pure Zshell script with use of the library (called \
"ZUI"): https://asciinema.org/a/147225. Curses library correctly describes itself by \
its name, and with that library there's no need for more "curses" when creating \
terminal app.

Maybe I should ask what advanced, surprising functionality did you or someone else \
obtain by CMake macro or function? This could lead me to what CMake can give to \
Zplugin.

I have an example of such functionality, although I think it's not that much \
advanced, but for my beginners level it's good and informing – I spotted this \
function:

function( QUERY_QMAKE VAR RESULT )
  get_target_property( QMAKE_EXEC Qt5::qmake LOCATION )
  exec_program( "${QMAKE_EXEC}" ARGS "-query ${VAR}" RETURN_VALUE retval \
OUTPUT_VARIABLE out )  if( retval EQUAL 0 )
  file( TO_CMAKE_PATH "${out}" out )
  set( ${RESULT} ${out} PARENT_SCOPE )
  endif()
endfunction()

It allows to query Qt's "qmake" and get library paths etc. Didn't need it, because \
                Qt5 has proper CMake packages.
-- 
Sebastian Gniazdowski
psprint@zdharma.org


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic