Skip to content

Commit

Permalink
JVar external project will now be also installed as part of the build…
Browse files Browse the repository at this point in the history
… process. Reverted examples back to manual build, as they all are dependent on different libraries and the supposed use case is that someone already uses a certain library so we don't need to install it.
  • Loading branch information
andrei-markeev committed Jul 10, 2016
1 parent c881864 commit bc60ac6
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
build
third_party
/.cproject
/.project
3 changes: 0 additions & 3 deletions CMakeLists.txt
Expand Up @@ -6,7 +6,6 @@ include(ExternalProject)

set(LIBPREFIX "${CMAKE_STATIC_LIBRARY_PREFIX}")
set(LIBSUFFIX "${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(CMAKE_VERBOSE_MAKEFILE ON)
if("${LIBRARY_OUTPUT_PATH}" STREQUAL "")
MESSAGE( WARN " SETTING LIBRARY_OUTPUT_PATH")
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
Expand All @@ -24,5 +23,3 @@ if("${CMAKE_MODULE_PATH}" STREQUAL "")
endif()

add_subdirectory(src)
# NOTE: There are some missing dependencies in this directory
#add_subdirectory(examples)
4 changes: 2 additions & 2 deletions cmake/jvar.cmake
Expand Up @@ -4,12 +4,12 @@ externalproject_add(JVAR
SOURCE_DIR ${CMAKE_SOURCE_DIR}/third_party/jvar
CONFIGURE_COMMAND ""
BUILD_COMMAND cmake ${CMAKE_SOURCE_DIR}/third_party/jvar
INSTALL_COMMAND ""
INSTALL_COMMAND make install
BUILD_IN_SOURCE 1
)
set(JVAR_INCLUDES ${CMAKE_SOURCE_DIR}/third_party/jvar/include)

mark_as_advanced(
JVAR
JVAR_INCLUDES
)
)
21 changes: 0 additions & 21 deletions examples/CMakeLists.txt

This file was deleted.

6 changes: 3 additions & 3 deletions examples/libwebsockets.cpp
Expand Up @@ -3,9 +3,9 @@
// $ g++ libwebsockets.cpp -lwebsockets -ljvar -lddpserver -o example
// $ ./example

#include "jvar.h"
#include "ddpserver.h"
#include "libwebsockets.h"
#include <jvar/jvar.h>
#include <ddpserver.h>
#include <libwebsockets.h>

DdpServer *ddpServer;
unsigned char buf[2048];
Expand Down
5 changes: 3 additions & 2 deletions examples/mongoose.cpp
@@ -1,9 +1,10 @@
// build and run:
//
// $ g++ mongoose.cpp -lmongoose -ljvar -lddpserver -o example
// $ wget https://github.com/cesanta/mongoose/raw/master/mongoose.c
// $ wget https://github.com/cesanta/mongoose/raw/master/mongoose.h
// $ g++ mongoose.cpp mongoose.c -ljvar -lddpserver -o example
// $ ./example

// NOTE: We need to add this dependency still
#include "mongoose.h"
#include <ddpserver.h>
#include <jvar/jvar.h>
Expand Down
4 changes: 2 additions & 2 deletions examples/websocketpp.cpp
Expand Up @@ -3,8 +3,8 @@
// $ g++ websocketpp.cpp -lboost_system -lboost_chrono -ljvar -lddpserver -o example
// $ ./example

#include "jvar.h"
#include "ddpserver.h"
#include <jvar/jvar.h>
#include <ddpserver.h>
#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>
#include <boost/lexical_cast.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/ddpserver.h
@@ -1,7 +1,7 @@
#ifndef DDPSERVER_H
#define DDPSERVER_H

#include "jvar.h"
#include <jvar/jvar.h>

class DdpServer {

Expand Down
4 changes: 1 addition & 3 deletions src/CMakeLists.txt
Expand Up @@ -8,10 +8,8 @@ file(GLOB DDP_HEADERS

include_directories(
${DDP_INCLUDES}
${JVAR_INCLUDES}
)

#TODO: Check compiler for modern C++ support
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall")
endif(CMAKE_COMPILER_IS_GNUCXX)
Expand All @@ -23,4 +21,4 @@ install(TARGETS ddpserver
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)

install(FILES ${DDP_HEADERS} DESTINATION include)
install(FILES ${DDP_HEADERS} DESTINATION include)

0 comments on commit bc60ac6

Please sign in to comment.