cmake: add option for enabling/disabling tests
This commit is contained in:
parent
e38eaa62a3
commit
0478ce70fa
6 changed files with 39 additions and 20 deletions
|
@ -19,8 +19,8 @@ include(cmake/check_avx.cmake)
|
|||
|
||||
# GIT VARIABLES
|
||||
|
||||
execute_process(COMMAND bash "-c" "git rev-parse HEAD" OUTPUT_VARIABLE GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND bash "-c" "git rev-parse --abbrev-ref HEAD" OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND bash "-c" "git rev-parse HEAD" OUTPUT_VARIABLE GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
execute_process(COMMAND bash "-c" "git rev-parse --abbrev-ref HEAD" OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
|
||||
# BUILD VERSION STRING
|
||||
|
||||
|
@ -74,23 +74,32 @@ if(NOT ${SCALAR_BUILD})
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# CHECK LIBRARIES : GTest
|
||||
|
||||
# CHECK LIBRARIES
|
||||
message(STATUS "check for libraries")
|
||||
find_package( GTest REQUIRED )
|
||||
if(GTest_FOUND)
|
||||
include_directories(${GTEST_INCLUDE_DIRS})
|
||||
|
||||
if(DEFINED ENABLE_TESTS)
|
||||
set(ENABLE_TESTS ${ENABLE_hdf5} CACHE BOOL "enable tests")
|
||||
else()
|
||||
message(FATAL_ERROR "GTest not found")
|
||||
set(ENABLE_TESTS TRUE CACHE BOOL "enable tests")
|
||||
endif()
|
||||
|
||||
# CHECK LIBRARIES : Threads
|
||||
if(ENABLE_TESTS)
|
||||
# CHECK LIBRARIES : GTest
|
||||
find_package( GTest REQUIRED )
|
||||
if(GTest_FOUND)
|
||||
include_directories(${GTEST_INCLUDE_DIRS})
|
||||
else()
|
||||
message(FATAL_ERROR "GTest not found")
|
||||
endif()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
if(Threads_FOUND)
|
||||
#include_directories(${Threads_INCLUDE_DIRS})
|
||||
else()
|
||||
message(FATAL_ERROR "Threads not found")
|
||||
# CHECK LIBRARIES : Threads
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
if(Threads_FOUND)
|
||||
#include_directories(${Threads_INCLUDE_DIRS})
|
||||
else()
|
||||
message(FATAL_ERROR "Threads not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# CHECK LIBRARIES : hdf5
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/include)
|
||||
add_subdirectory(tests)
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(bin)
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
add_subdirectory(tests)
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
install(DIRECTORY include/ DESTINATION ${INSTALL_PATH}/include/cnorxz/cereal)
|
||||
|
|
|
@ -11,6 +11,8 @@ set(HDF5_LIBS ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
|
|||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(tests)
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
install(DIRECTORY include/ DESTINATION ${INSTALL_PATH}/include/cnorxz/hdf5)
|
||||
|
|
|
@ -23,7 +23,9 @@ if(HDF5_IS_PARALLEL)
|
|||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(tests)
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
install(DIRECTORY include/ DESTINATION ${INSTALL_PATH}/include/cnorxz/hdf5_mpi)
|
||||
install(CODE "execute_process(COMMAND sed -i \"s|CXZ_H5_MPI_BUILD_MODE 1|CXZ_H5_MPI_BUILD_MODE 0|g;\" ${INSTALL_PATH}/include/cnorxz/hdf5_mpi/h5_mpi_base.h)")
|
||||
|
|
|
@ -11,6 +11,8 @@ set(MPI_LIBS ${MPI_LIBRARIES})
|
|||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(tests)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
install(DIRECTORY include/ DESTINATION ${INSTALL_PATH}/include/cnorxz/mpi)
|
||||
|
|
Loading…
Reference in a new issue