1# $Id: ConfigureMT.cmake 149 2009-11-12 02:40:41Z tplante $
2# $URL: https://software.sandia.gov/svn/hopspack/trunk/ConfigureMT.cmake $
3#
4# ************************************************************************
5#         HOPSPACK: Hybrid Optimization Parallel Search Package
6#                 Copyright 2009 Sandia Corporation
7#
8#   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9#   the U.S. Government retains certain rights in this software.
10# ************************************************************************
11
12
13#---- Define a boolean user option "mt" that can be set from the
14#---- command line ("-Dmt=true" or "=on" or "=yes"),
15#---- or from the CMake cache.
16
17OPTION (mt "TRUE means compile and link with multi-thread capability" FALSE)
18
19#---- If FALSE then do not link MT.
20#----
21#---- If TRUE, then on return sets the variables:
22#----   MT_FOUND        - for linking
23#----   OPSYS_LIBRARIES - for linking
24#----   HAVE_MT         - for header files
25
26
27#-------------------------------------------------------------------------
28IF (mt)
29#-------------------------------------------------------------------------
30
31   SET (MT_FOUND TRUE)
32
33   INCLUDE (FindThreads)
34   SET (OPSYS_LIBRARIES ${OPSYS_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
35
36   #---- The HOPSPACK header file needs to know that MPI is used.
37   SET (HAVE_MT TRUE)
38
39   MESSAGE (STATUS "HOPSPACK: Building with multi-thread capability.")
40
41
42#-------------------------------------------------------------------------
43ENDIF (mt)
44#-------------------------------------------------------------------------
45