Commit 64ccfeb2 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

minor updates to cmake build

parent 3a9bf159
......@@ -28,6 +28,9 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERS
set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wimplicit-fallthrough=0")
endif()
include(ProcessorCount)
ProcessorCount(N)
ExternalProject_Add(cppmicroservices
GIT_REPOSITORY https://github.com/cppmicroservices/cppmicroservices
GIT_TAG v3.1.0
......@@ -35,7 +38,7 @@ ExternalProject_Add(cppmicroservices
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install # DESTDIR=${CMAKE_BINARY_DIR}/cppus_install
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} -j${N} install # DESTDIR=${CMAKE_BINARY_DIR}/cppus_install
)
set(CppMicroServices_BASE_DIR ${CMAKE_BINARY_DIR}/cppus_install/usr/local)
......@@ -60,7 +63,7 @@ ExternalProject_Add(xacc-core
-DCPPUS_LIBRARY_DIR=${CppMicroServices_LIBRARY_DIR}
CMAKE_CACHE_ARGS -DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
BUILD_ALWAYS 1
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install # DESTDIR=${CMAKE_BINARY_DIR}/stage
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} -j${N} install # DESTDIR=${CMAKE_BINARY_DIR}/stage
TEST_BEFORE_INSTALL 1
)
......@@ -84,7 +87,7 @@ ExternalProject_Add(xacc-quantum
-DXACC_LIBRARY_DIR=${CMAKE_INSTALL_PREFIX}/lib #${XACC_LIBRARY_DIR}
CMAKE_CACHE_ARGS -DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
BUILD_ALWAYS 1
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install #DESTDIR=${CMAKE_BINARY_DIR}/stage
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} -j${N} install #DESTDIR=${CMAKE_BINARY_DIR}/stage
TEST_AFTER_INSTALL 1
)
......
......@@ -45,7 +45,8 @@ def main(argv=None):
# This python script should be in ${XACC_ROOT}/bin,
# we need to get XACC_ROOT
xaccLocation = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
xacc_cwd = os.getcwd()
# Get the plugins we're supposed to install
plugins = opts.plugins
......@@ -67,13 +68,18 @@ def main(argv=None):
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
include(ProcessorCount)
ProcessorCount(N)
if(N EQUAL 0)
set(N 1)
endif()
include(ExternalProject)
ExternalProject_Add("""+plugin+"""
GIT_REPOSITORY """+availablePluginUrls[plugin]+"""
GIT_TAG master
CMAKE_ARGS -DXACC_DIR="""+xaccLocation+"""
BUILD_ALWAYS 1
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} -j${N} install
TEST_BEFORE_INSTALL 1
)
"""
......@@ -93,6 +99,8 @@ def main(argv=None):
cmakecmd = ['cmake', '..']
subprocess.check_call(cmakecmd, stderr=subprocess.STDOUT, shell=False)
subprocess.check_call(['make'], stderr=subprocess.STDOUT, shell=False)
os.chdir(xacc_cwd)
if __name__ == "__main__":
sys.exit(main())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment