-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
83 lines (74 loc) · 1.95 KB
/
CMakeLists.txt
File metadata and controls
83 lines (74 loc) · 1.95 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
cmake_minimum_required(VERSION 3.22.2)
project(pg_bigm)
set(CMAKE_BUILD_TYPE Release)
# PGVER?
if(false)
elseif(PGVER STREQUAL PG91)
set(PGVERDIR "9.1")
elseif(PGVER STREQUAL PG92)
set(PGVERDIR "9.2")
elseif(PGVER STREQUAL PG93)
set(PGVERDIR "9.3")
elseif(PGVER STREQUAL PG94)
set(PGVERDIR "9.4")
elseif(PGVER STREQUAL PG95)
set(PGVERDIR "9.5")
elseif(PGVER STREQUAL PG96)
set(PGVERDIR "9.6")
elseif(PGVER STREQUAL PG100)
set(PGVERDIR "10.0")
elseif(PGVER STREQUAL PG110)
set(PGVERDIR "11.0")
elseif(PGVER STREQUAL PG120)
set(PGVERDIR "12.0")
elseif(PGVER STREQUAL PG130)
set(PGVERDIR "13.0")
elseif(PGVER STREQUAL PG140)
set(PGVERDIR "14.0")
elseif(PGVER STREQUAL PG150)
set(PGVERDIR "15.0")
elseif(PGVER STREQUAL PG160)
set(PGVERDIR "16.0")
elseif(PGVER STREQUAL PG170)
set(PGVERDIR "17.0")
elseif(PGVER STREQUAL PG180)
set(PGVERDIR "18.0")
else()
message(SEND_ERROR "PGVER: PG91 PG92 PG93 PG94 PG95 PG96 PG100 PG110 PG120 PG130 PG140 PG150 PG160 PG170 PG180")
endif()
add_definitions(-D${PGVER})
# CPU?
if(false)
elseif(CPU STREQUAL x86)
# ok
elseif(CPU STREQUAL x64)
# ok
else()
# ng
message(SEND_ERROR "CPU: x86 x64")
endif()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /SAFESEH:NO")
add_compile_options(
"$<$<CONFIG:RELEASE>:-MT>" # <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
"$<$<CONFIG:DEBUG>:-MTd>" # <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
)
find_library(
POSTGRES_LIBRARY
NAMES postgres
PATHS "PGfiles/${PGVERDIR}/lib_${CPU}"
)
include_directories(
include
"PGfiles/${PGVERDIR}/include"
"PGfiles/${PGVERDIR}/include/server"
"PGfiles/${PGVERDIR}/include_${CPU}"
"PGfiles/${PGVERDIR}/include_${CPU}/server"
)
# pg_bigm
add_library(pg_bigm SHARED
bigm_op.c
bigm_gin.c
)
target_link_libraries(pg_bigm
${POSTGRES_LIBRARY}
)