Cmake support
authorMarius Kintel <kintel@sim.no>
Tue, 17 Feb 2009 00:41:04 +0000 (01:41 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 10 Mar 2009 22:26:40 +0000 (23:26 +0100)
CMakeLists.txt [new file with mode: 0644]
config.h.cmake [new file with mode: 0644]
src/CMakeLists.txt [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6dc33de
--- /dev/null
@@ -0,0 +1,36 @@
+project(ftdi_eeprom)
+set(MAJOR_VERSION 0)
+set(MINOR_VERSION 2)
+set(PATCH_VERSION 0)
+set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})
+set(VERSION ${MAJOR_VERSION}.${MINOR_VERSION})
+
+# CMake
+if("${CMAKE_BUILD_TYPE}" STREQUAL "")
+   set(CMAKE_BUILD_TYPE Debug)
+endif("${CMAKE_BUILD_TYPE}" STREQUAL "")
+set(CMAKE_COLOR_MAKEFILE ON)
+cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
+
+# Debug build
+message("-- Build type: ${CMAKE_BUILD_TYPE}")
+if(${CMAKE_BUILD_TYPE} STREQUAL Debug)
+   add_definitions(-DDEBUG)
+endif(${CMAKE_BUILD_TYPE} STREQUAL Debug)
+
+include(FindPkgConfig)
+pkg_check_modules(Confuse REQUIRED libconfuse)
+INCLUDE_DIRECTORIES(${Confuse_INCLUDE_DIRS})
+LINK_DIRECTORIES(${Confuse_LIBRARY_DIRS})
+SET(libs ${libs} ${Confuse_LIBRARIES})
+
+pkg_check_modules(FTDI REQUIRED libftdi)
+INCLUDE_DIRECTORIES(${FTDI_INCLUDE_DIRS})
+LINK_DIRECTORIES(${FTDI_LIBRARY_DIRS})
+SET(libs ${libs} ${FTDI_LIBRARIES})
+
+configure_file(${PROJECT_SOURCE_DIR}/config.h.cmake ${PROJECT_BINARY_DIR}/config.h)
+add_definitions(-DHAVE_CONFIG_H)
+INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
+
+add_subdirectory(src)
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644 (file)
index 0000000..6e6624a
--- /dev/null
@@ -0,0 +1,5 @@
+#define HAVE_LIBCONFUSE ${Confuse_FOUND}
+
+/* Version number of package */
+#define VERSION "${VERSION}"
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b49ee71
--- /dev/null
@@ -0,0 +1,2 @@
+ADD_EXECUTABLE(ftdi_eeprom main.c)
+TARGET_LINK_LIBRARIES(ftdi_eeprom ${libs})