src/proto2/CMakeLists.txt
changeset 6 faa4e777cc6e
child 8 2de58a6d0395
equal deleted inserted replaced
5:617813994ab1 6:faa4e777cc6e
       
     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")
       
     9 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -pedantic -Wall -Wextra")
       
    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 # ClanLib 0.8
       
    19 find_package(ClanLib 0.8 REQUIRED COMPONENTS Core App Network)
       
    20 include_directories(${ClanLib_INCLUDE_DIRS})
       
    21 set(LIBS ${LIBS} ${ClanLib_LIBRARIES})
       
    22 
       
    23 # Assumes the project generates only one executable. If you need more, you'll need to alter
       
    24 # the script and replace ${PROJECT_SHORT_NAME} by executable name.
       
    25 add_executable("${PROJECT_SHORT_NAME}/proto2" ${SOURCES})
       
    26 target_link_libraries("${PROJECT_SHORT_NAME}/proto2" ${LIBS})
       
    27 install(TARGETS "${PROJECT_SHORT_NAME}/proto2" DESTINATION bin)
       
    28 
       
    29