forked from harperic/hoomd-blue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
93 lines (82 loc) · 2.59 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Maintainer: joaander
if (WIN32)
# require cmake 2.8 for add_test(NAME COMMAND) form on windows
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
else (WIN32)
# require cmake 2.6.2 for findCUDA.cmake
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2 FATAL_ERROR)
endif (WIN32)
if (CMAKE_MAJOR_VERSION VERSION_GREATER 2)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0026 OLD)
cmake_policy(SET CMP0042 OLD)
endif(COMMAND cmake_policy)
endif()
project (HOOMD)
# setup the install directories
include (CMake_install_options.cmake)
# bring in custom modules
add_subdirectory (CMake)
# setup version tagging info
include (CMake_version_options.cmake)
message(STATUS "Configuring HOOMD ${HOOMD_VERSION_LONG}")
# Handle user build options
include (CMake_build_options.cmake)
#################################
## setup python library and executable
# setup MPI support
include (HOOMDMPISetup)
# find the python libraries to link to
include(HOOMDPythonSetup)
# Find the boost libraries and set them up
include (HOOMDBoostSetup)
# Find CUDA and set it up
include (HOOMDCUDASetup)
# Set default CFlags
include (HOOMDCFlagsSetup)
# include some os specific options
include (HOOMDOSSpecificSetup)
# setup common libraries used by all targets in this project
include (HOOMDCommonLibsSetup)
# macros
include (HOOMDMacros)
# Configure some source files, include directories, and create variables listing all source files
include (CMake_src_setup.cmake)
# preprocessor flags
include (CMake_preprocessor_flags.cmake)
# setup the library compile mode
if(ENABLE_STATIC)
set(BUILD_SHARED_LIBS OFF)
else(ENABLE_STATIC)
set(BUILD_SHARED_LIBS ON)
endif(ENABLE_STATIC)
################################
## Process subdirectories
add_subdirectory (libhoomd)
add_subdirectory (share)
add_subdirectory (python-module)
add_subdirectory (python-runner)
###############################
## include documentation directories
if (ENABLE_DOXYGEN)
add_subdirectory (doc)
endif (ENABLE_DOXYGEN)
################################
# set up unit tests
include(CTest)
mark_as_advanced(DART_TESTING_TIMEOUT)
if (BUILD_TESTING)
# add test_all to the ALL target if requested (mainly for automatic test
# suites)
if (ENABLE_TEST_ALL)
set(_default_test_all ALL)
endif (ENABLE_TEST_ALL)
# setup convenience targets that prevent tests from always being built
add_custom_target(test_all ${_default_test_all})
add_dependencies(test_all hoomd)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
add_dependencies(check test_all)
add_subdirectory (test)
endif (BUILD_TESTING)
add_subdirectory (packaging)