diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 82ad108920..e75afc2e7a 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -35,7 +35,8 @@ link_directories(${PMEMOBJ_LIBRARY_DIRS}) add_cppstyle(examples-common ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) add_check_whitespace(examples-common ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) -function(add_example name srcs) +function(add_example name) + set(srcs ${ARGN}) prepend(srcs ${CMAKE_CURRENT_SOURCE_DIR} ${srcs}) add_executable(example-${name} ${srcs}) add_cppstyle(examples-${name} ${srcs}) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 57dc6cdd1a..9120fcaeb1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -85,12 +85,13 @@ set(CMAKE_REQUIRED_INCLUDES ${SAVED_CMAKE_REQUIRED_INCLUDES}) add_cppstyle("tests-common" ${CMAKE_CURRENT_SOURCE_DIR}/common/*.*pp) add_check_whitespace("tests-common" ${CMAKE_CURRENT_SOURCE_DIR}/common/*.*pp) -function(build_test name srcs) +function(build_test name) # skip posix tests if(${name} MATCHES "posix$" AND WIN32) return() endif() + set(srcs ${ARGN}) prepend(srcs ${CMAKE_CURRENT_SOURCE_DIR} ${srcs}) add_cppstyle(tests-${name} ${srcs})