forked from Alepha/Alepha
58 lines
1.5 KiB
CMake
58 lines
1.5 KiB
CMake
#cmake_policy( SET CMP0002 OLD )
|
|
|
|
# C++23 isn't widely supported among gnu-ish compilers yet... so 2b will have to do, for now.
|
|
add_compile_options( -std=c++2b )
|
|
|
|
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
|
|
add_compile_options( -fdiagnostics-column-unit=byte )
|
|
add_compile_options( -fconcepts-diagnostics-depth=0 )
|
|
endif()
|
|
|
|
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
|
add_compile_options( -Wno-inline-namespace-reopened-noninline )
|
|
add_compile_options( -Wno-unknown-warning-option )
|
|
add_compile_options( -Wno-unused-comparison )
|
|
add_compile_options( -Wno-inconsistent-missing-override )
|
|
add_compile_options( -DBOOST_NO_CXX98_FUNCTION_BASE )
|
|
endif()
|
|
|
|
|
|
|
|
include_directories( ${CMAKE_BINARY_DIR} . )
|
|
|
|
if( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" )
|
|
add_compile_options( -O0 )
|
|
add_compile_options( -g )
|
|
endif()
|
|
|
|
list( APPEND CMAKE_CTEST_ARGUMENTS "-VV" )
|
|
|
|
|
|
set( VERBOSE 1 )
|
|
set( CMAKE_VERBOSE_MAKEFILE true )
|
|
|
|
file( CREATE_LINK ${CMAKE_SOURCE_DIR} Alepha SYMBOLIC )
|
|
|
|
if( DEFINED ALEPHA_BOOST_PATH )
|
|
file( CREATE_LINK ${CMAKE_BINARY_DIR}/${ALEPHA_BOOST_PATH} boost SYMBOLIC )
|
|
include_directories( ${CMAKE_BINARY_DIR}/${ALEPHA_BOOST_PATH}/.. )
|
|
endif()
|
|
|
|
|
|
include(CTest)
|
|
|
|
enable_testing()
|
|
|
|
|
|
function( unit_test TEST_NAME )
|
|
|
|
get_filename_component( TEST_DOMAIN ${CMAKE_CURRENT_SOURCE_DIR} NAME )
|
|
set( FULL_TEST_NAME ${TEST_DOMAIN}.${TEST_NAME} )
|
|
|
|
add_executable( ${FULL_TEST_NAME} ${TEST_NAME}.cc )
|
|
add_test( ${FULL_TEST_NAME} ${FULL_TEST_NAME} )
|
|
target_link_libraries( ${FULL_TEST_NAME} unit-test )
|
|
|
|
endfunction( unit_test )
|
|
|