This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from forno/upgrade/v1.3.0
Upgrade to v1.3.0
- Loading branch information
Showing
24 changed files
with
981 additions
and
942 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
build/ | ||
bin/ | ||
**/*.swp | ||
/build | ||
Makefile | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "thirdpatry/googletest"] | ||
path = thirdpatry/googletest | ||
url = https://github.com/google/googletest.git | ||
ignore = dirty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
language: cpp | ||
sudo: false | ||
dist: trusty | ||
group: beta | ||
dist: trusty | ||
sudo: false | ||
compiler: | ||
- g++ | ||
- clang++ | ||
- g++ | ||
- clang++ | ||
before_install: | ||
- cd thirdpatry/googletest/googletest | ||
- cmake -DCMAKE_BUILD_TYPE=RELEASE . | ||
- make | ||
- cd - | ||
- mkdir build | ||
- cd build | ||
install: | ||
- make | ||
- mkdir cbuild | ||
- cd cbuild | ||
- cmake .. -DCMAKE_INSTALL_PREFIX=install | ||
- make | ||
- make install | ||
- cd .. | ||
- cmake .. -DCMAKE_INSTALL_PREFIX=install -DENABLE_TEST=ON | ||
- make | ||
- make install | ||
script: | ||
./bin/test | ||
- ctest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,95 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12.1) | ||
project(ics3 CXX) | ||
|
||
SET(PROJECT_VER_MAJOR 1) | ||
SET(PROJECT_VER_MINOR 2) | ||
SET(PROJECT_VER_PATCH 6) | ||
SET(PROJECT_VER "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}") | ||
SET(PROJECT_APIVER "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}") | ||
|
||
IF(NOT DEFINED CMAKE_BUILD_TYPE) | ||
# No effect for multi-configuration generators (e.g. for Visual Studio) | ||
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose: RelWithDebInfo Release Debug MinSizeRel None") | ||
ENDIF() | ||
|
||
SET(MY_DIR ${ics3_SOURCE_DIR}) | ||
|
||
OPTION(BUILD_SHARED_LIBS "Build shared (ON) or static (OFF) libraries" ON) | ||
OPTION(ENABLE_CXX11 "Enable C++11 support" ON) | ||
|
||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") | ||
|
||
SET(HAVE_CXX11 disabled) | ||
IF(ENABLE_CXX11) | ||
INCLUDE(CheckCXXCompilerFlag) | ||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) | ||
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) | ||
IF(COMPILER_SUPPORTS_CXX11) | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
SET(LIBICS3_WITH_CXX11_SUPPORT 1) | ||
SET(HAVE_CXX11 yes) | ||
ELSEIF(COMPILER_SUPPORTS_CXX0X) | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") | ||
SET(HAVE_CXX11 c++0x) | ||
ELSE() | ||
SET(HAVE_CXX11 no) | ||
MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") | ||
ENDIF() | ||
ENDIF(ENABLE_CXX11) | ||
cmake_minimum_required(VERSION 2.8.12.1) | ||
project(ics3 C CXX) | ||
|
||
set(PROJECT_VER_MAJOR 1) | ||
set(PROJECT_VER_MINOR 3) | ||
set(PROJECT_VER_PATCH 0) | ||
set(PROJECT_VER "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}") | ||
set(PROJECT_APIVER "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}") | ||
|
||
if(NOT DEFINED CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose: RelWithDebInfo Release Debug MinSizeRel None") | ||
endif() | ||
|
||
option(BUILD_SHARED_LIBS "Build shared (ON) or static (OFF) libraries" ON) | ||
option(ENABLE_TEST "Enable test program building" OFF) | ||
|
||
set(MY_DIR ${ics3_SOURCE_DIR}) | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") | ||
|
||
include(CheckCXXCompilerFlag) | ||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) | ||
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) | ||
if(COMPILER_SUPPORTS_CXX11) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
elseif(COMPILER_SUPPORTS_CXX0X) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") | ||
else() | ||
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") | ||
endif() | ||
|
||
#set the default path for built executables to the "bin" directory | ||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) | ||
|
||
#set the default path for built libraries to the "lib" directory | ||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) | ||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) | ||
|
||
# Add includes | ||
INCLUDE_DIRECTORIES( | ||
"${MY_DIR}/include" | ||
${PROJECT_BINARY_DIR} # for generated headers | ||
include_directories( | ||
${MY_DIR}/include | ||
) | ||
|
||
FILE(GLOB ICS3_SOURCES | ||
file(GLOB ICS3_SOURCES | ||
${MY_DIR}/src/*.cpp | ||
) | ||
|
||
LIST(REMOVE_ITEM ICS3_SOURCES ${MY_DIR}/src/test.cpp) | ||
|
||
FILE(GLOB ICS3_HEADERS | ||
file(GLOB ICS3_HEADERS | ||
${MY_DIR}/include/ics3/*.hpp | ||
${MY_DIR}/include/core.hpp | ||
) | ||
|
||
SET(SOURCES | ||
set(SOURCES | ||
${ICS3_HEADERS} | ||
${ICS3_SOURCES} | ||
) | ||
|
||
ADD_LIBRARY(ics3 ${SOURCES}) | ||
SET_TARGET_PROPERTIES(ics3 PROPERTIES | ||
add_library(ics3 ${SOURCES}) | ||
set_target_properties(ics3 PROPERTIES | ||
VERSION ${PROJECT_VER} | ||
SOVERSION ${PROJECT_APIVER} | ||
) | ||
|
||
TARGET_LINK_LIBRARIES(ics3) | ||
INSTALL(TARGETS ics3 DESTINATION lib RUNTIME DESTINATION bin) | ||
INSTALL(DIRECTORY "${MY_DIR}/include/${PROJECT_NAME}" DESTINATION include) | ||
|
||
GET_CMAKE_PROPERTY(vars VARIABLES) | ||
MESSAGE(STATUS "Feature list:") | ||
FOREACH(var ${vars}) | ||
IF(var MATCHES ^HAVE_) | ||
STRING(REPLACE HAVE_ "" feature ${var}) | ||
MESSAGE(STATUS " ${feature} ${${var}}") | ||
ENDIF() | ||
ENDFOREACH() | ||
target_link_libraries(ics3) | ||
|
||
if(ENABLE_TEST) | ||
set(GTEST_ROOT ${MY_DIR}/thirdpatry/googletest/googletest) | ||
find_package(GTest REQUIRED) | ||
find_package(Threads) | ||
|
||
include_directories(${GTEST_INCLUDE_DIRS}) | ||
add_executable(integrate test/integrate.cpp) | ||
target_link_libraries(integrate ics3 ${GTEST_BOTH_LIBRARIES}) | ||
if(THREADS_HAVE_PTHREAD_ARG) | ||
target_compile_options(PUBLIC integrate "-pthread") | ||
endif() | ||
if(CMAKE_THREAD_LIBS_INIT) | ||
target_link_libraries(integrate "${CMAKE_THREAD_LIBS_INIT}") | ||
endif() | ||
|
||
enable_testing() | ||
add_test(AllTestInIntegrate ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/integrate) | ||
endif() | ||
|
||
install(TARGETS ics3 DESTINATION lib RUNTIME DESTINATION bin) | ||
install(DIRECTORY "${MY_DIR}/include/${PROJECT_NAME}" DESTINATION include) | ||
|
||
get_cmake_property(vars VARIABLES) | ||
message(STATUS "Feature list:") | ||
foreach(var ${vars}) | ||
if(var MATCHES ^HAVE_) | ||
string(REPLACE HAVE_ "" feature ${var}) | ||
message(STATUS " ${feature} ${${var}}") | ||
endif() | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.