-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
107 lines (92 loc) · 3.24 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
cmake_minimum_required(VERSION 2.6)
option(MQWEB_ODBC "Use ODBC for configuration" OFF)
option(POCO_INSTALLED "Poco Installed" ON)
set(POCO_PREFIX "" CACHE STRING "Prefix Path for POCO")
if (UNIX)
set(MQ_INSTALLATION_PATH "/opt/mqm" CACHE STRING "MQ Installation Path")
set(MQ_INCLUDE "${MQ_INSTALLATION_PATH}/inc")
set(MQ_LIB "${MQ_INSTALLATION_PATH}/lib64")
else()
set(MQ_INSTALLATION_PATH "C:\\Program Files\\IBM\\WebSphere MQ" CACHE STRING "MQ Installation Path")
set(MQ_INCLUDE "${MQ_INSTALLATION_PATH}\\Tools\\c\\include")
set(MQ_LIB "${MQ_INSTALLATION_PATH}\\Tools\\Lib64")
endif()
project(MQWebSolution)
message(STATUS "Prefix ${POCO_PREFIX}")
if (CMAKE_BUILD_TYPE STREQUAL debug)
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin/debug)
else()
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin/release)
endif()
set(PocoLibList Foundation;Util;XML;Net;JSON;Data;DataSQLite)
if (MQWEB_ODBC)
message(STATUS "Adding ODBC support")
list(APPEND PocoLibList DataODBC)
endif()
foreach(pocolib ${PocoLibList})
if (CMAKE_BUILD_TYPE STREQUAL Debug)
set(pocolibname ${pocolib}d)
else()
set(pocolibname ${pocolib})
endif()
message(STATUS "Searching POCO library ${pocolib}")
set(POCO_LIB POCO_${pocolib}_LIBRARY)
if ( POCO_PREFIX )
if ( POCO_INSTALLED )
set(POCO_LIB_SEARCH_PATH "${POCO_PREFIX}/lib")
else()
set(POCO_LIB_SEARCH_PATH "${POCO_PREFIX}/cmake_build/lib")
endif()
find_library(${POCO_LIB} NAMES Poco${pocolibname}
PATHS ${POCO_LIB_SEARCH_PATH} NO_DEFAULT_PATH
)
endif()
find_library(${POCO_LIB} NAMES Poco${pocolibname})
if (${POCO_LIB})
message(STATUS "POCO ${pocolib} found: ${${POCO_LIB}}")
else()
message(FATAL_ERROR "No POCO ${pocolibname} library found!")
endif()
if (pocolib STREQUAL "Foundation")
set(POCO_INC_H Poco/${pocolib}.h)
elseif(pocolib STREQUAL "DataSQLite")
set(POCO_INC_H Poco/Data/SQLite/SQLite.h)
elseif(pocolib STREQUAL "DataODBC")
set(POCO_INC_H Poco/Data/ODBC/ODBC.h)
else()
set(POCO_INC_H Poco/${pocolib}/${pocolib}.h)
endif()
message(STATUS "Searching ${POCO_INC_H}")
set(POCO_INCLUDE_DIR POCO_${pocolib}_INCLUDE)
if ( POCO_PREFIX )
if ( POCO_INSTALLED )
set(POCO_INC_SEARCH_PATH "${POCO_PREFIX}/include")
else()
if (pocolib STREQUAL "DataSQLite")
set(POCO_INC_SEARCH_PATH "${POCO_PREFIX}/Data/SQLite/include")
elseif(pocolib STREQUAL "DataODBC")
set(POCO_INC_SEARCH_PATH "${POCO_PREFIX}/Data/ODBC/include")
else()
set(POCO_INC_SEARCH_PATH "${POCO_PREFIX}/${pocolib}/include")
endif()
endif()
message(STATUS "Search in ${POCO_INC_SEARCH_PATH}")
find_path(${POCO_INCLUDE_DIR} NAMES ${POCO_INC_H}
PATHS ${POCO_INC_SEARCH_PATH} NO_DEFAULT_PATH
)
else()
find_path(${POCO_INCLUDE_DIR} NAMES ${POCO_INC_H})
endif()
if (${POCO_INCLUDE_DIR})
message(STATUS "POCO ${pocolib} include directory: ${${POCO_INCLUDE_DIR}}")
else()
message(FATAL_ERROR "No POCO ${pocolib} include directory found")
endif()
endforeach()
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
#set(CMAKE_BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
add_subdirectory(MQ)
add_subdirectory(MQWeb)
add_subdirectory(MQCheck)
add_subdirectory(MQDictionary)