blob: 2e10913cf103d83d007904b9bfbbcd66387ac788 (
plain) (
blame)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
--- CMakeLists.txt.orig 2013-12-26 08:37:25 UTC
+++ CMakeLists.txt
@@ -1,5 +1,5 @@
-set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/c_flag_overrides.cmake)
-set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_flag_overrides.cmake)
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
project(rime)
cmake_minimum_required(VERSION 2.8)
@@ -21,6 +21,20 @@ endif(WIN32)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
+include_directories(${PROJECT_SOURCE_DIR}/include)
+include_directories(${PROJECT_SOURCE_DIR}/thirdparty/include)
+link_directories(${PROJECT_SOURCE_DIR}/thirdparty/lib)
+if(MSVC)
+ if(MSVC10)
+ # stdint.h is missing from VS2010
+ include_directories(${PROJECT_SOURCE_DIR}/thirdparty/include/msvc)
+ endif(MSVC10)
+ add_definitions("/wd4244 /wd4996")
+endif(MSVC)
+if(UNIX)
+ add_definitions("-std=c++11")
+endif(UNIX)
+
set(Boost_USE_STATIC_LIBS ${BUILD_STATIC})
set(Gflags_STATIC ${BUILD_STATIC})
set(Glog_STATIC ${BUILD_STATIC})
@@ -82,20 +96,6 @@ else(X11Keysym)
message(WARNING "X11/keysym.h not found.")
endif(X11Keysym)
-include_directories(${PROJECT_SOURCE_DIR}/include)
-include_directories(${PROJECT_SOURCE_DIR}/thirdparty/include)
-link_directories(${PROJECT_SOURCE_DIR}/thirdparty/lib)
-if(MSVC)
- if(MSVC10)
- # stdint.h is missing from VS2010
- include_directories(${PROJECT_SOURCE_DIR}/thirdparty/include/msvc)
- endif(MSVC10)
- add_definitions("/wd4244 /wd4996")
-endif(MSVC)
-if(UNIX)
- add_definitions("-std=c++11")
-endif(UNIX)
-
if(NOT DEFINED LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
endif()
@@ -104,7 +104,7 @@ if(NOT DEFINED BIN_INSTALL_DIR)
set(BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin)
endif()
-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
@@ -120,7 +120,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(includedir "${CMAKE_INSTALL_PREFIX}/include")
configure_file(${PROJECT_SOURCE_DIR}/rime.pc.in ${PROJECT_BINARY_DIR}/rime.pc)
install(FILES include/rime_api.h DESTINATION include)
- install(FILES ${PROJECT_BINARY_DIR}/rime.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+ install(FILES ${PROJECT_BINARY_DIR}/rime.pc DESTINATION ${prefix}/libdata/pkgconfig)
install(FILES cmake/RimeConfig.cmake DESTINATION share/cmake/rime)
if(BUILD_DATA)
install(FILES ${PROJECT_SOURCE_DIR}/data/default.yaml DESTINATION ${pkgdatadir})
@@ -131,7 +131,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
file(GLOB supplement_schema ${PROJECT_SOURCE_DIR}/data/supplement/*.yaml)
install(FILES ${supplement_schema} DESTINATION ${pkgdatadir})
endif(BUILD_DATA)
-endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+endif(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
if(BUILD_SHARED_LIBS)
set(RIME_LIBRARY rime)
|