-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
executable file
·62 lines (47 loc) · 1.77 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(wnb)
# Boost dependency
#--------------------------------------------------
IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET (BOOST_ROOT /Developer/boost_build/) # Suggested path
ELSE()
SET (BOOST_ROOT "/usr/include")
ENDIF()
MESSAGE(STATUS "** Search Boost root: ${BOOST_ROOT}")
FIND_PACKAGE(Boost COMPONENTS graph REQUIRED)
MESSAGE(STATUS "** Boost Include: ${Boost_INCLUDE_DIR}")
MESSAGE(STATUS "** Boost Libraries: ${Boost_LIBRARY_DIRS}")
MESSAGE(STATUS "** Boost Libraries: ${Boost_LIBRARIES}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
# Project
#--------------------------------------------------
LINK_DIRECTORIES(${wnb_SOURCE_DIR}/lib)
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
SET(PROJECT_VERSION "0.6")
SET(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION})
ADD_CUSTOM_TARGET(dist
COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD
| bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
ADD_CUSTOM_TARGET(check
COMMAND ./check/check.sh ./check/list.txt)
## Compiler flags
IF (CMAKE_COMPILER_IS_GNUCXX)
list(APPEND CMAKE_CXX_FLAGS " --std=c++11 -O3 -DNDEBUG -Wall -Wextra")
#list(APPEND CMAKE_CXX_FLAGS " -g -Wall -Wextra")
ENDIF()
SET(WNB_SRCS wnb/core/wordnet.cc
wnb/core/load_wordnet.cc wnb/core/info_helper.cc)
# Executable
#--------------------------------------------------
ADD_EXECUTABLE (wntest wnb/main.cc ${WNB_SRCS})
SET(EXECUTABLE_OUTPUT_PATH ${wnb_BINARY_DIR}/bin)
# Static library
#--------------------------------------------------
ADD_LIBRARY(wnb ${WNB_SRCS})
SET(LIBRARY_OUTPUT_PATH ${wnb_BINARY_DIR}/lib)
IF (Boost_FOUND)
TARGET_LINK_LIBRARIES(wntest ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(wnb ${Boost_LIBRARIES})
ENDIF()