hrnt@0: FILE(GLOB SOURCE_FILES "*.cc") hrnt@0: FILE(GLOB HEADER_FILES "*.hh") hrnt@0: hrnt@0: set(SOURCES ${SOURCE_FILES} ${HEADER_FILES}) hrnt@0: hrnt@0: # Set default compile flags for GCC hrnt@0: if(CMAKE_COMPILER_IS_GNUCXX) hrnt@0: message(STATUS "GCC detected, enabling pedantic mode and warnings") hrnt@0: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -pedantic -Wall -Wextra") hrnt@0: endif(CMAKE_COMPILER_IS_GNUCXX) hrnt@0: hrnt@0: # Generate config.h hrnt@0: configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY) hrnt@0: include_directories("${CMAKE_CURRENT_BINARY_DIR}") hrnt@0: hrnt@0: # Libraries hrnt@0: hrnt@0: # An example of how to use a library. You'll need FindExampleLibrary.cmake for this to work hrnt@0: # Put that file in trunk/cmake/Modules/ and also look inside the file for further instructions. hrnt@0: #find_package(ExampleLibrary REQUIRED) hrnt@0: #include_directories(${ExampleLibrary_INCLUDE_DIRS}) hrnt@0: #set(LIBS ${LIBS} ${ExampleLibrary_LIBRARIES}) hrnt@0: hrnt@0: # Assumes the project generates only one executable. If you need more, you'll need to alter hrnt@0: # the script and replace ${PROJECT_SHORT_NAME} by executable name. hrnt@0: add_executable("${PROJECT_SHORT_NAME}" ${SOURCES}) hrnt@0: target_link_libraries("${PROJECT_SHORT_NAME}" ${LIBS}) hrnt@0: install(TARGETS "${PROJECT_SHORT_NAME}" DESTINATION bin) hrnt@0: terom@6: # prototype terom@6: add_subdirectory(proto2) terom@6: