1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
FIND_PACKAGE(Boost 1.48 COMPONENTS system filesystem REQUIRED)
FIND_PACKAGE(SDL REQUIRED)
ADD_DEFINITIONS(-D BOOST_ALL_NO_LIB)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
# a unit is the combination of a header and a cpp file in the same directory
SET(laserboy_unit
LaserBoy
LaserBoy_common
LaserBoy_frame
LaserBoy_frame_effects
LaserBoy_frame_set
LaserBoy_frame_set_effects
LaserBoy_ild_header
LaserBoy_segment
LaserBoy_palette
LaserBoy_palette_set
LaserBoy_real_segment
LaserBoy_wave
LaserBoy_space
LaserBoy_TUI
LaserBoy_SDL_GUI
LaserBoy_bmp
LaserBoy_font
)
# add header files without accompanying source here
SET(laserboy_hdrs
)
# add source files without accompanying header here
SET(laserboy_src
)
FOREACH(UnitName ${laserboy_unit})
SET(laserboy_src ${laserboy_src} ${UnitName}.cpp)
SET(laserboy_hdrs ${laserboy_hdrs} ${UnitName}.hpp)
ENDFOREACH(UnitName)
ADD_EXECUTABLE(laserboy
${laserboy_src}
${laserboy_hdr}
)
TARGET_LINK_LIBRARIES(laserboy
${Boost_LIBRARIES}
${SDL_LIBRARY}
)
SET_TARGET_PROPERTIES(laserboy PROPERTIES
VERSION ${VERSION_SERIES}.${VERSION_MAJOR}.${VERSION_MINOR}
DEBUG_POSTFIX "_d"
)
IF(BUILDING_DEB)
SET_TARGET_PROPERTIES(laserboy PROPERTIES
COMPILE_DEFINITIONS LASERBOY_ILD_SHARE="/usr/share/laserboy/ild"
COMPILE_DEFINITIONS LASERBOY_WAV_SHARE="/usr/share/laserboy/wav"
COMPILE_DEFINITIONS LASERBOY_BMP_SHARE="/usr/share/laserboy/bmp"
)
ENDIF()
INSTALL(TARGETS laserboy RUNTIME DESTINATION bin)
|