CMakeLists.txt 3.07 KB
Newer Older
1
2
3
4
5
6
7
8
# *******************************************************************************
# Copyright (c) 2017 UT-Battelle, LLC.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v.10 which accompany this distribution. 
# The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 
# and the Eclipse Distribution License is available at 
# https://eclipse.org/org/documents/edl-v10.php
Mccaskey, Alex's avatar
Mccaskey, Alex committed
9
10
#
# Contributors:
11
12
#   Alexander J. McCaskey - initial API and implementation 
# *******************************************************************************/
13
14
15
16
17
set (PACKAGE_NAME "XACC Gate Model Quantum Computing Runtime")
set (PACKAGE_DESCIPTION "Runtime library for gate model quantum computing")

set (LIBRARY_NAME xacc-quantum-gate)

18
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/utils)
Mccaskey, Alex's avatar
Mccaskey, Alex committed
19
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ir)
20
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/compiler)
Mccaskey, Alex's avatar
Mccaskey, Alex committed
21
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ir/instructions)
22
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ir/algorithms)
23
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ir/transformations)
24
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/accelerator)
25
26

file (GLOB_RECURSE HEADERS *.hpp)
27
file (GLOB SRC *.cpp accelerator/*.cpp compiler/*.cpp ir/*.cpp ir/instructions/*.cpp utils/*.cpp ir/algorithms/*.cpp ir/transformations/*.cpp)
28
29
30
31
32

# Set up dependencies to resources to track changes
usFunctionGetResourceSource(TARGET ${LIBRARY_NAME} OUT SRC)
# Generate bundle initialization code
usFunctionGenerateBundleInit(TARGET ${LIBRARY_NAME} OUT SRC)
33
34

add_library(${LIBRARY_NAME} SHARED ${SRC})
35

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
set(_bundle_name xacc_quantum_gate)
set_target_properties(${LIBRARY_NAME} PROPERTIES
  # This is required for every bundle
  COMPILE_DEFINITIONS US_BUNDLE_NAME=${_bundle_name}
  # This is for convenience, used by other CMake functions
  US_BUNDLE_NAME ${_bundle_name}
  )

if(BUILD_SHARED_LIBS)
  set_target_properties(${LIBRARY_NAME} PROPERTIES
    CXX_VISIBILITY_PRESET hidden
    VISIBILITY_INLINES_HIDDEN 1
    )
endif()

# Embed meta-data from a manifest.json file
usFunctionEmbedResources(TARGET ${LIBRARY_NAME}
  WORKING_DIRECTORY
    ${CMAKE_CURRENT_SOURCE_DIR}
  FILES
    manifest.json
  )
Mccaskey, Alex's avatar
Mccaskey, Alex committed
58
59
  
link_directories(${Boost_LIBRARY_DIR})
60

61
62
63
64
65
66
set(CppUsLib CppMicroServicesd)
link_directories(${CPPUS_LIBRARY_DIR})
find_library(cppus_has_d_suffix CppMicroServicesd)
if (NOT cppus_has_d_suffix)
	set(CppUsLib CppMicroServices)
endif()
67
target_link_libraries(${LIBRARY_NAME} ${Boost_LIBRARIES} xacc ${CppUsLib} restclient-cpp) #cpprest ${OPENSSL_LIBRARIES})
Mccaskey, Alex's avatar
Mccaskey, Alex committed
68

69
70
71
72
73
74
if (APPLE)
add_custom_command(TARGET xacc-quantum-gate
    POST_BUILD COMMAND 
    ${CMAKE_INSTALL_NAME_TOOL} -change "${CMAKE_INSTALL_PREFIX}/lib/librestclient-cpp.1.dylib" "@rpath/librestclient-cpp.1.dylib" $<TARGET_FILE:xacc-quantum-gate>)
endif()

75
add_subdirectory(compiler)
Mccaskey, Alex's avatar
Mccaskey, Alex committed
76
add_subdirectory(ir)
77
add_subdirectory(utils)
78
add_subdirectory(accelerator)
79

80
81
install(FILES ${HEADERS} DESTINATION include/quantum/gate)
install(TARGETS ${LIBRARY_NAME} DESTINATION lib)