forked from Alepha/Alepha
A lot of progress towards unifying the build system.
This commit is contained in:
1
AutoRAII.test/CMakeLists.txt
Normal file
1
AutoRAII.test/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
unit_test( 0 )
|
@ -1,3 +0,0 @@
|
|||||||
CXXFLAGS+= -std=c++17 -I ../
|
|
||||||
|
|
||||||
all: 0
|
|
@ -1,14 +1,29 @@
|
|||||||
cmake_minimum_required( VERSION 3.25 )
|
cmake_minimum_required( VERSION 3.25 )
|
||||||
project( Alepha )
|
project( Alepha )
|
||||||
|
|
||||||
add_compile_options( -I . ; -std=c++20 )
|
include( cmake/rules.cmake )
|
||||||
|
|
||||||
set( VERBOSE 1 )
|
|
||||||
set( CMAKE_VERBOSE_MAKEFILE true )
|
|
||||||
|
|
||||||
file( CREATE_LINK ${CMAKE_SOURCE_DIR} Alepha SYMBOLIC )
|
|
||||||
|
|
||||||
add_library( alepha SHARED Console.cpp ProgramOptions.cpp string_algorithms.cpp word_wrap.cpp )
|
# The core alepha library:
|
||||||
|
|
||||||
|
add_library( alepha SHARED
|
||||||
|
Console.cpp
|
||||||
|
ProgramOptions.cpp
|
||||||
|
string_algorithms.cpp
|
||||||
|
word_wrap.cpp
|
||||||
|
)
|
||||||
|
# Everything else depends upon it
|
||||||
link_libraries( alepha )
|
link_libraries( alepha )
|
||||||
|
|
||||||
|
# The subdirs to build
|
||||||
|
add_subdirectory( Meta )
|
||||||
|
add_subdirectory( Reflection )
|
||||||
|
|
||||||
|
# The local subdir tests to build
|
||||||
|
add_subdirectory( AutoRAII.test )
|
||||||
|
add_subdirectory( comparisons.test )
|
||||||
|
add_subdirectory( Exception.test )
|
||||||
|
|
||||||
|
# Sample applications
|
||||||
add_executable( example example.cc )
|
add_executable( example example.cc )
|
||||||
|
1
Exception.test/CMakeLists.txt
Normal file
1
Exception.test/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
unit_test( exception )
|
@ -1,9 +0,0 @@
|
|||||||
CXXFLAGS+= -std=c++2a -I ../
|
|
||||||
CXXFLAGS+= -g -O0
|
|
||||||
CXX=g++
|
|
||||||
|
|
||||||
CXXFLAGS+= -Wno-inline-namespace-reopened-noninline
|
|
||||||
CXXFLAGS+= -Wno-unused-comparison
|
|
||||||
CXXFLAGS+= -DAlepha=MyProject_Alepha
|
|
||||||
|
|
||||||
all: exception
|
|
1
Meta/CMakeLists.txt
Normal file
1
Meta/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
add_subdirectory( Meta.test )
|
@ -1,3 +0,0 @@
|
|||||||
CXXFLAGS+= -std=c++17 -I ../
|
|
||||||
|
|
||||||
all: test
|
|
1
Meta/Meta.test/CMakeLists.txt
Normal file
1
Meta/Meta.test/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
unit_test( traits )
|
1
Reflection/CMakeLists.txt
Normal file
1
Reflection/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
add_subdirectory( tuplizeAggregate.test )
|
1
Reflection/tuplizeAggregate.test/CMakeLists.txt
Normal file
1
Reflection/tuplizeAggregate.test/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
unit_test( 0 )
|
@ -1,4 +0,0 @@
|
|||||||
CXXFLAGS+= -std=c++17 -I .
|
|
||||||
CXXFLAGS+= -g -O0
|
|
||||||
|
|
||||||
all: 0
|
|
27
cmake/rules.cmake
Normal file
27
cmake/rules.cmake
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#cmake_policy( SET CMP0002 OLD )
|
||||||
|
|
||||||
|
add_compile_options( -I ${CMAKE_BINARY_DIR} ; -std=c++20 )
|
||||||
|
|
||||||
|
|
||||||
|
list( APPEND CMAKE_CTEST_ARGUMENTS "-VV" )
|
||||||
|
|
||||||
|
|
||||||
|
set( VERBOSE 1 )
|
||||||
|
set( CMAKE_VERBOSE_MAKEFILE true )
|
||||||
|
|
||||||
|
file( CREATE_LINK ${CMAKE_SOURCE_DIR} Alepha SYMBOLIC )
|
||||||
|
|
||||||
|
|
||||||
|
include(CTest)
|
||||||
|
|
||||||
|
|
||||||
|
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} )
|
||||||
|
|
||||||
|
endfunction( unit_test )
|
||||||
|
|
1
comparisons.test/CMakeLists.txt
Normal file
1
comparisons.test/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
unit_test( 0 )
|
@ -1,4 +0,0 @@
|
|||||||
CXXFLAGS+= -std=c++17 -I ../
|
|
||||||
CXXFLAGS+= -g -O0
|
|
||||||
|
|
||||||
all: 0
|
|
Reference in New Issue
Block a user