CMakeLists.txt 1.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#
# @author Tobias Weber
# @date jan-2019
# @license GPLv3, see 'LICENSE' file
#

cmake_minimum_required(VERSION 3.0)
project(magstructfact)

set(CMAKE_VERBOSE_MAKEFILE TRUE)
Tobias WEBER's avatar
Tobias WEBER committed
11
option(BUILD_LIB "build as dynamic library" FALSE)
12
13
14
15
16
17
18

find_package(Boost REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets OpenGL)

set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTOMOC TRUE)

Tobias WEBER's avatar
Tobias WEBER committed
19
20
set(CMAKE_CXX_STANDARD 20)
add_definitions(-std=c++20)
21
22
add_definitions(${Boost_CXX_FLAGS})

Tobias WEBER's avatar
Tobias WEBER committed
23
24
25
26
27
include_directories(
	"${PROJECT_SOURCE_DIR}" "${Boost_INCLUDE_DIRS}/.." "../.."
	"ext" "ext/gemmi/include" "ext/gemmi/third_party"
	"../../ext/gemmi/include" "../../ext/gemmi/third_party"
)
28
29
30
31
32

if(BUILD_LIB)
	set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)

	add_definitions(-DBUILD_LIB)
Tobias WEBER's avatar
Tobias WEBER committed
33
	add_library(takin_magstructfact SHARED
34
		magstructfact.cpp magstructfact.h
35
		../../tlibs2/libs/glplot.cpp ../../tlibs2/libs/glplot.h)
36
else()
Tobias WEBER's avatar
Tobias WEBER committed
37
	add_executable(takin_magstructfact
38
		magstructfact.cpp magstructfact.h
39
		../../tlibs2/libs/glplot.cpp ../../tlibs2/libs/glplot.h)
40
41
endif()

Tobias WEBER's avatar
Tobias WEBER committed
42
43
target_link_libraries(takin_magstructfact ${Boost_LIBRARIES})
qt5_use_modules(takin_magstructfact Core Gui Widgets OpenGL)