Re: [CMake] Makefile to CMakeLists.txt (GTEST)

2010-12-07 Thread Kevyn-Alexandre Paré
Yes it's true I didn't think of this one. It work nicely, here what I have done: wget http://googletest.googlecode.com/files/gtest-1.5.0.tar.bz2 tar xjvf gtest-1.5.0.tar.bz2 cd gtest-1.5.0 mkdir my-test vim CMakeLists.txt # Add ADD_SUBDIRECTORY(my-test) cd my-test # SIMPLE HEADER FILE vim

Re: [CMake] Makefile to CMakeLists.txt (GTEST)

2010-12-07 Thread Kevyn-Alexandre Paré
Thx for replying, But it didn't change by switching it. Regards, Kevyn-Alexandre Paré On Wed, 2010-12-01 at 22:14 +, Fraser Hutchison wrote: Hi Kevyn-Alexandre, I think moving the -lpthread to after ${GTEST_LIB_PATH}gtest.a ${GTEST_LIB_PATH}gtest_main.a should help. Cheers,

Re: [CMake] Makefile to CMakeLists.txt (GTEST)

2010-12-07 Thread Kevyn-Alexandre Paré
Thx for replying, It seem that my simple example and using a add_subdirectory and reusing CMakelists.txt of the gtest source solved my problem. Regards, On Sat, 2010-12-04 at 05:48 -0500, Philip Lowman wrote: On Wed, Dec 1, 2010 at 10:59 AM, Kevyn-Alexandre Paré kap...@rogue-research.com

Re: [CMake] Makefile to CMakeLists.txt (GTEST)

2010-12-07 Thread Kevyn-Alexandre Paré
Just want to say that since I want to test C code i need this in my header file (for more details see http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B% 2B#Linking_C_and_C.2B.2B_code): #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */ extern C { #endif void function ();

Re: [CMake] Makefile to CMakeLists.txt (GTEST)

2010-12-04 Thread Philip Lowman
On Wed, Dec 1, 2010 at 10:59 AM, Kevyn-Alexandre Paré kap...@rogue-research.com wrote: Philip, Thx for the reply. Neither of these solutions change a thing. I try to play with ADD_CUSTOM_TARGET but same error... ADD_CUSTOM_TARGET(RRThread.o ALL COMMAND ${CMAKE_C_COMPILER} -I

Re: [CMake] Makefile to CMakeLists.txt (GTEST)

2010-12-01 Thread Kevyn-Alexandre Paré
Philip, Thx for the reply. Neither of these solutions change a thing. I try to play with ADD_CUSTOM_TARGET but same error... ADD_CUSTOM_TARGET(RRThread.o ALL COMMAND ${CMAKE_C_COMPILER} -I ${MICRONTRACKER_COMMON_PATH} -I${GTEST_HEADER_PATH} -lpthread -c ${MICRONTRACKER_COMMON_PATH}RRThread.c

Re: [CMake] Makefile to CMakeLists.txt (GTEST)

2010-12-01 Thread Ben Medina
Note that recent versions of gtest come with a CMakeLists.txt, so you can just use add_subdirectory on the gtest source tree. - Ben On Wed, Dec 1, 2010 at 7:59 AM, Kevyn-Alexandre Paré kap...@rogue-research.com wrote: Philip, Thx for the reply. Neither of these solutions change a thing. I

[CMake] Makefile to CMakeLists.txt (GTEST)

2010-11-29 Thread Kevyn-Alexandre Paré
Hi, /// - What I trying to do is to compile my unit test with google test with cmake from a working Makefile. /// - Here the Makefile RRThread.o : $(USER_DIR)/RRThread.c $(USER_DIR)/RRThread.h $(GTEST_HEADERS) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/RRThread.c UT_RRThread.o :

Re: [CMake] Makefile to CMakeLists.txt (GTEST)

2010-11-29 Thread Philip Lowman
Try adding the gtest.a library as well. Also, order does matter when you are linking static libraries so you might need to play with the ordering. Also, when you get some time, have a look at FindGTest.cmake. It may help you simplify adding your tests. On Mon, Nov 29, 2010 at 5:55 PM,