Skip to content

Commit

Permalink
New build system
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspard committed Apr 18, 2012
1 parent 6edcc4f commit c12d35c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
28 changes: 24 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
include_directories(src)
# --------------------------------------------------------------
# glut
#
# provides:
# glut.so
# --------------------------------------------------------------
set(MODULE_NAME glut)
set(target ${MODULE_NAME})

find_package(GLUT REQUIRED)
include_directories(src)

file(GLOB MODULE_SOURCES ${MODULE}/src/*.cpp ${MODULE}/src/${PLAT}/*.cpp ${MODULE}/src/*.c ${MODULE}/src/${PLAT}/*.c)
add_library(${target} MODULE ${MODULE_SOURCES})
set_target_properties(${target}
PROPERTIES
LINK_FLAGS ${PLAT_OBJ_FLAGS}
PREFIX ""
SUFFIX ".so"
)
target_link_libraries(${target} ${GLUT_LIBRARIES})

build_module("glut" ${MODULE_SOURCES})

target_link_libraries("glut" ${GLUT_LIBRARIES})
# --------------------------------------------------------------
# install
# --------------------------------------------------------------
install(TARGETS ${target}
DESTINATION lib/lubyk
)
4 changes: 2 additions & 2 deletions src/lua_glut.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <GLUT/glut.h>
#include <stdlib.h>
#else
#include <GL/gl.h>
#include <GL/freeglut.h>
#include <malloc.h>
#endif

Expand Down Expand Up @@ -359,4 +359,4 @@ static const luaL_reg glutlib[] = {
LUAGLUT_API int luaopen_glut(lua_State *L){
luaL_openlib(L, "glut", glutlib, 0);
return 1;
}
}

0 comments on commit c12d35c

Please sign in to comment.