Commit 6299e02c authored by Jan Möbius's avatar Jan Möbius

Added library dir to unittests

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@410 fdac6126-5c0c-442c-9429-916003d36597
parent 72508d77
......@@ -51,6 +51,11 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
~/sw/gtest/lib
/opt/local/lib
/usr/local/lib)
if ( _GTEST_LIBRARY )
get_filename_component(_GTEST_LIBRARY_DIR ${_GTEST_LIBRARY} PATH CACHE )
endif()
endif(GTEST_PREFIX)
if(_GTEST_INCLUDE_DIR AND _GTEST_LIBRARY AND _GTEST_MAIN_LIBRARY)
set(GTEST_FOUND true)
......@@ -60,7 +65,9 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
"Libraries to link for Google Test framework")
set(GTEST_MAIN_LIBRARIES ${_GTEST_MAIN_LIBRARY} CACHE FILEPATH
"Libraries to link for Google Test automatic main() definition")
mark_as_advanced(GTEST_INCLUDE_DIRS GTEST_LIBRARIES GTEST_MAIN_LIBRARIES)
set(GTEST_LIBRARY_DIR ${_GTEST_LIBRARY_DIR} CACHE FILEPATH
"Library dir containing Google Test libraries")
mark_as_advanced(GTEST_INCLUDE_DIRS GTEST_LIBRARIES GTEST_MAIN_LIBRARIES GTEST_LIBRARY_DIR )
if(NOT GoogleTest_FIND_QUIETLY)
message(STATUS "Found Google Test: ${GTEST_LIBRARIES}")
endif(NOT GoogleTest_FIND_QUIETLY)
......
......@@ -16,6 +16,8 @@ if(GTEST_FOUND)
add_executable(unittests EXCLUDE_FROM_ALL unittests.cc)
# Link against all necessary libraries
target_link_libraries(unittests OpenMeshCore OpenMeshTools gtest gtest_main pthread)
# set additional link directories
link_directories(${GTEST_LIBRARY_DIR} )
# Set output directory to ${BINARY_DIR}/Unittests
set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Unittests)
# Set compiler flags
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment