-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow cmake to build as both a standalone project as well as a subproject (ie add_subdirectory(mkl-dnn)) #44
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,15 +18,15 @@ add_subdirectory (gtest) | |
|
||
set(APP_NAME "gtest") | ||
set(MAIN_SRC_GTEST main.cpp) | ||
include_directories(${CMAKE_SOURCE_DIR}/include) | ||
include_directories(${CMAKE_SOURCE_DIR}/tests/gtests | ||
${CMAKE_SOURCE_DIR}/tests/gtests/gtest | ||
|
||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/gtest | ||
${CMAKE_CURRENT_SOURCE_DIR}/in | ||
) | ||
include_directories(${CMAKE_SOURCE_DIR}/tests/gtests/in) | ||
# TODO: enable me! | ||
#file(GLOB API_TEST_CASES_SRC api_tests/*.cpp) | ||
#file(GLOB PRIM_TEST_CASES_SRC test_*.cpp) | ||
file(GLOB PRIM_TEST_CASES_SRC RELATIVE ${CMAKE_SOURCE_DIR}/tests/gtests | ||
file(GLOB PRIM_TEST_CASES_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/../gtests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is incompatible with cmake 2.8.11. For some reasons Is there any particular reason why you do this trick: ../gtests, even though you are already in this directory? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me check. I found the multiple gtest directories a little confusing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, removed |
||
test_sum.cpp | ||
test_reorder.cpp | ||
test_concat.cpp | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,9 @@ | |
set(TARGET_NAME gtest) | ||
set(MAIN_SRC "src/gtest-all.cc") | ||
source_group("" FILES ${MAIN_SRC}) | ||
include_directories(${CMAKE_SOURCE_DIR}/tests/gtests | ||
${CMAKE_SOURCE_DIR}/tests/gtests/gtest) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/.. | ||
${CMAKE_CURRENT_SOURCE_DIR}/gtest) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same as here: what this line stands for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed |
||
find_package(Threads REQUIRED) | ||
add_library(${TARGET_NAME} STATIC ${MAIN_SRC}) | ||
target_link_libraries(${TARGET_NAME} ${CMAKE_THREAD_LIBS_INIT}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any specific reason for adding this line?
${CMAKE_CURRENT_SOURCE_DIR}/..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed