forked from OpenChemistry/avogadroapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
79 lines (62 loc) · 2.1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
# Use the new policy for linking to qtmain
if(POLICY CMP0020)
# cmake_policy(SET CMP0020 NEW)
endif()
project(AvogadroApp)
set(CMAKE_MODULE_PATH ${AvogadroApp_SOURCE_DIR}/cmake)
# Request C++11 standard, using new CMake variables.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_EXTENSIONS False)
# Set symbol visibility defaults for all targets.
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
set(CMAKE_VISIBILITY_INLINES_HIDDEN True)
include(BuildType)
include(BuildLocation)
include(CompilerFlags)
include(InstallLocation)
include(DetermineVersion)
# Set up our version.
set(AvogadroApp_VERSION_MAJOR "1")
set(AvogadroApp_VERSION_MINOR "90")
set(AvogadroApp_VERSION_PATCH "0")
set(AvogadroApp_VERSION
"${AvogadroApp_VERSION_MAJOR}.${AvogadroApp_VERSION_MINOR}.${AvogadroApp_VERSION_PATCH}")
find_package(Git)
determine_version(${AvogadroApp_SOURCE_DIR} ${GIT_EXECUTABLE} "AvogadroApp")
if(APPLE)
set(MACOSX_BUNDLE_NAME "Avogadro2")
set(prefix "${MACOSX_BUNDLE_NAME}.app/Contents")
set(INSTALL_INCLUDE_DIR "${prefix}/${INSTALL_INCLUDE_DIR}")
set(INSTALL_RUNTIME_DIR "${prefix}/MacOS")
set(INSTALL_LIBRARY_DIR "${prefix}/${INSTALL_LIBRARY_DIR}")
set(INSTALL_ARCHIVE_DIR "${prefix}/${INSTALL_ARCHIVE_DIR}")
set(INSTALL_DATA_DIR "${prefix}/${INSTALL_DATA_DIR}")
set(INSTALL_DOC_DIR "${prefix}/${INSTALL_DOC_DIR}")
set(INSTALL_CMAKE_DIR "${prefix}/Resources")
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
option(ENABLE_TESTING "Enable testing and building the tests." OFF)
if(ENABLE_TESTING)
include(CTest)
enable_testing()
endif()
option(Avogadro_ENABLE_RPC "Enable RPC server" ON)
add_subdirectory(avogadro)
option(BUILD_DOCUMENTATION "Build project documentation" OFF)
if(BUILD_DOCUMENTATION)
add_subdirectory(docs)
endif()
install(
FILES
README.md
CONTRIBUTING.md
COPYING
DESTINATION "${INSTALL_DOC_DIR}/avogadro2")
include(AvogadroCPack)
if(ENABLE_TESTING)
include(BuildPackageTest)
BuildPackageTest_Add("AvogadroApp" "${CMAKE_CURRENT_BINARY_DIR}")
add_subdirectory(tests)
endif()