-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (75 loc) · 1.87 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
PROJECT( SBOL_TEST )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
cmake_policy(SET CMP0015 NEW) # set policy for using relative paths
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
IF (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
SET( LINK_DIR ${CMAKE_INSTALL_PREFIX}/SBOL/lib ) # Windows library path
SET( HEADER_DIR ${CMAKE_INSTALL_PREFIX}/SBOL/include ) # Windows header path
find_library(xml2
NAME libxml2_a.lib
PATHS ${LINK_DIR}
)
find_library(zlib
NAME zlib.lib
PATHS ${LINK_DIR}
)
find_library(iconv
NAME iconv_a.lib
PATHS ${LINK_DIR}
)
find_library(xml2
NAME libxml2.a
PATHS ${LINK_DIR}
)
FIND_LIBRARY(raptor2
NAME raptor2.lib
PATHS ${LINK_DIR}
)
find_library(sbol
NAME sbol.lib
PATHS ${LINK_DIR}
)
ELSE ()
SET( LINK_DIR ${CMAKE_INSTALL_PREFIX}/lib ) # Mac library path
SET( HEADER_DIR ${CMAKE_INSTALL_PREFIX}/include/sbol ) # Mac header path
FIND_LIBRARY (sbol sbol)
FIND_LIBRARY (raptor2 raptor2)
FIND_LIBRARY (curl curl)
FIND_LIBRARY (jsoncpp jsoncpp)
# FIND_LIBRARY (xml2 xml2)
# FIND_LIBRARY (zlib z)
# FIND_LIBRARY (iconv iconv)
ENDIF ()
# gather headers
INCLUDE_DIRECTORIES( ${HEADER_DIR} )
MESSAGE("${HEADER_DIR}")
# gather source files
FILE( GLOB APPLICATION_FILES
"*.h"
"Source.cpp"
)
# build test executable
ADD_EXECUTABLE( sbol_test
${APPLICATION_FILES}
)
IF (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
TARGET_LINK_LIBRARIES( sbol_test
${sbol}
${raptor2}
${xml2}
${zlib}
${iconv}
ws2_32
)
ELSE ()
TARGET_LINK_LIBRARIES( sbol_test
${sbol}
${raptor2}
${curl}
${jsoncpp}
${xml2}
${zlib}
${iconv}
)
MESSAGE("${sbol}")
ENDIF ()