Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Add CMake opt files (#34) #36

Merged
merged 4 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions assets/pogo/preferences/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
14 changes: 14 additions & 0 deletions assets/pogo/preferences/cmake_common_target.opt
Original file line number Diff line number Diff line change
@@ -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})

54 changes: 54 additions & 0 deletions assets/pogo/preferences/cmake_tango.opt.in
Original file line number Diff line number Diff line change
@@ -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})
17 changes: 1 addition & 16 deletions assets/pogo/preferences/tango.opt.in
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
# vim: set filetype=make:

#------------------------------------------------------------------------------
#-- gcc version
#------------------------------------------------------------------------------
GCC_MAJOR_VERSION_GT4 := $(shell expr `c++ -dumpversion | cut -f1 -d.` \> 4)
GCC_MAJOR_VERSION_EQ4 := $(shell expr `c++ -dumpversion | cut -f1 -d.` \== 4)
GCC_MINOR_VERSION_GTEQ3 := $(shell expr `c++ -dumpversion | cut -f2 -d.` \>= 3)
ifeq ($(GCC_MAJOR_VERSION_GT4),1)
CXX11 = -std=c++0x
else
ifeq ($(GCC_MAJOR_VERSION_EQ4),1)
ifeq ($(GCC_MINOR_VERSION_GTEQ3),1)
CXX11 = -std=c++0x
endif
endif
endif
#------------------------------------------------------------------------------
#-- TANGO_HOME
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -159,7 +144,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) -Dlinux

#------------------------------------------------------------------------------
#-- CFLAGS
Expand Down