Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ferencr committed Nov 8, 2017
0 parents commit 4c08bdd
Show file tree
Hide file tree
Showing 1,384 changed files with 412,651 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set line endigs of the text files to native format
* text=auto
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Exclude the .gradle directories
**/.gradle
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "3rdparty/boost"]
path = 3rdparty/boost
url = https://github.com/boostorg/boost.git
[submodule "3rdparty/zlib"]
path = 3rdparty/zlib
url = https://github.com/madler/zlib.git
[submodule "3rdparty/PMD"]
path = 3rdparty/PMD
url = https://github.com/sed-inf-u-szeged/pmd.git
[submodule "java/lib/langtools"]
path = java/lib/langtools
url = https://github.com/sed-inf-u-szeged/langtools.git
2 changes: 2 additions & 0 deletions 3rdparty/CMake/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set line endigs of the patch files
*.patch text eol=lf
23 changes: 23 additions & 0 deletions 3rdparty/CMake/SearchAndCopyFiles.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

if (NOT IS_ABSOLUTE ${COPY_SOURCE})
set (COPY_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/${COPY_SOURCE})
endif()

file (GLOB_RECURSE FILES_TO_COPY
${COPY_SOURCE}${COPY_PATTERN}
)

message ("COPY:${FILES_TO_COPY}")

foreach (SOURCE_FILE ${FILES_TO_COPY})
file(RELATIVE_PATH TARGET_FILE ${COPY_SOURCE} ${SOURCE_FILE})
message ("${COPY_TARGET}/${TARGET_FILE}")
get_filename_component(TARGET_DIR "${COPY_TARGET}/${TARGET_FILE}" DIRECTORY)
file (COPY ${SOURCE_FILE}
DESTINATION ${TARGET_DIR}
)
endforeach ()




28 changes: 28 additions & 0 deletions 3rdparty/CMake/zlib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0fe939d..b1719fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -188,6 +188,10 @@ add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZL
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES SOVERSION 1)

+if (MSVC)
+ set_target_properties(zlibstatic PROPERTIES COMPILE_FLAGS "/MT")
+endif()
+
if(NOT CYGWIN)
# This property causes shared libraries on Linux to have the full version
# encoded into their final filename. We disable this on Cygwin because
@@ -211,10 +215,9 @@ elseif(BUILD_SHARED_LIBS AND WIN32)
endif()

if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
- install(TARGETS zlib zlibstatic
+ install(TARGETS zlibstatic
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
- LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
+ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}")
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}")
153 changes: 153 additions & 0 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
include(ExternalProject)

# All the external static library names should follow this naming convention:
# Linux:
# lib<name>.a
# Windows:
# <name>.lib

file (MAKE_DIRECTORY ${COLUMBUS_3RDPARTY_INSTALL_DIR}/bin)
file (MAKE_DIRECTORY ${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib)
file (MAKE_DIRECTORY ${COLUMBUS_3RDPARTY_INSTALL_DIR}/include)

########################### zlib #########################

ExternalProject_Add(zlib
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib
PATCH_COMMAND git clean -x -d -f
COMMAND git reset --hard
COMMAND git apply --ignore-whitespace ${CMAKE_CURRENT_SOURCE_DIR}/CMake/zlib.patch
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${COLUMBUS_3RDPARTY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)

# This extra rename step is needed on windows to rename the library to be compatible with the CMake library naming convention.
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
ExternalProject_Add_Step (zlib rename
DEPENDEES BUILD INSTALL
COMMAND ${CMAKE_COMMAND} -E rename ${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib/zlibstatic$<$<CONFIG:Debug>:d>.lib ${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib/z.lib
LOG 1
)
endif()


########################### boost ########################
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
if (COLUMBUS_64BIT)
set (BOOST_ADDRESS_MODEL address-model=64)
endif ()
endif ()

ExternalProject_Add(boost
DEPENDS zlib
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/boost
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${COMMAND_PREFIX}bootstrap${SCRIPT_EXT}
BUILD_COMMAND ${COMMAND_PREFIX}b2 --reconfigure --build-dir=${CMAKE_CURRENT_BINARY_DIR}/boost-prefix --prefix=${COLUMBUS_3RDPARTY_INSTALL_DIR} -j8 --with-filesystem --with-system --with-date_time --with-iostreams --with-graph --with-regex --with-thread --with-math --layout=system variant=$<$<CONFIG:Debug>:debug>$<$<CONFIG:Release>:release> runtime-link=static architecture=x86 threading=multi ${BOOST_ADDRESS_MODEL} link=static -sZLIB_INCLUDE=${COLUMBUS_3RDPARTY_INSTALL_DIR}/include -sZLIB_LIBPATH=${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib -sZLIB_BINARY=z -sNO_ZLIB=0 -sNO_BZIP2=1 headers
COMMAND ${COMMAND_PREFIX}b2 --reconfigure --build-dir=${CMAKE_CURRENT_BINARY_DIR}/boost-prefix --prefix=${COLUMBUS_3RDPARTY_INSTALL_DIR} -j8 --with-filesystem --with-system --with-date_time --with-iostreams --with-graph --with-regex --with-thread --with-math --layout=system variant=$<$<CONFIG:Debug>:debug>$<$<CONFIG:Release>:release> runtime-link=static architecture=x86 threading=multi ${BOOST_ADDRESS_MODEL} link=static -sZLIB_INCLUDE=${COLUMBUS_3RDPARTY_INSTALL_DIR}/include -sZLIB_LIBPATH=${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib -sZLIB_BINARY=z -sNO_ZLIB=0 -sNO_BZIP2=1 install
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "No sepearate installation step is needed."
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)

# This extra rename step is needed on windows to rename the libraries to be compatible with the CMake library naming convention.
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
set (BOOST_LIBRARY_NAMES_TO_RENAME
iostreams
graph
date_time
chrono
math_c99
math_c99f
math_c99l
math_tr1
math_tr1f
math_tr1l
regex
system
filesystem
thread
)

foreach (LIB ${BOOST_LIBRARY_NAMES_TO_RENAME})
set (BOOST_RENAME_COMMAND ${BOOST_RENAME_COMMAND} COMMAND ${CMAKE_COMMAND} -E rename "${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib/libboost_${LIB}.lib" "${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib/boost_${LIB}.lib")
endforeach()

ExternalProject_Add_Step (boost rename
DEPENDEES BUILD INSTALL
${BOOST_RENAME_COMMAND}
LOG 1
)
endif ()


########################### xerces-c #########################

if (CMAKE_SYSTEM_NAME STREQUAL Linux)
ExternalProject_Add( xerces-c
SVN_REPOSITORY https://svn.apache.org/repos/asf/xerces/c/tags/Xerces-C_3_1_4
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
CONFIGURE_COMMAND ./reconf
COMMAND ./configure --disable-shared -disable-network --disable-transcoder-icu --prefix=${COLUMBUS_3RDPARTY_INSTALL_DIR}
BUILD_COMMAND make -j8 all
INSTALL_COMMAND make install
LOG_DOWNLOAD 1
LOG_UPDATE 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)

elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)

if (COLUMBUS_64BIT)
set (XERCESC_BUILD_OUTPUT_DIR Win64)
else()
set (XERCESC_BUILD_OUTPUT_DIR Win32)
endif ()

ExternalProject_Add( xerces-c
SVN_REPOSITORY https://svn.apache.org/repos/asf/xerces/c/tags/Xerces-C_3_1_4
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo "No configuration is required."
BUILD_COMMAND msbuild projects/Win32/VC14/xerces-all/xerces-all.sln /m /t:XercesLib "/p:Configuration=Static $<CONFIG>" /p:Platform=${VS_PLATFORM} /p:PlatformToolset=${CMAKE_VS_PLATFORM_TOOLSET}
INSTALL_COMMAND ${CMAKE_COMMAND} "-DCOPY_SOURCE=${CMAKE_CURRENT_BINARY_DIR}/xerces-c-prefix/src/xerces-c/src/xercesc/" "-DCOPY_TARGET=${COLUMBUS_3RDPARTY_INSTALL_DIR}/include/xercesc" -DCOPY_PATTERN=*.hpp -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/SearchAndCopyFiles.cmake
COMMAND ${CMAKE_COMMAND} "-DCOPY_SOURCE=${CMAKE_CURRENT_BINARY_DIR}/xerces-c-prefix/src/xerces-c/src/xercesc/" "-DCOPY_TARGET=${COLUMBUS_3RDPARTY_INSTALL_DIR}/include/xercesc" -DCOPY_PATTERN=*.c -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/SearchAndCopyFiles.cmake
COMMAND ${CMAKE_COMMAND} -E copy "Build/${XERCESC_BUILD_OUTPUT_DIR}/VC14/Static $<CONFIG>/xerces-c_static_3$<$<CONFIG:Debug>:d>.lib" ${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib/xerces-c.lib
LOG_DOWNLOAD 1
LOG_UPDATE 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)
endif ()

########################### PMD #########################

set (PMD_PACKAGE_VERSION pmd-bin-5.2.3)
set (PMD_DIST_PACKAGE ${CMAKE_CURRENT_SOURCE_DIR}/PMD/pmd-dist/target/${PMD_PACKAGE_VERSION}.zip)
set (PMD_PACKAGE ${COLUMBUS_3RDPARTY_INSTALL_DIR}/PMD.zip)

add_custom_command (
OUTPUT ${PMD_PACKAGE}
COMMAND mvn${MVN_POSTFIX} package -DskipTests > ${CMAKE_CURRENT_BINARY_DIR}/PMD-build.log
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/PMD/pmd-dist/target/ ${CMAKE_COMMAND} -E remove_directory PMD
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/PMD/pmd-dist/target/ ${CMAKE_COMMAND} -E tar xf ${PMD_DIST_PACKAGE}
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/PMD/pmd-dist/target/ ${CMAKE_COMMAND} -E rename ${PMD_PACKAGE_VERSION} PMD
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/PMD/pmd-dist/target/ ${CMAKE_COMMAND} -E tar cf ${PMD_DIST_PACKAGE} --format=zip PMD
COMMAND ${CMAKE_COMMAND} -E copy ${PMD_DIST_PACKAGE} ${PMD_PACKAGE}
COMMENT "Building PMD"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/PMD
)

add_custom_target (
PMD
DEPENDS ${PMD_PACKAGE}
)

set_target_properties (PMD PROPERTIES FOLDER "ExternalProjectTargets/pmd")
1 change: 1 addition & 0 deletions 3rdparty/PMD
Submodule PMD added at 7792e3
1 change: 1 addition & 0 deletions 3rdparty/boost
Submodule boost added at 13f154
Binary file added 3rdparty/findbugs/findbugs-3.0.0.tar.gz
Binary file not shown.
Binary file added 3rdparty/jars/ant-1.6.5.jar
Binary file not shown.
Binary file added 3rdparty/jars/guessencoding-1.4.jar
Binary file not shown.
Binary file added 3rdparty/jars/jewelcli-0.8.5.jar
Binary file not shown.
Binary file added 3rdparty/jars/logback-classic-1.0.13.jar
Binary file not shown.
Binary file added 3rdparty/jars/logback-core-1.0.13.jar
Binary file not shown.
Binary file added 3rdparty/jars/slf4j-api-1.7.5.jar
Binary file not shown.
1 change: 1 addition & 0 deletions 3rdparty/zlib
Submodule zlib added at cacf7f
21 changes: 21 additions & 0 deletions CMake/BuildInfo.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

set (BUILD_INFO_FILE ${CMAKE_BINARY_DIR}/BuildInfo.txt)
set (BUILD_INFO_H_FILE ${CMAKE_BINARY_DIR}/BuildInfo.h)

add_custom_command (
OUTPUT ${BUILD_INFO_FILE} ${BUILD_INFO_H_FILE}
COMMAND git rev-parse --short HEAD > ${BUILD_INFO_FILE}
COMMAND ${CMAKE_COMMAND} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_MODULE_PATH}/GenerateBuildInfoH.cmake
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/.git/HEAD
)

add_custom_target (
generate_build_info ALL
DEPENDS ${BUILD_INFO_FILE} ${BUILD_INFO_H_FILE}
)

set_target_properties (generate_build_info PROPERTIES FOLDER ${CMAKE_SUPPORT_FOLDER_NAME})



77 changes: 77 additions & 0 deletions CMake/CodebaseOptions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

# Global options required for compiling the code base
configure_file (config/columbus_config.h.in columbus_config.h)
include_directories (${CMAKE_BINARY_DIR})
include_directories (${CMAKE_BINARY_DIR}/lib)
include_directories (${CMAKE_SOURCE_DIR}/inc)
include_directories (${CMAKE_SOURCE_DIR}/lib)
include_directories (${CMAKE_SOURCE_DIR}/wrapper)

# Compiler standard options
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_EXTENSIONS OFF)

option (STRIP "Strip all symbols from the binaries" OFF)

# Compiler warning settings
if (MSVC)
# For ninja builds on windows we set the CMAKE_VS_PLATFORM_TOOLSET to V140 (VS2015)
if (NOT CMAKE_VS_PLATFORM_TOOLSET)
set (CMAKE_VS_PLATFORM_TOOLSET V140 CACHE STRING "" FORCE)
endif ()

# Disable some common compiler warnings end enable parallel build
set (EXTRA_COMPILER_OPTIONS "/wd4996 /wd4267 /wd4786 /wd4996 /MP /EHsc")

# In Release builds enable Whole Program Optimization and Compile Time Code Generation
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
set (CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")

# The MSVCRT library is the DLL version of the CRT. (/MD) Since we use static CRT no MSVCRT is needed.
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:MSVCRT")

# The MSVCRTD library is the debug DLL version of the CRT. (/MDd) Since we use static CRT no MSVCRTD is needed.
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRTD")

# Replace the default MultiThreadedDLL runtime to MultiThreaded.
replace_compiler_options (/MD /MT)
replace_compiler_options (/MDd /MTd)

# Set some global macro definitions requred for use boost and xerces
add_definitions(-DBOOST_ALL_NO_LIB -DXERCES_STATIC_LIBRARY)

elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)

# Enable compiler warnings
set (EXTRA_COMPILER_OPTIONS "-Wall")

if (STRIP)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s")
endif ()

set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc")

endif ()

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILER_OPTIONS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILER_OPTIONS}")

# Common global dependencies
set (COLUMBUS_GLOBAL_DEPENDENCY generate_build_info)

set (COLUMBUS_3RDPARTY_INSTALL_DIR ${CMAKE_BINARY_DIR}/3rdparty/install)
set (COLUMBUS_3RDPARTY_SOURCE_DIR ${CMAKE_SOURCE_DIR}/3rdparty)

include_directories (SYSTEM ${COLUMBUS_3RDPARTY_INSTALL_DIR}/include)
link_directories (${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib)

if (CMAKE_SYSTEM_NAME STREQUAL Windows)
set (MVN_POSTFIX .bat)
set (GRADLE_POSTFIX .bat)
endif ()



11 changes: 11 additions & 0 deletions CMake/ConfigureFile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@


# Expected input variables:
# INPUT_FILE_NAME
# OUTPUT_FILE_NAME
# TEMPLATE_VARIABLE_NAME
# TEMPLATE_VARIABLE_VALUE_FILE

file (READ ${TEMPLATE_VARIABLE_VALUE_FILE} ${TEMPLATE_VARIABLE_NAME})
string (STRIP "${${TEMPLATE_VARIABLE_NAME}}" ${TEMPLATE_VARIABLE_NAME})
configure_file(${INPUT_FILE_NAME} ${OUTPUT_FILE_NAME})
9 changes: 9 additions & 0 deletions CMake/GenerateBuildInfoH.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

file(STRINGS ${BINARY_DIR}/BuildInfo.txt BUILD_NUMBER)

file(WRITE ${BINARY_DIR}/BuildInfo.h
"#ifndef _BUILD_INFO_H_\n"
"#define _BUILD_INFO_H_\n"
"#define REVISION_NUMBER \"${BUILD_NUMBER}\"\n"
"#endif\n"
)
29 changes: 29 additions & 0 deletions CMake/PlatformOptions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@


set (COLUMBUS_64BIT FALSE)

if (((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CL_64) OR (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64))
set (COLUMBUS_64BIT TRUE)
endif ()

if (COLUMBUS_64BIT)
set (COLUMBUS_PLATFORM_NAME x64)
set (VS_PLATFORM x64)
set (VS_PLATFORM_DIR x64/)
else ()
set (COLUMBUS_PLATFORM_NAME x86)
set (VS_PLATFORM WIN32)
set (VS_PLATFORM_DIR )
endif ()

if (CMAKE_SYSTEM_NAME STREQUAL Windows)
set (SCRIPT_EXT .bat)
elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)
set (SCRIPT_EXT .sh)
set (COMMAND_PREFIX ./)
else ()
message (FATAL_ERROR "Unknown system:${CMAKE_SYSTEM_NAME}")
endif()

set (COLUMBUS_PLATFORM_DEPENDENT_DIR ${COLUMBUS_PLATFORM_NAME})
set (EXE ${CMAKE_EXECUTABLE_SUFFIX})
Loading

0 comments on commit 4c08bdd

Please sign in to comment.