0
|
1 |
FILE(GLOB SOURCE_FILES "*.cc")
|
|
2 |
FILE(GLOB HEADER_FILES "*.hh")
|
|
3 |
|
|
4 |
set(SOURCES ${SOURCE_FILES} ${HEADER_FILES})
|
|
5 |
|
|
6 |
# Set default compile flags for GCC
|
|
7 |
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
8 |
message(STATUS "GCC detected, enabling pedantic mode and warnings")
|
10
|
9 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -Wall -Wextra")
|
0
|
10 |
endif(CMAKE_COMPILER_IS_GNUCXX)
|
|
11 |
|
|
12 |
# Generate config.h
|
|
13 |
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY)
|
|
14 |
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
|
15 |
|
|
16 |
# Libraries
|
|
17 |
|
|
18 |
# An example of how to use a library. You'll need FindExampleLibrary.cmake for this to work
|
|
19 |
# Put that file in trunk/cmake/Modules/ and also look inside the file for further instructions.
|
|
20 |
#find_package(ExampleLibrary REQUIRED)
|
|
21 |
#include_directories(${ExampleLibrary_INCLUDE_DIRS})
|
|
22 |
#set(LIBS ${LIBS} ${ExampleLibrary_LIBRARIES})
|
|
23 |
|
|
24 |
# Assumes the project generates only one executable. If you need more, you'll need to alter
|
|
25 |
# the script and replace ${PROJECT_SHORT_NAME} by executable name.
|
|
26 |
add_executable("${PROJECT_SHORT_NAME}" ${SOURCES})
|
|
27 |
target_link_libraries("${PROJECT_SHORT_NAME}" ${LIBS})
|
|
28 |
install(TARGETS "${PROJECT_SHORT_NAME}" DESTINATION bin)
|
|
29 |
|
6
|
30 |
# prototype
|
|
31 |
add_subdirectory(proto2)
|
|
32 |
|