2020-07-10 18:06:26 +01:00
|
|
|
# Optionally glob, but only for CMake 3.12 or later:
|
2020-07-23 21:47:13 +01:00
|
|
|
#file(GLOB HEADER_LIST CONFIGURE_DEPENDS "${INCLUDE_DIR}/**/*.hpp")
|
|
|
|
#file(GLOB SOURCES_LIST CONFIGURE_DEPENDS "${SOURCE_DIR}/**/*.cpp")
|
|
|
|
set(HEADER_LIST
|
|
|
|
"${INCLUDE_DIR}/serene/expr.hpp"
|
2020-07-25 15:49:19 +01:00
|
|
|
"${INCLUDE_DIR}/serene/serene.hpp"
|
|
|
|
"${INCLUDE_DIR}/serene/state.hpp"
|
|
|
|
"${INCLUDE_DIR}/serene/compiler.hpp"
|
2020-08-01 19:58:34 +01:00
|
|
|
"${INCLUDE_DIR}/serene/namespace.hpp"
|
|
|
|
"${INCLUDE_DIR}/serene/special_forms/def.hpp")
|
2020-07-10 18:06:26 +01:00
|
|
|
# Make an automatic library - will be static or dynamic based on user setting
|
2020-07-16 15:48:06 +01:00
|
|
|
add_library(lserene
|
|
|
|
serene.cpp
|
|
|
|
reader.cpp
|
|
|
|
symbol.cpp
|
|
|
|
list.cpp
|
2020-07-25 15:49:19 +01:00
|
|
|
namespace.cpp
|
|
|
|
compiler.cpp
|
|
|
|
state.cpp
|
2020-08-01 19:58:34 +01:00
|
|
|
special_forms/def.cpp
|
2020-07-16 15:48:06 +01:00
|
|
|
${HEADER_LIST})
|
|
|
|
|
2020-07-10 18:06:26 +01:00
|
|
|
|
|
|
|
# We need this directory, and users of our library will need it too
|
2020-07-16 15:48:06 +01:00
|
|
|
target_compile_features(lserene PUBLIC cxx_std_20)
|
2020-07-23 21:47:13 +01:00
|
|
|
target_include_directories(lserene PRIVATE ${INCLUDE_DIR})
|
2020-07-23 17:13:16 +01:00
|
|
|
target_include_directories(lserene PUBLIC ${PROJECT_BINARY_DIR})
|
2020-07-10 18:06:26 +01:00
|
|
|
|
|
|
|
# This depends on (header only) boost
|
2020-07-16 15:48:06 +01:00
|
|
|
target_link_libraries(lserene ${llvm_libs} fmt::fmt)
|
2020-07-10 18:06:26 +01:00
|
|
|
source_group(TREE "${INCLUDE_DIR}" PREFIX "Header Files" FILES ${HEADER_LIST})
|