|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- # Project setup
- PROJECT(xml)
- CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
-
-
- # Compiler setup
- SET(CMAKE_C_FLAGS_DEBUG "-DDEBUG")
- SET(CMAKE_C_FLAGS_RELEASE "-O2")
-
- #IF (${CMAKE_BUILD_TYPE} strequal "Debug")
- # ADD_DEFINITIONS(-DDEBUG)
- #
- #ELSE (DEFINED ${DEBUG_BUILD})
- # SET(CMAKE_BUILD_TYPE ${CMAKE_C_FLAGS_RELEASE})
- #ENDIF (DEFINED ${DEBUG_BUILD})
-
-
- # Sources
- SET(SOURCE_DIRECTORY src)
- SET(TEST_SOURCE_DIRECTORY test)
-
-
- # Build library
- ADD_LIBRARY(xml STATIC
- ${SOURCE_DIRECTORY}/xml.c
- )
-
-
- # Build unit cases
- INCLUDE_DIRECTORIES(${SOURCE_DIRECTORY})
-
- ADD_EXECUTABLE(test-xml
- ${TEST_SOURCE_DIRECTORY}/test-xml
- )
- TARGET_LINK_LIBRARIES(test-xml xml)
-
-
- # Building example
- ADD_EXECUTABLE(example
- ${TEST_SOURCE_DIRECTORY}/example
- )
- TARGET_LINK_LIBRARIES(example xml)
-
-
- # Deploy
- #INSTALL(TARGETS xml DESTINATION lib)
- #INSTALL(FILES DESTINATION)
-
|