summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-02-24 16:10:38 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-02-24 17:35:38 -0300
commita9a1bfa16220446594f2caa600c10f588f995981 (patch)
tree50df28c9d10dfe13f617fded1f37b6370967c0c8
parentf7a2b6099245ee47cd7f87b2ca7c0a8e513797d0 (diff)
downloadgeneratorrunner-a9a1bfa16220446594f2caa600c10f588f995981.tar.gz
generatorrunner-a9a1bfa16220446594f2caa600c10f588f995981.tar.xz
generatorrunner-a9a1bfa16220446594f2caa600c10f588f995981.zip
Remove FindGeneratorRunner.cmake file in favor of GeneratorRunnerConfig and Version .cmake files.
This is the right way to go, according to: - http://www.cmake.org/pipermail/cmake/2009-April/028504.html - http://www.cmake.org/Wiki/CMake_2.6_Notes#Packages Reviewed by Renato Ara├║jo <renato.filho@openbossa.org>
-rw-r--r--CMakeLists.txt12
-rw-r--r--FindGeneratorRunner.cmake.in21
-rw-r--r--GeneratorRunnerConfig.cmake.in7
-rw-r--r--GeneratorRunnerVersion.cmake.in9
4 files changed, 24 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fd5b7ff..710e6d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,8 +48,10 @@ target_link_libraries(generatorrunner
# create pkg-config file
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/generatorrunner.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/generatorrunner.pc" @ONLY)
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/FindGeneratorRunner.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/FindGeneratorRunner.cmake" @ONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/GeneratorRunnerConfig.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratorRunnerConfig.cmake" @ONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/GeneratorRunnerVersion.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratorRunnerVersion.cmake" @ONLY)
# uninstall target
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake"
@@ -74,8 +76,10 @@ install(FILES generator.h DESTINATION include/generatorrunner)
install(FILES generatorrunnermacros.h DESTINATION include/generatorrunner)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/generatorrunner.pc" DESTINATION
"${LIB_INSTALL_DIR}/pkgconfig")
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/FindGeneratorRunner.cmake"
- DESTINATION "share/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/Modules")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/GeneratorRunnerConfig.cmake"
+ DESTINATION "${LIB_INSTALL_DIR}/cmake/GeneratorRunner-${generator_VERSION}")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/GeneratorRunnerVersion.cmake"
+ DESTINATION "${LIB_INSTALL_DIR}/cmake/GeneratorRunner-${generator_VERSION}")
#FIXME: manpages should be installed only on Linux targets
file(GLOB manpages "${CMAKE_CURRENT_SOURCE_DIR}/*.1")
diff --git a/FindGeneratorRunner.cmake.in b/FindGeneratorRunner.cmake.in
deleted file mode 100644
index 3c975e3..0000000
--- a/FindGeneratorRunner.cmake.in
+++ /dev/null
@@ -1,21 +0,0 @@
-# - try to find GENERATORRUNNER
-# GENERATORRUNNER_INCLUDE_DIR - Directories to include to use GENERATORRUNNER
-# GENERATORRUNNER_LIBRARIES - Files to link against to use GENERATORRUNNER
-# GENERATORRUNNER_FOUND - GENERATORRUNNER was found
-
-FIND_PATH(GENERATORRUNNER_INCLUDE_DIR generator.h "@CMAKE_INSTALL_PREFIX@/include/generatorrunner")
-FIND_LIBRARY(GENERATORRUNNER_LIBRARY genrunner "@LIB_INSTALL_DIR@")
-
-IF (GENERATORRUNNER_INCLUDE_DIR AND GENERATORRUNNER_LIBRARY)
- SET(GENERATORRUNNER_FOUND TRUE)
-ENDIF (GENERATORRUNNER_INCLUDE_DIR AND GENERATORRUNNER_LIBRARY)
-
-IF (GENERATORRUNNER_FOUND)
- MESSAGE(STATUS "Found GeneratorRunner: ${GENERATORRUNNER_LIBRARY}")
- SET(GENERATORRUNNER_PLUGIN_DIR @generator_plugin_DIR@)
- SET(GENERATORRUNNER_VERSION "@generator_VERSION@")
-ELSE (GENERATORRUNNER_FOUND)
- IF (GeneratorRunner_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Could not find GeneratorRunner")
- ENDIF (GeneratorRunner_FIND_REQUIRED)
-ENDIF (GENERATORRUNNER_FOUND)
diff --git a/GeneratorRunnerConfig.cmake.in b/GeneratorRunnerConfig.cmake.in
new file mode 100644
index 0000000..0a217fa
--- /dev/null
+++ b/GeneratorRunnerConfig.cmake.in
@@ -0,0 +1,7 @@
+# GENERATORRUNNER_INCLUDE_DIR - Directories to include to use GENERATORRUNNER
+# GENERATORRUNNER_LIBRARIES - Files to link against to use GENERATORRUNNER
+# GENERATORRUNNER_PLUGIN_DIR - Where to find/put plugins for generator runner
+
+SET(GENERATORRUNNER_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/generatorrunner")
+SET(GENERATORRUNNER_LIBRARY "genrunner")
+SET(GENERATORRUNNER_PLUGIN_DIR @generator_plugin_DIR@)
diff --git a/GeneratorRunnerVersion.cmake.in b/GeneratorRunnerVersion.cmake.in
new file mode 100644
index 0000000..fe0e36e
--- /dev/null
+++ b/GeneratorRunnerVersion.cmake.in
@@ -0,0 +1,9 @@
+set(PACKAGE_VERSION @generator_VERSION@)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @generator_MAJOR_VERSION@)
+ if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @generator_MINOR_VERSION@)
+ set(PACKAGE_VERSION_COMPATIBLE 1)
+ if("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @generator_MICRO_VERSION@)
+ set(PACKAGE_VERSION_EXACT 1)
+ endif()
+ endif()
+endif()