Permalink
Browse files

Added CMake build system. See README.cmake

  • Loading branch information...
1 parent 2c693d6 commit 56fcc3be55024c50fd0d9045b5bca8f4cf521249 @smarter committed Mar 21, 2011
Showing with 58 additions and 0 deletions.
  1. +42 −0 CMakeLists.txt
  2. +16 −0 README.cmake
View
42 CMakeLists.txt
@@ -0,0 +1,42 @@
+cmake_minimum_required(VERSION 2.6)
+
+include(CheckLibraryExists)
+
+project(openj)
+
+set (libj_SRCS
+ a.c ab.c af.c ai.c am.c am1.c amn.c ao.c ap.c ar.c as.c au.c c.c ca.c cc.c cd.c cf.c cg.c ch.c cip.c cl.c cp.c cpdtsp.c cr.c crs.c ct.c cu.c cv.c cx.c d.c dc.c dss.c
+ dstop.c dsusp.c dtoa.c f.c f2.c i.c io.c j.c jdlllic.c k.c m.c mbx.c p.c pv.c px.c r.c rl.c rt.c s.c sc.c sl.c sn.c t.c u.c v.c v0.c v1.c v2.c va1.c va2.c va2s.c vamultsp.c
+ vb.c vbang.c vbit.c vcant.c vchar.c vcat.c vcatsp.c vcomp.c vcompsc.c vd.c vdx.c ve.c vf.c vfft.c vfrom.c vfromsp.c vg.c vgauss.c vgcomp.c vgranking.c vgsort.c vgsp.c vi.c
+ viix.c visp.c vm.c vo.c vp.c vq.c vrand.c vrep.c vs.c vsb.c vt.c vu.c vx.c vz.c w.c wc.c wn.c ws.c x.c x15.c xa.c xb.c xc.c xcrc.c xd.c xf.c xfmt.c xh.c xi.c xl.c xo.c xs.c
+ xt.c xu.c)
+
+set(jconsole_SRCS
+ jconsole.c
+ jeload.c)
+
+set(jconsole_LIBS
+ m)
+
+add_definitions("-DNOASM")
+
+if (UNIX AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ add_definitions("-D_UNIX64")
+endif (UNIX AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+
+check_library_exists(dl dlopen "" HAVE_DL)
+if (HAVE_DL)
+ set(jconsole_LIBS ${jconsole_LIBS} dl)
+endif (HAVE_DL)
+
+check_library_exists(readline readline "" HAVE_READLINE)
+if (HAVE_READLINE)
+ set(jconsole_LIBS ${jconsole_LIBS} readline)
+ add_definitions("-DREADLINE")
+endif (HAVE_READLINE)
+
+add_library(j SHARED ${libj_SRCS})
+set_target_properties(j PROPERTIES COMPILE_FLAGS "-fPIC -O3 -fno-strict-aliasing")
+
+add_executable(jconsole ${jconsole_SRCS})
+target_link_libraries(jconsole ${jconsole_LIBS})
View
16 README.cmake
@@ -0,0 +1,16 @@
+* To build:
+mkdir build && cd build
+cmake ..
+make
+
+* Run with:
+./jconsole
+
+* If you had unmet optional dependencies and want to
+ update the Makefile after getting them, run:
+rm CMakeCache.txt
+cmake ..
+
+* Cross-compile with:
+mkdir build.x && cd build.x
+cmake .. -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=arm-none-linux-gnueabi-gcc

0 comments on commit 56fcc3b

Please sign in to comment.