From 932c8d0953daf15d5ab03fdcff6902b7830112d3 Mon Sep 17 00:00:00 2001 From: haraldhv Date: Fri, 23 Feb 2007 17:17:51 +0000 Subject: [PATCH] Added cmakelist --- CMakeLists.txt | 21 +++++++++++++++++++ lib/CMakeLists.txt | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 lib/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..79377ce --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +project(EVERYTHING) + +set(dgl_DIR dgl) +get_filename_component(dgl_ABSOLUTE ${dgl_DIR} ABSOLUTE) +add_subdirectory(${dgl_ABSOLUTE}) + +set(effector_DIR effector) +get_filename_component(effector_ABSOLUTE ${effector_DIR} ABSOLUTE) +add_subdirectory(${effector_ABSOLUTE}) + +set(prods_DIR prods) +get_filename_component(prods_ABSOLUTE ${prods_DIR} ABSOLUTE) +add_subdirectory(${prods_ABSOLUTE}) + +#set(editor_DIR editor) +#get_filename_component(editor_ABSOLUTE ${editor_DIR} ABSOLUTE) +#add_subdirectory(${editor_ABSOLUTE}) + +set(shadertest_DIR shadertest) +get_filename_component(shadertest_ABSOLUTE ${shadertest_DIR} ABSOLUTE) +add_subdirectory(${shadertest_ABSOLUTE}) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 0000000..7990c56 --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1,52 @@ +project(dgl) + +set(DGL_SRCS + dgl_default_shaders.c + dgl_error.c + dgl_fbo.c + dgl_font.c + dgl_image.c + dgl_input.c + dgl_math.c + dgl_model_ase.c + dgl_model_binary.c + dgl_model.c + dgl_perspective.c + dgl_shader.c + dgl_skeleton.c + dgl_sound.c + dgl_timer.c + dgl_window.c + ) + +#find SDL and its related libraries +find_package(SDL REQUIRED) +find_package(SDL_image REQUIRED) +find_package(SDL_mixer REQUIRED) +include_directories( ${SDL_INCLUDE_DIR} ${SDLIMAGE_INCLUDE_DIR} ${SDLMIXER_INCLUDE_DIR}) + +#find OpenGL and GLU +find_package(OpenGL REQUIRED) +include_directories( ${OPENGL_INCLUDE_DIR} ) + +#find GLEW +set(CMAKE_MODULE_PATH ..) +find_package(GLEW REQUIRED) + + +#compile the dgl library +add_library(dgl ${DGL_SRCS}) +#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") +# c99 flag not used now, not supported by visual studio + +target_link_libraries(dgl ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDLMIXER_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ) + +#extra mac weirdness thingy line +if (APPLE) +#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Dmain=SDL_main ") +target_link_libraries(dgl -lSDLmain) +endif (APPLE) + +#compile the test library +add_executable(test main.c) +target_link_libraries(test dgl)