Commits

Devlon  committed 56210f9 Merge

Adopting CMakeList improvements

  • Participants
  • Parent commits d2f893f, 92b48f0
  • Branches devel

Comments (0)

Files changed (2)

File CMakeLists.txt

-cmake_minimum_required(VERSION 2.8)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
     
-project(cepheus CXX)
+PROJECT(cepheus CXX)
 
 # set (CMAKE_CXX_COMPILER                   "/usr/bin/clang++")
-set (CMAKE_CXX_FLAGS_INIT                 "-Wall -pedantic -fPIC -shared -g")
-set (CMAKE_LINK_FLAGS                     "-fPIC -shared")
+SET (CMAKE_CXX_FLAGS_INIT                 "-Wall -pedantic -fPIC -shared -g")
+SET (CMAKE_LINK_FLAGS                     "-fPIC -shared")
 # set (CMAKE_CXX_FLAGS_INIT                 "-Wall -pedantic")
 # set (CMAKE_AR                             "/usr/bin/llvm-ar")
 # set (CMAKE_LINKER                         "/usr/bin/llvm-ld")
 # set (CMAKE_OBJDUMP                        "/usr/bin/llvm-objdump")
 # set (CMAKE_RANLIB                         "/usr/bin/llvm-ranlib")
 
-set (SOURCES
+SET (SOURCES
                         src/Core/Game.cpp
                         src/Graphics/Image.cpp
                         src/Core/Entity.cpp
                         src/Scene/SceneManager.cpp
 )
 
-INCLUDE_DIRECTORIES(    ${CMAKE_CURRENT_SOURCE_DIR}/src/headers)
-set (CONF_FILE          ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h)
-file(MAKE_DIRECTORY     ${CMAKE_CURRENT_SOURCE_DIR}/bin)
-file(WRITE              ${CONF_FILE})
+INCLUDE_DIRECTORIES(    
+        ${CMAKE_CURRENT_SOURCE_DIR}/src/headers
+)
+SET (
+        CONF_FILE          ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h
+)
+FILE(
+        MAKE_DIRECTORY     ${CMAKE_CURRENT_SOURCE_DIR}/bin
+)
+FILE(
+        WRITE              ${CONF_FILE}
+)
 
-add_library (           cepheus_shared SHARED ${SOURCES}    )
+ADD_LIBRARY (
+        cepheus_shared      SHARED          ${SOURCES}    
+)
 
 # SET_PROPERTY(TARGET     cepheus_shared PROPERTY SOVERSION 1.0)
 # SET_PROPERTY(TARGET     cepheus_shared PROPERTY VERSION 1.0)
+FIND_LIBRARY( 
+            SDL_LIB 
+            NAMES                   SDL SDL-1.2
+            PATHS
+                                    /lib
+                                    /usr/lib
+                                    /usr/lib64
+                                    /usr/local/lib
+                                    /usr/local/lib64
+)
+FIND_LIBRARY( 
+            SDLMAIN_LIB 
+            NAMES                   SDLmain
+            PATHS
+                                    /lib
+                                    /usr/lib
+                                    /usr/lib64
+                                    /usr/local/lib
+                                    /usr/local/lib64
+)
 
-target_link_libraries(  cepheus_shared SDL  SDLmain )
+TARGET_LINK_LIBRARIES(  
+        cepheus_shared          ${SDL_LIB}      ${SDLMAIN_LIB} 
+)
 
-add_library (cepheus_static STATIC ${SOURCES})
-target_link_libraries( cepheus_static SDL)
+add_library (
+        cepheus_static          STATIC          ${SOURCES}
+)
+TARGET_LINK_LIBRARIES( 
+        cepheus_static                          ${SDL_LIB}
+)
+
 
 # SET_PROPERTY(TARGET cepheus_static PROPERTY SOVERSION 1.0)
 # SET_PROPERTY(TARGET cepheus_static PROPERTY VERSION 1.0)
                      SOVERSION                       1.0
 )
 
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY          "bin")
-add_executable(test1_shared                  src/tests/main1.cpp)
-add_executable(test1_static                  src/tests/main1.cpp)
-target_link_libraries(test1_shared           cepheus_shared)
-target_link_libraries(test1_static           cepheus_static)
+SET(
+        CMAKE_RUNTIME_OUTPUT_DIRECTORY          "bin"
+)
+ADD_EXECUTABLE(
+        test1_shared                  src/tests/main1.cpp
+)
+ADD_EXECUTABLE(
+        test1_static                  src/tests/main1.cpp
+)
+TARGET_LINK_LIBRARIES(
+        test1_shared           cepheus_shared
+)
+TARGET_LINK_LIBRARIES(
+        test1_static           cepheus_static
+)
 # file(REMOVE ${CONF_FILE})

File src/tests/main1.cpp

             ){
                this->exit();
             }
+            // Do all logic stuff.
+            // this->getSceneManager
+            //                ->getCurrentScene()->update(
+            //                                      this->getInput() 
+            // );
         }
         // Override render method.
         void render(Cepheus::GraphicManager *gm){
-
+            // Clear screen for new rendering.
+            // gm->getScreen()->clear();
+            
+            // Do all rendering stuff here.
+            //this->getSceneManager()->getCurrentScene()->render(gm);
         }
 };