build: set default build type, fix pkg-config file
authorStefan Huber <shuber@sthu.org>
Thu, 14 Nov 2013 16:19:03 +0000 (17:19 +0100)
committerStefan Huber <shuber@sthu.org>
Thu, 14 Nov 2013 16:19:03 +0000 (17:19 +0100)
CMakeLists.txt
INSTALL.txt [new file with mode: 0644]
build.sh
lib/libstick.pc.cmake

index 8969cb30776f56573a0ad2ceb95aa9ac4f12924c..d4bde329b10543a8e2e4777b9469b9615594d1a1 100644 (file)
@@ -1,6 +1,13 @@
 cmake_minimum_required (VERSION 2.6)
 project (libstick)
 
+# Set a default build type if none was specified
+if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  message(STATUS "Setting build type to 'Release' as none was specified.")
+  set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
+  # Set the possible values of build type for cmake-gui
+  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
+endif()
 
 if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++98 -pedantic")
@@ -17,7 +24,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release")
        set(CMAKE_CXX_FLAGS "-O2 ${CMAKE_CXX_FLAGS}")
 endif()
 
-set(PACKAGE_STRING stick)
+set(PACKAGE_STRING libstick)
 set(PACKAGE_BUGREPORT stefan.huber@ist.ac.at)
 set(PACKAGE_VERSION 0.1)
 
diff --git a/INSTALL.txt b/INSTALL.txt
new file mode 100644 (file)
index 0000000..c064704
--- /dev/null
@@ -0,0 +1,7 @@
+To build libstick call 'build.sh'. This will build libstick in build/. To
+install libstick, go into build/ and call 'make install'. Look into build.sh to
+set installation path or other building options.
+
+If you want to use libstick in your software, you may want to use pkg-config to
+obtain necessary compiler and linker flags. Recall to set PKG_CONFIG_PATH in
+case you installed libstick not to a standard destination.
index dddbb7668026feee529fe5cf0baa13b2eb233bc3..ed2a93e1c709b0e88f5030b8c55a188cd6d407ae 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -3,5 +3,8 @@ echo $PWD
 mkdir -p build
 cd build
 
-#cmake -D CMAKE_INSTALL_PREFIX:PATH=foo/ -D CMAKE_BUILD_TYPE="Debug" ..
+#cmake -D CMAKE_INSTALL_PREFIX:PATH=foo/ -D CMAKE_BUILD_TYPE="Debug"  -D WITH_UNITTESTS=1 ..
 cmake -D CMAKE_BUILD_TYPE="Release" ..
+
+make
+#make install
index 1a577946fb7b2f74d7827db2a7bba503be1982aa..0ad10f1cb01b26a1ff954c1de005a76de2d384d2 100644 (file)
@@ -5,5 +5,5 @@ includedir=${prefix}/include
 Name: @PACKAGE_STRING@
 Description: A peristent homology libarary
 Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lm
-Cflags: -I${includedir}/@PACKAGE_STRING@-@PACKAGE_VERSION@
+Libs: -L${libdir}
+Cflags: -I${includedir}