Fix potential problem in Messenger related to MPI window
[hoomd-blue.git] / CMakeLists.txt
blob4df01c3002f585244e4f92e593976adc5966bf5f
1 # Maintainer: joaander
3 if (WIN32)
4 # require cmake 2.8 for add_test(NAME COMMAND) form on windows
5 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
6 else (WIN32)
7 # require cmake 2.6.2 for findCUDA.cmake
8 CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2 FATAL_ERROR)
9 endif (WIN32)
11 if (CMAKE_MAJOR_VERSION VERSION_GREATER 2)
12 if(COMMAND cmake_policy)
13     cmake_policy(SET CMP0003 NEW)
14     cmake_policy(SET CMP0026 OLD)
15     cmake_policy(SET CMP0042 OLD)
16 endif(COMMAND cmake_policy)
17 endif()
19 project (HOOMD)
21 # setup the install directories
22 include (CMake_install_options.cmake)
23 # bring in custom modules
24 add_subdirectory (CMake)
25 # setup version tagging info
26 include (CMake_version_options.cmake)
28 message(STATUS "Configuring HOOMD ${HOOMD_VERSION_LONG}")
30 # Handle user build options
31 include (CMake_build_options.cmake)
32 #################################
33 ## setup python library and executable
34 # setup MPI support
35 include (HOOMDMPISetup)
36 # find the python libraries to link to
37 include(HOOMDPythonSetup)
38 # Find the boost libraries and set them up
39 include (HOOMDBoostSetup)
40 # Find CUDA and set it up
41 include (HOOMDCUDASetup)
42 # Set default CFlags
43 include (HOOMDCFlagsSetup)
44 # include some os specific options
45 include (HOOMDOSSpecificSetup)
46 # setup common libraries used by all targets in this project
47 include (HOOMDCommonLibsSetup)
48 # macros
49 include (HOOMDMacros)
50 # Configure some source files, include directories, and create variables listing all source files
51 include (CMake_src_setup.cmake)
52 # preprocessor flags
53 include (CMake_preprocessor_flags.cmake)
55 # setup the library compile mode
56 if(ENABLE_STATIC)
57     set(BUILD_SHARED_LIBS OFF)
58 else(ENABLE_STATIC)
59     set(BUILD_SHARED_LIBS ON)
60 endif(ENABLE_STATIC)
62 ################################
63 ## Process subdirectories
64 add_subdirectory (libhoomd)
65 add_subdirectory (share)
66 add_subdirectory (python-module)
67 add_subdirectory (python-runner)
69 ###############################
70 ## include documentation directories
71 if (ENABLE_DOXYGEN)
72     add_subdirectory (doc)
73 endif (ENABLE_DOXYGEN)
75 ################################
76 # set up unit tests
77 include(CTest)
78 mark_as_advanced(DART_TESTING_TIMEOUT)
79 if (BUILD_TESTING)
80     # add test_all to the ALL target if requested (mainly for automatic test
81     # suites)
82     if (ENABLE_TEST_ALL)
83         set(_default_test_all ALL)
84     endif (ENABLE_TEST_ALL)
85     # setup convenience targets that prevent tests from always being built
86     add_custom_target(test_all ${_default_test_all})
87     add_dependencies(test_all hoomd)
88     add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
89     add_dependencies(check test_all)
90     add_subdirectory (test)
91 endif (BUILD_TESTING)
93 add_subdirectory (packaging)