Solved it by the following code.
ExternalProject_Add(project_luajit
#URL http://luajit.org/download/LuaJIT-2.0.1.tar.gz
SOURCE_DIR "/users/wcd/cmake-v3/out/build/project_luajit-prefix/src/project_luajit"
DOWNLOAD_COMMAND ""
#PREFIX ${CMAKE_CURRENT_BINARY_DIR}/luajit-2.0.1
CONFIGURE_COMMAND ""
BUILD_COMMAND make
BUILD_IN_SOURCE true
INSTALL_COMMAND make install
)
ExternalProject_Get_Property(project_luajit SOURCE_DIR)
message("+++++" ${SOURCE_DIR})
add_executable(${PROJECT_NAME} main.c)
target_link_libraries(${PROJECT_NAME} ${SOURCE_DIR}/src/libluajit.so)