mirror of
https://github.com/vimpunk/mio.git
synced 2025-12-06 08:46:51 +08:00
Add BUILD_TESTS option, installation
Remove compiler flags/warnings, makefile verbosity and colors
This commit is contained in:
parent
2db812da58
commit
b6517e711f
@ -3,40 +3,34 @@ project( mio )
|
||||
|
||||
### Standard
|
||||
set( CMAKE_CXX_STANDARD 11 )
|
||||
set( CMAKE_CXX_STANDARD_REQUIRED ON )
|
||||
set( CMAKE_CXX_EXTENSIONS ON )
|
||||
|
||||
### Verbosity
|
||||
set( CMAKE_COLOR_MAKEFILE ON )
|
||||
set( CMAKE_VERBOSE_MAKEFILE ON )
|
||||
|
||||
# Generate 'compile_commands.json' for clang_complete
|
||||
set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
|
||||
|
||||
### Flags
|
||||
if( MSVC )
|
||||
add_compile_options( /W3 )
|
||||
elseif( CMAKE_COMPILER_IS_GNUCXX )
|
||||
add_compile_options( -Wall )
|
||||
add_compile_options( -Wextra )
|
||||
endif()
|
||||
### Flags/Options
|
||||
option( BUILD_TESTS "Enable the building of mio unit tests" OFF )
|
||||
|
||||
### Library targets
|
||||
add_library( mio INTERFACE)
|
||||
target_include_directories( mio INTERFACE include )
|
||||
install(
|
||||
DIRECTORY include/
|
||||
DESTINATION include
|
||||
)
|
||||
|
||||
### Test targets
|
||||
|
||||
## test
|
||||
add_executable(
|
||||
test
|
||||
test/test.cpp
|
||||
)
|
||||
target_link_libraries( test PRIVATE mio )
|
||||
|
||||
## example
|
||||
add_executable(
|
||||
example
|
||||
test/example.cpp
|
||||
)
|
||||
target_link_libraries( example PRIVATE mio )
|
||||
if( BUILD_TESTS )
|
||||
## test
|
||||
add_executable(
|
||||
test
|
||||
test/test.cpp
|
||||
)
|
||||
target_link_libraries( test PRIVATE mio )
|
||||
|
||||
## example
|
||||
add_executable(
|
||||
example
|
||||
test/example.cpp
|
||||
)
|
||||
target_link_libraries( example PRIVATE mio )
|
||||
endif()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user