Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
Takin
mag-core
Commits
f4c72536
Commit
f4c72536
authored
Jun 17, 2019
by
Tobias WEBER
Browse files
restructured tools
parent
cbf039a7
Changes
29
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
f4c72536
...
...
@@ -47,6 +47,7 @@ tmp/**
!tmp/.dir
build/**
tools/structfact/build/**
tools/cif2xml/build/**
tools/magstructfact/build/**
tools/magsgbrowser/build/**
tools/pol/build/**
...
...
CMakeLists.txt
View file @
f4c72536
#
# @author Tobias Weber <tweber@ill.fr>
# @date
6-apr
-201
8
# @date
17-jun
-201
9
# @license see 'LICENSE' file
#
cmake_minimum_required
(
VERSION 3.0
)
project
(
in20tools
)
message
(
"Build type:
${
CMAKE_BUILD_TYPE
}
"
)
# setup tools
add_subdirectory
(
tools/setup
)
if
(
NOT
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
"Release"
)
set
(
CMAKE_VERBOSE_MAKEFILE TRUE
)
endif
()
# magnetic and nuclear structure tools
add_subdirectory
(
tools/structfact
)
add_subdirectory
(
tools/magstructfact
)
add_subdirectory
(
tools/magsgbrowser
)
add_subdirectory
(
tools/cif2xml
)
set
(
CMAKE_CXX_STANDARD 17
)
add_definitions
(
-std=c++17
)
# polarisation tools
add_subdirectory
(
tools/pol
)
# -----------------------------------------------------------------------------
# Boost
find_package
(
Boost REQUIRED COMPONENTS system filesystem iostreams REQUIRED
)
add_definitions
(
${
Boost_CXX_FLAGS
}
)
# Qt
find_package
(
Qt5Core REQUIRED
)
find_package
(
Qt5Gui REQUIRED
)
find_package
(
Qt5Widgets REQUIRED
)
find_package
(
Qt5PrintSupport REQUIRED
)
set
(
CMAKE_AUTOMOC ON
)
set
(
CMAKE_AUTOUIC ON
)
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Build parser
find_package
(
FLEX REQUIRED
)
find_package
(
BISON 3.0 REQUIRED
)
# temp dir for parser
file
(
MAKE_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/parser
)
# parser
BISON_TARGET
(
cliparser tools/cli/cliparser.y
${
CMAKE_CURRENT_BINARY_DIR
}
/parser/cliparser_impl.cpp
COMPILE_FLAGS
"-S lalr1.cc --defines=
${
CMAKE_CURRENT_BINARY_DIR
}
/parser/cliparser_impl.h"
)
# lexer
FLEX_TARGET
(
clilexer tools/cli/clilexer.l
${
CMAKE_CURRENT_BINARY_DIR
}
/parser/clilexer_impl.cpp
COMPILE_FLAGS
"--c++ --header-file=
${
CMAKE_CURRENT_BINARY_DIR
}
/parser/clilexer_impl.h"
)
ADD_FLEX_BISON_DEPENDENCY
(
clilexer cliparser
)
# let moc ignore the generated files
set_property
(
SOURCE
parser/cliparser_impl.cpp parser/cliparser_impl.h parser/cliparser_impl.hpp
parser/clilexer_impl.cpp parser/clilexer_impl.h parser/clilexer_impl.hpp
PROPERTY SKIP_AUTOGEN ON
)
# -----------------------------------------------------------------------------
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
"
"
${
PROJECT_SOURCE_DIR
}
/ext"
"
${
Boost_INCLUDE_DIRS
}
"
"
${
Boost_INCLUDE_DIRS
}
/.."
"
${
PROJECT_SOURCE_DIR
}
/tools/cli"
"
${
PROJECT_BINARY_DIR
}
/parser"
)
add_executable
(
in20
tools/in20/main.cpp tools/in20/mainwnd.cpp tools/in20/mainwnd.h
tools/in20/filebrowser.cpp tools/in20/filebrowser.h
tools/in20/workspace.cpp tools/in20/workspace.h
tools/in20/data.cpp tools/in20/data.h
tools/in20/plot.cpp tools/in20/plot.h
tools/in20/command.cpp tools/in20/command.h
tools/in20/globals.cpp tools/in20/globals.h
${
BISON_cliparser_OUTPUT_SOURCE
}
${
BISON_cliparser_OUTPUT_HEADER
}
${
FLEX_clilexer_OUTPUTS
}
${
FLEX_clilexer_OUTPUT_HEADER
}
tools/cli/cliparser.cpp tools/cli/cliparser.h tools/cli/cliparser_types.h
tools/cli/ast.cpp tools/cli/sym.cpp
tools/cli/funcs.cpp tools/cli/funcs.h
libs/log.cpp
ext/qcp/qcustomplot.cpp ext/qcp/qcustomplot.h
)
target_link_libraries
(
in20
${
Boost_LIBRARIES
}
Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport
-ldl
)
# main tool
add_subdirectory
(
tools/main
)
env.sh
View file @
f4c72536
...
...
@@ -3,5 +3,5 @@
#export CC=clang
#export CXX=clang++
export
CC
=
gcc-
8
export
CXX
=
g++-
8
export
CC
=
gcc-
9
export
CXX
=
g++-
9
tools/cif2xml/CMakeLists.txt
0 → 100644
View file @
f4c72536
#
# @author Tobias Weber
# @date dec-2018
# @license GPLv3, see 'LICENSE' file
#
cmake_minimum_required
(
VERSION 3.0
)
project
(
cif2xml
)
set
(
CMAKE_VERBOSE_MAKEFILE TRUE
)
find_package
(
Boost REQUIRED
)
set
(
CMAKE_CXX_STANDARD 20
)
add_definitions
(
-std=c++2a -fconcepts
)
add_definitions
(
${
Boost_CXX_FLAGS
}
)
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
"
"
${
Boost_INCLUDE_DIRS
}
/.."
"../.."
"../../ext/gemmi/include"
"../../ext/gemmi/third_party"
"ext"
"ext/gemmi/include"
"ext/gemmi/third_party"
)
add_executable
(
cif2xml
cif2xml.cpp ../structfact/loadcif.h
)
target_link_libraries
(
cif2xml
# -static-libstdc++ -static-libgcc
)
tools/
structfact
/cif2xml.cpp
→
tools/
cif2xml
/cif2xml.cpp
View file @
f4c72536
...
...
@@ -5,7 +5,7 @@
* @license GPLv3, see 'LICENSE' file
*/
#include "loadcif.h"
#include "
../structfact/
loadcif.h"
#include "libs/_cxx20/math_algos.h"
#include <gemmi/version.hpp>
...
...
tools/cli/ast.cpp
View file @
f4c72536
...
...
@@ -6,7 +6,7 @@
*/
#include "cliparser.h"
#include "tools/in
20
/globals.h"
#include "tools/
ma
in/globals.h"
#include "funcs.h"
#include <cmath>
...
...
tools/cli/cliparser.h
View file @
f4c72536
...
...
@@ -20,7 +20,7 @@
#include "cliparser_types.h"
#include "cliparser_impl.h"
#include "tools/in
20
/data.h"
#include "tools/
ma
in/data.h"
class
CliAST
;
...
...
tools/cli/cliparser.y
View file @
f4c72536
...
...
@@ -5,10 +5,12 @@
* @license see 'LICENSE' file
*/
%define parser_class_name { CliParser }
//%define parser_class_name { CliParser }
%define api.parser.class { CliParser }
%define api.value.type variant
%define api.token.constructor
%error-verbose
//%error-verbose
%define parse.error verbose
%code requires { #include "cliparser_types.h" }
%code { #include "cliparser.h" }
...
...
tools/cli/funcs.cpp
View file @
f4c72536
...
...
@@ -6,7 +6,7 @@
*/
#include "funcs.h"
#include "tools/in
20
/globals.h"
#include "tools/
ma
in/globals.h"
#include "libs/phys.h"
...
...
tools/cli/sym.cpp
View file @
f4c72536
...
...
@@ -6,7 +6,7 @@
*/
#include "cliparser.h"
#include "tools/in
20
/globals.h"
#include "tools/
ma
in/globals.h"
#include "funcs.h"
#include "libs/algos.h"
#include "libs/str.h"
...
...
tools/magstructfact/CMakeLists.txt
View file @
f4c72536
...
...
@@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.0)
project
(
magstructfact
)
set
(
CMAKE_VERBOSE_MAKEFILE TRUE
)
set
(
BUILD_LIB FALSE
)
option
(
BUILD_LIB
"build as dynamic library"
FALSE
)
find_package
(
Boost REQUIRED
)
find_package
(
Qt5 REQUIRED COMPONENTS Core Gui Widgets OpenGL
)
...
...
@@ -20,8 +20,11 @@ set(CMAKE_CXX_STANDARD 17)
add_definitions
(
-std=c++17 -fconcepts
)
add_definitions
(
${
Boost_CXX_FLAGS
}
)
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
"
"
${
Boost_INCLUDE_DIRS
}
/.."
"../.."
"../../ext/gemmi/include"
"../../ext/gemmi/third_party"
)
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
"
"
${
Boost_INCLUDE_DIRS
}
/.."
"../.."
"ext"
"ext/gemmi/include"
"ext/gemmi/third_party"
"../../ext/gemmi/include"
"../../ext/gemmi/third_party"
)
if
(
BUILD_LIB
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE TRUE
)
...
...
tools/main/CMakeLists.txt
0 → 100644
View file @
f4c72536
#
# @author Tobias Weber <tweber@ill.fr>
# @date 6-apr-2018
# @license see 'LICENSE' file
#
cmake_minimum_required
(
VERSION 3.0
)
project
(
in20tools
)
message
(
"Build type:
${
CMAKE_BUILD_TYPE
}
"
)
if
(
NOT
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
"Release"
)
set
(
CMAKE_VERBOSE_MAKEFILE TRUE
)
endif
()
set
(
CMAKE_CXX_STANDARD 17
)
add_definitions
(
-std=c++17
)
# -----------------------------------------------------------------------------
# Boost
find_package
(
Boost REQUIRED COMPONENTS system filesystem iostreams REQUIRED
)
add_definitions
(
${
Boost_CXX_FLAGS
}
)
# Qt
find_package
(
Qt5Core REQUIRED
)
find_package
(
Qt5Gui REQUIRED
)
find_package
(
Qt5Widgets REQUIRED
)
find_package
(
Qt5PrintSupport REQUIRED
)
set
(
CMAKE_AUTOMOC ON
)
set
(
CMAKE_AUTOUIC ON
)
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Build parser
find_package
(
FLEX REQUIRED
)
find_package
(
BISON 3.0 REQUIRED
)
# temp dir for parser
file
(
MAKE_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/parser
)
# parser
BISON_TARGET
(
cliparser ../cli/cliparser.y
${
CMAKE_CURRENT_BINARY_DIR
}
/parser/cliparser_impl.cpp
COMPILE_FLAGS
"-S lalr1.cc --defines=
${
CMAKE_CURRENT_BINARY_DIR
}
/parser/cliparser_impl.h"
)
# lexer
FLEX_TARGET
(
clilexer ../cli/clilexer.l
${
CMAKE_CURRENT_BINARY_DIR
}
/parser/clilexer_impl.cpp
COMPILE_FLAGS
"--c++ --header-file=
${
CMAKE_CURRENT_BINARY_DIR
}
/parser/clilexer_impl.h"
)
ADD_FLEX_BISON_DEPENDENCY
(
clilexer cliparser
)
# let moc ignore the generated files
set_property
(
SOURCE
parser/cliparser_impl.cpp parser/cliparser_impl.h parser/cliparser_impl.hpp
parser/clilexer_impl.cpp parser/clilexer_impl.h parser/clilexer_impl.hpp
PROPERTY SKIP_AUTOGEN ON
)
# -----------------------------------------------------------------------------
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
"
"
${
PROJECT_SOURCE_DIR
}
/ext"
"
${
PROJECT_SOURCE_DIR
}
/tools/cli"
"
${
PROJECT_SOURCE_DIR
}
/../.."
"
${
PROJECT_SOURCE_DIR
}
/../../ext"
"
${
PROJECT_SOURCE_DIR
}
/../../tools/cli"
"
${
Boost_INCLUDE_DIRS
}
"
"
${
Boost_INCLUDE_DIRS
}
/.."
"
${
PROJECT_BINARY_DIR
}
/parser"
)
add_executable
(
in20
main.cpp mainwnd.cpp mainwnd.h
filebrowser.cpp filebrowser.h
workspace.cpp workspace.h
data.cpp data.h plot.cpp plot.h
command.cpp command.h
globals.cpp globals.h
${
BISON_cliparser_OUTPUT_SOURCE
}
${
BISON_cliparser_OUTPUT_HEADER
}
${
FLEX_clilexer_OUTPUTS
}
${
FLEX_clilexer_OUTPUT_HEADER
}
../cli/cliparser.cpp ../cli/cliparser.h ../cli/cliparser_types.h
../cli/ast.cpp ../cli/sym.cpp
../cli/funcs.cpp ../cli/funcs.h
../../libs/log.cpp
../../ext/qcp/qcustomplot.cpp ../../ext/qcp/qcustomplot.h
)
target_link_libraries
(
in20
${
Boost_LIBRARIES
}
Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport
-ldl
)
tools/in
20
/command.cpp
→
tools/
ma
in/command.cpp
View file @
f4c72536
File moved
tools/in
20
/command.h
→
tools/
ma
in/command.h
View file @
f4c72536
File moved
tools/in
20
/data.cpp
→
tools/
ma
in/data.cpp
View file @
f4c72536
File moved
tools/in
20
/data.h
→
tools/
ma
in/data.h
View file @
f4c72536
File moved
tools/in
20
/filebrowser.cpp
→
tools/
ma
in/filebrowser.cpp
View file @
f4c72536
File moved
tools/in
20
/filebrowser.h
→
tools/
ma
in/filebrowser.h
View file @
f4c72536
File moved
tools/in
20
/globals.cpp
→
tools/
ma
in/globals.cpp
View file @
f4c72536
File moved
tools/in
20
/globals.h
→
tools/
ma
in/globals.h
View file @
f4c72536
File moved
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment