Hi, I want to use Gtest for some unit tests on a number of the C functions that comprise my C executable. However, Gtest ( And gMock ) are C++ testing frameworks.
What I would like to have is a project for my exe and then a separate project for my C++ library and be able to change the source properties to use the language CXX just before compiling. The problem I'm having is that CMake uses the CXX compiler for the C files. Here's what I would like to have project(cexe) set(SOURCES foo.c bar.c ) add_executable( cexe ${SOURCES} ) project(cpplib) set_source_files_properties(${SOURCES} PROPERTIES LANGUAGE CXX ) add_library( cpplib SHARED ${SOURCES} ) Is there a way to do this ? Can target_compile_options set the compile type for a given target ? In the past I've had to copy the .C files to some renamed .CPP equivalent and then compile off of that. I'm hoping that enough new functionality has been added to Cmake to allow separation between compiles. Thanks, -- Jimi Damon ACCES I/O Products, Inc. <http://accesio.com/go.cgi?p=/contact/contact.html> Linux Engineer jda...@accesio.com (858) 550-7320 x3015 [image: ACCES I/O Logo] 10623 Roselle Street San Diego CA 92121-1506 <http://accesio.com/> -- WARNING - This e-mail or its attachments may contain controlled technical data or controlled technology within the definition of the International Traffic in Arms Regulations (ITAR) or Export Administration Regulations (EAR), and are subject to the export control laws of the U.S. Government. Transfer of this data or technology by any means to a foreign person, whether in the United States or abroad, without an export license or other approval from the U.S. Government, is prohibited. The information contained in this document is CONFIDENTIAL and property of ACCES I/O Products, Inc. Any unauthorized review, use, disclosure or distribution is prohibited without express written consent of ACCES I/O Products, Inc. If you are not the intended recipient, please contact the sender and destroy all copies of the original message and enclosed attachments.
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake