CMakeLists.txt
author Ryan C. Gordon <icculus@icculus.org>
Thu, 22 Nov 2012 12:39:53 -0500
changeset 108 0a4566740a98
parent 103 7528b40af909
permissions -rw-r--r--
Make this work on gcc2.
icculus@3
     1
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
icculus@3
     2
PROJECT(FatELF)
icculus@3
     3
icculus@49
     4
EXECUTE_PROCESS(
icculus@49
     5
    COMMAND hg tip --template hg-{rev}:{node|short}
icculus@49
     6
    WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
icculus@49
     7
    RESULT_VARIABLE HGVERSION_RC
icculus@49
     8
    OUTPUT_VARIABLE FATELF_VERSION
icculus@49
     9
    ERROR_QUIET
icculus@49
    10
    OUTPUT_STRIP_TRAILING_WHITESPACE
icculus@49
    11
)
icculus@49
    12
icculus@103
    13
IF(CMAKE_COMPILER_IS_GNUCC)
icculus@103
    14
    ADD_DEFINITIONS(-pipe -fsigned-char -Wall -Werror)
icculus@103
    15
ENDIF(CMAKE_COMPILER_IS_GNUCC)
icculus@103
    16
icculus@49
    17
ADD_DEFINITIONS(-DAPPID=fatelf)
icculus@49
    18
ADD_DEFINITIONS(-DAPPREV="${FATELF_VERSION}")
icculus@49
    19
icculus@3
    20
INCLUDE_DIRECTORIES(include)
icculus@6
    21
icculus@55
    22
ADD_LIBRARY(fatelf-utils STATIC utils/fatelf-utils.c)
icculus@55
    23
icculus@55
    24
MACRO(ADD_FATELF_EXECUTABLE _NAME)
icculus@55
    25
    ADD_EXECUTABLE(${_NAME} utils/${_NAME}.c)
icculus@55
    26
    TARGET_LINK_LIBRARIES(${_NAME} fatelf-utils)
icculus@55
    27
    INSTALL(TARGETS ${_NAME} RUNTIME DESTINATION bin)
icculus@55
    28
ENDMACRO(ADD_FATELF_EXECUTABLE)
icculus@55
    29
icculus@55
    30
ADD_FATELF_EXECUTABLE(fatelf-glue)
icculus@55
    31
ADD_FATELF_EXECUTABLE(fatelf-info)
icculus@55
    32
ADD_FATELF_EXECUTABLE(fatelf-extract)
icculus@55
    33
ADD_FATELF_EXECUTABLE(fatelf-replace)
icculus@55
    34
ADD_FATELF_EXECUTABLE(fatelf-remove)
icculus@55
    35
ADD_FATELF_EXECUTABLE(fatelf-verify)
icculus@55
    36
ADD_FATELF_EXECUTABLE(fatelf-split)
icculus@55
    37
ADD_FATELF_EXECUTABLE(fatelf-validate)
icculus@3
    38
icculus@3
    39
# end of CMakeLists.txt ...
icculus@3
    40