Skip to content

Commit ecf9e0c

Browse files
authored
Merge pull request #1 from Yaraslaut/fix/project_naming
Fixes name of the project to use as dependency with conan
2 parents 911a4a5 + d2cfc61 commit ecf9e0c

6 files changed

Lines changed: 24 additions & 27 deletions

File tree

CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
33
set(CMAKE_CXX_EXTENSIONS OFF)
44
set(CMAKE_CXX_STANDARD 26)
55

6-
project(rsl_xml CXX)
6+
project(rsl-xml CXX)
77

8-
add_library(rsl_xml)
9-
target_include_directories(rsl_xml PUBLIC include)
8+
add_library(rsl-xml)
9+
target_include_directories(rsl-xml PUBLIC include)
1010
add_subdirectory(src)
1111

12-
target_compile_options(rsl_xml PUBLIC "-freflection-latest")
13-
target_include_directories(rsl_xml PUBLIC
12+
target_compile_options(rsl-xml PUBLIC "-freflection-latest")
13+
target_include_directories(rsl-xml PUBLIC
1414
$<INSTALL_INTERFACE:include>
1515
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>)
1616

1717
find_package(rsl-util REQUIRED)
18-
target_link_libraries(rsl_xml PUBLIC rsl::util)
18+
target_link_libraries(rsl-xml PUBLIC rsl::util)
1919

2020

21-
install(TARGETS rsl_xml)
21+
install(TARGETS rsl-xml)
2222
install(DIRECTORY include/ DESTINATION include)
2323

2424
option(BUILD_EXAMPLES "Enable examples" ON)
@@ -33,13 +33,13 @@ if (BUILD_TESTING)
3333
message(STATUS "Building unit tests")
3434

3535
enable_testing()
36-
add_executable(rsl_xml_test)
36+
add_executable(rsl-xml-test)
3737
add_subdirectory(test)
3838

3939
find_package(GTest REQUIRED)
40-
target_link_libraries(rsl_xml_test PRIVATE rsl_xml)
41-
target_link_libraries(rsl_xml_test PRIVATE GTest::gtest)
40+
target_link_libraries(rsl-xml-test PRIVATE rsl-xml)
41+
target_link_libraries(rsl-xml-test PRIVATE GTest::gtest)
4242

4343
include(GoogleTest)
44-
gtest_discover_tests(rsl_xml_test)
45-
endif()
44+
gtest_discover_tests(rsl-xml-test)
45+
endif()

conanfile.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ class rslXmlRecipe(ConanFile):
2020
"shared": [True, False],
2121
"fPIC": [True, False],
2222
"examples": [True, False],
23-
"editable": [True, False],
2423
"tests" : [True, False]
2524
}
26-
default_options = {"shared": False, "fPIC": True, "examples": False, "editable": False, "tests": False}
25+
default_options = {"shared": False, "fPIC": True, "examples": False, "tests": False}
2726

2827
# Sources are located in the same place as this recipe, copy them to the recipe
2928
exports_sources = "CMakeLists.txt", "src/*", "include/*", "test/*"
@@ -57,9 +56,7 @@ def build(self):
5756
"BUILD_EXAMPLES": self.options.examples,
5857
})
5958
cmake.build()
60-
if self.options.editable:
61-
# package is in editable mode - make sure it's installed after building
62-
cmake.install()
59+
cmake.install()
6360

6461
def package(self):
6562
cmake = CMake(self)
@@ -70,5 +67,5 @@ def package_info(self):
7067
self.cpp_info.components["xml"].set_property("cmake_target_name", "rsl::xml")
7168
self.cpp_info.components["xml"].includedirs = ["include"]
7269
self.cpp_info.components["xml"].libdirs = ["lib"]
73-
self.cpp_info.components["xml"].libs = ["rsl_xml"]
74-
self.cpp_info.components["xml"].requires = ["rsl-util::util"]
70+
self.cpp_info.components["xml"].libs = ["rsl-xml"]
71+
self.cpp_info.components["xml"].requires = ["rsl-util::util"]

example/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
project(rsl_xml)
1+
project(rsl-xml)
22

33
function(DEFINE_EXAMPLE TARGET)
44
add_executable(example_${TARGET} "${TARGET}.cpp")
5-
target_link_libraries(example_${TARGET} PRIVATE rsl_xml)
5+
target_link_libraries(example_${TARGET} PRIVATE rsl-xml)
66
endfunction()
77

8-
DEFINE_EXAMPLE(xml)
8+
DEFINE_EXAMPLE(xml)

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
target_sources(rsl_xml PRIVATE dummy.cpp)
1+
target_sources(rsl-xml PRIVATE dummy.cpp)

test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
target_sources(rsl_serialize_test PRIVATE main.cpp)
1+
target_sources(rsl-serialize-test PRIVATE main.cpp)
22

3-
add_subdirectory(xml)
3+
add_subdirectory(xml)

test/xml/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
target_sources(rsl_serialize_test PRIVATE
1+
target_sources(rsl-serialize-test PRIVATE
22
basic.cpp
3-
)
3+
)

0 commit comments

Comments
 (0)