Created
September 10, 2011 06:06
-
-
Save fpersson/1207996 to your computer and use it in GitHub Desktop.
a minimal working sample of cmake for gtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Breif - A minimal working CMakeLists.txt for goggle unittesting | |
# Author - Fredrik Persson - [email protected] | |
# Licens - BSD | |
cmake_minimum_required (VERSION 2.6) | |
project(demo) | |
find_package (GTest REQUIRED) | |
include_directories(${GTest_INCLUDE_DIRS}) | |
set(CORELIBS ${GTEST_BOTH_LIBRARIES} ) | |
set(CMAKE_CXX_FLAGS "-pthread") | |
add_executable(demo_unittest ${CORELIBS} test.cpp ) | |
target_link_libraries(demo_unittest ${CORELIBS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <gtest/gtest.h> | |
TEST(footest, inittest){ | |
} | |
int main(int argc, char* argv[]) | |
{ | |
::testing::InitGoogleTest(&argc, argv); | |
RUN_ALL_TESTS(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment