diff --git a/CMakeLists.txt b/CMakeLists.txt index 314aa20..b247743 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,27 +12,33 @@ file(GLOB_RECURSE cxx_files ./src/*.cxx) file(GLOB_RECURSE header_files ./src/*.h) add_executable(UR ${cpp_files} ${cxx_files} ${header_files} ${Aurora_Source}) target_compile_options(UR PUBLIC ${Aurora_Complie_Options} "-march=native") +target_include_directories(UR PUBLIC ./src/) target_include_directories(UR PUBLIC ${Aurora_INCLUDE_DIRS}) target_include_directories(UR PUBLIC ${Parser_INCLUDE_DIRS}) target_include_directories(UR PUBLIC ${URDepends_INCLUDES_DIRS}) target_link_libraries(UR PUBLIC ${Aurora_Libraries}) target_link_libraries(UR PUBLIC matio) target_link_libraries(UR PUBLIC ${Parser_Libraries}) + target_link_libraries(UR PUBLIC URDepends::TransDetection) +target_link_libraries(UR PUBLIC URDepends::eikonal) + find_package(GTest REQUIRED) INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS}) -file(GLOB_RECURSE test_cpp ./test/*.cpp) -enable_testing() +enable_testing() +file(GLOB_RECURSE test_cpp test/*.cpp) add_executable(UR_Test ${cpp_files} ${header_files} ${Aurora_Source} ${test_cpp} ) target_include_directories(UR_Test PUBLIC ./test/ ./src/) target_compile_options(UR_Test PUBLIC ${Aurora_Complie_Options} "-march=native") target_include_directories(UR_Test PUBLIC ${Aurora_INCLUDE_DIRS}) target_include_directories(UR_Test PUBLIC ${Parser_INCLUDE_DIRS}) target_include_directories(UR_Test PUBLIC ${URDepends_INCLUDES_DIRS}) +# 必须写前面不然容易出问题 +target_link_libraries(UR_Test PUBLIC ${GTEST_BOTH_LIBRARIES}) target_link_libraries(UR_Test PUBLIC ${Aurora_Libraries}) target_link_libraries(UR_Test PUBLIC matio) target_link_libraries(UR_Test PUBLIC ${Parser_Libraries}) target_link_libraries(UR_Test PUBLIC URDepends::TransDetection) -target_link_libraries(UR_Test PUBLIC ${GTEST_BOTH_LIBRARIES}) -gtest_discover_tests(UR_Test ) \ No newline at end of file +target_link_libraries(UR_Test PUBLIC URDepends::eikonal) +gtest_discover_tests(UR_Test) \ No newline at end of file