mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-10 23:44:29 +00:00
CMake enhancements
* Add magic_enum as an interface library * Enable tests and examples only if is top project * Use more modern approach to include directories * Add install target
This commit is contained in:
parent
20568660dd
commit
e10ba181f1
4 changed files with 47 additions and 11 deletions
|
|
@ -1,8 +1,5 @@
|
|||
include(CheckCXXCompilerFlag)
|
||||
|
||||
include_directories(3rdparty/Catch2)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||
|
||||
set(SOURCES test.cpp)
|
||||
|
||||
set(OPTIONS "")
|
||||
|
|
@ -28,6 +25,8 @@ endif()
|
|||
function(make_target target std)
|
||||
add_executable(${target} ${SOURCES})
|
||||
target_compile_options(${target} PRIVATE ${OPTIONS})
|
||||
target_include_directories(${target} PRIVATE 3rdparty/Catch2)
|
||||
target_link_libraries(${target} PRIVATE magic_enum)
|
||||
if(std)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
target_compile_options(${target} PRIVATE /std:${std})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue