1 #=========================================================
3 MESSAGE(${in}=${${in}})
5 #=========================================================
6 # Process ggo (gengetopt) files (http://www.gnu.org/software/gengetopt/)
7 MACRO (WRAP_GGO GGO_SRCS)
8 MAKE_DIRECTORY(${CMAKE_BINARY_DIR}/ggo)
9 FOREACH(GGO_FILE ${ARGN})
10 GET_FILENAME_COMPONENT(GGO_BASEFILENAME ${GGO_FILE} NAME_WE)
11 GET_FILENAME_COMPONENT(GGO_FILE_ABS ${GGO_FILE} ABSOLUTE)
12 SET(GGO_H ${GGO_BASEFILENAME}_ggo.h)
13 SET(GGO_C ${GGO_BASEFILENAME}_ggo.c)
14 SET(GGO_OUTPUT ${GGO_H} ${GGO_C})
15 ADD_CUSTOM_COMMAND(OUTPUT ${GGO_OUTPUT}
16 COMMAND ${CLITK_GENGETOPT}/gengetopt
17 ARGS < ${GGO_FILE_ABS}
18 --output-dir=${CMAKE_CURRENT_BINARY_DIR}
19 --arg-struct-name=args_info_${GGO_BASEFILENAME}
20 --func-name=cmdline_parser_${GGO_BASEFILENAME}
21 --file-name=${GGO_BASEFILENAME}_ggo
27 SET(${GGO_SRCS} ${${GGO_SRCS}} ${CMAKE_CURRENT_BINARY_DIR}/${GGO_BASEFILENAME}_ggo.c)
28 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) #For _ggo.h includes
32 # Reproduce old mechanism with new macro for ggo files (for the time being)
33 FILE(GLOB ALL_GGO_FILES *.ggo)
34 WRAP_GGO(ALL_GGO_SRCS ${ALL_GGO_FILES})
35 #=========================================================
36 #Set a reasonable build mode default if the user hasn't set any
37 if (NOT CMAKE_BUILD_TYPE)
38 set(CMAKE_BUILD_TYPE Release)
39 endif (NOT CMAKE_BUILD_TYPE)
40 #=========================================================
41 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
42 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
43 LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lib)
44 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/common)
45 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/tools)
46 INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/filters) #For _ggo.h includes from other directories
47 #=========================================================