2012-06-25 17:59:17 +00:00
|
|
|
# CBot shared library is built separately
|
2012-08-31 18:55:16 +00:00
|
|
|
add_subdirectory(CBot)
|
|
|
|
|
|
|
|
# Tools directory is built separately
|
|
|
|
add_subdirectory(tools)
|
2012-04-14 23:02:51 +00:00
|
|
|
|
2012-09-08 01:05:12 +00:00
|
|
|
# Tests
|
|
|
|
add_subdirectory(graphics/engine/test)
|
|
|
|
|
2012-06-25 17:59:17 +00:00
|
|
|
|
2012-06-26 21:39:31 +00:00
|
|
|
# Configure options
|
|
|
|
option(DEBUG "Enable debug output" ON)
|
|
|
|
|
2012-07-18 19:47:47 +00:00
|
|
|
set(PLATFORM_LIBS "")
|
|
|
|
|
2012-06-26 21:39:31 +00:00
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
|
|
|
set(PLATFORM_WINDOWS 1)
|
|
|
|
set(PLATFORM_LINUX 0)
|
|
|
|
set(PLATFORM_OTHER 0)
|
2012-07-28 21:36:12 +00:00
|
|
|
# On Windows, GLEW is required
|
|
|
|
if (${USE_GLEW} MATCHES "auto")
|
|
|
|
set(USE_GLEW 1)
|
|
|
|
endif()
|
2012-06-26 21:39:31 +00:00
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
set(PLATFORM_WINDOWS 0)
|
|
|
|
set(PLATFORM_LINUX 1)
|
|
|
|
set(PLATFORM_OTHER 0)
|
2012-07-28 21:36:12 +00:00
|
|
|
# On Linux, we should be fine without GLEW
|
|
|
|
if (${USE_GLEW} MATCHES "auto")
|
|
|
|
set(USE_GLEW 0)
|
|
|
|
endif()
|
2012-07-18 19:47:47 +00:00
|
|
|
# for clock_gettime
|
|
|
|
set(PLATFORM_LIBS "-lrt")
|
2012-06-26 21:39:31 +00:00
|
|
|
else()
|
|
|
|
set(PLATFORM_WINDOWS 0)
|
|
|
|
set(PLATFORM_LINUX 0)
|
|
|
|
set(PLATFORM_OTHER 1)
|
2012-07-28 21:36:12 +00:00
|
|
|
# Use GLEW to be safe
|
|
|
|
if (${USE_GLEW} MATCHES "auto")
|
|
|
|
set(USE_GLEW 1)
|
|
|
|
endif()
|
2012-06-26 21:39:31 +00:00
|
|
|
endif()
|
2012-04-14 23:02:51 +00:00
|
|
|
|
2012-07-28 21:36:12 +00:00
|
|
|
set(OPTIONAL_LIBS "")
|
|
|
|
set(OPTIONAL_INCLUDE_DIRS "")
|
|
|
|
|
|
|
|
if(${USE_GLEW} EQUAL 1)
|
|
|
|
find_package(GLEW REQUIRED)
|
|
|
|
set(OPTIONAL_LIBS ${OPTIONAL_LIBS} ${GLEW_LIBRARY})
|
|
|
|
set(OPTIONAL_INCLUDE_DIRS ${OPTIONAL_INCLUDE_DIRS} ${GLEW_INCLUDE_PATH})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2012-06-26 21:39:31 +00:00
|
|
|
# Configure file
|
|
|
|
configure_file(common/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/common/config.h)
|
|
|
|
|
|
|
|
|
|
|
|
# Source files
|
2012-06-25 17:59:17 +00:00
|
|
|
# Commented out files are still dependent on DirectX or WinAPI
|
2012-07-04 20:14:28 +00:00
|
|
|
|
2012-06-26 21:39:31 +00:00
|
|
|
set(SOURCES
|
2012-06-25 17:59:17 +00:00
|
|
|
app/app.cpp
|
|
|
|
app/main.cpp
|
|
|
|
app/system.cpp
|
|
|
|
common/event.cpp
|
2012-07-03 22:04:53 +00:00
|
|
|
common/image.cpp
|
2012-07-04 17:56:22 +00:00
|
|
|
common/logger.cpp
|
2012-06-25 17:59:17 +00:00
|
|
|
common/iman.cpp
|
|
|
|
# common/metafile.cpp
|
|
|
|
# common/misc.cpp
|
|
|
|
# common/modfile.cpp
|
|
|
|
# common/profile.cpp
|
2012-08-25 10:02:10 +00:00
|
|
|
common/restext.cpp
|
|
|
|
common/restext_strings.c
|
2012-07-11 18:50:42 +00:00
|
|
|
common/stringutils.cpp
|
2012-07-26 20:26:19 +00:00
|
|
|
graphics/core/color.cpp
|
2012-08-09 20:50:04 +00:00
|
|
|
graphics/engine/camera.cpp
|
2012-07-26 20:26:19 +00:00
|
|
|
graphics/engine/cloud.cpp
|
|
|
|
graphics/engine/engine.cpp
|
|
|
|
graphics/engine/lightman.cpp
|
|
|
|
graphics/engine/lightning.cpp
|
|
|
|
graphics/engine/modelfile.cpp
|
|
|
|
graphics/engine/particle.cpp
|
|
|
|
graphics/engine/planet.cpp
|
|
|
|
graphics/engine/pyro.cpp
|
|
|
|
graphics/engine/terrain.cpp
|
|
|
|
graphics/engine/text.cpp
|
|
|
|
graphics/engine/water.cpp
|
2012-06-25 17:59:17 +00:00
|
|
|
graphics/opengl/gldevice.cpp
|
|
|
|
# object/auto/auto.cpp
|
|
|
|
# object/auto/autobase.cpp
|
|
|
|
# object/auto/autoconvert.cpp
|
|
|
|
# object/auto/autoderrick.cpp
|
|
|
|
# object/auto/autodestroyer.cpp
|
|
|
|
# object/auto/autoegg.cpp
|
|
|
|
# object/auto/autoenergy.cpp
|
|
|
|
# object/auto/autofactory.cpp
|
|
|
|
# object/auto/autoflag.cpp
|
|
|
|
# object/auto/autohuston.cpp
|
|
|
|
# object/auto/autoinfo.cpp
|
|
|
|
# object/auto/autojostle.cpp
|
|
|
|
# object/auto/autokid.cpp
|
|
|
|
# object/auto/autolabo.cpp
|
|
|
|
# object/auto/automush.cpp
|
|
|
|
# object/auto/autonest.cpp
|
|
|
|
# object/auto/autonuclear.cpp
|
|
|
|
# object/auto/autopara.cpp
|
|
|
|
# object/auto/autoportico.cpp
|
|
|
|
# object/auto/autoradar.cpp
|
|
|
|
# object/auto/autorepair.cpp
|
|
|
|
# object/auto/autoresearch.cpp
|
|
|
|
# object/auto/autoroot.cpp
|
|
|
|
# object/auto/autosafe.cpp
|
|
|
|
# object/auto/autostation.cpp
|
|
|
|
# object/auto/autotower.cpp
|
|
|
|
# object/brain.cpp
|
|
|
|
# object/mainmovie.cpp
|
|
|
|
# object/motion/motion.cpp
|
|
|
|
# object/motion/motionant.cpp
|
|
|
|
# object/motion/motionbee.cpp
|
|
|
|
# object/motion/motionhuman.cpp
|
|
|
|
# object/motion/motionmother.cpp
|
|
|
|
# object/motion/motionspider.cpp
|
|
|
|
# object/motion/motiontoto.cpp
|
|
|
|
# object/motion/motionvehicle.cpp
|
|
|
|
# object/motion/motionworm.cpp
|
|
|
|
# object/object.cpp
|
|
|
|
# object/robotmain.cpp
|
|
|
|
# object/task/task.cpp
|
|
|
|
# object/task/taskadvance.cpp
|
|
|
|
# object/task/taskbuild.cpp
|
|
|
|
# object/task/taskfire.cpp
|
|
|
|
# object/task/taskfireant.cpp
|
|
|
|
# object/task/taskflag.cpp
|
|
|
|
# object/task/taskgoto.cpp
|
|
|
|
# object/task/taskgungoal.cpp
|
|
|
|
# object/task/taskinfo.cpp
|
|
|
|
# object/task/taskmanager.cpp
|
|
|
|
# object/task/taskmanip.cpp
|
|
|
|
# object/task/taskpen.cpp
|
|
|
|
# object/task/taskrecover.cpp
|
|
|
|
# object/task/taskreset.cpp
|
|
|
|
# object/task/tasksearch.cpp
|
|
|
|
# object/task/taskshield.cpp
|
|
|
|
# object/task/taskspiderexplo.cpp
|
|
|
|
# object/task/tasktake.cpp
|
|
|
|
# object/task/taskterraform.cpp
|
|
|
|
# object/task/taskturn.cpp
|
|
|
|
# object/task/taskwait.cpp
|
|
|
|
# physics/physics.cpp
|
|
|
|
# script/cbottoken.cpp
|
|
|
|
# script/cmdtoken.cpp
|
|
|
|
# script/script.cpp
|
2012-07-04 17:56:22 +00:00
|
|
|
# sound/sound.cpp
|
2012-06-25 17:59:17 +00:00
|
|
|
# ui/button.cpp
|
|
|
|
# ui/check.cpp
|
|
|
|
# ui/color.cpp
|
|
|
|
# ui/compass.cpp
|
|
|
|
# ui/control.cpp
|
|
|
|
# ui/displayinfo.cpp
|
|
|
|
# ui/displaytext.cpp
|
|
|
|
# ui/edit.cpp
|
|
|
|
# ui/editvalue.cpp
|
|
|
|
# ui/gauge.cpp
|
|
|
|
# ui/group.cpp
|
|
|
|
# ui/image.cpp
|
|
|
|
# ui/interface.cpp
|
|
|
|
# ui/key.cpp
|
|
|
|
# ui/label.cpp
|
|
|
|
# ui/list.cpp
|
|
|
|
# ui/maindialog.cpp
|
|
|
|
# ui/mainmap.cpp
|
|
|
|
# ui/mainshort.cpp
|
|
|
|
# ui/map.cpp
|
|
|
|
# ui/scroll.cpp
|
|
|
|
# ui/shortcut.cpp
|
|
|
|
# ui/slider.cpp
|
|
|
|
# ui/studio.cpp
|
|
|
|
# ui/target.cpp
|
|
|
|
# ui/window.cpp
|
|
|
|
)
|
2012-06-13 20:48:35 +00:00
|
|
|
|
2012-06-26 21:39:31 +00:00
|
|
|
set(LIBS
|
|
|
|
${SDL_LIBRARY}
|
|
|
|
${SDLIMAGE_LIBRARY}
|
2012-08-03 21:23:13 +00:00
|
|
|
${SDLTTF_LIBRARY}
|
2012-06-26 21:39:31 +00:00
|
|
|
${OPENGL_LIBRARY}
|
2012-07-03 22:04:53 +00:00
|
|
|
${PNG_LIBRARIES}
|
2012-07-28 21:36:12 +00:00
|
|
|
${OPTIONAL_LIBS}
|
2012-07-18 19:47:47 +00:00
|
|
|
${PLATFORM_LIBS}
|
2012-07-04 20:14:28 +00:00
|
|
|
CBot
|
2012-06-26 21:39:31 +00:00
|
|
|
)
|
2012-04-14 23:02:51 +00:00
|
|
|
|
2012-07-03 22:04:53 +00:00
|
|
|
include_directories(. ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${SDL_INCLUDE_DIR}
|
|
|
|
${SDL_IMAGE_INCLUDE_DIR}
|
|
|
|
${SDLTTF_INCLUDE_DIR}
|
|
|
|
${PNG_INCLUDE_DIRS}
|
2012-07-28 21:36:12 +00:00
|
|
|
${OPTIONAL_INCLUDE_DIRS}
|
2012-07-03 22:04:53 +00:00
|
|
|
)
|
2012-04-14 23:02:51 +00:00
|
|
|
|
2012-06-26 21:39:31 +00:00
|
|
|
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/CBot)
|
2012-04-14 23:02:51 +00:00
|
|
|
|
2012-06-26 21:39:31 +00:00
|
|
|
add_executable(colobot ${SOURCES})
|
2012-04-14 23:02:51 +00:00
|
|
|
|
2012-06-26 21:39:31 +00:00
|
|
|
target_link_libraries(colobot ${LIBS})
|