add WITH_TESTING

refactor_docs
liaogang 8 years ago
parent 06063a01b6
commit 8b6fad67ae

@ -1,8 +1,6 @@
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()
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)
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()
Loading…
Cancel
Save