Skip to content

Commit

Permalink
Reduce compiler warnings; Updating CMake Setup (#6)
Browse files Browse the repository at this point in the history
* [WIP] Add two half step decimation scheme

* Explicit data return types in SimplexID::data

* Improving CMake logic; Setup casc as an interface library

* Updating travis-ci to use xenial

* Refactoring size_t to std::size_t

* Resolving warned undefined behaviors

* Cleanup of compiler warnings

* Wrapping c++17 attributes to hopefully prevent unsupported warnings
  • Loading branch information
ctlee authored May 31, 2019
1 parent e60c576 commit 712708a
Show file tree
Hide file tree
Showing 25 changed files with 647 additions and 446 deletions.
17 changes: 10 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
notifications:
email: false
slack:
on_success: change
on_failure: always
secure: ilztqDylzgDwnh+AAHdrmHjgD4rjutJa5rh783H8HfW7KKY+RtHaAa+Z9V6uAbU3/fPk29fkCXRxT/scAI4Fn0TQ/Hi0alCs7ytNJg+2fbVcI5xWHbmJznOb0pQl0Gn6MGwouSyP9WvRtivtT5u+wlNR6yKycTmUI9qP3Fe7nA/k/WdRt5SHGjjprtYZYbBOg+9UStzubMuQj5hTBeDs78UyUbejSsZ0Cp9+OkTcugoEegwn0o9QdkvFGHF/hQ5bVGGNVAFUVOg+B4DFiw59MbsgIDZ663CXCTxUJ1I4uS3rI7LpnY2G8c5dKp9E2KDkM8sPKWzg4qeyj1POMPNDUbNYWIHBBK4NxrQ+PqW1nquxNTVsqYi2IXVmV2BWx9+SUS06YwDsjrCcQyAtnCzxn/tL3aX/8jyeN3yPwytJgDuj9IF8nIJZuuMgDOs1ZVa9fbL8ANBMcZMKIPCSwjO8670ULl5xKAWKGTY7HwzGLU3syQBwOX+eukf9zx2Y9qrsP1kJJT8YTOD45icJRAMPQQEiN20wxKh/V7Kz0ewc6LG8Bv1FyM6f+7ehNZvkwrStzJJ85JwDkPeTKKiBa3kuBQzE0CBm3/cTYCXgQEo3jggH1xPF8OkbYhuX8TrZjp3PBVCABto6V6OGILFA7Hhv6gK9eHxCSVOICPfWCfYXakY=

language: cpp
dist: trusty
dist: xenial
sudo: false

# Blacklist
Expand All @@ -14,6 +18,8 @@ matrix:
include:
- os: osx
osx_image: xcode
before_install:
- brew install doxygen
- os: linux
addons:
apt:
Expand All @@ -27,16 +33,13 @@ before_install:
- eval "${MATRIX_EVAL}"
install:
- mkdir build; cd build;
- cmake .. -DBUILD_CASCTESTS=on;
- cmake ..;
- make -j4;
script:
- ./bin/casctests;
- ctest -V
after_success:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew install doxygen;
brew install graphviz;
cmake ..;
make docs;
make docs
fi;
deploy:
provider: pages
Expand Down
87 changes: 49 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,71 +20,82 @@
#
# ***************************************************************************

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.11)

# Disable in source builds
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

#####################################################################
# Project GAMer
#####################################################################
project(CASC VERSION 1.0.0)
project(CASC VERSION 1.0.1 LANGUAGES CXX)

# Require c++14 and standard libraries
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Check if casc is being used directly or via add_subdirectory
set(CASC_MASTER_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CASC_MASTER_PROJECT ON)
endif()

#####################################################################
# Options
#####################################################################
option(BUILD_CASCTESTS "Build the test scripts" OFF)
option(BUILD_CASCEXAMPLES "Build the CASC surface mesh example" OFF)
option(CASC_INSTALL "Install casc header files?" ${CASC_MASTER_PROJECT})
option(BUILD_CASCTESTS "Build the test scripts?" ${CASC_MASTER_PROJECT})
# option(BUILD_CASCEXAMPLES "Build the CASC surface mesh example?" ${CASC_MASTER_PROJECT})

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()

if(BUILD_CASCTESTS)
enable_testing()
endif(BUILD_CASCTESTS)
set(CASC_VERSION ${CASC_VERSION_MAJOR}.${CASC_VERSION_MINOR}.${CASC_VERSION_PATCH})
message(STATUS "casc v${CASC_VERSION}")

# Define where to put the libraries and binaries
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
# Cache variables
set(CASC_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/include" CACHE INTERNAL "")

include_directories(include)
include(GNUInstallDirs)

# Install directive for the header files
install(DIRECTORY include DESTINATION casc FILES_MATCHING PATTERN "*.h")
add_library(casc INTERFACE)
target_include_directories(casc INTERFACE
$<BUILD_INTERFACE:${CASC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

# List the include directories...
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "CASC include_dir: ${dir}")
endforeach()
if(CASC_INSTALL)
install(DIRECTORY ${CASC_INCLUDE_DIR}/casc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# TODO (0): Also setup cmake support files cascConfig.cmake etc.
endif()

if(BUILD_CASCTESTS)
enable_testing()
add_subdirectory(tests)
endif(BUILD_CASCTESTS)

if(BUILD_CASCEXAMPLES)
add_subdirectory(examples)
endif(BUILD_CASCEXAMPLES)
# if(BUILD_CASCEXAMPLES)
# add_subdirectory(examples)
# endif(BUILD_CASCEXAMPLES)

#####################################################################
# Target to generate Doxygen documentation
#####################################################################
find_package(Doxygen)
if(DOXYGEN_FOUND)
message(STATUS "Doxygen Executable: ${DOXYGEN_EXECUTABLE}")
message(STATUS "Build the documentation using `make docs`")
# Parse Doxyfile.in and replace CMake @macros@.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(docs
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
else()
message(STATUS "CMake could not find Doxygen. Please install Doxygen or help me find your Doxygen binary to build the documentation!")
endif(DOXYGEN_FOUND)
if(CASC_MASTER_PROJECT)
#####################################################################
# Target to generate Doxygen documentation
#####################################################################
find_package(Doxygen)
if(DOXYGEN_FOUND)
message(STATUS "Doxygen Executable: ${DOXYGEN_EXECUTABLE}")
message(STATUS "Build the documentation using `make docs`")
# Parse Doxyfile.in and replace CMake @macros@.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(docs
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
else()
message(STATUS "CMake could not find Doxygen. Please install Doxygen or help me find your Doxygen binary to build the documentation!")
endif(DOXYGEN_FOUND)
endif(CASC_MASTER_PROJECT)
Loading

0 comments on commit 712708a

Please sign in to comment.