Skip to content

Commit

Permalink
Fixed C++11 module. Added example in Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xvjau-ro committed Jun 27, 2012
1 parent 17eed5d commit 6b1fd80
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
15 changes: 0 additions & 15 deletions CheckForCPP11.cmake

This file was deleted.

11 changes: 11 additions & 0 deletions CheckForCPP11Config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
add_definitions(-W -Wall -Wno-unused-function -pipe)
set(CPP11_DEFS -std=c++0x -D__USE_CPP0X__ -D__USE_CPP11__)
else()
set(CPP11_DEFS -D__USE_CPP0X__ -D__USE_CPP11__)
endif()

try_compile( CPP11
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_LIST_DIR}/CheckForCPP11.cpp
COMPILE_DEFINITIONS ${CPP11_DEFS} )
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
misc-cmake-modules
==================

For example, these modules could be put into some 'global' directory like:

/usr/local/share/misc-cmake-modules

This directory could be put into some global enviroment variable like adding to you ~/.bashrc

export MISC_CMAKE_MODULES='/usr/local/share/misc-cmake-modules'

and then putting the following in you project files:

find_package(SQLite3 HINTS $ENV{MISC_CMAKE_MODULES})

### CheckForCPP11.cmake

Checks whether C++11 is available in the compiler.

if ( CPP11 )
message(STATUS "Using C++ 11")
add_definitions(${CPP11_DEFS})
else()
message(STATUS "Not using C++ 11 - falling back to boost.org")
find_package(Boost)
if ( ${Boost_INCLUDE_DIRS} )
include_directories(${Boost_INCLUDE_DIRS})
add_definitions(-DUSE_BOOST)
endif()
endif()


### FreeApache-apr.cmake

Expand Down

0 comments on commit 6b1fd80

Please sign in to comment.