-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (47 loc) · 1.43 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
#
set(PACKAGE_NAME "sampleassembly")
if("${BUILDING_MCVINE}" STREQUAL "")
set(VERSION "0.1")
set(AUTHOR "Jiao Lin")
set(AUTHOR_EMAILE "[email protected]")
set(VENDOR "DANSE")
set(SUMMARY "Sample assembly representation")
set(LICENSE "BSD")
set(RPM_APP_GROUP "Development/Tools")
set(GITHUB_URL "https://github.com/danse-inelastic/sampleassembly")
# this is released with danse.ins packages
set(DEP_DANSE_PKGS "danse.ins")
#
cmake_minimum_required (VERSION 2.8)
project (${PACKAGE_NAME})
# get cmake_utils
execute_process(
COMMAND rm -rf cmake_utils
COMMAND git clone https://github.com/danse-inelastic/cmake_utils
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
set(CMAKE_MODULE_PATH ${PROJECT_BINARY_DIR}/cmake_utils)
# utils
include(System) # system info
include(Dirs) # directory structure
include(TestUtils)
# needs python
find_package ( PythonLibs REQUIRED )
find_package ( PythonInterp REQUIRED )
# python installation path
set(INSTALL_PY_PATH "${INSTALL_LIB_DIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
#
enable_testing()
endif()
# python
file(
COPY ${PACKAGE_NAME}
DESTINATION ${EXPORT_PYTHON}/
FILES_MATCHING PATTERN "*.py"
)
# tests
set(BUILD_TESTS_PATH ${TESTS_DIR}/${PACKAGE_NAME})
# copy tests to build
file(COPY tests/ DESTINATION ${BUILD_TESTS_PATH})
# add python tests
PYUNITTEST_ADD_TESTS_IN_DIR( ${BUILD_TESTS_PATH} ${PACKAGE_NAME})