File tree Expand file tree Collapse file tree 4 files changed +16
-13
lines changed
Expand file tree Collapse file tree 4 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,15 @@ include(${CMAKE_SOURCE_DIR}/scripts/cmake/project_add_all_folders.cmake)
1414include (${CMAKE_SOURCE_DIR} /scripts/cmake/conan_custom_setup.cmake)
1515include (${CMAKE_SOURCE_DIR} /scripts/cmake/hackerrank_challenge.cmake)
1616
17-
1817compiler_check()
1918
2019if (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)
2326endif (USE_CONAN_LIBS)
2427
2528include (CTest)
Original file line number Diff line number Diff line change 11[requires]
22gtest/1.10.0
33boost/1.69.0
4+ jsoncpp/1.9.4
45
56[generators]
67cmake
Original file line number Diff line number Diff 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)
2221endmacro ()
2322
2423macro (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 )
Original file line number Diff line number Diff 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
7171namespace hackerrank {
7272namespace bmgandre {${ns_begin}
You can’t perform that action at this time.
0 commit comments