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,7 +1,5 @@
|
|||
include(CheckCXXCompilerFlag)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||
|
||||
set(OPTIONS "")
|
||||
|
||||
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
|
|
@ -21,3 +19,4 @@ add_executable(example
|
|||
example.cpp
|
||||
${CMAKE_SOURCE_DIR}/include/magic_enum.hpp)
|
||||
target_compile_options(example PRIVATE ${OPTIONS})
|
||||
target_link_libraries(example PRIVATE magic_enum)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue