From 4bd8be7b5852b8cce652941fd4a4a5f67ec63f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Sun, 16 Feb 2014 15:24:25 +0100 Subject: [PATCH] Added cmake configuration We leave the original Makefile as alternative, but it is currently overwritten by a call to cmake. --- .gitignore | 5 +++++ CMakeLists.txt | 27 +++++++++++++++++++++++++++ Makefile | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt diff --git a/.gitignore b/.gitignore index e57185e..1f626cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ *.o *.user +/CMakeCache.txt +/CMakeFiles/ +/blockofighter +/gmon.out +/*.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..907b895 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,27 @@ +project(blockofighter) +cmake_minimum_required(VERSION 2.8) +aux_source_directory(src SRC_LIST) +add_executable(${PROJECT_NAME} ${SRC_LIST}) + +find_package(SDL REQUIRED) +find_package(SDL_image REQUIRED) + +if(NOT SDL_FOUND) + message(FATAL_ERROR "SDL not found!") +endif(NOT SDL_FOUND) + +if(NOT SDLIMAGE_FOUND) + message(FATAL_ERROR "SDL not found!") +endif(NOT SDLIMAGE_FOUND) + +include_directories( + ${SDL_INCLUDE_DIR} + ${SDLIMAGE_INCLUDE_DIR} +) +target_link_libraries(blockofighter + ${SDL_LIBRARY} + ${SDLIMAGE_LIBRARY} + SDLmain + GL + GLU +) diff --git a/Makefile b/Makefile index ba864f5..fa60bdf 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ ifeq ($(FMOD), yes) endif CC = c++ -CFLAGS = -I. -O3 $(GFXFLAGS) $(SNDFLAGS) -pg -s +CFLAGS = -I. -O3 $(GFXFLAGS) $(SNDFLAGS) LIBS = $(GFXLIBS) $(SNDLIBS)