Newer
Older
#
# @author Tobias Weber
# @date jan-2019
# @license GPLv3, see 'LICENSE' file
#
cmake_minimum_required(VERSION 3.0)
project(magstructfact)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
# system specific settings
message("Building for ${CMAKE_SYSTEM_NAME} systems.")
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# pass linker --subsystem option
add_compile_options(-Wl,--subsystem,windows)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_compile_options(-mmacosx-version-min=10.10)
endif()
find_package(Boost REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets OpenGL)
set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTOMOC TRUE)
set(CMAKE_CXX_STANDARD 20)
add_definitions(-std=c++20)
add_definitions(${Boost_CXX_FLAGS})
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)
add_definitions(-DBUILD_LIB)
magstructfact.cpp magstructfact.h
../../tlibs2/libs/glplot.cpp ../../tlibs2/libs/glplot.h)
magstructfact.cpp magstructfact.h
../../tlibs2/libs/glplot.cpp ../../tlibs2/libs/glplot.h)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_link_options(takin_magstructfact
# create an __info_plist section in the binary
PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,${PROJECT_SOURCE_DIR}/../../setup_mac/InfoMagStructFact.plist
target_link_libraries(takin_magstructfact ${Boost_LIBRARIES})
qt5_use_modules(takin_magstructfact Core Gui Widgets OpenGL)