Browse Source

cmake setup

Fabian Peter Hammerle 8 years ago
commit
3982c0194b
3 changed files with 28 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 16 0
      CMakeLists.txt
  3. 11 0
      main.cpp

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+/build

+ 16 - 0
CMakeLists.txt

@@ -0,0 +1,16 @@
+cmake_minimum_required (VERSION 2.8.0)
+project (app)
+
+file(GLOB SOURCES *.cpp)
+
+find_library(XDO_LIB xdo)
+if(NOT XDO_LIB)
+    message(FATAL_ERROR "libxdo not found")
+endif()
+
+# add_definitions(-pthread)
+# add_definitions(-std=c++11)
+# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
+
+add_executable(app ${SOURCES})
+target_link_libraries(app "${XDO_LIB}")

+ 11 - 0
main.cpp

@@ -0,0 +1,11 @@
+extern "C" {
+    #include <xdo.h>
+}
+
+int main() {
+    xdo_t* xdo = xdo_new(NULL);
+    if(!xdo) {
+        return 1;
+    }
+    return 0;
+}