@@ -14,6 +14,7 @@ add_library(scratchcpp SHARED)
1414add_subdirectory (src)
1515include_directories (src) # TODO: Remove this line
1616include_directories (include )
17+ install (TARGETS scratchcpp DESTINATION lib)
1718
1819target_sources (scratchcpp
1920 PUBLIC
@@ -66,31 +67,28 @@ target_sources(scratchcpp
6667 include /scratchcpp/test /scriptbuilder.h
6768)
6869
69- if (LIBSCRATCHCPP_PRINT_LLVM_IR)
70- target_compile_definitions (scratchcpp PRIVATE PRINT_LLVM_IR)
71- endif ()
72-
7370include (FetchContent)
74- set (ZIP_SRC thirdparty/zip/src)
75- set (UTFCPP_SRC thirdparty/utfcpp/source )
7671
77- add_library (zip SHARED
78- ${ZIP_SRC} /zip.c
79- ${ZIP_SRC} /zip.h
80- ${ZIP_SRC} /miniz.h
81- )
82- target_include_directories (scratchcpp PUBLIC ${ZIP_SRC} )
72+ # zip
73+ include (build /zip.cmake)
74+ target_link_libraries (scratchcpp PRIVATE zip)
8375
76+ # utfcpp
77+ set (UTFCPP_SRC thirdparty/utfcpp/source )
8478target_include_directories (scratchcpp PUBLIC ${UTFCPP_SRC} )
79+
80+ # spimpl
8581include_directories (thirdparty/spimpl)
8682
83+ # JSON
8784FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
8885FetchContent_MakeAvailable(json)
89-
9086target_link_libraries (scratchcpp PRIVATE nlohmann_json::nlohmann_json)
91- target_link_libraries (scratchcpp PRIVATE zip)
87+
88+ # Audio
9289target_link_libraries (scratchcpp PRIVATE scratchcpp-audio)
9390
91+ # Network
9492if (LIBSCRATCHCPP_NETWORK_SUPPORT)
9593 FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
9694 GIT_TAG 225b7454877805f089b3895260438e929bd6d123) # 09-22-2024
@@ -99,16 +97,23 @@ if (LIBSCRATCHCPP_NETWORK_SUPPORT)
9997 target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_NETWORK_SUPPORT)
10098endif ()
10199
100+ # LLVM
102101include (build /HunterPackages.cmake)
103102include (build /LLVM.cmake)
104103target_link_libraries (scratchcpp PRIVATE LLVM)
105104
105+ if (LIBSCRATCHCPP_PRINT_LLVM_IR)
106+ target_compile_definitions (scratchcpp PRIVATE PRINT_LLVM_IR)
107+ endif ()
108+
109+ # Macros
106110target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_LIBRARY)
107111target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION="${PROJECT_VERSION} " )
108112target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} )
109113target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_MINOR=${PROJECT_VERSION_MINOR} )
110114target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_PATCH=${PROJECT_VERSION_PATCH} )
111115
116+ # Unit tests
112117if (LIBSCRATCHCPP_BUILD_UNIT_TESTS)
113118 enable_testing ()
114119 add_subdirectory (test )
0 commit comments