Skip to content

Commit

Permalink
Merge pull request #48 from brunocodutra/develop
Browse files Browse the repository at this point in the history
Bump to 0.3.3
  • Loading branch information
brunocodutra authored Oct 11, 2016
2 parents d383f2b + d2fc8a4 commit 888e613
Show file tree
Hide file tree
Showing 88 changed files with 1,959 additions and 150 deletions.
23 changes: 22 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,31 @@
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.0)

project(Metal CXX)

set(METAL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")

file(STRINGS "${METAL_INCLUDE_DIR}/metal/config/version.hpp"
METAL_CONFIG_VERSION_HPP REGEX "METAL_[A-Z]+ [0-9]+" LIMIT_COUNT 3
)

LIST(GET METAL_CONFIG_VERSION_HPP 0 METAL_MAJOR)
LIST(GET METAL_CONFIG_VERSION_HPP 1 METAL_MINOR)
LIST(GET METAL_CONFIG_VERSION_HPP 2 METAL_PATCH)

string(REGEX REPLACE ".*MAJOR ([0-9]+).*" "\\1" METAL_MAJOR "${METAL_MAJOR}")
string(REGEX REPLACE ".*MINOR ([0-9]+).*" "\\1" METAL_MINOR "${METAL_MINOR}")
string(REGEX REPLACE ".*PATCH ([0-9]+).*" "\\1" METAL_PATCH "${METAL_PATCH}")

set(METAL_VERSION "${METAL_MAJOR}.${METAL_MINOR}.${METAL_PATCH}")

message(STATUS "Configuring Metal ${METAL_VERSION}")

add_library(metal INTERFACE)
target_include_directories(metal INTERFACE ${METAL_INCLUDE_DIR})

include("${CMAKE_SOURCE_DIR}/cmake/config.cmake")
include("${CMAKE_SOURCE_DIR}/cmake/testing.cmake")
include("${CMAKE_SOURCE_DIR}/cmake/deployment.cmake")
Expand Down
18 changes: 0 additions & 18 deletions cmake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,6 @@
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt

set(METAL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")

file(STRINGS "${METAL_INCLUDE_DIR}/metal/config/version.hpp"
METAL_CONFIG_VERSION_HPP REGEX "METAL_[A-Z]+ [0-9]+" LIMIT_COUNT 3
)

LIST(GET METAL_CONFIG_VERSION_HPP 0 METAL_MAJOR)
LIST(GET METAL_CONFIG_VERSION_HPP 1 METAL_MINOR)
LIST(GET METAL_CONFIG_VERSION_HPP 2 METAL_PATCH)

string(REGEX REPLACE ".*MAJOR ([0-9]+).*" "\\1" METAL_MAJOR "${METAL_MAJOR}")
string(REGEX REPLACE ".*MINOR ([0-9]+).*" "\\1" METAL_MINOR "${METAL_MINOR}")
string(REGEX REPLACE ".*PATCH ([0-9]+).*" "\\1" METAL_PATCH "${METAL_PATCH}")

set(METAL_VERSION "${METAL_MAJOR}.${METAL_MINOR}.${METAL_PATCH}")

message(STATUS "Configuring Metal ${METAL_VERSION}")

option(METAL_ENABLE_WARNINGS "enable compiler warnings" ON)
option(METAL_STRICT "treat compiler warnings as errors" OFF)
option(METAL_VERBOSE "increase output verbosity" OFF)
Expand Down
9 changes: 3 additions & 6 deletions cmake/deployment.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ foreach(_ INCLUDE CMAKE)
endforeach()

file(RELATIVE_PATH METAL_INCLUDE_DIRS
"${METAL_CMAKE_INSTALL_DIR}" "${METAL_INCLUDE_INSTALL_DIR}"
${METAL_CMAKE_INSTALL_DIR} ${METAL_INCLUDE_INSTALL_DIR}
)

set(METAL_INCLUDE_DIRS "\${METAL_CMAKE_DIR}/${METAL_INCLUDE_DIRS}")
Expand All @@ -40,13 +40,10 @@ configure_file(cmake/MetalConfigVersion.cmake.in
@ONLY
)

install(DIRECTORY
"${METAL_INCLUDE_DIR}"
DESTINATION "${METAL_INCLUDE_INSTALL_DIR}"
)
install(DIRECTORY ${METAL_INCLUDE_DIR} DESTINATION ${METAL_INCLUDE_INSTALL_DIR})

install(FILES
"${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/MetalConfig.cmake"
"${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/MetalConfigVersion.cmake"
DESTINATION "${METAL_CMAKE_INSTALL_DIR}"
DESTINATION ${METAL_CMAKE_INSTALL_DIR}
)
1 change: 1 addition & 0 deletions cmake/testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function(metal_build_test_tree _root _prefix)
set(target ${_root}.${node})
if(EXISTS "${_prefix}/${node}.cpp")
add_executable(${target} EXCLUDE_FROM_ALL "${_prefix}/${node}.cpp")
target_link_libraries(${target} metal)
else()
add_custom_target(${target})
endif()
Expand Down
9 changes: 5 additions & 4 deletions doc/js/metal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
// See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt

$(function(){
var page = window.location.pathname.split("/").pop().split("#")[0];
var page = window.location.pathname.split("/").pop();
if(!page.length)
page = "index.html";

if(/[^_]+__[^_.]+.html/.test(page))
var section = page;
if(/[^_]+__[^_.]+.html/.test(section))
section = "modules.html";
else
section = page;

$("#sections > #menu a[href='" + section +"']").each(function(){
$(this).parent().addClass("active");
Expand Down
2 changes: 1 addition & 1 deletion doc/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Metal may optionally be installed system-wide to ease integration with external
projects. If you'd rather use Metal locally, you may skip to the
[next section](#using_metal).

Make sure to have [CMake] v2.8.12 or newer installed on your system, then,
Make sure to have [CMake] v3.0 or newer installed on your system, then,
from within an empty directory, issue the following commands.

cmake /path/to/Metal
Expand Down
1 change: 0 additions & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt

include_directories("${METAL_INCLUDE_DIR}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/")

add_custom_target(examples)
Expand Down
Loading

0 comments on commit 888e613

Please sign in to comment.