summaryrefslogtreecommitdiff
path: root/dyecmd/CMakeLists.txt
blob: 485666485996e567b0c835d7e03bb0774f213323 (plain) (blame)
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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(MANA_DYECOMMAND)

IF (NOT VERSION)
    SET(VERSION 1.0.0)
ENDIF()

STRING(REPLACE "." " " _VERSION ${VERSION})
SEPARATE_ARGUMENTS(_VERSION)
LIST(LENGTH _VERSION _LEN)
IF(NOT (_LEN EQUAL 4 OR _LEN EQUAL 3))
    MESSAGE(FATAL_ERROR "Version needs to be in the form MAJOR.MINOR.RELEASE[.BUILD]")
ENDIF()

LIST(GET _VERSION 0 VER_MAJOR)
LIST(GET _VERSION 1 VER_MINOR)
LIST(GET _VERSION 2 VER_RELEASE)
IF(_LEN EQUAL 4)
    LIST(GET _VERSION 3 VER_BUILD)
ELSE()
    SET(VER_BUILD 0)
ENDIF()

# where to look for cmake modules
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules)

ADD_SUBDIRECTORY(src)