terom@417: FILE(GLOB SOURCE_FILES "*.cc") terom@417: FILE(GLOB HEADER_FILES "*.hh") hrnt@0: terom@397: set_source_files_properties("version.c" PROPERTIES GENERATED true) hrnt@0: terom@417: # Component selection terom@417: set (GRAPHICS_ENABLED true) terom@417: set (NETWORK_ENABLED true) terom@417: terom@417: mark_as_advanced (CLEAR GRAPHICS_ENABLED NETWORK_ENABLED) terom@417: 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: terom@412: # main module terom@412: set (CORE_CLANLIB_COMPONENTS Core App Signals) terom@417: set (CORE_SOURCES ${SOURCE_FILES} ${HEADER_FILES} "version.c") terom@412: terom@412: # Graphics module terom@417: if (GRAPHICS_ENABLED) terom@417: add_subdirectory (Graphics) terom@417: terom@417: endif (GRAPHICS_ENABLED) terom@417: terom@417: # Network module terom@417: if (NETWORK_ENABLED) terom@417: add_subdirectory (Network) terom@417: terom@417: endif (NETWORK_ENABLED) terom@412: hrnt@0: # Libraries terom@412: set (CLANLIB_VERSION 0.8) terom@417: set (CLANLIB_COMPONENTS ${CORE_CLANLIB_COMPONENTS} ${GRAPHICS_CLANLIB_COMPONENTS} ${NETWORK_CLANLIB_COMPONENTS}) hrnt@0: terom@185: # ClanLib 0.8 terom@412: message (STATUS "Finding ClanLib version=${CLANLIB_VERSION}, components=${CLANLIB_COMPONENTS}" ) terom@412: find_package(ClanLib ${CLANLIB_VERSION} REQUIRED COMPONENTS ${CLANLIB_COMPONENTS}) terom@412: terom@185: include_directories(${ClanLib_INCLUDE_DIRS}) terom@412: terom@412: # build list of libs/source files terom@185: set(LIBS ${LIBS} ${ClanLib_LIBRARIES}) terom@417: set(SOURCES ${CORE_SOURCES} ${GRAPHICS_SOURCES} ${NETWORK_SOURCES}) 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: