CMakeLists.txt 2.38 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
9
10
#
# Contributors:
11
12
#   Alexander J. McCaskey - initial API and implementation 
# *******************************************************************************/
13
14
15
16
17
set (PACKAGE_NAME "XACC Adiabatic Quantum Computing and Quantum Annealing Runtime")
set (PACKAGE_DESCIPTION "Runtime library for aqc and qa")

set (LIBRARY_NAME xacc-quantum-aqc)

18
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ir)
19
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/compiler)
20
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/compiler/default)
21
22

file (GLOB_RECURSE HEADERS *.hpp)
23
file (GLOB SRC *.cpp compiler/default/*.cpp)
24
25

# Set up dependencies to resources to track changes
26
usFunctionGetResourceSource(TARGET ${LIBRARY_NAME} OUT SRC)
27
# Generate bundle initialization code
28
usFunctionGenerateBundleInit(TARGET ${LIBRARY_NAME} OUT SRC)
29

30
#----
31

32
add_library(${LIBRARY_NAME} SHARED ${SRC})
33

34
35
set(_bundle_name xacc_quantum_aqc)
set_target_properties(${LIBRARY_NAME} PROPERTIES
36
37
38
39
40
41
42
  # 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)
43
  set_target_properties(${LIBRARY_NAME} PROPERTIES
44
45
46
47
48
49
    CXX_VISIBILITY_PRESET hidden
    VISIBILITY_INLINES_HIDDEN 1
    )
endif()

# Embed meta-data from a manifest.json file
50
usFunctionEmbedResources(TARGET ${LIBRARY_NAME}
51
  WORKING_DIRECTORY
52
    ${CMAKE_CURRENT_SOURCE_DIR}
53
54
55
56
  FILES
    manifest.json
  )

57
58
59
60
61
62
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()
63
target_link_libraries(${LIBRARY_NAME} ${Boost_LIBRARIES} ${CppUsLib} xacc cpprest ${OPENSSL_LIBRARIES})
64

65
66
add_subdirectory(ir)
add_subdirectory(compiler)
67

68
install(FILES ${HEADERS} DESTINATION include/quantum/aqc)
69
install(TARGETS ${LIBRARY_NAME} DESTINATION lib)
70
71