Functionize setting cmake dirs, cover backbone and tests.
include_directories("${PROJECT_SOURCE_DIR}/src/")
+function(set_output_dirs TARGET_NAME PATH)
+ set_target_properties("${TARGET_NAME}" PROPERTIES
+ PREFIX ""
+ LIBRARY_OUTPUT_DIRECTORY "${PATH}"
+ RUNTIME_OUTPUT_DIRECTORY "${PATH}")
+endfunction(set_output_dirs)
+
set(backbone_SOURCES
t/src/lily_backbone.c
t/src/lily_covlib.c)
@@ -10,11 +17,6 @@ else()
add_library(backbone SHARED ${backbone_SOURCES})
endif()
-set_target_properties(backbone PROPERTIES
- PREFIX ""
- LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/test/t/"
- RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/test/t/")
-
add_executable(pre-commit-tests test_driver.c $<TARGET_OBJECTS:liblily_obj>)
if(LILY_NEED_DL)
@@ -24,3 +26,6 @@ endif()
if(LILY_NEED_M)
target_link_libraries(pre-commit-tests m)
endif()
+
+set_output_dirs(backbone "${PROJECT_BINARY_DIR}/test/t/")
+set_output_dirs(pre-commit-tests "${PROJECT_BINARY_DIR}")
