-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
49 lines (36 loc) · 1.53 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
CMAKE_MINIMUM_REQUIRED(VERSION 1.4)
PROJECT(GOTOPLUSPLUS)
OPTION(USE_UNICODE "Use UNICODE" ON)
INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
CHECK_SYMBOL_EXISTS(wprintf wchar.h HAVE_WPRINTF)
CHECK_SYMBOL_EXISTS(dlopen dlfcn.h HAVE_DLOPEN)
ADD_DEFINITIONS(-finput-charset=ISO-8859-1)
IF(HAVE_WPRINTF AND USE_UNICODE)
ADD_DEFINITIONS(-D_UNICODE)
ENDIF(HAVE_WPRINTF AND USE_UNICODE)
SET(CURL_LIBS "")
MACRO(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
CHECK_LIBRARY_EXISTS("${LIBRARY};${CURL_LIBS}" ${SYMBOL} ""
${VARIABLE})
IF(${VARIABLE})
SET(CURL_LIBS ${CURL_LIBS} ${LIBRARY})
ENDIF(${VARIABLE})
ENDMACRO(CHECK_LIBRARY_EXISTS_CONCAT)
CHECK_LIBRARY_EXISTS_CONCAT(dl dlopen HAVE_LIBDL)
CHECK_LIBRARY_EXISTS_CONCAT(ncurses printw HAVE_LIBNCURSES)
CHECK_LIBRARY_EXISTS_CONCAT(pthread pthread_create HAVE_LIBPTHREAD)
CONFIGURE_FILE(${GOTOPLUSPLUS_SOURCE_DIR}/include/gotopp/config.h.in
${GOTOPLUSPLUS_BINARY_DIR}/config.h)
INCLUDE_DIRECTORIES(${GOTOPLUSPLUS_BINARY_DIR})
IF(CMAKE_CXX_COMPILER MATCHES cl)
IF(NOT CMAKE_CXX_COMPILER MATCHES clang)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t")
ENDIF(NOT CMAKE_CXX_COMPILER MATCHES clang)
ENDIF(CMAKE_CXX_COMPILER MATCHES cl)
INCLUDE_DIRECTORIES(${GOTOPLUSPLUS_SOURCE_DIR}/boehmgc/include)
INCLUDE_DIRECTORIES(${GOTOPLUSPLUS_SOURCE_DIR}/include)
IF(UNIX)
INSTALL_FILES(/man/man1/ ${GOTOPLUSPLUS_SOURCE_DIR}/doc/gpp.1 "")
ENDIF(UNIX)
SUBDIRS(boehmgc src interpreteur modules)