forked from jesusvasquez333/smurf-processor-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
70 lines (55 loc) · 2.3 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
# ----------------------------------------------------------------------------
# Title : ROGUE Example Module CMAKE
# ----------------------------------------------------------------------------
# File : CMakeLists.txt
# Created : 2018-02-27
# ----------------------------------------------------------------------------
# This file is part of the rogue_example software. It is subject to
# the license terms in the LICENSE.txt file found in the top-level directory
# of this distribution and at:
# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
# No part of the rogue_example software, including this file, may be
# copied, modified, propagated, or distributed except according to the terms
# contained in the LICENSE.txt file.
# ----------------------------------------------------------------------------
# Check cmake version
cmake_minimum_required(VERSION 2.8)
include(InstallRequiredSystemLibraries)
# Project name
project (MyModule)
# C/C++
enable_language(CXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
# Boost Configuration
set(Boost_USE_MULTITHREADED ON)
# Boost may need help on SLAC machines
set(BOOST_ROOT:PATHNAME $ENV{BOOST_PATH})
# First try standard suffix for boost
find_package(Boost 1.58 COMPONENTS system thread python3)
# Next try Debian/Ubuntu suffix for boost
if (NOT Boost_FOUND)
find_package(Boost 1.58 REQUIRED COMPONENTS system thread python-py35)
endif()
# Find python3
find_package(PythonInterp 3 REQUIRED)
find_package(PythonLibs 3 REQUIRED)
# Find Rogue
set(Rogue_DIR $ENV{ROGUE_DIR}/lib)
find_package(Rogue REQUIRED)
# Find Rogue
set(Smurf_DIR $ENV{SMURF_DIR}/lib)
find_package(Smurf REQUIRED)
include_directories(/usr/local/include/)
include_directories(${ROGUE_INCLUDE_DIRS})
include_directories(${SMURF_INCLUDE_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR}/include/)
# Create rogue python library
AUX_SOURCE_DIRECTORY(src SRC_FILES)
add_library(MyModule SHARED ${SRC_FILES})
# Set output to TOP/lib, remove lib prefix
set_target_properties(MyModule PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set_target_properties(MyModule PROPERTIES PREFIX "")
# Link to rogue core
TARGET_LINK_LIBRARIES(MyModule LINK_PUBLIC ${ROGUE_LIBRARIES} ${SMURF_LIBRARIES})