Permalink
Browse files

Merge pull request #8 from png85/OpenKTG.unix

FindOpenKTG.cmake (via png85)
  • Loading branch information...
2 parents a25f2cf + 1b1c56a commit d2854b84cecdb083f99707cc47dfff588f45b8c0 @rygorous rygorous committed Apr 18, 2012
Showing with 46 additions and 0 deletions.
  1. +2 −0 ktg/.gitignore
  2. +3 −0 ktg/CMakeLists.txt
  3. +41 −0 ktg/FindOpenKTG.cmake
View
@@ -5,3 +5,5 @@ ipch/
*.sln.old
*.sdf
*.opensdf
+build/
+*~
View
@@ -15,6 +15,9 @@ add_library(OpenKTG ${openKTG_SOURCES})
install(TARGETS OpenKTG ARCHIVE DESTINATION lib)
install(FILES ${openKTG_HEADERS} DESTINATION include/OpenKTG)
+set(openKTG_DOC_FILES LICENSE README.txt)
+install(FILES ${openKTG_DOC_FILES} DESTINATION share/doc/OpenKTG)
+
#
# demo executable
add_executable(demo demo.cpp)
View
@@ -0,0 +1,41 @@
+#
+# CMake find_package macro for libOpenKTG
+#
+# This file can be included in projects using libOpenKTG to automatically
+# locate the library & include directories.
+#
+
+if(QIRC_INCLUDE_DIR)
+ set(OpenKTG_FIND_QUIETLY TRUE)
+endif(OpenKTG_INCLUDE_DIR)
+
+find_path(OpenKTG_INCLUDE_DIR OpenKTG/gentexture.hpp
+ PATHS
+ "$ENV{OpenKTG}/include"
+ /usr/local/include
+ /usr/pkg/include
+ /usr/include
+)
+
+find_library(OpenKTG_LIBRARIES OpenKTG
+ PATHS
+ "$ENV{OpenKTG}/lib"
+ /usr/local/lib
+ /usr/pkg/lib
+ /usr/lib
+)
+
+set(OpenKTG_FOUND FALSE)
+if(OpenKTG_INCLUDE_DIR)
+ if(OpenKTG_LIBRARIES)
+ set(OpenKTG_FOUND TRUE)
+ if(NOT OpenKTG_FIND_QUIETLY)
+ message(STATUS "Found libOpenKTG: ${OpenKTG_LIBRARIES}")
+ endif(NOT OpenKTG_FIND_QUIETLY)
+ endif(OpenKTG_LIBRARIES)
+endif(OpenKTG_INCLUDE_DIR)
+
+mark_as_advanced(
+ OpenKTG_INCLUDE_DIR
+ OpenKTG_LIBRARIES
+)

0 comments on commit d2854b8

Please sign in to comment.