Commit ec2aa067 authored by Mccaskey, Alex's avatar Mccaskey, Alex

automating git submodule init, clean up in cmakelists files

Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 0c94c2f7
......@@ -26,6 +26,27 @@ if (FROM_SETUP_PY AND NOT APPLE)
set (CMAKE_SHARED_LINKER_FLAGS "-static-libstdc++" CACHE INTERNAL "" FORCE)
endif()
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
# Update submodules as needed
option(GIT_SUBMODULE "Check submodules during build" ON)
if(GIT_SUBMODULE)
message(STATUS "Submodule update")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
endif()
endif()
endif()
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/tpls/cppmicroservices/CMakeLists.txt"
OR NOT EXISTS "${CMAKE_SOURCE_DIR}/tpls/boost-cmake/CMakeLists.txt"
OR NOT EXISTS "${CMAKE_SOURCE_DIR}/tpls/cpr/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif()
set(CMAKE_DEBUG_POSTFIX "")
set(CMAKE_SKIP_INSTALL_RPATH OFF)
set(CMAKE_SKIP_RPATH OFF)
......
......@@ -74,7 +74,8 @@ install(TARGETS ${LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/plugins)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/qcs/cmake")
find_package(UUID)
message(STATUS "HOWDY ${UUID_INCLUDE_DIRS} ${UUID_LIBRARIES}")
if (UUID_FOUND AND EXISTS $ENV{HOME}/.zmq/include/msgpack.hpp)
message(
STATUS "${BoldGreen}Building QCS Accelerator.${ColorReset}")
#add_subdirectory(qcs)
endif()
......@@ -67,11 +67,9 @@ set(BUILD_SHARED_LIBS FALSE)
set(BOOST_LIBS_OPTIONAL graph CACHE STRING "" FORCE)
add_subdirectory(boost-cmake)
#INSTALL( DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/boost-cmake/boost/boost_1_64_0/boost" DESTINATION include )
# Compiler-specific C++11 activation (FROM ANTLR4).
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
message(STATUS "HELLO FROM GNU ${CMAKE_CXX_COMPILER_ID}")
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
# Just g++-5.0 and greater contain <codecvt> header. (test in ubuntu)
......@@ -81,7 +79,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCH
add_subdirectory(antlr)
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND APPLE)
message(STATUS "HELLO FROM CLANG ${CMAKE_CXX_COMPILER_ID}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
add_subdirectory(antlr)
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
......@@ -94,7 +91,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_SYSTEM_NAME MATCHES
endif()
# You can use libc++ to compile this project when g++ is NOT greater than or equal to 5.0.
if (WITH_LIBCXX)
message(STATUS "HELLO WORLD WITH LIBCXX")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
endif ()
......@@ -40,6 +40,8 @@ add_library(xacc SHARED
add_dependencies(xacc cpr)
if(LIBUNWIND_FOUND)
message(
STATUS "${BoldGreen}Building xacc with libunwind support.${ColorReset}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAS_LIBUNWIND")
target_include_directories(xacc
PRIVATE ${CMAKE_BINARY_DIR}
......@@ -61,7 +63,6 @@ if(LIBUNWIND_FOUND)
${CMAKE_SOURCE_DIR}/tpls/mpark-variant
${CMAKE_SOURCE_DIR}/tpls/nlohmann)
message(STATUS "LIBS: ${LIBUNWIND_LIBRARIES} ${LIBUNWINDX86_LIBRARIES}")
target_link_libraries(xacc
PUBLIC CppMicroServices
PRIVATE cpr ${LIBUNWIND_LIBRARIES}
......
if(EXISTS ${XACC_ENSMALLEN_INCLUDE_DIR}/ensmallen.hpp)
if(EXISTS ${XACC_ARMADILLO_INCLUDE_DIR}/armadillo)
message(
STATUS "${BoldGreen}Building MLPack Optimizer.${ColorReset}")
set(LIBRARY_NAME xacc-mlpack)
file(GLOB
......
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