-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (35 loc) · 1.22 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8)
# C++ support is necessary for linking with libclang
project(voidcaster C CXX)
# FindLibClang is not part of the CMake distribution
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
# find the GCC system include directory
include(${CMAKE_SOURCE_DIR}/cmake/FindGccSysIncludeDir.cmake)
# for generating version.h
find_package(Git)
# to find version.h
include_directories(${CMAKE_BINARY_DIR})
# The Voidcaster itself
add_executable(voidcaster
interact.c
msa.c
treemunger.c
voidcaster.c
)
# compile and link it against libclang
find_package(LibClang)
include_directories(${LIBCLANG_INCLUDE_DIRS})
target_link_libraries(voidcaster ${LIBCLANG_LIBRARIES})
# define the GCC system include directory
if(GCC_SYS_INCLUDE_DIR)
set_property(TARGET voidcaster APPEND PROPERTY COMPILE_DEFINITIONS GCC_SYSINCLUDE="${GCC_SYS_INCLUDE_DIR}")
endif(GCC_SYS_INCLUDE_DIR)
# generate version.h
add_custom_target(
version
${CMAKE_COMMAND} -D SRC="${CMAKE_SOURCE_DIR}/version.h.in"
-D DST="${CMAKE_BINARY_DIR}/version.h"
-D GIT_EXECUTABLE="${GIT_EXECUTABLE}"
-P ${CMAKE_SOURCE_DIR}/cmake/version.cmake
)
add_dependencies(voidcaster version)