Skip to content

Commit 2b3702c

Browse files
Renaming CMake targets
1 parent 30f7e84 commit 2b3702c

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

CMakeLists.txt

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ target_include_directories( string-view-lite INTERFACE
106106
configure_file( "${CMAKE_CURRENT_LIST_DIR}/External/cfgpath/cfgpath.h"
107107
"${CMAKE_CURRENT_LIST_DIR}/Include/cfgpath.h" COPYONLY)
108108

109-
110-
111109
if(RUNCPP2_BUILD_TESTS)
112110
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/External/ssTest")
113111
endif()
@@ -193,14 +191,14 @@ set(RUNCPP2_SOURCE_FILES "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/Profile.
193191
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/PipelineSteps.cpp"
194192
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/IncludeManager.cpp")
195193

196-
add_library(runcpp2 STATIC ${RUNCPP2_SOURCE_FILES})
194+
add_library(runcpp2Lib STATIC ${RUNCPP2_SOURCE_FILES})
197195

198196
set(RUNCPP2_PRIVATE_LINK_LIBS ssLogger System2 CppOverride dylib)
199197
set(RUNCPP2_PUBLIC_LINK_LIBS ghc_filesystem ryml::ryml mpark_variant MacroPowerToys string-view-lite yaml DSResult)
200198

201-
target_include_directories(runcpp2 PUBLIC "${CMAKE_CURRENT_LIST_DIR}/Include")
202-
target_link_libraries(runcpp2 PRIVATE ${RUNCPP2_PRIVATE_LINK_LIBS})
203-
target_link_libraries(runcpp2 PUBLIC ${RUNCPP2_PUBLIC_LINK_LIBS})
199+
target_include_directories(runcpp2Lib PUBLIC "${CMAKE_CURRENT_LIST_DIR}/Include")
200+
target_link_libraries(runcpp2Lib PRIVATE ${RUNCPP2_PRIVATE_LINK_LIBS})
201+
target_link_libraries(runcpp2Lib PUBLIC ${RUNCPP2_PUBLIC_LINK_LIBS})
204202

205203
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
206204
# TODO: Try to change to /Wall
@@ -226,34 +224,34 @@ else()
226224
endif()
227225
endif()
228226

229-
target_compile_options(runcpp2 PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS}")
227+
target_compile_options(runcpp2Lib PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS}")
230228

231229
# Define the runcpp2 and default config version macro
232-
target_compile_definitions(runcpp2 PUBLIC RUNCPP2_VERSION="${RUNCPP2_PROJECT_VERSION}"
233-
RUNCPP2_CONFIG_VERSION=${RUNCPP2_CONFIG_VERSION})
230+
target_compile_definitions(runcpp2Lib PUBLIC RUNCPP2_VERSION="${RUNCPP2_PROJECT_VERSION}"
231+
RUNCPP2_CONFIG_VERSION=${RUNCPP2_CONFIG_VERSION})
234232

235233
# =========================================================================
236234
# runcpp2 executable
237235
# =========================================================================
238236

239-
add_executable(runcpp2_main "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/main.cpp")
240-
target_compile_options(runcpp2_main PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS}")
241-
target_link_libraries(runcpp2_main PRIVATE runcpp2 ssLogger)
242-
set_target_properties(runcpp2_main PROPERTIES OUTPUT_NAME "runcpp2")
237+
add_executable(runcpp2 "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/main.cpp")
238+
target_compile_options(runcpp2 PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS}")
239+
target_link_libraries(runcpp2 PUBLIC runcpp2Lib ssLogger)
243240

244241
# =========================================================================
245242
# runcpp2 library override
246243
# =========================================================================
247244

248-
add_library(runcpp2_override STATIC ${RUNCPP2_SOURCE_FILES})
249-
target_include_directories(runcpp2_override PUBLIC "${CMAKE_CURRENT_LIST_DIR}/Include")
250-
target_link_libraries(runcpp2_override PRIVATE ${RUNCPP2_PRIVATE_LINK_LIBS})
251-
target_link_libraries(runcpp2_override PUBLIC ${RUNCPP2_PUBLIC_LINK_LIBS})
252-
target_compile_options(runcpp2_override PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS}")
253-
target_compile_definitions(runcpp2_override PUBLIC RUNCPP2_VERSION="${RUNCPP2_PROJECT_VERSION}"
254-
RUNCPP2_CONFIG_VERSION=${RUNCPP2_CONFIG_VERSION}
255-
INTERNAL_RUNCPP2_UNIT_TESTS=1)
256245
if(RUNCPP2_BUILD_TESTS)
246+
add_library(runcpp2Override STATIC ${RUNCPP2_SOURCE_FILES})
247+
target_include_directories(runcpp2Override PUBLIC "${CMAKE_CURRENT_LIST_DIR}/Include")
248+
target_link_libraries(runcpp2Override PRIVATE ${RUNCPP2_PRIVATE_LINK_LIBS})
249+
target_link_libraries(runcpp2Override PUBLIC ${RUNCPP2_PUBLIC_LINK_LIBS})
250+
target_compile_options(runcpp2Override PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS}")
251+
target_compile_definitions( runcpp2Override PUBLIC
252+
RUNCPP2_VERSION="${RUNCPP2_PROJECT_VERSION}"
253+
RUNCPP2_CONFIG_VERSION=${RUNCPP2_CONFIG_VERSION}
254+
INTERNAL_RUNCPP2_UNIT_TESTS=1)
257255
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Src/Tests")
258256
endif()
259257

Src/Tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ target_compile_definitions(IncludeManagerTest PRIVATE INTERNAL_RUNCPP2_UNIT_TEST
1919
add_executable(ConfigParsingTest "${CMAKE_CURRENT_LIST_DIR}/ConfigParsingTest.cpp")
2020
target_include_directories(ConfigParsingTest PRIVATE "${CMAKE_CURRENT_LIST_DIR}/../../Include")
2121
target_compile_options(ConfigParsingTest PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS}")
22-
target_link_libraries(ConfigParsingTest PRIVATE ghc_filesystem CppOverride ssTest ssLogger runcpp2_override)
22+
target_link_libraries(ConfigParsingTest PRIVATE ghc_filesystem CppOverride ssTest ssLogger runcpp2Override)
2323
target_compile_definitions(ConfigParsingTest PRIVATE INTERNAL_RUNCPP2_UNIT_TESTS=1)
2424

2525

2626
function(create_data_test TEST_NAME)
2727
add_executable("${TEST_NAME}" "${CMAKE_CURRENT_LIST_DIR}/Data/${TEST_NAME}.cpp")
2828
target_compile_options("${TEST_NAME}" PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS}")
2929
target_compile_definitions("${TEST_NAME}" PRIVATE INTERNAL_RUNCPP2_UNIT_TESTS=1 TERMCOLOR_USE_ANSI_ESCAPE_SEQUENCES=1)
30-
target_link_libraries("${TEST_NAME}" PUBLIC runcpp2 ssTest)
30+
target_link_libraries("${TEST_NAME}" PUBLIC runcpp2Lib ssTest)
3131
endfunction()
3232

3333
create_data_test(FilePropertiesTest)

0 commit comments

Comments
 (0)