certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi/scripts CMakeLists.txt certi-config.in


From: CERTI CVS commits
Subject: [certi-cvs] certi/scripts CMakeLists.txt certi-config.in
Date: Tue, 06 May 2014 09:02:10 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      14/05/06 09:02:10

Modified files:
        scripts        : CMakeLists.txt 
Added files:
        scripts        : certi-config.in 

Log message:
        Provide a certi-config script in order to ease hand-written build 
systems.
        certi-config --cflags provides compile flags
        certi-config --libs provides linker flags
        one should use: --hlaversion option in order to select 1.3, 1516 or 
1516e.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/scripts/CMakeLists.txt?cvsroot=certi&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/certi/scripts/certi-config.in?cvsroot=certi&rev=1.1

Patches:
Index: CMakeLists.txt
===================================================================
RCS file: /sources/certi/certi/scripts/CMakeLists.txt,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- CMakeLists.txt      24 Jun 2010 14:07:05 -0000      1.2
+++ CMakeLists.txt      6 May 2014 09:02:10 -0000       1.3
@@ -6,16 +6,23 @@
 ##################################################################
 
 ########### Configure and install some scripts files #############
-SET(prefix ${CMAKE_INSTALL_PREFIX})
-SET(configure_input "Generated by CMake.")
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/myCERTI_env.sh.in
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(configure_input "Generated by CMake.")
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/myCERTI_env.sh.in
   ${CMAKE_CURRENT_BINARY_DIR}/myCERTI_env.sh @ONLY)
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/myCERTI_env.csh.in
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/myCERTI_env.csh.in
   ${CMAKE_CURRENT_BINARY_DIR}/myCERTI_env.csh @ONLY)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/certi-config.in
+  ${CMAKE_CURRENT_BINARY_DIR}/certi-config @ONLY)
 
-INSTALL(FILES
+install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/myCERTI_env.sh
   ${CMAKE_CURRENT_BINARY_DIR}/myCERTI_env.csh
+  ${CMAKE_CURRENT_BINARY_DIR}/certi-config
+  PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_READ GROUP_EXECUTE 
WORLD_READ WORLD_EXECUTE
+  DESTINATION share/scripts)
+  
+install(FILES
   FindCERTI.cmake
   UseCERTI.cmake
   FindRTI.cmake

Index: certi-config.in
===================================================================
RCS file: certi-config.in
diff -N certi-config.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ certi-config.in     6 May 2014 09:02:10 -0000       1.1
@@ -0,0 +1,120 @@
+#!/bin/sh
+# @configure_input@
+
+work_dir=`pwd`
+script_dir=`dirname $0`; cd ${script_dir}; script_dir=`pwd`
+prefix="${script_dir}/../.."; cd ${prefix}; prefix=`pwd`;
+cd ${work_dir}
+
+usage()
+{
+   cat <<EOF
+Usage: certi-config [OPTIONS]
+Options:
+        No option:
+            Output all the flags (compiler and linker) required to compile 
your program.
+        [--prefix]]
+            Output the directory in which CERTI is installed a.k.a. CERTI HOME.
+        [--version|-v]
+            Output the version of CERTI.
+        [--libs|--ldflags]
+            Output the linker flags to use for CERTI.
+        [--cflags]
+            Output the compiler flags to use for CERTI.
+        [--hlaversion]
+            Specify which version of HLA to use. May be 1.3, 1516 or 1516e 
(a.k.a. Evolved).
+        [--help]
+            Output this message
+EOF
+}
+execdir="${prefix}/bin"
+includedir="${prefix}/include"
+libdir="${prefix}/lib"
+datadir="${prefix}/share"
+
+certi_dirlibhla="-I${includedir}/libhla"
+
+hlaversion=13
+
+certi_dir13="-I${includedir}/hla13 ${certi_dirlibhla}"
+certi_lib13="-L${libdir} -lRTI-NGd -lFedTimed -lHLAd -lCERTId"
+
+certi_dir1516="-I${includedir}/ieee1516-2000 ${certi_dirlibhla}"
+certi_lib1516="-L${libdir} -lRTI1516d -lFedTime1516d -lHLAd -lCERTId"
+
+certi_dir1516e="-I${includedir}/ieee1516-2010 ${certi_dirlibhla}"
+certi_lib1516e="-L${libdir} -lRTI1516ed -lFedTime1516ed -lHLAd -lCERTId"
+
+while test $# -gt 0; do
+  case "$1" in
+  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  case $1 in
+    --help|-h)
+      usage 1>&2
+      exit 1
+      ;;
+    --hlaversion=*)
+      hlaversion=${optarg}
+      case $hlaversion in
+         13|1.3)
+           hlaversion=13
+           ;;
+         1516)
+           hlaversion=1516
+           ;;
+         1516e|Evolved|evolved)
+           hlaversion=1516e
+           ;;
+         *)
+           echo "Wrong HLA version can only be 13, 1516 or 1516e not 
\"${hlaversion}\" "
+           usage 1>&2
+           exit 1
+           ;;
+      esac
+      ;;
+    --prefix)
+      echo_prefix=true
+      ;;
+    --version|-v)
+      echo "CERTI @PACKAGE_VERSION@"
+      exit 0
+      ;;
+    --libs|--ldflags)
+      echo_libs=true
+      ;;
+    --cflags)
+      echo_cflags=true
+      ;;
+    *)
+      usage 1>&2
+      exit 1
+      ;;
+  esac
+  shift
+done
+
+eval "finaldir=\${certi_dir${hlaversion}}"
+eval "finallib=\${certi_lib${hlaversion}}"
+
+if test ! x"${echo_prefix}" = x"true" \
+   -a ! x"${echo_cflags}" = x"true" \
+   -a ! x"${echo_libs}" = x"true"; 
+then
+   echo ${finaldir} ${finallib}
+fi
+
+if test x"${echo_prefix}" = x"true" ; then
+    echo ${prefix}
+fi
+
+if test x"${echo_cflags}" = x"true"; then
+    echo ${finaldir} 
+fi
+
+if test x"${echo_libs}" = x"true"; then
+    echo ${finallib}
+fi
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]