Re: [CMake] adding extra target to CMakeLists.txt

2010-02-11 Thread Olaf Peter
Tyler Roscoe schrieb: On Wed, Feb 10, 2010 at 09:08:50PM +0100, Olaf Peter wrote: How can I add an extra lint/syntax check target for my executable, like: check-syntax: c++ -o /dev/null ${CXX_FLAGS} ${CXX_DEFINES} -S ${MY_PROJECT_SOURCES} .PHONY: check-syntax You'll want to look at

Re: [CMake] adding extra target to CMakeLists.txt

2010-02-11 Thread Olaf Peter
OK, now I have it: add_custom_target (syntax-check COMMAND $(CXX) $(CXXFLAGS) -Wall -Wextra -pedantic -fsyntax-only $(CHECK_SRC) VERBATIM) But how can I get there the Defines and Includes from regular target compile? Thanks, Olaf ___ Powered by

Re: [CMake] adding extra target to CMakeLists.txt

2010-02-11 Thread Ryan Pavlik
Load them from the target using the target properties: get_directory_property(_include_dirs INCLUDE_DIRECTORIES) set(_includeflags) foreach(_dir ${_include_dirs}) list(APPEND _args ${YOURTOOL_INCLUDEPATH_ARG}${_dir}) endforeach() get_target_property(_sources ${_targetname} SOURCES)

[CMake] adding extra target to CMakeLists.txt

2010-02-10 Thread Olaf Peter
How can I add an extra lint/syntax check target for my executable, like: check-syntax: c++ -o /dev/null ${CXX_FLAGS} ${CXX_DEFINES} -S ${MY_PROJECT_SOURCES} .PHONY: check-syntax to make created Makefile?? thanks, Olaf ___ Powered by

Re: [CMake] adding extra target to CMakeLists.txt

2010-02-10 Thread Tyler Roscoe
On Wed, Feb 10, 2010 at 09:08:50PM +0100, Olaf Peter wrote: How can I add an extra lint/syntax check target for my executable, like: check-syntax: c++ -o /dev/null ${CXX_FLAGS} ${CXX_DEFINES} -S ${MY_PROJECT_SOURCES} .PHONY: check-syntax You'll want to look at add_custom_command() and