demo/CMakeLists.txt
author Akos Ladanyi <ladanyi@tmit.bme.hu>
Wed, 05 Nov 2008 14:44:37 +0000
changeset 363 a637fb9d457b
parent 141 96f81c791f0c
child 473 17d918051964
child 510 d8ca76573eb3
permissions -rw-r--r--
Revert to the canonical way of customizing CXXFLAGS

A default list of compiler flags is set via AM_CXXFLAGS Automake variable.
However this gets overridden by per-target CXXFLAGS variables (e.g.
foo_CXXFLAGS in case the foo target). Because of this you should append
$(AM_CXXFLAGS) to the end of the per-target CXXFLAGS variables (e.g.
foo_CXXFLAGS = ... $(AM_CXXFLAGS)).

After this default list of flags the contents of the CXXFLAGS user variable is
passed to the compiler. This variable has a default value determined by
configure (in case of g++ it is '-g -O2'). You can override this by specifying
CXXFLAGS when invoking make (e.g. make CXXFLAGS='-O3').
     1 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
     2 
     3 LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
     4 
     5 SET(DEMOS
     6   arg_parser_demo
     7   graph_to_eps_demo
     8   lgf_demo)
     9 
    10 FOREACH(DEMO_NAME ${DEMOS})
    11   ADD_EXECUTABLE(${DEMO_NAME} ${DEMO_NAME}.cc)
    12   TARGET_LINK_LIBRARIES(${DEMO_NAME} lemon)
    13 ENDFOREACH(DEMO_NAME)