Skip to content

Commit 648c64c

Browse files
committed
Merge branch 'release/2.1.1'
2 parents 303e1e1 + 3331b0a commit 648c64c

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ include(${CMAKE_SOURCE_DIR}/scripts/cmake/project_add_all_folders.cmake)
1414
include(${CMAKE_SOURCE_DIR}/scripts/cmake/conan_custom_setup.cmake)
1515
include(${CMAKE_SOURCE_DIR}/scripts/cmake/hackerrank_challenge.cmake)
1616

17-
1817
compiler_check()
1918

2019
if (USE_CONAN_LIBS)
21-
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
22-
conan_custom_setup()
20+
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
21+
conan_custom_setup()
22+
else()
23+
find_package(PkgConfig REQUIRED)
24+
pkg_check_modules(JsonCpp REQUIRED jsoncpp>=1.9.4)
25+
find_package(Boost 1.68.0)
2326
endif (USE_CONAN_LIBS)
2427

2528
include(CTest)

conanfile.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[requires]
22
gtest/1.10.0
33
boost/1.69.0
4+
jsoncpp/1.9.4
45

56
[generators]
67
cmake

scripts/cmake/hackerrank_challenge.cmake

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ macro(hackerrank_setup_project)
1313
set_target_properties(${ProjectId} PROPERTIES FOLDER "${ProjectFolder}")
1414

1515
if (USE_CONAN_LIBS)
16-
target_link_libraries(${ProjectId} ${CONAN_LIBS})
16+
target_link_libraries(${ProjectId} ${CONAN_LIBS} m)
1717
else()
18-
find_package(Boost 1.68.0)
19-
include_directories(${Boost_INCLUDE_DIRS})
20-
target_link_libraries(${ProjectId} ${Boost_LIBRARIES})
21-
endif (USE_CONAN_LIBS)
18+
include_directories(${Boost_INCLUDE_DIRS} ${JsonCpp_INCLUDE_DIRS})
19+
target_link_libraries(${ProjectId} ${Boost_LIBRARIES} ${JsonCpp_LIBRARIES} m)
20+
endif (USE_CONAN_LIBS)
2221
endmacro()
2322

2423
macro(hackerrank_challenge_solution)
@@ -42,11 +41,11 @@ macro(hackerrank_challenge_test)
4241
target_link_libraries(${ProjectTest} ${ProjectId} ${TestBaseProject} ${CONAN_LIBS})
4342
else()
4443
# GTest
45-
find_package(GTest REQUIRED)
46-
include_directories(${GTEST_INCLUDE_DIRS})
44+
find_package(GTest REQUIRED)
45+
include_directories(${GTEST_INCLUDE_DIRS})
4746

48-
target_link_libraries(${ProjectTest} ${ProjectId} ${TestBaseProject} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)
49-
endif (USE_CONAN_LIBS)
47+
target_link_libraries(${ProjectTest} ${ProjectId} ${TestBaseProject} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)
48+
endif (USE_CONAN_LIBS)
5049

5150
set_property(TARGET ${ProjectTest} PROPERTY CXX_STANDARD 14)
5251
set_property(TARGET ${ProjectTest} PROPERTY CXX_STANDARD_REQUIRED ON)

scripts/setup-new-problem

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function write_header_file {
6666
done
6767

6868
echo -ne "#ifndef ${problem_name^^}_H
69-
#define ${problem_name^^}_H
69+
#define ${problem_name^^}_H
7070
7171
namespace hackerrank {
7272
namespace bmgandre {${ns_begin}

0 commit comments

Comments
 (0)