forked from ring-lang/ring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (44 loc) · 1.75 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
# Description : Build Ring using CMake
# Author : Mahmoud Fayed <[email protected]>
# Date : 2016.08.21
cmake_minimum_required (VERSION 2.6)
project (ring)
# Header Files
include_directories(include)
# Add source files
file(GLOB SOURCES "src/*.c")
file(GLOB SOURCES "extensions/ringcurl/*.c")
file(GLOB SOURCES "extensions/ringopenssl/*.c")
file(GLOB SOURCES "extensions/ringodbc/*.c")
file(GLOB SOURCES "extensions/ringmysql/*.c")
file(GLOB SOURCES "extensions/ringsqlite/*.c")
list(REMOVE_ITEM SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/ring.c)
list(REMOVE_ITEM SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/ringw.c)
# Check the Operating System
IF (WIN32)
message("Building Ring for Windows")
# Libraries
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libdepwin/LibCurl/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libdepwin/MySQL/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libdepwin/openssl/include)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libdepwin/LibCurl/lib)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libdepwin/MySQL/lib)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libdepwin/openssl/lib)
add_library(ring SHARED ${SOURCES})
target_link_libraries (ring odbc32 libmysql libeay32 libcurl)
ELSE(WIN32)
IF(NOT APPLE)
message("Building Ring for Linux")
# Libraries
include_directories(/usr/include/mysql)
link_directories(/usr/lib/mysql/lib)
ELSE(NOT APPLE)
message("Building Ring For MacOS X")
ENDIF(NOT APPLE)
add_library(ring SHARED ${SOURCES})
target_link_libraries (ring m dl odbc mysqlclient ssl crypto curl)
ENDIF(WIN32)
# Create Executable
ADD_EXECUTABLE (ringlang ${CMAKE_CURRENT_SOURCE_DIR}/src/ring.c)
TARGET_LINK_LIBRARIES (ringlang ring)
set_target_properties(ringlang PROPERTIES OUTPUT_NAME ring)