-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move JsonCpp and SPLINTER from submodules to external CMake dependencies
- git submodules are not working well for bundled libraries, and also it's not clear how they would be packaged in the final version - therefore, JsonCpp and SPLINTER have been moved from git submodules to external CMake dependencies handled with the EXTERNALPROJECT_ADD command. This automatically clones their repositories at a fixed commit and builds the results. This will make packaging much easier - Improvements to FindCppTransport.cmake module which is now configured using the installation prefix, so it is guaranteed to find the JsonCpp and SPLINTER libraries which were installed with CppTransport - Boost and GiNaC dependencies still handled as before, assuming they have been pre-installed by a sysadmin or package manager. This seems to make most sense; installing shared libraries (eg. for Boost) in non-standard locations is complex and difficult to do correctly, and also both Boost and GiNaC (via CLN and then GMP) have not-completely-trivial build procedures. We get the best user experience by having these components properly installed in standard locations - update to SPLINTER 3.0, and adjustments for its new API
- Loading branch information
Showing
12 changed files
with
177 additions
and
86 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,6 +0,0 @@ | ||
[submodule "CppTransport/thirdparty/jsoncpp"] | ||
path = CppTransport/thirdparty/jsoncpp | ||
url = https://ds283@github.com/open-source-parsers/jsoncpp.git | ||
[submodule "CppTransport/thirdparty/splinter"] | ||
path = CppTransport/thirdparty/splinter | ||
url = https://ds283@github.com/bgrimstad/splinter.git | ||
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 was deleted.
Oops, something went wrong.
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,51 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 3.0) | ||
|
||
INCLUDE(ExternalProject) | ||
|
||
|
||
FUNCTION(BUILD_JSONCPP BUILD_DIR INSTALL_PREFIX) | ||
|
||
SET(JSONCPP_SRC ${BUILD_DIR}/src) | ||
SET(JSONCPP_BIN ${BUILD_DIR}/bin) | ||
SET(JSONCPP_INSTALL ${INSTALL_PREFIX}) | ||
SET(JSONCPP_INSTALL ${INSTALL_PREFIX} PARENT_SCOPE) | ||
|
||
EXTERNALPROJECT_ADD( | ||
jsoncpp | ||
GIT_REPOSITORY https://github.com/open-source-parsers/jsoncpp.git | ||
GIT_TAG 45da594e71ad0ac323aada534c338a308d63b84f | ||
SOURCE_DIR ${JSONCPP_SRC} | ||
BINARY_DIR ${JSONCPP_BIN} | ||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${JSONCPP_INSTALL} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
) | ||
|
||
SET(JSONCPP_LIBRARIES ${JSONCPP_INSTALL}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX} PARENT_SCOPE) | ||
SET(JSONCPP_INCLUDE_DIRS ${JSONCPP_INSTALL}/include PARENT_SCOPE) | ||
|
||
ADD_DEPENDENCIES(DEPS jsoncpp) | ||
|
||
ENDFUNCTION(BUILD_JSONCPP) | ||
|
||
|
||
FUNCTION(BUILD_SPLINTER BUILD_DIR INSTALL_PREFIX) | ||
|
||
SET(SPLINTER_SRC ${BUILD_DIR}/src) | ||
SET(SPLINTER_BIN ${BUILD_DIR}/bin) | ||
SET(SPLINTER_INSTALL ${INSTALL_PREFIX}) | ||
SET(SPLINTER_INSTALL ${INSTALL_PREFIX} PARENT_SCOPE) | ||
|
||
EXTERNALPROJECT_ADD( | ||
SPLINTER | ||
GIT_REPOSITORY https://github.com/bgrimstad/splinter.git | ||
GIT_TAG 2c877c0d7f68025764f7af048cc609e5c05080e0 | ||
SOURCE_DIR ${SPLINTER_SRC} | ||
BINARY_DIR ${SPLINTER_BIN} | ||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${SPLINTER_INSTALL} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
) | ||
|
||
SET(SPLINTER_LIBRARIES ${SPLINTER_INSTALL}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}splinter-static-3-0${CMAKE_STATIC_LIBRARY_SUFFIX} PARENT_SCOPE) | ||
SET(SPLINTER_INCLUDE_DIRS ${SPLINTER_INSTALL}/include PARENT_SCOPE) | ||
|
||
ADD_DEPENDENCIES(DEPS SPLINTER) | ||
|
||
ENDFUNCTION(BUILD_SPLINTER) |
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
# determine path to runtime system .h files | ||
FIND_PATH(CPPTRANSPORT_INCLUDE_DIR NAMES transport.h PATHS @CMAKE_INSTALL_PREFIX@ PATH_SUFFIXES include/cpptransport/transport-runtime) | ||
|
||
# determine path to pre-installed SPLINTER and JsonCpp libraries | ||
FIND_LIBRARY(CPPTRANSPORT_SPLINTER_LIBRARY NAMES splinter-static-3-0 PATHS @CMAKE_INSTALL_PREFIX@ PATH_SUFFIXES lib/cpptransport/lib NO_DEFAULT_PATH) | ||
FIND_LIBRARY(CPPTRANSPORT_JSONCPP_LIBRARY NAMES jsoncpp PATHS @CMAKE_INSTALL_PREFIX@ PATH_SUFFIXES lib/cpptransport/lib NO_DEFAULT_PATH) | ||
|
||
# determine paths for system installation of Boost | ||
FIND_PACKAGE(Boost REQUIRED COMPONENTS log system filesystem random timer date_time mpi thread serialization program_options regex) | ||
|
||
|
||
SET(CPPTRANSPORT_INCLUDE_DIRS | ||
${CPPTRANSPORT_INCLUDE_DIR}/.. | ||
${CPPTRANSPORT_INCLUDE_DIR}/../SPLINTER | ||
${Boost_INCLUDE_DIRS} | ||
) | ||
|
||
|
||
SET(CPPTRANSPORT_LIBRARIES | ||
${CPPTRANSPORT_SPLINTER_LIBRARY} | ||
${CPPTRANSPORT_JSONCPP_LIBRARY} | ||
${Boost_LIBRARIES} | ||
) | ||
|
||
|
||
INCLUDE(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CppTransport DEFAULT_MSG | ||
CPPTRANSPORT_INCLUDE_DIR | ||
CPPTRANSPORT_SPLINTER_LIBRARY | ||
CPPTRANSPORT_JSONCPP_LIBRARY | ||
) | ||
|
||
|
||
MARK_AS_ADVANCED( | ||
CPPTRANSPORT_INCLUDE_DIR | ||
) |
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,25 @@ | ||
// | ||
// Created by David Seery on 20/04/2016. | ||
// Copyright (c) 2016 University of Sussex. All rights reserved. | ||
// | ||
|
||
#ifndef CPPTRANSPORT_BUILD_DATA_H | ||
#define CPPTRANSPORT_BUILD_DATA_H | ||
|
||
|
||
#include <string> | ||
|
||
|
||
namespace build_data | ||
{ | ||
|
||
const std::string config_timestamp = "${CONFIG_TIMESTAMP}"; | ||
const std::string c_compiler = "${CMAKE_C_COMPILER_ID}"; | ||
const std::string cpp_compiler = "${CMAKE_CXX_COMPILER_ID}"; | ||
const std::string build_type = "${CMAKE_BUILD_TYPE}"; | ||
const std::string system_name = "${CMAKE_SYSTEM}"; | ||
|
||
} // namespace build_data | ||
|
||
|
||
#endif //CPPTRANSPORT_BUILD_DATA_H |
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
Submodule jsoncpp
deleted from
45da59
Submodule splinter
deleted from
88e502
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