@@ -5,6 +5,11 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
55
66project (runcpp2)
77
8+ # if(TARGET runcpp2)
9+ # message("runcpp2 cmake target has been added before. Skipping cmake...")
10+ # return()
11+ # endif()
12+
813set (CMAKE_CXX_STANDARD 11)
914
1015option (RUNCPP2_UPDATE_DEFAULT_YAMLS "Update default yaml files" OFF )
@@ -78,6 +83,20 @@ message("RUNCPP2_PROJECT_VERSION: ${RUNCPP2_PROJECT_VERSION}")
7883# =========================================================================
7984# External Dependencies
8085# =========================================================================
86+
87+ # runcpp2 doesn't rely on install at all. Disabling it.
88+ # if(NOT DEFINED RUNCPP2_DISABLE_INSTALLATION)
89+ # # This variable is responsible for installation disabling.
90+ # set(RUNCPP2_DISABLE_INSTALLATION ON)
91+ #
92+ # # Replace install() with conditional installation.
93+ # macro(install)
94+ # if(NOT RUNCPP2_DISABLE_INSTALLATION)
95+ # _install(${ARGN})
96+ # endif()
97+ # endmacro()
98+ # endif()
99+
81100add_subdirectory ("${CMAKE_CURRENT_LIST_DIR} /External/ssLogger" )
82101
83102set (RYML_DEFAULT_CALLBACK_USES_EXCEPTIONS ON CACHE BOOL "" FORCE)
@@ -88,12 +107,24 @@ add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/External/System2")
88107add_subdirectory ("${CMAKE_CURRENT_LIST_DIR} /External/dylib" )
89108add_subdirectory ("${CMAKE_CURRENT_LIST_DIR} /External/variant" )
90109
110+ set (EXPECTED_BUILD_PACKAGE OFF )
111+ set (BUILD_TESTING OFF )
112+ add_subdirectory ("${CMAKE_CURRENT_LIST_DIR} /External/DSResult" )
113+
114+ set (BUILD_TESTING ON )
115+ add_subdirectory ("${CMAKE_CURRENT_LIST_DIR} /External/libyaml" )
116+ set (BUILD_TESTING OFF )
117+
118+ # NOTE: Just include the file. Can't add subdirectory since it install stuff
119+ # add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/External/string-view-lite")
120+ add_library (string -view-lite INTERFACE )
121+ target_include_directories ( string -view-lite INTERFACE
122+ "${CMAKE_CURRENT_LIST_DIR} /External/string-view-lite/include" )
123+
91124# Copy cfgpath.h
92125configure_file ( "${CMAKE_CURRENT_LIST_DIR} /External/cfgpath/cfgpath.h"
93126 "${CMAKE_CURRENT_LIST_DIR} /Include/cfgpath.h" COPYONLY )
94127
95-
96-
97128if (RUNCPP2_BUILD_TESTS)
98129 add_subdirectory ("${CMAKE_CURRENT_LIST_DIR} /External/ssTest" )
99130endif ()
@@ -177,16 +208,17 @@ set(RUNCPP2_SOURCE_FILES "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/Profile.
177208 "${CMAKE_CURRENT_LIST_DIR} /Src/runcpp2/runcpp2.cpp"
178209 "${CMAKE_CURRENT_LIST_DIR} /Src/runcpp2/BuildsManager.cpp"
179210 "${CMAKE_CURRENT_LIST_DIR} /Src/runcpp2/PipelineSteps.cpp"
180- "${CMAKE_CURRENT_LIST_DIR} /Src/runcpp2/IncludeManager.cpp" )
211+ "${CMAKE_CURRENT_LIST_DIR} /Src/runcpp2/IncludeManager.cpp"
212+ "${CMAKE_CURRENT_LIST_DIR} /Src/runcpp2/LibYAML_Wrapper.cpp" )
181213
182- add_library (runcpp2 STATIC ${RUNCPP2_SOURCE_FILES} )
214+ add_library (runcpp2Lib STATIC ${RUNCPP2_SOURCE_FILES} )
183215
184216set (RUNCPP2_PRIVATE_LINK_LIBS ssLogger System2 CppOverride dylib)
185- set (RUNCPP2_PUBLIC_LINK_LIBS ghc_filesystem ryml::ryml mpark_variant MacroPowerToys)
217+ set (RUNCPP2_PUBLIC_LINK_LIBS ghc_filesystem ryml::ryml mpark_variant MacroPowerToys string -view-lite yaml DSResult )
186218
187- target_include_directories (runcpp2 PUBLIC "${CMAKE_CURRENT_LIST_DIR} /Include" )
188- target_link_libraries (runcpp2 PRIVATE ${RUNCPP2_PRIVATE_LINK_LIBS} )
189- target_link_libraries (runcpp2 PUBLIC ${RUNCPP2_PUBLIC_LINK_LIBS} )
219+ target_include_directories (runcpp2Lib PUBLIC "${CMAKE_CURRENT_LIST_DIR} /Include" )
220+ target_link_libraries (runcpp2Lib PRIVATE ${RUNCPP2_PRIVATE_LINK_LIBS} )
221+ target_link_libraries (runcpp2Lib PUBLIC ${RUNCPP2_PUBLIC_LINK_LIBS} )
190222
191223if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" )
192224 # TODO: Try to change to /Wall
@@ -212,35 +244,35 @@ else()
212244 endif ()
213245endif ()
214246
215- target_compile_options (runcpp2 PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS} " )
247+ target_compile_options (runcpp2Lib PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS} " )
216248
217249# Define the runcpp2 and default config version macro
218- target_compile_definitions (runcpp2 PUBLIC RUNCPP2_VERSION="${RUNCPP2_PROJECT_VERSION} "
219- RUNCPP2_CONFIG_VERSION=${RUNCPP2_CONFIG_VERSION} )
250+ target_compile_definitions (runcpp2Lib PUBLIC RUNCPP2_VERSION="${RUNCPP2_PROJECT_VERSION} "
251+ RUNCPP2_CONFIG_VERSION=${RUNCPP2_CONFIG_VERSION} )
220252
221253# =========================================================================
222254# runcpp2 executable
223255# =========================================================================
224256
225- add_executable (runcpp2_main "${CMAKE_CURRENT_LIST_DIR} /Src/runcpp2/main.cpp" )
226- target_compile_options (runcpp2_main PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS} " )
227- target_link_libraries (runcpp2_main PRIVATE runcpp2 ssLogger)
228- set_target_properties (runcpp2_main PROPERTIES OUTPUT_NAME "runcpp2" )
257+ add_executable (runcpp2 "${CMAKE_CURRENT_LIST_DIR} /Src/runcpp2/main.cpp" )
258+ target_compile_options (runcpp2 PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS} " )
259+ target_link_libraries (runcpp2 PUBLIC runcpp2Lib ssLogger)
229260
230261# =========================================================================
231262# runcpp2 library override
232263# =========================================================================
233264
234- add_library (runcpp2_override STATIC ${RUNCPP2_SOURCE_FILES} )
235- target_include_directories (runcpp2_override PUBLIC "${CMAKE_CURRENT_LIST_DIR} /Include" )
236- target_link_libraries (runcpp2_override PRIVATE ${RUNCPP2_PRIVATE_LINK_LIBS} )
237- target_link_libraries (runcpp2_override PUBLIC ${RUNCPP2_PUBLIC_LINK_LIBS} )
238- target_compile_options (runcpp2_override PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS} " )
239- target_compile_definitions (runcpp2_override PUBLIC RUNCPP2_VERSION="${RUNCPP2_PROJECT_VERSION} "
240- RUNCPP2_CONFIG_VERSION=${RUNCPP2_CONFIG_VERSION}
241- INTERNAL_RUNCPP2_UNIT_TESTS=1)
242265if (RUNCPP2_BUILD_TESTS)
266+ add_library (runcpp2Override STATIC ${RUNCPP2_SOURCE_FILES} )
267+ target_include_directories (runcpp2Override PUBLIC "${CMAKE_CURRENT_LIST_DIR} /Include" )
268+ target_link_libraries (runcpp2Override PRIVATE ${RUNCPP2_PRIVATE_LINK_LIBS} )
269+ target_link_libraries (runcpp2Override PUBLIC ${RUNCPP2_PUBLIC_LINK_LIBS} )
270+ target_compile_options (runcpp2Override PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS} " )
271+ target_compile_definitions ( runcpp2Override PUBLIC
272+ RUNCPP2_VERSION="${RUNCPP2_PROJECT_VERSION} "
273+ RUNCPP2_CONFIG_VERSION=${RUNCPP2_CONFIG_VERSION}
274+ INTERNAL_RUNCPP2_UNIT_TESTS=1)
243275 add_subdirectory ("${CMAKE_CURRENT_LIST_DIR} /Src/Tests" )
244276endif ()
245277
246-
278+ # set(RUNCPP2_DISABLE_INSTALLATION OFF)
0 commit comments