1#
2# This is the toplevel CMakeLists.txt that is used to build cbq-gui.
3# Note that this expects to run in the context of the cbq-gui manifest;
4# in particular it expects all Go code to be laid out in goproj/
5# and godeps/ subdirectories, including cbq-gui itself.
6#
7CMAKE_MINIMUM_REQUIRED (VERSION 2.8.10)
8PROJECT ("cbq-gui")
9SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/tlm/cmake/Modules/")
10SET (GODEPSDIR "${CMAKE_CURRENT_SOURCE_DIR}/godeps")
11
12ADD_CUSTOM_TARGET (realclean
13  )
14  
15INCLUDE (FindCouchbaseGo)
16
17SET (GOVERSION 1.8.3)
18
19SET (CBQ_GUI_PROJ github.com/couchbase/query-ui)
20SET (CBQ_GUI_SRC "${CMAKE_CURRENT_SOURCE_DIR}/goproj/src/${CBQ_GUI_PROJ}")
21SET (CORE_UI_SRC "${CMAKE_CURRENT_SOURCE_DIR}/ns_server/priv/public/ui")
22
23GoInstall (TARGET cbq-gui PACKAGE ${CBQ_GUI_PROJ}
24  GOPATH "${CMAKE_CURRENT_SOURCE_DIR}/goproj" "${CMAKE_CURRENT_SOURCE_DIR}/godeps"
25  INSTALL_PATH "." GOVERSION ${GOVERSION})
26  
27# move the query-ui code 
28INSTALL (DIRECTORY "${CBQ_GUI_SRC}/query-ui" DESTINATION "./static")
29
30# copy the ns_server core ui code as well
31INSTALL (DIRECTORY "${CORE_UI_SRC}/app" DESTINATION "./static/query-ui")
32INSTALL (DIRECTORY "${CORE_UI_SRC}/libs" DESTINATION "./static/query-ui")
33
34# and a license
35INSTALL (PROGRAMS "${CBQ_GUI_SRC}/LICENSE.txt" DESTINATION ".")
36IF (WIN32)
37  INSTALL (PROGRAMS "${CBQ_GUI_SRC}/launch-cbq-gui.bat" DESTINATION ".")
38ELSE (WIN32)
39  INSTALL (PROGRAMS "${CBQ_GUI_SRC}/launch-cbq-gui.sh" DESTINATION ".")
40ENDIF (WIN32)
41