cmake_minimum_required (VERSION 2.6) project (Farmlands) set (SRC_DIR "src") set (ASSET_DIR "assets") set (BUILD_DIR "build") set (LIBS "SDL2" "SDL2_image" "SDL2_ttf" "boost_filesystem" "boost_system") set (TARGET "Farmlands") file (GLOB_RECURSE FILES_CPP "${SRC_DIR}/*.cpp") file (GLOB_RECURSE FILES_ASSETS "${ASSET_DIR}/*") add_executable(${TARGET} ${FILES_CPP}) target_link_libraries(${TARGET} ${LIBS}) set_property(TARGET ${TARGET} PROPERTY CXX_STANDARD 11) set_property(TARGET ${TARGET} PROPERTY CXX_STANDARD_REQUIRED ON) include_directories ( ${SRC_DIR} ) add_custom_target ( PREPARE_ASSETS COMMAND python3 "${BUILD_DIR}/prepareAssets.py" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) add_dependencies(${TARGET} PREPARE_ASSETS) # Eclipse related configuration if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") endif (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCXX) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") endif (CMAKE_COMPILER_IS_GNUCXX) set (CMAKE_VERBOSE_MAKEFILE ON)