7091be1891
Summary: CMake is smart enough to transitively detect dependencies and link them appropriately. Therefore, it is enough that we put all libraries that memgraph uses to the dependency list of memgraph_lib and memgraph_pic targets. Patch the fmt library for C++14 and higher fmt library would detect that C++11 is supported and then put the compiler flag. This flag was set so it overrides parent project compiler flags. This override from fmt would prevent us from using C++14 features. New version (3.1) of fmt resolves this issue, but it hasn't been released yet. Therefore, this commit updates the script which clones fmt to use the released 3.0.1 version and apply the fix on that. Reviewers: dgleich, buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D441
31 lines
1.0 KiB
CMake
31 lines
1.0 KiB
CMake
find_package(Threads REQUIRED)
|
|
|
|
# get all cpp abs file names recursively starting from current directory
|
|
file(GLOB poc_cpps *.cpp)
|
|
message(STATUS "Available poc cpp files are: ${poc_cpps}")
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/poc)
|
|
|
|
# for each cpp file build binary
|
|
foreach(poc_cpp ${poc_cpps})
|
|
|
|
# get exec name (remove extension from the abs path)
|
|
get_filename_component(exec_name ${poc_cpp} NAME_WE)
|
|
|
|
# set target name in format {project_name}_{test_type}_{exec_name}
|
|
set(target_name ${project_name}_poc_${exec_name})
|
|
|
|
# build exe file
|
|
add_executable(${target_name} ${poc_cpp})
|
|
set_property(TARGET ${target_name} PROPERTY CXX_STANDARD ${cxx_standard})
|
|
|
|
# OUTPUT_NAME sets the real name of a target when it is built and can be
|
|
# used to help create two targets of the same name even though CMake
|
|
# requires unique logical target names
|
|
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${exec_name})
|
|
|
|
# link libraries
|
|
target_link_libraries(${target_name} memgraph_lib)
|
|
|
|
endforeach()
|