cmake_minimum_required(VERSION 2.8) project(CloonelJump CXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -pedantic -Wconversion") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -Wall -Wextra -pedantic -Wconversion") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -Wall -Wextra -pedantic -Wconversion") option(WITH_BUILTIN_PHYSFS "Force using the version of PhysFS accompanying the code even if a system library is available" OFF) option(FORCE_OPENGLES "Try to chose the openGL ES renderer if available. Enable this on Raspberry Pi" OFF) if (FORCE_OPENGLES) add_definitions(-DFORCE_OPENGLES) endif (FORCE_OPENGLES) include(FindPkgConfig) PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2) find_package(PNG REQUIRED) find_package(Boost 1.55.0 REQUIRED) if (NOT WITH_BUILTIN_PHYSFS) find_package(PhysFS 2.0.3) endif() if (PHYSFS_FOUND) message(STATUS "Using system's PhysFS, set WITH_BUILTIN_PHYSFS to on to override this") else(PHYSFS_FOUND) message(STATUS "Using internal PhysFS") set(PHYSFS_INCLUDE_DIR "lib/physfs-2.0.3") set(PHYSFS_LIBRARY "physfs") endif(PHYSFS_FOUND) add_definitions( ${PNG_DEFINITIONS} # -DWITH_VERBOSE_OBS_MANAGER -DWITH_VERBOSE_COLLIDER ) include_directories(SYSTEM ${SDL2_INCLUDE_DIR} ${PNG_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} lib/tree-2.81/src ) include_directories( src src/movers include "${PROJECT_BINARY_DIR}" ${PHYSFS_INCLUDE_DIR} ) configure_file( "${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}Config.h.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.h" ) if (NOT PHYSFS_FOUND) add_subdirectory(lib/physfs-2.0.3) endif(NOT PHYSFS_FOUND) add_executable(${PROJECT_NAME} src/main.cpp src/texture.cpp src/sdlerror.cpp src/sdlmain.cpp src/gamebase.cpp src/character.cpp src/placeable.cpp src/physicsfswrapper.cpp src/gameplayscene.cpp src/movers/mover.cpp src/movers/moveroneshot.cpp src/movers/moversine.cpp src/gameplaysceneclassic.cpp src/movers/moverrelative.cpp src/inputbag.cpp src/movers/moverleftright.cpp src/tiledwallpaper.cpp src/drawable.cpp src/sizeratio.cpp src/sizenotifiable.cpp src/horzcollisionbar.cpp src/platform.cpp src/vectormath.cpp src/platformsystem.cpp src/movers/moverworld.cpp src/line.cpp src/collider.cpp ) target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES} ${PHYSFS_LIBRARY} ${PNG_LIBRARIES} )