110448Snilay@cs.wisc.edu# Copyright (c) 2014 Mark D. Hill and David A. Wood
210448Snilay@cs.wisc.edu# All rights reserved.
310448Snilay@cs.wisc.edu#
410448Snilay@cs.wisc.edu# Redistribution and use in source and binary forms, with or without
510448Snilay@cs.wisc.edu# modification, are permitted provided that the following conditions are
610448Snilay@cs.wisc.edu# met: redistributions of source code must retain the above copyright
710448Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer;
810448Snilay@cs.wisc.edu# redistributions in binary form must reproduce the above copyright
910448Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer in the
1010448Snilay@cs.wisc.edu# documentation and/or other materials provided with the distribution;
1110448Snilay@cs.wisc.edu# neither the name of the copyright holders nor the names of its
1210448Snilay@cs.wisc.edu# contributors may be used to endorse or promote products derived from
1310448Snilay@cs.wisc.edu# this software without specific prior written permission.
1410448Snilay@cs.wisc.edu#
1510448Snilay@cs.wisc.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1610448Snilay@cs.wisc.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1710448Snilay@cs.wisc.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1810448Snilay@cs.wisc.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1910448Snilay@cs.wisc.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2010448Snilay@cs.wisc.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2110448Snilay@cs.wisc.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2210448Snilay@cs.wisc.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2310448Snilay@cs.wisc.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2410448Snilay@cs.wisc.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2510448Snilay@cs.wisc.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2610448Snilay@cs.wisc.edu
2710448Snilay@cs.wisc.educmake_minimum_required (VERSION 2.6)
2810448Snilay@cs.wisc.edu
2910448Snilay@cs.wisc.eduproject (DSENT)
3010448Snilay@cs.wisc.edu# find out all the file that need to be compiled
3110448Snilay@cs.wisc.edufile(GLOB_RECURSE SRCS  "*.h" "*.cc")
3210448Snilay@cs.wisc.edu
3310448Snilay@cs.wisc.edu# add the library
3410448Snilay@cs.wisc.eduadd_library(dsent MODULE ${SRCS})
3510448Snilay@cs.wisc.edu
3610448Snilay@cs.wisc.eduSET(PYTHON_CONFIG "python-config")
3710448Snilay@cs.wisc.edu
3810448Snilay@cs.wisc.edu# add the binary tree to the search path for include files
3910448Snilay@cs.wisc.eduinclude_directories("${CMAKE_SOURCE_DIR}" "`${PYTHON_CONFIG} --includes`")
4010448Snilay@cs.wisc.eduEXEC_PROGRAM(${PYTHON_CONFIG} ARGS --cflags OUTPUT_VARIABLE PYTHON_CFLAGS)
4110448Snilay@cs.wisc.eduEXEC_PROGRAM(${PYTHON_CONFIG} ARGS --ldflags OUTPUT_VARIABLE PYTHON_LFLAGS)
4210448Snilay@cs.wisc.edu
4310448Snilay@cs.wisc.eduset_target_properties(dsent PROPERTIES
4410448Snilay@cs.wisc.edu        PREFIX ""
4510448Snilay@cs.wisc.edu        COMPILE_FLAGS "${PYTHON_CFLAGS} -std=c++11"
4610448Snilay@cs.wisc.edu        LINK_FLAGS "${PYTHON_LFLAGS}")
47