mujs icon indicating copy to clipboard operation
mujs copied to clipboard

Create CMakeLists.txt

Open wxd237 opened this issue 7 years ago • 1 comments
trafficstars

add cmake build system tool

wxd237 avatar Aug 17 '18 10:08 wxd237

The Makefile build system is needed to do various development tasks such as creating the astnames.h and opnames.h header files, pkg-config files, and release tarballs. A simple CMake build system can't reproduce these tasks; and the one you provide here doesn't work on non-unix platforms anyway since it hardwires in GCC compiler flags and a dependency on readline.

If you just want to build and use the library, you only need to compile the single file "one.c" in your build. Here's a simplified CMakeLists.txt that will build and install the library and command line interpreter on unix like systems:

project ( mujs C )
cmake_minimum_required ( VERSION 2.6 )
add_library ( mujs one.c )
add_executable ( mujs-sh main.c )
target_compile_definitions ( mujs-sh PRIVATE HAVE_READLINE )
target_link_libraries ( mujs-sh mujs readline m )
install ( TARGETS mujs-sh DESTINATION bin )
install ( TARGETS mujs DESTINATION lib )
install ( FILES mujs.h DESTINATION include )

ccxvii avatar Aug 17 '18 11:08 ccxvii