Skip to content

Commit

Permalink
CMake fixes, Boost 1.51.0 and VS 2012 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
ignacio committed Sep 30, 2012
1 parent 53826c6 commit dae58cd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
20 changes: 16 additions & 4 deletions CMakeLists.txt
@@ -1,16 +1,28 @@
PROJECT(LuaNode C CXX) PROJECT(LuaNode C CXX)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_MINIMUM_REQUIRED(VERSION 2.6)


FIND_PACKAGE(Lua51 REQUIRED) FIND_PACKAGE( Lua51 REQUIRED )
FIND_PACKAGE(OpenSSL REQUIRED) FIND_PACKAGE( OpenSSL REQUIRED )
FIND_PACKAGE(Threads REQUIRED) FIND_PACKAGE( Threads REQUIRED )


SET( BOOST_MIN_VERSION "1.44.0" )

# We want to statically link the multithreaded versions. And we don't want Boost auto-link feature
# since it doesn't play nice with CMake
SET( Boost_USE_STATIC_LIBS ON ) SET( Boost_USE_STATIC_LIBS ON )
SET( Boost_USE_MULTITHREADED ON ) SET( Boost_USE_MULTITHREADED ON )
SET( Boost_USE_STATIC_RUNTIME OFF ) SET( Boost_USE_STATIC_RUNTIME OFF )
ADD_DEFINITIONS( -DBOOST_ALL_NO_LIB ) ADD_DEFINITIONS( -DBOOST_ALL_NO_LIB )


FIND_PACKAGE(Boost COMPONENTS system date_time thread REQUIRED) # boost::thread since version 1.50 relies on boost::chrono
# So check which Boost version is available and look for the required libs
FIND_PACKAGE( Boost )
SET( local_boost_version "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}" )
IF (${local_boost_version} VERSION_GREATER "1.49")
FIND_PACKAGE( Boost ${BOOST_MIN_VERSION} COMPONENTS system date_time thread chrono REQUIRED )
ELSE()
FIND_PACKAGE( Boost ${BOOST_MIN_VERSION} COMPONENTS system date_time thread REQUIRED )
ENDIF()


FIND_PROGRAM(LUA NAMES lua-5.1 lua5.1 lua) FIND_PROGRAM(LUA NAMES lua-5.1 lua5.1 lua)


Expand Down
1 change: 1 addition & 0 deletions src/luanode_crypto.h
Expand Up @@ -8,6 +8,7 @@


#include <openssl/hmac.h> #include <openssl/hmac.h>
#include <boost/asio/ssl.hpp> #include <boost/asio/ssl.hpp>
#include <boost/array.hpp>


namespace LuaNode { namespace LuaNode {


Expand Down
1 change: 1 addition & 0 deletions src/luanode_datagram_udp.h
Expand Up @@ -7,6 +7,7 @@


#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#include <boost/array.hpp>


namespace LuaNode { namespace LuaNode {


Expand Down
1 change: 1 addition & 0 deletions src/luanode_net.h
Expand Up @@ -7,6 +7,7 @@


#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#include <boost/array.hpp>


namespace LuaNode { namespace LuaNode {


Expand Down

0 comments on commit dae58cd

Please sign in to comment.