-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
40 lines (35 loc) · 1.19 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
cmake_minimum_required(VERSION 2.8)
project(caf_cash CXX)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
# check whether SASH submodule is available
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/sash/sash/")
message(STATUS "SASH submodule not loaded, disable CASH")
set(DISABLE_CASH yes)
endif()
# check whether libedit is available
if(NOT DISABLE_CASH)
find_package(Libedit)
if(NOT LIBEDIT_FOUND)
message(STATUS "Libedit not found, disable CASH")
set(DISABLE_CASH yes)
endif()
endif()
file(GLOB CAF_CASH_HDRS "caf/cash/*.hpp" "sash/sash/*.hpp")
set(CAF_CASH_SRCS
src/main.cpp
src/shell.cpp)
# add targets to CMake
if(NOT DISABLE_CASH)
include_directories(. ${LIBCAF_INCLUDE_DIRS} sash/)
add_executable(cash ${CAF_CASH_SRCS} ${CAF_CASH_HDRS})
target_link_libraries(cash
${LD_FLAGS}
${CAF_LIBRARY_CORE}
${CAF_LIBRARY_IO}
${CAF_LIBRARY_RIAC}
${PTHREAD_LIBRARIES}
${LIBEDIT_LIBRARIES})
install(PROGRAMS ${EXECUTABLE_OUTPUT_PATH}/cash DESTINATION bin)
else()
add_custom_target(cash SOURCES ${CAF_CASH_SRCS} ${CAF_CASH_HDRS})
endif()