-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
57 lines (46 loc) · 1.53 KB
/
CMakeLists.txt
File metadata and controls
57 lines (46 loc) · 1.53 KB
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
cmake_minimum_required(VERSION 2.8)
project(open_password_manager)
set(SOURCE_EXE main.c info.c daemon.c db.c term.c encrypt.c password.c)
#set(SOURCE_LIB foo.c)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g")
include_directories(includes)
#add_library(foo STATIC ${SOURCE_LIB})
find_package(OpenSSL REQUIRED)
if (NOT OPENSSL_FOUND)
message(SEND_ERROR "Failed to find openssl")
return()
else()
include_directories(${OPENSSL_INCLUDE_DIR})
endif()
find_package(X11)
if (NOT X11_FOUND)
message(WARNING "X11 devel package was not found. Password buffering will not work")
add_definitions( -DNO_X11 )
else()
if (NOT X11_Xmu_FOUND)
# for old cmakes
find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
find_library(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH})
if (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
set(X11_OK "1")
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
include_directories(${X11_INCLUDE_DIR})
include_directories(${X11_Xmu_INCLUDE_PATH})
else()
message(WARNING "libXmu devel package was not found. Password buffering will not work")
add_definitions( -DNO_X11 )
endif()
else()
set(X11_OK "1")
include_directories(${X11_INCLUDE_DIR})
include_directories(${X11_Xmu_INCLUDE_PATH})
endif()
endif()
set(PROGNAME "opm")
add_executable(${PROGNAME} ${SOURCE_EXE})
target_link_libraries(${PROGNAME} ${OPENSSL_LIBRARIES})
if (X11_OK)
target_link_libraries(${PROGNAME} ${X11_LIBRARIES})
target_link_libraries(${PROGNAME} ${X11_Xmu_LIB})
endif()
install(TARGETS ${PROGNAME} DESTINATION /usr/bin)