src/CMakeLists.txt
changeset 185 25becd2cb026
parent 119 7dceed9a7f93
child 186 0738f2949a2b
equal deleted inserted replaced
184:561892e2a30e 185:25becd2cb026
     1 FILE(GLOB SOURCE_FILES "*.cc")
     1 FILE(GLOB SOURCE_FILES "*.cc")
     2 FILE(GLOB HEADER_FILES "*.hh")
     2 FILE(GLOB HEADER_FILES "*.hh")
     3 
     3 
     4 set(SOURCES ${SOURCE_FILES} ${HEADER_FILES})
     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 -Wall -Wextra")
       
    10 endif(CMAKE_COMPILER_IS_GNUCXX)
       
    11 
     5 
    12 # Generate config.h
     6 # Generate config.h
    13 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY)
     7 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY)
    14 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
     8 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
    15 
     9 
    16 # Libraries
    10 # Libraries
    17 
    11 
    18 # An example of how to use a library. You'll need FindExampleLibrary.cmake for this to work
    12 # ClanLib 0.8
    19 # Put that file in trunk/cmake/Modules/ and also look inside the file for further instructions.
    13 find_package(ClanLib 0.8 REQUIRED COMPONENTS Core App Signals Display GL Sound Network)
    20 #find_package(ExampleLibrary REQUIRED)
    14 include_directories(${ClanLib_INCLUDE_DIRS})
    21 #include_directories(${ExampleLibrary_INCLUDE_DIRS})
    15 set(LIBS ${LIBS} ${ClanLib_LIBRARIES})
    22 #set(LIBS ${LIBS} ${ExampleLibrary_LIBRARIES})
       
    23 
    16 
    24 # Assumes the project generates only one executable. If you need more, you'll need to alter
    17 # 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.
    18 # the script and replace ${PROJECT_SHORT_NAME} by executable name.
    26 add_executable("${PROJECT_SHORT_NAME}" ${SOURCES})
    19 add_executable("${PROJECT_SHORT_NAME}" ${SOURCES})
    27 target_link_libraries("${PROJECT_SHORT_NAME}" ${LIBS})
    20 target_link_libraries("${PROJECT_SHORT_NAME}" ${LIBS})
    28 install(TARGETS "${PROJECT_SHORT_NAME}" DESTINATION bin)
    21 install(TARGETS "${PROJECT_SHORT_NAME}" DESTINATION bin)
    29 
    22 
    30 # prototype
       
    31 add_subdirectory(proto2)
       
    32 
    23