@@ -39,36 +39,36 @@ find_package(Threads REQUIRED)
3939find_package (CURL REQUIRED )
4040find_package (jsoncpp )
4141
42- add_library (restclient-cpp SHARED
43- source /restclient.cc
44- source /connection.cc
42+ add_library (restclient-cpp SHARED
43+ source /restclient.cc
44+ source /connection.cc
4545 source /helpers.cc
4646)
47- set_property (TARGET restclient-cpp PROPERTY SOVERSION 2.1.1 )
47+ set_property (TARGET restclient-cpp PROPERTY SOVERSION 2.1.1 )
4848
4949target_compile_features (restclient-cpp PUBLIC cxx_std_11 )
5050
51- list (APPEND restclient-cpp_PUBLIC_HEADERS
52- include /restclient-cpp/restclient.h
53- "${CMAKE_CURRENT_BINARY_DIR} /include/restclient-cpp/version.h"
54- include /restclient-cpp/connection.h
51+ list (APPEND restclient-cpp_PUBLIC_HEADERS
52+ include /restclient-cpp/restclient.h
53+ "${CMAKE_CURRENT_BINARY_DIR} /include/restclient-cpp/version.h"
54+ include /restclient-cpp/connection.h
5555 include /restclient-cpp/helpers.h
5656)
5757# target_sources(restclient-cpp PRIVATE ${restclient-cpp_PUBLIC_HEADERS})
58- set_property (TARGET restclient-cpp PROPERTY
58+ set_property (TARGET restclient-cpp PROPERTY
5959 PUBLIC_HEADER ${restclient-cpp_PUBLIC_HEADERS} )
6060target_include_directories (restclient-cpp PRIVATE include )
61-
62- if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR} /version.h.in" )
63- file (WRITE "${CMAKE_CURRENT_BINARY_DIR} /version.h.in" [=[
64- #ifndef INCLUDE_RESTCLIENT_CPP_VERSION_H_
65- #define INCLUDE_RESTCLIENT_CPP_VERSION_H_
66- #define RESTCLIENT_VERSION "@restclient-cpp_VERSION@"
67- #endif // INCLUDE_RESTCLIENT_CPP_VERSION_H_
68- ]=] )
69- endif ()
70- configure_file ("${CMAKE_CURRENT_BINARY_DIR} /version.h.in"
71- "${CMAKE_CURRENT_BINARY_DIR} /include/restclient-cpp/version.h" )
61+
62+ if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR} /version.h.in" )
63+ file (WRITE "${CMAKE_CURRENT_BINARY_DIR} /version.h.in" [=[
64+ #ifndef INCLUDE_RESTCLIENT_CPP_VERSION_H_
65+ #define INCLUDE_RESTCLIENT_CPP_VERSION_H_
66+ #define RESTCLIENT_VERSION "@restclient-cpp_VERSION@"
67+ #endif // INCLUDE_RESTCLIENT_CPP_VERSION_H_
68+ ]=] )
69+ endif ()
70+ configure_file ("${CMAKE_CURRENT_BINARY_DIR} /version.h.in"
71+ "${CMAKE_CURRENT_BINARY_DIR} /include/restclient-cpp/version.h" )
7272target_include_directories (restclient-cpp PRIVATE "${CMAKE_CURRENT_BINARY_DIR} /include" )
7373
7474target_link_libraries (restclient-cpp
@@ -90,8 +90,8 @@ install(TARGETS restclient-cpp EXPORT restclient-cppTargets
9090 RESOURCE DESTINATION ${DATA_INSTALL_DIR}
9191)
9292
93- include (CMakePackageConfigHelpers )
94- file (WRITE "${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} Config.cmake.in"
93+ include (CMakePackageConfigHelpers )
94+ file (WRITE "${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} Config.cmake.in"
9595 "@PACKAGE_INIT@\n include(\$ {CMAKE_CURRENT_LIST_DIR}/\@ PROJECT_NAME\@ Targets.cmake)\n " )
9696configure_package_config_file (
9797 ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME}Config.cmake.in
@@ -128,15 +128,16 @@ if(Gtest_FOUND AND jsoncpp_FOUND)
128128enable_testing ()
129129
130130
131- add_executable (test -program
132- vendor/jsoncpp-0.10.5/dist/jsoncpp.cpp
133- test /tests.cpp
134- test /test_restclient.cc
135- test /test_connection.cc
131+ add_executable (test -program
132+ vendor/jsoncpp-0.10.5/dist/jsoncpp.cpp
133+ test /tests.cpp
134+ test /test_restclient.cc
135+ test /test_connection.cc
136+ test /test_helpers.cc
136137)
137- target_include_directories (test -program
138- PRIVATE include
139- PRIVATE vendor/jsoncpp-0.10.5/dist
138+ target_include_directories (test -program
139+ PRIVATE include
140+ PRIVATE vendor/jsoncpp-0.10.5/dist
140141 PRIVATE "${CMAKE_CURRENT_BINARY_DIR} /include" )
141142
142143target_link_libraries (test -program
@@ -147,14 +148,14 @@ gtest_discover_tests(test-program
147148 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
148149 EXTRA_ARGS -VV
149150)
150-
151- endif ()
152-
153-
154- # TODO: Setup ctest here for valgrind and CI
155-
156- # TODO: Setup cpack here for automatic packaging.
157- # Note most of the work is already done above due to use of properties and install commands.
151+
152+ endif ()
153+
154+
155+ # TODO: Setup ctest here for valgrind and CI
156+
157+ # TODO: Setup cpack here for automatic packaging.
158+ # Note most of the work is already done above due to use of properties and install commands.
158159
159160include (FeatureSummary )
160161feature_summary (WHAT ALL )
0 commit comments