diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d77e8d2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/srcSAX"] + path = src/srcSAX + url = https://github.com/srcML/srcSAX.git diff --git a/CMake/config.cmake b/CMake/config.cmake new file mode 100644 index 0000000..e1165b5 --- /dev/null +++ b/CMake/config.cmake @@ -0,0 +1,37 @@ +## +# config.cmake +# +# Copyright (C) 2014-2015 SDML (www.sdml.info) +# +# This file is part of the srcSlice. +# +# The srcSlice is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# The srcSlice is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the srcSlice; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Build configuration file + +# build options +#option(BUILD_UNIT_TESTS "Build unit tests for srcSlice" ON) +#option(BUILD_EXAMPLES "Build example tests for srcSlice" ON) + +# find needed libraries +find_package(LibXml2 REQUIRED) + +# include needed includes +include_directories(${LIBXML2_INCLUDE_DIR}) +add_definitions("-std=c++0x -O3") + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) diff --git a/CMake/install.cmake b/CMake/install.cmake new file mode 100644 index 0000000..116dc16 --- /dev/null +++ b/CMake/install.cmake @@ -0,0 +1,24 @@ +## +# install.cmake +# +# Copyright (C) 2014-2015 SDML (www.sdml.info) +# +# This file is part of the srcSlice. +# +# The srcSlice is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# The srcSlice is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the srcSlice; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +if(NOT WIN32) +set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() diff --git a/CMake/srcslice.cmake b/CMake/srcslice.cmake new file mode 100644 index 0000000..ae71c64 --- /dev/null +++ b/CMake/srcslice.cmake @@ -0,0 +1,23 @@ +## +# srcslice.cmake +# +# Copyright (C) 2014 SDML (www.sdml.info) +# +# This file is part of the srcSlice. +# +# The srcSlice is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# The srcSlice is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the srcSlice; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +include(config) +include(install) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a33943..37032aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,35 @@ -set(CMAKE_CXX_FLAGS "-std=c++0x -O3") +## +# CMakeLists.txt +# +# Copyright (C) 2015 SDML (www.sdml.info) +# +# This file is part of the srcSlice. +# +# The srcSlice is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# The srcSlice is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the srcSlice; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Build configuration file -SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build) -SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build) +cmake_minimum_required(VERSION 2.8) +project(srcSlice) -include_directories(${LIBXML2_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/srcSAX/src/srcsax ${CMAKE_SOURCE_DIR}/srcSAX/src/cpp src/headers src/cpp) +enable_testing() + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake) +include(srcslice) + +include_directories(src/headers src/cpp + src/srcSAX/src/srcsax src/srcSAX/src/cpp src/srcSAX/src/windows) add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4cda752..6d4887d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ -file(GLOB SRCSAXHANDLER_SOURCE ../../srcSAX/src/srcsax/*.cpp ../../srcSAX/src/cpp/*.cpp) -file(GLOB SRCSAXHANDLER_INCLUDE ../../srcSAX/src/srcsax/*.h* ../../srcSAX/src/cpp/*.h*) +add_subdirectory(srcSAX/src) + file(GLOB SRCSLICEHANDLER_SOURCE cpp/*.cpp) file(GLOB SRCSLICEHANDLER_INCLUDE headers/*.hpp) diff --git a/src/srcSAX b/src/srcSAX new file mode 160000 index 0000000..6032c5c --- /dev/null +++ b/src/srcSAX @@ -0,0 +1 @@ +Subproject commit 6032c5c3623d7f1ff4192b5ae3c4056a383251d6