diff --git a/sm/csmpp/.gitignore b/sm/csmpp/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..64e8f962de99a44d5709613b339c68970a462ba8 --- /dev/null +++ b/sm/csmpp/.gitignore @@ -0,0 +1,6 @@ +libcsmpp-static.a +libcsmpp.dylib +csmpp.pc +cmake_install.cmake +Makefile +CMakeCache.txt diff --git a/sm/csmpp/CMakeLists.txt b/sm/csmpp/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..9bbb3a8ca532c85c5dbd7e8526145aa184eeec06 --- /dev/null +++ b/sm/csmpp/CMakeLists.txt @@ -0,0 +1,50 @@ +cmake_minimum_required(VERSION 2.4) +PROJECT (CSMPP CXX) +SET(csmpp_version 0.1) + +# Require we have pkgconfig installed +find_package(PkgConfig REQUIRED) +# Tell pkgconfig to look for CSM +pkg_check_modules(CSM REQUIRED csm) + +# Look for CSM +IF(${CSM_FOUND}) + MESSAGE("CSM_LIBRARY_DIRS: ${CSM_LIBRARY_DIRS}") + MESSAGE("CSM_LIBRARIES: ${CSM_LIBRARIES}") + MESSAGE("CSM_INCLUDE_DIRS: ${CSM_INCLUDE_DIRS}") + MESSAGE("CSM_LDFLAGS: " ${CSM_LDFLAGS}) + + + INCLUDE_DIRECTORIES(${CSM_INCLUDE_DIRS}) # important! + LINK_DIRECTORIES(${CSM_LIBRARY_DIRS}) # important! +ELSE(${CSM_FOUND}) + MESSAGE(FATAL_ERROR "CSM not found. Check that the environment variable PKG_CONFIG_PATH includes the path containing the file 'csm.pc'.") +ENDIF(${CSM_FOUND}) + +# Name of generated libraries +SET(dynamic_lib csmpp) +SET(static_lib csmpp-static) +SET(csmpp_sources csmpp.cpp) + +SET(csmpp_c_flags "") +SET(csmpp_link_flags ${CSM_LDFLAGS} ) + +# Creation of static library +ADD_LIBRARY(${static_lib} STATIC ${csmpp_sources}) +TARGET_LINK_LIBRARIES(${static_lib} ${CSM_LIBRARIES}) +INSTALL(TARGETS ${static_lib} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + +# Creation of dynamic library +ADD_LIBRARY(${dynamic_lib} SHARED ${csmpp_sources}) +TARGET_LINK_LIBRARIES(${dynamic_lib} ${CSM_LIBRARIES}) +INSTALL(TARGETS ${dynamic_lib} LIBRARY DESTINATION lib) + + +# Installation of pkgconfig configuration file +CONFIGURE_FILE(csmpp.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/csmpp.pc @ONLY) + +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/csmpp.pc + DESTINATION lib/pkgconfig) + + + diff --git a/sm/csmpp/README.txt b/sm/csmpp/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..dbeb9c92b4e624873464eeaf8802fcec6355f22b --- /dev/null +++ b/sm/csmpp/README.txt @@ -0,0 +1 @@ +This is a C++ wrapper to CSM. diff --git a/sm/csmpp/csmpp.cpp b/sm/csmpp/csmpp.cpp new file mode 100644 index 0000000000000000000000000000000000000000..848d22c629f0e2a2316717bd45fed5324a2680b7 --- /dev/null +++ b/sm/csmpp/csmpp.cpp @@ -0,0 +1,6 @@ +#include "csmpp.h" + + +void test_function() { + +} \ No newline at end of file diff --git a/sm/csmpp/csmpp.h b/sm/csmpp/csmpp.h new file mode 100644 index 0000000000000000000000000000000000000000..8fe56827c40bf37fd298712374e3748b93a8b85a --- /dev/null +++ b/sm/csmpp/csmpp.h @@ -0,0 +1,2 @@ + +void test_function(); \ No newline at end of file diff --git a/sm/csmpp/csmpp.pc.in b/sm/csmpp/csmpp.pc.in new file mode 100644 index 0000000000000000000000000000000000000000..9c11a01d4bffa1fafe0ed24711eb3ef484ff68cc --- /dev/null +++ b/sm/csmpp/csmpp.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: csmpp +Description: C++ wrapper to CSM +Requires: csm +Version: @csmpp_version@ +Libs: @csmpp_link_flags@ -L${libdir} -l@csmpp_link_flags@ +Cflags: @csmpp_c_flags@ -I${includedir}