提交 2e674211 编写于 作者: G gangliao 提交者: GitHub

Merge pull request #2155 from gangliao/ten_fix

add WITH_TESTING in Majel
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
if(GTEST_INCLUDE_DIR AND GTEST_LIBRARIES) if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
message("-- Found gtest (include: ${GTEST_INCLUDE_DIR}, library: ${GTEST_LIBRARIES})")
else()
# find #include <majel/xx.h> # find #include <majel/xx.h>
get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
include_directories(${PARENT_DIR}) include_directories(${PARENT_DIR})
...@@ -18,6 +16,8 @@ else() ...@@ -18,6 +16,8 @@ else()
set(THIRD_PARTY_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party) set(THIRD_PARTY_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
set(WITH_TESTING ON) set(WITH_TESTING ON)
include(external/gtest) include(external/gtest)
else()
message("-- Found gtest (include: ${GTEST_INCLUDE_DIR}, library: ${GTEST_LIBRARIES})")
endif() endif()
########################### Build Majel ############################# ########################### Build Majel #############################
...@@ -29,6 +29,9 @@ if(CUDA_FOUND) ...@@ -29,6 +29,9 @@ if(CUDA_FOUND)
else() else()
add_library(majel ${MAJEL_CXX_FILES}) add_library(majel ${MAJEL_CXX_FILES})
endif() endif()
add_dependencies(majel ${external_project_dependencies})
##################################################################### #####################################################################
add_subdirectory(test) if(WITH_TESTING)
add_subdirectory(test)
endif()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册