4 # require cmake 2.8 for add_test(NAME COMMAND) form on windows
5 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
7 # require cmake 2.6.2 for findCUDA.cmake
8 CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2 FATAL_ERROR)
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)
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
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)
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)
50 # Configure some source files, include directories, and create variables listing all source files
51 include (CMake_src_setup.cmake)
53 include (CMake_preprocessor_flags.cmake)
55 # setup the library compile mode
57 set(BUILD_SHARED_LIBS OFF)
59 set(BUILD_SHARED_LIBS ON)
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
72 add_subdirectory (doc)
73 endif (ENABLE_DOXYGEN)
75 ################################
78 mark_as_advanced(DART_TESTING_TIMEOUT)
80 # add test_all to the ALL target if requested (mainly for automatic test
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)
93 add_subdirectory (packaging)