-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathCMakeLists.txt
62 lines (48 loc) · 1.18 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
#
# CMakeLists.txt for yast2/ruby-bindings
#
cmake_minimum_required(VERSION 2.4)
if(COMMAND cmake_policy)
# let cmake escape preprocessor definitions
cmake_policy(SET CMP0005 NEW)
endif()
project(yast2-ruby-bindings)
set(PACKAGE "yast2-ruby-bindings")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -g -O3 -Wall -Woverloaded-virtual")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu++0x -g -O3 -Wall")
#
# Where is YaST ?
#
find_package(Yast REQUIRED)
if(NOT YAST_LIBRARY)
message(FATAL_ERROR "Please install yast2-core-devel.")
endif()
if(NOT YAST_PLUGIN_UI_LIBRARY)
message(FATAL_ERROR "YAST_PLUGIN_UI_LIBRARY not set, please install yast2-ycp-ui-bindings-devel.")
endif()
#
# Where is Ruby ?
#
find_package(Ruby REQUIRED)
if(NOT RUBY_EXECUTABLE)
message(FATAL_ERROR "Ruby not found.")
endif()
if(NOT RUBY_INCLUDE_PATH)
message(FATAL_ERROR "ruby-devel not found.")
endif()
#
# crypt.h or xcrypt.h ?
#
INCLUDE(CheckIncludeFiles)
CHECK_INCLUDE_FILES(xcrypt.h HAVE_XCRYPT_H)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
#
# -> src/
#
add_subdirectory(src)
#
# -> tests/
#
include(CTest)
enable_testing()
add_subdirectory(tests)