Full preprocessor support in Inno Setup language files (isl) - inno-setup

I use three languages with my installer and at the moment I'm doing all the overrides inside my script. Here's an example:
[Messages]
en.SetupWindowTitle=Setup - %1 {#AppVersion}
ru.SetupWindowTitle=Установка - %1 {#AppVersion}
ua.SetupWindowTitle=Встановлення - %1 {#AppVersion}
en.SetupAppRunningError=Setup has detected that {#SetupSetting('VersionInfoOriginalFileName')} is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit.
ru.SetupAppRunningError=Обнаружен запущенный экземпляр {#SetupSetting('VersionInfoOriginalFileName')}.%n%nПожалуйста, закройте все экземпляры приложения, затем нажмите «OK», чтобы продолжить, или «Отмена», чтобы выйти.
ua.SetupAppRunningError=Виявлено запущений екземпляр {#SetupSetting('VersionInfoOriginalFileName')}.%n%nБудь ласка, закрийте всі копії програми та натисніть «OK» для продовження, або «Скасувати» для виходу.
[CustomMessages]
en.AppRunningError=Setup has detected that {#AppExeName} is currently running.%n%nPlease, close the {#AppExeName} application, then click «OK» to continue or «Cancel» to exit.
ru.AppRunningError=В памяти находится {#AppExeName}.%n%nЗавершите работу {#AppExeName} и нажмите «OK», чтобы продолжить, или «Отмена», чтобы выйти.
ua.AppRunningError=В пам'яті знаходиться {#AppExeName}.%n%nЗавершіть роботу {#AppExeName} та натисніть «OK» для продовження, або «Скасувати» для виходу.
I have lots of messages overridden inside the script. I would like to know what is the most effective way to transfer all those overrides into the .isl files taking into account that I have preprocessor directives {#...} used. I could use FmtMessage(...), but that means that I would have to include FmtMessage(...) for every single message.

First check, if some of the less invasive solutions might not cover your needs:
Can I use .isl files for the messages with preprocessor directives in Inno Setup?
If you want a full preprocessor support in .isl files, you can pass them through the actual Inno Setup preprocessor:
Factor out common include file (defines.iss) with all the variable definitions (and some support code):
// Definitions
#define AppVersion "1.2.3"
// more definitions ...
// Support code
#define PreprocessedTranslationFile GetEnv("TEMP") + "\lang.isl"
#define SavePreprocessedTranslation() SaveToFile(PreprocessedTranslationFile)
Include that file at the beginning of your .iss and all your .isl's:
#include "defines.iss"
Call SavePreprocessedTranslation at the end of all your .isl's:
#expr SavePreprocessedTranslation()
Make the preprocessor call iscc on the modified .isl files. It will of course fail, as the .isl is not a valid .iss, but the preprocessor part of iscc should complete and create the preprocessed .isl file.
#define DebugPreprocessLanguage 0
#define PreprocessLanguage(Path) \
Local[0] = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe", \
DeleteFileNow(PreprocessedTranslationFile), \
Local[1] = DebugPreprocessLanguage ? SourcePath + "\islpreprocess.log" : "nul", \
Local[2] = "/C """"" + Local[0] + """ """ + Path + """ " + \
">> " + Local[1] + " 2>&1 """, \
Exec("cmd", Local[2], SourcePath, , SW_HIDE), \
(FileExists(PreprocessedTranslationFile) || \
Error(Path + " failed to preprocess")), \
Local[3] = GetEnv("TEMP") + "\" + ExtractFileName(Path), \
CopyFile(PreprocessedTranslationFile, Local[3]), \
DeleteFileNow(PreprocessedTranslationFile), \
Local[3]
And use the preprocessed .isl files in the [Languages] section.
[Languages]
Name: "en"; MessagesFile: {#PreprocessLanguage("Default.isl")}
Name: "nl"; MessagesFile: {#PreprocessLanguage("Dutch.isl")}
If you have problems, set DebugPreprocessLanguage to 1 to see the .isl preprocessor output.
You can even improve the process by making the preprocessor add the #include "defines.iss" and #expr SavePreprocessedTranslation() automatically to the .isl's before calling the iscc.

Related

MAKE fails to find ft2build.h (freetype2 header) -freetype(2.8.1) is installed properly

I am Trying to compile 'xplanet' R224 (latest version) on Ubuntu 18.04
MAKE fails to find ft2build.h (freetype2 header) I have 'freetype'(2.8.1) installed properly and all the files are there. I have searched stackoverflow and found many people with the same problem (ft2build.h not found) yet no consensus on why or what the solution is.
Any help is appreciated.
MAKE ERROR MESSAGE:
In file included from getTextRenderer.cpp:8:0:
TextRendererFT2.h:4:10: fatal error: ft2build.h: No such file or directory
#include <ft2build.h>
compilation terminated.
Makefile:458: recipe for target 'getTextRenderer.o' failed
make[3]: *** [getTextRenderer.o] Error 1
MY INSTALLED FREETYPE FILES:
ls /usr/include/freetype2/freetype/config
ftconfig.h ftheader.h ftmodule.h ftoption.h ftstdlib.h
ls /usr/include/freetype2/freetype
config ftautoh.h ftbzip2.h ftcid.h ftgasp.h ftimage.h ftlzw.h ftmoderr.h ftpfr.h ftstroke.h ftttdrv.h ttnameid.h
freetype.h ftbbox.h ftcache.h fterrdef.h ftglyph.h ftincrem.h ftmac.h ftotval.h ftrender.h ftsynth.h fttypes.h tttables.h
ft2build.h ftbdf.h ftcffdrv.h fterrors.h ftgxval.h ftlcdfil.h ftmm.h ftoutln.h ftsizes.h ftsystem.h ftwinfnt.h tttags.h
ftadvanc.h ftbitmap.h ftchapters.h ftfntfmt.h ftgzip.h ftlist.h ftmodapi.h ftpcfdrv.h ftsnames.h fttrigon.h t1tables.h ttunpat.h
ls /usr/include/freetype2
freetype ft2build.h
MAKEFILE INCLUDES THESE LINES:
FREETYPE2_CFLAGS = -I/usr/include/freetype2 -I/usr/include/libpng16
FREETYPE2_LIBS = -lfreetype
FREETYPE_CFLAGS =
FREETYPE_LIBS =
They have there a mix of FREETYPE and FREETYPE2 variables for some reason. I managed to make it compile with those changes:
In src/libdisplay/Makefile.am:
--- src/libdisplay/Makefile.am.old 2022-02-27 22:21:56.089575296 +0100
+++ src/libdisplay/Makefile.am 2022-02-27 22:22:13.424197851 +0100
## -26,7 +26,7 ##
EXTRA_libdisplay_a_SOURCES = DisplayMacAqua.cpp DisplayMacAqua.h DisplayMSWin.cpp DisplayMSWin.h TextRendererFT2.cpp TextRendererFT2.h TextRendererPangoFT2.cpp TextRendererPangoFT2.h DisplayX11.cpp DisplayX11.h vroot.h TimerMacAqua.cpp TimerMacAqua.h TimerX11.cpp TimerX11.h
-AM_CPPFLAGS = -I#top_srcdir#/src #X_CFLAGS# #FREETYPE_CFLAGS#
+AM_CPPFLAGS = -I#top_srcdir#/src #X_CFLAGS# #FREETYPE2_CFLAGS#
if USE_AR
libdisplay_a_AR = $(AR) cru
In src/Makefile.am:
--- src/Makefile.am.old 2022-02-27 22:22:02.953029931 +0100
+++ src/Makefile.am 2022-02-27 22:22:31.438766211 +0100
## -8,7 +8,7 ##
parsegeom = ParseGeom.c ParseGeom.h
endif
-AM_CPPFLAGS = -DDATADIR=\"$(datadir)#separator#xplanet\" #X_CFLAGS# #FREETYPE_CFLAGS#
+AM_CPPFLAGS = -DDATADIR=\"$(datadir)#separator#xplanet\" #X_CFLAGS# #FREETYPE2_CFLAGS#
AM_LDFLAGS = #xplanet_LDFLAGS#
xplanet_SOURCES = \
## -72,5 +72,5 ##
libprojection/libprojection.a \
libsgp4sdp4/libsgp4sdp4.a \
#GRAPHICS_LIBS# #CSPICE_LIBS# #X_LIBS# \
- #XSS_LIBS# #FREETYPE_LIBS# #AQUA_LIBS# \
+ #XSS_LIBS# #FREETYPE2_LIBS# #AQUA_LIBS# \
#LIBICONV# #LIBCHARSET#
The solution above was completely successful. FREETYPE2 was misspelled in three places as FREETYPE in "src/Makefile.am" Installation had no further problems
Molly
Feb 27 at 22:50

The postinstall intercept hook 'update_gio_module_cache' failed

I am building core-image-minimal for warrior branch. My device has atom processor so I have changed nehalem to atom in tune-corei7.inc file. My machine is set to intel-corei7-64. While generating core-image-minimal, I am facing following error:
NOTE: Installing complementary packages ...
NOTE: Running ['oe-pkgdata-util', '-p', '/home/panther2/warrior/build_panther1/tmp/pkgdata/panther1', 'glob', '/tmp/installed-pkgs03hhi936', '']
NOTE: Running intercept scripts:
NOTE: > Executing update_gio_module_cache intercept ...
NOTE: Exit code 1. Output:
+ [ True = False -a qemuwrapper-cross != nativesdk-qemuwrapper-cross ]
+ qemu-x86_64 -r 3.2.0 -cpu atom,check=false -E LD_LIBRARY_PATH=/home/panther2/warrior/build_panther1/tmp/work/panther1-poky-linux/core-image-minimal/1.0-r0/rootfs/usr/lib:/home/panther2/warrior/build_panther1/tmp/work/panther1-poky-linux/core-image-minimal/1.0-r0/rootfs/lib -L /home/panther2/warrior/build_panther1/tmp/work/panther1-poky-linux/core-image-minimal/1.0-r0/rootfs /home/panther2/warrior/build_panther1/tmp/work/panther1-poky-linux/core-image-minimal/1.0-r0/rootfs/usr/libexec/gio-querymodules /home/panther2/warrior/build_panther1/tmp/work/panther1-poky-linux/core-image-minimal/1.0-r0/rootfs/usr/lib/gio/modules/
unable to find CPU model 'atom'
ERROR: The postinstall intercept hook 'update_gio_module_cache' failed, details in /home/panther2/warrior/build_panther1/tmp/work/panther1-poky-linux/core-image-minimal/1.0-r0/temp/log.do_rootfs
ERROR:
DEBUG: Python function do_rootfs finished
ERROR: Function failed: do_rootfs
Any help here?
Thanks in advance..!
Edit : Attaching "tune-corei7.inc" file
# Settings for the GCC(1) cpu-type "atom":
#
# Intel atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,
# SSE4.2 and POPCNT instruction set support.
#
# This tune is recommended for Intel atom and Silvermont (e.g. Bay Trail) CPUs
# (and beyond).
#
DEFAULTTUNE ?= "corei7-64"
# Include the previous tune to pull in PACKAGE_EXTRA_ARCHS
require conf/machine/include/tune-atom.inc
# Extra tune features
TUNEVALID[corei7] = "Enable corei7 specific processor optimizations"
TUNE_CCARGS .= "${#bb.utils.contains('TUNE_FEATURES', 'corei7', ' -march=atom -mtune=generic -mfpmath=sse -msse4.2', '', d)}"
# Extra tune selections
AVAILTUNES += "corei7-32"
TUNE_FEATURES_tune-corei7-32 = "${TUNE_FEATURES_tune-x86} corei7"
BASE_LIB_tune-corei7-32 = "lib"
TUNE_PKGARCH_tune-corei7-32 = "corei7-32"
PACKAGE_EXTRA_ARCHS_tune-corei7-32 = "${PACKAGE_EXTRA_ARCHS_tune-atom-32} corei7-32"
QEMU_EXTRAOPTIONS_corei7-32 = " -cpu nehalem,check=false"
AVAILTUNES += "corei7-64"
TUNE_FEATURES_tune-corei7-64 = "${TUNE_FEATURES_tune-x86-64} corei7"
BASE_LIB_tune-corei7-64 = "lib64"
TUNE_PKGARCH_tune-corei7-64 = "corei7-64"
PACKAGE_EXTRA_ARCHS_tune-corei7-64 = "${PACKAGE_EXTRA_ARCHS_tune-atom-64} corei7-64"
QEMU_EXTRAOPTIONS_corei7-64 = " -cpu nehalem,check=false"
AVAILTUNES += "corei7-64-x32"
TUNE_FEATURES_tune-corei7-64-x32 = "${TUNE_FEATURES_tune-x86-64-x32} corei7"
BASE_LIB_tune-corei7-64-x32 = "libx32"
TUNE_PKGARCH_tune-corei7-64-x32 = "corei7-64-x32"
PACKAGE_EXTRA_ARCHS_tune-corei7-64-x32 = "${PACKAGE_EXTRA_ARCHS_tune-atom-64-x32} corei7-64-x32"
QEMU_EXTRAOPTIONS_corei7-64-x32 = " -cpu nehalem,check=false"

unistd_32.h and syscall_table_32.h not found

I am building a system call on linux kernel 3.8.0. I added my code to
pre>/usr/src/linux/kernel/sys.c
But I cannot find any unistd_32.h to add
#define __NR_helloworld
and syscall_table_32.h to add .
long sys_helloworldThere is a file called unistd.h. But it is not seems to be the correct file
<pre>#ifndef _ASM_X86_UNISTD_H
#define _ASM_X86_UNISTD_H 1
#include <uapi/asm/unistd.h>
# ifdef CONFIG_X86_X32_ABI
# define __SYSCALL_MASK (~(__X32_SYSCALL_BIT))
# else
# define __SYSCALL_MASK (~0)
# endif
# ifdef CONFIG_X86_32
# include <asm/unistd_32.h>
# define __ARCH_WANT_STAT64
# define __ARCH_WANT_SYS_IPC
# define __ARCH_WANT_SYS_OLD_MMAP
# define __ARCH_WANT_SYS_OLD_SELECT
# else
# include <asm/unistd_64.h>
# include <asm/unistd_64_x32.h>
# define __ARCH_WANT_COMPAT_SYS_TIME
# endif
# define __ARCH_WANT_OLD_READDIR
# define __ARCH_WANT_OLD_STAT
# define __ARCH_WANT_SYS_ALARM
# define __ARCH_WANT_SYS_FADVISE64
# define __ARCH_WANT_SYS_GETHOSTNAME
# define __ARCH_WANT_SYS_GETPGRP
# define __ARCH_WANT_SYS_LLSEEK
# define __ARCH_WANT_SYS_NICE
# define __ARCH_WANT_SYS_OLDUMOUNT
# define __ARCH_WANT_SYS_OLD_GETRLIMIT
# define __ARCH_WANT_SYS_OLD_UNAME
# define __ARCH_WANT_SYS_PAUSE
# define __ARCH_WANT_SYS_RT_SIGACTION
# define __ARCH_WANT_SYS_RT_SIGSUSPEND
# define __ARCH_WANT_SYS_SGETMASK
# define __ARCH_WANT_SYS_SIGNAL
# define __ARCH_WANT_SYS_SIGPENDING
# define __ARCH_WANT_SYS_SIGPROCMASK
# define __ARCH_WANT_SYS_SOCKETCALL
# define __ARCH_WANT_SYS_TIME
# define __ARCH_WANT_SYS_UTIME
# define __ARCH_WANT_SYS_WAITPID
# define __ARCH_WANT_SYS_FORK
# define __ARCH_WANT_SYS_VFORK
# define __ARCH_WANT_SYS_CLONE
/*
* "Conditional" syscalls
*
* What we want is __attribute__((weak,alias("sys_ni_syscall"))),
* but it doesn't work on all toolchains, so we just do it by hand
*/
# define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
#endif /* _ASM_X86_UNISTD_H */</pre>
Please Help ThankYou
The way you add the system calls in latest kernel has been changed. Now you need to modify the following files to add a new syscall.
arch/x86/syscalls/syscall_32.tbl >> for 32-bit
arch/x86/syscalls/syscall_64.tbl >> for 64-bit
include/linux/syscalls.h
An example of adding sys_finit_module:
vim /arch/x86/syscalls/syscall_32.tbl
347 i386 process_vm_readv sys_process_vm_readv compat_sys_process_vm_readv
348 i386 process_vm_writev sys_process_vm_writev compat_sys_process_vm_writev
349 i386 kcmp sys_kcmp
**350 i386 finit_module sys_finit_module**
vim include/linux/syscalls.h
asmlinkage long sys_finit_module(int fd, const char __user *uargs);
in kernel 4.4.3, I think the files are at:
arch/x86/entry/syscall_32.tbl >> for 32-bit, and
arch/x86/entry/syscall_64.tbl >> for 64-bit

Compiling jrtplib with MSVC with /MT flag

I am using the provided CMakeLists.txt file which contains the code above. What I am trying to do is to compile the library using the /MT flag. Does anybody know how to do that?
Thanks in advance,
Here the code:
cmake_minimum_required(VERSION 2.6)
project(jrtplib)
set(VERSION 3.9.1)
SET(CMAKE_C_FLAGS "/nologo /W3 /GX /Gy /YX")
SET(CMAKE_C_FLAGS_DEBUG "/MTd /Z7 /Od")
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2")
SET(CMAKE_C_FLAGS_MINSIZEREL "/MT /O2")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
set (_DEFAULT_LIBRARY_INSTALL_DIR lib)
if (EXISTS "${CMAKE_INSTALL_PREFIX}/lib32/" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set (_DEFAULT_LIBRARY_INSTALL_DIR lib32)
elseif (EXISTS "${CMAKE_INSTALL_PREFIX}/lib64/" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set (_DEFAULT_LIBRARY_INSTALL_DIR lib64)
endif ()
set(LIBRARY_INSTALL_DIR "${_DEFAULT_LIBRARY_INSTALL_DIR}" CACHE PATH "Library installation directory")
if(NOT IS_ABSOLUTE "${LIBRARY_INSTALL_DIR}")
set(LIBRARY_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIR}")
endif()
include(CheckCXXCompilerFlag)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckCXXSourceCompiles)
include(TestBigEndian)
include(${PROJECT_SOURCE_DIR}/cmake/Macros.cmake)
find_package(JThread)
set(JRTPLIB_LINK_LIBS "")
set(JRTPLIB_INTERNAL_INCLUDES "")
set(JRTPLIB_EXTERNAL_INCLUDES "")
add_additional_stuff(JRTPLIB_EXTERNAL_INCLUDES JRTPLIB_LINK_LIBS)
jrtplib_support_option("Support SDES PRIV items" JRTPLIB_SUPPORT_SDESPRIV RTP_SUPPORT_SDESPRIV ON "// No support for SDES PRIV items")
jrtplib_support_option("Support the probation mechanism for a new source" JRTPLIB_SUPPORT_PROBATION RTP_SUPPORT_PROBATION ON "// Do not wait for a number of consecutive packets to validate source")
jrtplib_support_option("Support sending RTCP APP packets" JRTPLIB_SUPPORT_SENDAPP RTP_SUPPORT_SENDAPP ON "// No direct support for sending RTCP APP packets")
jrtplib_support_option("Support sending unknown RTCP packets" JRTPLIB_SUPPORT_RTCPUNKNOWN RTP_SUPPORT_RTCPUNKNOWN OFF "// No support for sending unknown RTCP packets")
jrtplib_support_option("Support memory management mechanism" JRTPLIB_SUPPORT_MEMORYMGMT RTP_SUPPORT_MEMORYMANAGEMENT ON "// No memory management support")
jrtplib_include_test(sys/filio.h RTP_HAVE_SYS_FILIO "// Don't have <sys/filio.h>")
jrtplib_include_test(sys/sockio.h RTP_HAVE_SYS_SOCKIO "// Don't have <sys/sockio.h>")
jrtplib_include_test(ifaddrs.h RTP_SUPPORT_IFADDRS "// No ifaddrs support")
if (JTHREAD_FOUND)
set(V "ON")
else (JTHREAD_FOUND)
set(V "OFF")
endif (JTHREAD_FOUND)
option(JTHREAD_ENABLED "Thread support" ${V})
if (JTHREAD_ENABLED)
set (RTP_SUPPORT_THREAD "#define RTP_SUPPORT_THREAD")
if (JTHREAD_FOUND)
save_paths(JRTPLIB_EXTERNAL_INCLUDES "${JTHREAD_INCLUDE_DIRS}")
save_paths(JRTPLIB_LINK_LIBS "${JTHREAD_LIBRARIES}")
endif(JTHREAD_FOUND)
else (JTHREAD_ENABLED)
set (RTP_SUPPORT_THREAD "// No support for JThread was enabled")
endif (JTHREAD_ENABLED)
if (CMAKE_CROSSCOMPILING)
option (JRTPLIB_USE_BIGENDIAN "Target platform is big endian" ON)
if (JRTPLIB_USE_BIGENDIAN)
set(RTP_ENDIAN "#define RTP_BIG_ENDIAN")
else (JRTPLIB_USE_BIGENDIAN)
set(RTP_ENDIAN "// Little endian system")
endif (JRTPLIB_USE_BIGENDIAN)
else (CMAKE_CROSSCOMPILING)
test_big_endian(JRTPLIB_BIGENDIAN)
if (JRTPLIB_BIGENDIAN)
set(RTP_ENDIAN "#define RTP_BIG_ENDIAN")
else (JRTPLIB_BIGENDIAN)
set(RTP_ENDIAN "// Little endian system")
endif (JRTPLIB_BIGENDIAN)
endif (CMAKE_CROSSCOMPILING)
jrtplib_test_feature(socklentest RTP_SOCKLENTYPE_UINT TRUE "// socklen_t is 'int'")
jrtplib_test_feature(ipv4mcasttest RTP_SUPPORT_IPV4MULTICAST FALSE "// No IPv4 multicasting support")
jrtplib_test_feature(salentest RTP_HAVE_SOCKADDR_LEN FALSE "// No sa_len member in struct sockaddr")
jrtplib_test_feature(getloginrtest RTP_SUPPORT_GETLOGINR FALSE "// Not using getlogin_r")
jrtplib_test_feature(ipv6test RTP_SUPPORT_IPV6 FALSE "// No IPv6 support")
jrtplib_test_feature(ipv6mcasttest RTP_SUPPORT_IPV6MULTICAST FALSE "// No IPv6 multicasting support")
check_cxx_source_compiles("#include <stdint.h>\n#include <sys/types.h>\nint main(void) { size_t a = 0 ; size_t b = a; uint32_t x = 0; uint32_t y = x; return 0; }" JRTPLIB_STDINT)
if (JRTPLIB_STDINT)
set(RTP_INTTYPE_HEADERS "#include <stdint.h>\n#include <sys/types.h>")
else (JRTPLIB_STDINT)
check_cxx_source_compiles("#include <inttypes.h>\n#include <sys/types.h>\nint main(void) { uint32_t x = 0; uint32_t y = x; return 0; }" JRTPLIB_INTTYPES)
if (JRTPLIB_INTTYPES)
set(RTP_INTTYPE_HEADERS "#include <inttypes.h>\n#include <sys/types.h>\n")
else (JRTPLIB_INTTYPES)
if (NOT UNIX AND WIN32)
set(RTP_INTTYPE_HEADERS "#include \"rtptypes_win.h\"")
else (NOT UNIX AND WIN32)
set(RTP_INTTYPE_HEADERS "#error Could not find header files that define types like 'uint32_t'. Please edit the file ${PROJECT_BINARY_DIR}/src/rtptypes_unix.h and make sure that the following types are defined: int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t")
message("\n\nError: Could not find header files that define types like 'uint32_t'.\nPlease edit the file ${PROJECT_BINARY_DIR}/src/rtptypes_unix.h\nand make sure that the following types are defined: \nint8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t\n\n")
endif (NOT UNIX AND WIN32)
endif (JRTPLIB_INTTYPES)
endif (JRTPLIB_STDINT)
if (NOT UNIX AND WIN32)
set(RTP_WINSOCK_HEADERS "#if defined(WIN32) || defined(_WIN32_WCE)\n #include <winsock2.h> \n #include <ws2tcpip.h>\n#ifndef _WIN32_WCE\n #include <sys/types.h>\n#endif // _WIN32_WCE\n#endif // WIN32 || _WIN32_WCE\n")
endif (NOT UNIX AND WIN32)
if (NOT UNIX)
set(JRTPLIB_COMPILE_STATIC ON CACHE BOOL "Flag indicating if a static library should be built, or a dynamic one")
list(APPEND JRTPLIB_LINK_LIBS "ws2_32")
endif (NOT UNIX)
if (UNIX OR JRTPLIB_COMPILE_STATIC)
set(JRTPLIB_IMPORT "")
set(JRTPLIB_EXPORT "")
else (UNIX OR JRTPLIB_COMPILE_STATIC)
set(JRTPLIB_IMPORT "__declspec(dllimport)")
set(JRTPLIB_EXPORT "__declspec(dllexport)")
endif (UNIX OR JRTPLIB_COMPILE_STATIC)
configure_file("${PROJECT_SOURCE_DIR}/src/rtptypes.h.in" "${PROJECT_BINARY_DIR}/src/rtptypes.h")
configure_file("${PROJECT_SOURCE_DIR}/src/rtpconfig.h.in" "${PROJECT_BINARY_DIR}/src/rtpconfig.h")
save_paths(JRTPLIB_INTERNAL_INCLUDES "${PROJECT_SOURCE_DIR}/src" "${PROJECT_BINARY_DIR}/src")
add_subdirectory(src)
add_subdirectory(examples)
if (UNIX)
get_target_property(JRTPLIB_LOCAL_LIBRARY_NAME jrtplib-shared LOCATION)
get_filename_component(JRTPLIB_LIBNAME "${JRTPLIB_LOCAL_LIBRARY_NAME}" NAME)
set(JRTPLIB_LIBS "${LIBRARY_INSTALL_DIR}/${JRTPLIB_LIBNAME}")
else (UNIX)
if (JRTPLIB_COMPILE_STATIC)
get_target_property(JRTPLIB_LOCAL_LIBRARY_NAME jrtplib-static RELEASE_LOCATION)
get_filename_component(JRTPLIB_LIBNAME_RELEASE "${JRTPLIB_LOCAL_LIBRARY_NAME}" NAME_WE)
get_target_property(JRTPLIB_LOCAL_LIBRARY_NAME jrtplib-static DEBUG_LOCATION)
get_filename_component(JRTPLIB_LIBNAME_DEBUG "${JRTPLIB_LOCAL_LIBRARY_NAME}" NAME_WE)
else (JRTPLIB_COMPILE_STATIC)
get_target_property(JRTPLIB_LOCAL_LIBRARY_NAME jrtplib-shared RELEASE_LOCATION)
get_filename_component(JRTPLIB_LIBNAME_RELEASE "${JRTPLIB_LOCAL_LIBRARY_NAME}" NAME_WE)
get_target_property(JRTPLIB_LOCAL_LIBRARY_NAME jrtplib-shared DEBUG_LOCATION)
get_filename_component(JRTPLIB_LIBNAME_DEBUG "${JRTPLIB_LOCAL_LIBRARY_NAME}" NAME_WE)
endif (JRTPLIB_COMPILE_STATIC)
set(JRTPLIB_LIBS optimized "${LIBRARY_INSTALL_DIR}/${JRTPLIB_LIBNAME_RELEASE}.lib"
debug "${LIBRARY_INSTALL_DIR}/${JRTPLIB_LIBNAME_DEBUG}.lib")
endif (UNIX)
set(JRTPLIB_INCDIRS ${JRTPLIB_EXTERNAL_INCLUDES} ${CMAKE_INSTALL_PREFIX}/include)
set(JRTPLIB_LIBS ${JRTPLIB_LIBS} ${JRTPLIB_LINK_LIBS})
remove_empty(JRTPLIB_INCDIRS)
list(REMOVE_DUPLICATES JRTPLIB_INCDIRS)
remove_empty(JRTPLIB_LIBS)
foreach(ARG ${JRTPLIB_LIBS})
set(JRTPLIB_LIBS_CMAKECONFIG "${JRTPLIB_LIBS_CMAKECONFIG} \"${ARG}\"")
endforeach()
foreach(ARG ${JRTPLIB_INCDIRS})
set(JRTPLIB_INCDIRS_CMAKECONFIG "${JRTPLIB_INCDIRS_CMAKECONFIG} \"${ARG}\"")
endforeach()
configure_file("${PROJECT_SOURCE_DIR}/cmake/JRTPLIBConfig.cmake.in" "${PROJECT_BINARY_DIR}/cmake/JRTPLIBConfig.cmake")
install(FILES "${PROJECT_BINARY_DIR}/cmake/JRTPLIBConfig.cmake" DESTINATION ${LIBRARY_INSTALL_DIR}/cmake/JRTPLIB)
if (UNIX)
foreach(ARG ${JRTPLIB_LIBS})
set(JRTPLIB_LIBS_PKGCONFIG "${JRTPLIB_LIBS_PKGCONFIG} ${ARG}")
endforeach()
foreach(ARG ${JRTPLIB_INCDIRS})
set(JRTPLIB_INCDIRS_PKGCONFIG "${JRTPLIB_INCDIRS_PKGCONFIG} -I${ARG}")
endforeach()
configure_file(${PROJECT_SOURCE_DIR}/pkgconfig/jrtplib.pc.in ${PROJECT_BINARY_DIR}/pkgconfig/jrtplib.pc)
install(FILES ${PROJECT_BINARY_DIR}/pkgconfig/jrtplib.pc DESTINATION ${LIBRARY_INSTALL_DIR}/pkgconfig)
endif (UNIX)
Adding flags to CMAKE_C_FLAGS and friends is the proper way to pass specific flags to the compiler, but the CMAKE_C_* variables only affect compilation of C files.
If you have any C++ files in the project, you'll also need to set CMAKE_CXX_FLAGS and friends.
Also, you can do this without modifying the CMakeLists file, in cmake-gui or ccmake. After configuring once, you can see the default values for these variables in cmake-gui or ccmake. Then, you can change some of the variables directly in the app, configure again, and voila: you've set the flags for your build tree without modifying any code.
If you always want the flags, then modifying the code is the right approach. But if you're just trying to get a build done, you can set the flags without touching the code.

What is the importance of "pre" in nodejs version v0.6.21-pre?

Some versions are having "-pre" at the end of version number and some are not having.
What is the importance of "-pre"?
It means the binary was built from a development or "preview" commit.
From src/node_version.h:
#if NODE_VERSION_IS_RELEASE
# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
NODE_STRINGIFY(NODE_PATCH_VERSION)
#else
# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
NODE_STRINGIFY(NODE_PATCH_VERSION) "-pre"
#endif
The -pre is removed for releases (ex: 2012.08.03 Version 0.6.21 (maintenance)) and added again with the subsequent version bump (ex: now working on 0.6.22).

Resources