Commit d6a3475d authored by chuck cranor's avatar chuck cranor
Browse files

update cmake build. examples and tests moved.

parent fb258c01
...@@ -4,18 +4,10 @@ ...@@ -4,18 +4,10 @@
# included from ../CMakeLists.txt # included from ../CMakeLists.txt
set (margo-egs client-timeout.c client.c server-hang.c server.c sleep.c) add_executable (example-client client.c)
target_link_libraries (example-client margo)
set_property (TARGET example-client PROPERTY OUTPUT_NAME client)
add_library (my-rpc STATIC my-rpc.c) add_executable (example-server my-rpc.c server.c)
target_link_libraries (my-rpc margo) target_link_libraries (example-server margo)
set_property (TARGET example-server PROPERTY OUTPUT_NAME server)
foreach (lcv ${margo-egs})
# need a exec name... use regex to extract the file basename into ${id}
string (REGEX REPLACE ".*/" "" id ${lcv})
string (REGEX REPLACE "([A-Za-z0-9_]+)\\.c+$" "\\1" id ${id})
add_executable (${id} ${lcv})
target_link_libraries (${id} my-rpc)
endforeach ()
...@@ -4,9 +4,23 @@ ...@@ -4,9 +4,23 @@
# included from ../CMakeLists.txt # included from ../CMakeLists.txt
set (abts-tests basic.sh sleep.sh timeout.sh) set (margo-testprogs sleep server client server-hang client-timeout)
set (margo-tests sleep.sh basic.sh basic-ded-pool.sh timeout.sh)
foreach (lcv ${abts-tests}) # server helper library
add_library (my-rpc STATIC my-rpc.c)
target_link_libraries (my-rpc margo)
foreach (lcv ${margo-testprogs})
add_executable (${lcv} ${lcv}.c)
if (${lcv} MATCHES server)
target_link_libraries (${lcv} my-rpc) # my-rpc implies margo
else ()
target_link_libraries (${lcv} margo)
endif ()
endforeach ()
foreach (lcv ${margo-tests})
# need a test name... use regex to extract the file basename into ${id} # need a test name... use regex to extract the file basename into ${id}
string (REGEX REPLACE ".*/" "" id ${lcv}) string (REGEX REPLACE ".*/" "" id ${lcv})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment