diff --git a/assets/pogo/preferences/Makefile.am b/assets/pogo/preferences/Makefile.am index 60655f546..1932ecb74 100644 --- a/assets/pogo/preferences/Makefile.am +++ b/assets/pogo/preferences/Makefile.am @@ -7,10 +7,12 @@ edit = sed \ preferencesdir = $(datadir)/pogo/preferences -dist_preferences_DATA = common_target.opt +dist_preferences_DATA = common_target.opt \ + cmake_common_target.opt nodist_preferences_DATA = Pogo.site_properties \ - tango.opt + tango.opt \ + cmake_tango.opt $(nodist_preferences_DATA): Makefile @@ -24,7 +26,9 @@ $(nodist_preferences_DATA): Makefile CLEANFILES = $(nodist_preferences_DATA) Pogo.site_properties: $(srcdir)/Pogo.site_properties.in tango.opt: $(srcdir)/tango.opt.in +cmake_tango.opt: $(srcdir)/cmake_tango.opt.in EXTRA_DIST = \ Pogo.site_properties.in \ - tango.opt.in + tango.opt.in \ + cmake_tango.opt.in diff --git a/assets/pogo/preferences/cmake_common_target.opt b/assets/pogo/preferences/cmake_common_target.opt new file mode 100644 index 000000000..dce67a3d5 --- /dev/null +++ b/assets/pogo/preferences/cmake_common_target.opt @@ -0,0 +1,14 @@ + +# +# Set library directories +# +link_directories(${USER_LIB_DIR} ${TANGO_LIB_HOME}) + +# +# Compile and link +# +message("SERVER_NAME=${SERVER_NAME}") +message("SERVER_SRC=${SERVER_SRC}") +add_executable(${SERVER_NAME} ${SERVER_SRC}) +target_link_libraries(${SERVER_NAME} ${USER_LIBS} ${TANGO_LIBS}) + diff --git a/assets/pogo/preferences/cmake_tango.opt.in b/assets/pogo/preferences/cmake_tango.opt.in new file mode 100644 index 000000000..8549d3ca9 --- /dev/null +++ b/assets/pogo/preferences/cmake_tango.opt.in @@ -0,0 +1,54 @@ +# +# Set default PATH +# +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin/") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) + +if(DEFINED TANGO_HOME) + message("-DTANGO_HOME specified in the command line") +else() + set(TANGO_HOME $ENV{TANGO_HOME}) +endif(DEFINED TANGO_HOME) + +if(DEFINED TANGO_HOME) + message("TANGO_HOME = ${TANGO_HOME}") +else() + set(TANGO_HOME @prefix@) +endif(DEFINED TANGO_HOME) + +set(ENV{PKG_CONFIG_PATH} "${TANGO_HOME}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}") + +if(DEFINED OMNI_HOME) + message("-DOMNI_HOME specified in the command line") +else() + set(OMNI_HOME $ENV{OMNI_HOME}) +endif(DEFINED OMNI_HOME) +if(DEFINED OMNI_HOME) + message("OMNI_HOME = ${OMNI_HOME}") + set(ENV{PKG_CONFIG_PATH} "${OMNI_HOME}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}") +endif(DEFINED OMNI_HOME) + + +if(DEFINED ZMQ_HOME) + message("-DZMQ_HOME specified in the command line") +else() + set(ZMQ_HOME $ENV{ZMQ_HOME}) +endif(DEFINED ZMQ_HOME) +if(DEFINED ZMQ_HOME) + message("ZMQ_HOME = ${ZMQ_HOME}") + set(ENV{PKG_CONFIG_PATH} "${ZMQ_HOME}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}") +endif(DEFINED ZMQ_HOME) + +# +# Compiler flags +# +set(CMAKE_CXX_FLAGS "${CXXFLAGS_USER} ${CMAKE_CXX_FLAGS}") + +find_package(PkgConfig REQUIRED) +pkg_check_modules(PKG_TANGO REQUIRED tango) + +set(TANGO_INCLUDES ${PKG_TANGO_INCLUDE_DIRS}) +set(TANGO_LIBS ${PKG_TANGO_LIBRARIES}) +set(TANGO_LIB_HOME ${PKG_TANGO_LIBRARY_DIRS}) + +add_definitions (${PKG_TANGO_CFLAGS_OTHER}) diff --git a/assets/pogo/preferences/tango.opt.in b/assets/pogo/preferences/tango.opt.in index 633dea6a7..26db3d4ad 100644 --- a/assets/pogo/preferences/tango.opt.in +++ b/assets/pogo/preferences/tango.opt.in @@ -4,17 +4,22 @@ #-- gcc version #------------------------------------------------------------------------------ GCC_MAJOR_VERSION_GT4 := $(shell expr `c++ -dumpversion | cut -f1 -d.` \> 4) +GCC_MAJOR_VERSION_LT6 := $(shell expr `c++ -dumpversion | cut -f1 -d.` \< 6) GCC_MAJOR_VERSION_EQ4 := $(shell expr `c++ -dumpversion | cut -f1 -d.` \== 4) +GCC_MAJOR_VERSION_EQ6 := $(shell expr `c++ -dumpversion | cut -f1 -d.` \== 6) GCC_MINOR_VERSION_GTEQ3 := $(shell expr `c++ -dumpversion | cut -f2 -d.` \>= 3) -ifeq ($(GCC_MAJOR_VERSION_GT4),1) +GCC_MINOR_VERSION_LT1 := $(shell expr `c++ -dumpversion | cut -f2 -d.` \< 1) + +ifeq ($(GCC_MAJOR_VERSION_LT6),1) CXX11 = -std=c++0x else - ifeq ($(GCC_MAJOR_VERSION_EQ4),1) - ifeq ($(GCC_MINOR_VERSION_GTEQ3),1) + ifeq ($(GCC_MAJOR_VERSION_EQ6),1) + ifeq ($(GCC_MINOR_VERSION_LT1),1) CXX11 = -std=c++0x endif endif endif + #------------------------------------------------------------------------------ #-- TANGO_HOME #------------------------------------------------------------------------------ @@ -159,7 +164,7 @@ ifdef CXXFLAGS_USR CXXFLAGS_USER = $(CXXFLAGS_USR) endif -CXXFLAGS += -D_REENTRANT -W $(INCLUDE_DIRS) $(CXXFLAGS_USER) $(CXX11) -Dlinux +CXXFLAGS += -D_REENTRANT -W $(INCLUDE_DIRS) $(CXXFLAGS_USER) $(CXX11) -Dlinux #------------------------------------------------------------------------------ #-- CFLAGS