@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
22
33include (FetchContent)
44
5- project (plib )
5+ project (pscript )
66
77set (CMAKE_CXX_STANDARD 20)
88
@@ -17,45 +17,43 @@ endif()
1717option (PLIB_ENABLE_TESTS "Enable building tests" ${is_root_project} )
1818option (PLIB_BUILD_PSCRIPT_DEMO_APP "Enable pscript demo app" ON ) # TODO: set default to off
1919
20- if (PLIB_ENABLE_TESTS )
20+ if (${PSCRIPT_ENABLE_TESTS} )
2121 add_subdirectory (tests)
2222endif ()
2323
2424FetchContent_Declare(
2525 peglib
2626 GIT_REPOSITORY https://github.com/NotAPenguin0/cpp-peglib
2727)
28+
2829FetchContent_MakeAvailable(peglib)
2930
3031FetchContent_Declare(
31- fmt
32- GIT_REPOSITORY https://github.com/fmtlib/fmt
32+ plib
33+ GIT_REPOSITORY https://github.com/NotAPenguin0/plib
3334)
34- FetchContent_MakeAvailable(fmt)
3535
36- # TODO: Add option to exclude pscript
36+ FetchContent_MakeAvailable(plib)
37+
3738
38- add_library (plib STATIC )
39- target_sources (plib PRIVATE
39+ add_library (pscript STATIC )
40+ target_sources (pscript PRIVATE
4041 src/pscript/context.cpp
4142 src/pscript/memory.cpp
4243 src/pscript/value .cpp
4344 src/pscript/variable .cpp
4445 src/pscript/script.cpp
4546)
46- target_include_directories (plib PUBLIC "${CMAKE_CURRENT_SOURCE_DIR} /include" ${peglib_SOURCE_DIR} )
47-
48- target_link_libraries (plib PUBLIC fmt)
49- target_include_directories (plib PRIVATE ${fmt_SOURCE_DIR} /include )
47+ target_include_directories (pscript PUBLIC "${CMAKE_CURRENT_SOURCE_DIR} /include" ${peglib_SOURCE_DIR} )
5048
5149target_compile_options (plib PRIVATE "-Wno-format" )
5250
5351# copy over modules to build directory
5452file (GLOB_RECURSE MODULE_FILES "modules/*" )
5553add_custom_command (
56- TARGET plib POST_BUILD
54+ TARGET pscript POST_BUILD
5755 COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR} /modules/" ${${CMAKE_PROJECT_NAME} _BINARY_DIR}/pscript-modules
5856 DEPENDS ${MODULE_FILES}
59- COMMENT "Copying plib modules"
57+ COMMENT "Copying pscript modules"
6058 VERBATIM
6159)
0 commit comments