src/CMakeLists.txt
author Tero Marttila <terom@fixme.fi>
Wed, 21 Jan 2009 23:07:22 +0200
branchnew_graphics
changeset 412 721c60072091
parent 411 106aaf6eadfe
child 417 c503e0c6a740
permissions -rw-r--r--
new graphics code compiles... no, it doesn't work yet
412
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
     1
FILE(GLOB SOURCE_FILES "*.cc" "Network/*.cc")
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
     2
FILE(GLOB HEADER_FILES "*.hh" "Network/*.hh")
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     3
397
13fa0546ef87 hopefully version stuff is now run properly on every make...
Tero Marttila <terom@fixme.fi>
parents: 186
diff changeset
     4
set_source_files_properties("version.c" PROPERTIES GENERATED true)
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     5
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     6
# Generate config.h
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     7
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     8
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     9
412
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    10
# main module
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    11
set (CORE_CLANLIB_COMPONENTS Core App Signals)
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    12
set (CORE_SOURCES ${SOURCE_FILES} ${HEADER_FILES})
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    13
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    14
# Graphics module
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    15
add_subdirectory(Graphics)
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    16
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    17
# Libraries
412
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    18
set (CLANLIB_VERSION 0.8)
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    19
set (CLANLIB_COMPONENTS ${CORE_CLANLIB_COMPONENTS} ${GRAPHICS_CLANLIB_COMPONENTS})
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    20
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents: 119
diff changeset
    21
# ClanLib 0.8
412
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    22
message (STATUS "Finding ClanLib version=${CLANLIB_VERSION}, components=${CLANLIB_COMPONENTS}" )
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    23
find_package(ClanLib ${CLANLIB_VERSION} REQUIRED COMPONENTS ${CLANLIB_COMPONENTS})
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    24
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents: 119
diff changeset
    25
include_directories(${ClanLib_INCLUDE_DIRS})
412
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    26
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    27
# build list of libs/source files
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents: 119
diff changeset
    28
set(LIBS ${LIBS} ${ClanLib_LIBRARIES})
412
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    29
set(SOURCES ${CORE_SOURCES} ${GRAPHICS_SOURCES} "version.c")
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    30
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    31
# Assumes the project generates only one executable. If you need more, you'll need to alter
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    32
# the script and replace ${PROJECT_SHORT_NAME} by executable name.
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    33
add_executable("${PROJECT_SHORT_NAME}" ${SOURCES})
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    34
target_link_libraries("${PROJECT_SHORT_NAME}" ${LIBS})
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    35
install(TARGETS "${PROJECT_SHORT_NAME}" DESTINATION bin)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    36
6
faa4e777cc6e fiddle with cmake, fix some compile errors
terom
parents: 0
diff changeset
    37