Browse Source

Preparation for SDK include dir cleaning up.

Yao Wei Tjong 姚伟忠 11 years ago
parent
commit
16e05862ab

+ 24 - 23
.gitignore

@@ -1,15 +1,16 @@
 # Output directories (in case of non out-of-source)
-Bin/*
-!Bin/**/
-!Bin/*.bat
-!Bin/*.sh
-Bin/*.app/
-Bin/*.app.dSYM/
-Bin/Data/LuaScripts/jit/
-Bin/Screenshots/
-Bin/tool/
+/Bin/*
+!/Bin/**/
+!/Bin/*.bat
+!/Bin/*.sh
+/Bin/*.app/
+/Bin/*.app.dSYM/
+/Bin/jit/
+/Bin/Screenshots/
+/Bin/tool/
+/include/
+/lib*/
 generated/
-Lib/
 
 # Compiled shaders
 *.vs2
@@ -24,29 +25,29 @@ Lib/
 *.luc
 
 # Generated documentation (in case of non out-of-source)
-Docs/html/
-Docs/qch/
-Docs/Doxyfile
+/Docs/html/
+/Docs/qch/
+/Docs/Doxyfile
 
 # Eclipse project settings (in case of non out-of-source)
-.*project
-.settings
+/.*project
+/.settings
 
 # KDevelop project settings
-*.kdev?
+/*.kdev?
 
 # Qt Creator project settings
-CMakeLists.txt.user
+/CMakeLists.txt.user
 
 # Android non out-of-source project settings
-Android/project.properties
-Android/local.properties
-Android/proguard-project.txt
+/Android/project.properties
+/Android/local.properties
+/Android/proguard-project.txt
 
 # Android non out-of-source build and output directories
-Android/Urho3D
-Android/ThirdParty
-Android/libs
+/Android/Urho3D/
+/Android/ThirdParty/
+/Android/libs/
 
 # Non out-of-source CMake generated build files
 CMakeCache.txt

+ 1 - 1
CMake/Modules/FindUrho3D.cmake

@@ -134,7 +134,7 @@ else ()
         if (ANDROID)
             set (URHO3D_LIB_SEARCH_PATH ${URHO3D_BUILD_TREE}/libs/${ANDROID_NDK_ABI_NAME})
         else ()
-            set (URHO3D_LIB_SEARCH_PATH ${URHO3D_BUILD_TREE}/Lib)
+            set (URHO3D_LIB_SEARCH_PATH ${URHO3D_BUILD_TREE}/lib)
         endif ()
         # Only perform a non-rooted search in the specified path
         find_library (URHO3D_LIBRARIES NAMES ${URHO3D_LIB_NAMES} PATHS ${URHO3D_LIB_SEARCH_PATH} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)

+ 94 - 13
CMake/Modules/Urho3D-CMake-common.cmake

@@ -388,22 +388,37 @@ set_output_directories (${CMAKE_BINARY_DIR}/Bin RUNTIME PDB)
 # Macro for setting symbolic link on platform that supports it
 macro (create_symlink SOURCE DESTINATION)
     if (CMAKE_HOST_WIN32)
+        if (IS_DIRECTORY ${SOURCE})
+            set (SLASH_D /D)
+        else ()
+            unset (SLASH_D)
+        endif ()
         if (URHO3D_MKLINK)
-            if (NOT EXISTS  ${DESTINATION})
-                if (IS_DIRECTORY ${SOURCE})
-                    set (MKLINK_OPT /D)
-                else ()
-                    unset (MKLINK_OPT)
-                endif ()
-                execute_process (COMMAND mklink ${MKLINK_OPT} "${DESTINATION}" "${SOURCE}")
+            if (NOT EXISTS ${DESTINATION})
+                execute_process (COMMAND mklink ${SLASH_D} ${DESTINATION} ${SOURCE})
             endif ()
         elseif (${ARGN} STREQUAL FALLBACK_TO_COPY)
-            execute_process (COMMAND -E copy_if_different "${SOURCE}" "${DESTINATION}")
+            if (NOT IS_ABSOLUTE ${SOURCE})
+                get_filename_component (PATH ${DESTINATION} PATH)
+                set (SOURCE ${PATH}/${SOURCE})
+            endif ()
+            if (SLASH_D)
+                set (COMMAND COMMAND ${CMAKE_COMMAND} -E copy_directory ${SOURCE} ${DESTINATION})
+            else ()
+                set (COMMAND COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SOURCE} ${DESTINATION})
+            endif ()
+            if (TARGET ${TARGET_NAME})
+                # Fallback to copy everytime the target is built
+                add_custom_command (TARGET ${TARGET_NAME} POST_BUILD ${COMMAND} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+            else ()
+                # Fallback to copy only one time
+                execute_process (${COMMAND})
+            endif ()
         else ()
             message (WARNING "Unable to create symbolic link on this host system, you may need to manually copy file/dir from \"${SOURCE}\" to \"${DESTINATION}\"")
         endif ()
     else ()
-        execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink "${SOURCE}" "${DESTINATION}")
+        execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink ${SOURCE} ${DESTINATION})
     endif ()
 endmacro ()
 
@@ -430,11 +445,11 @@ if (ANDROID)
     endif ()
     # Create symbolic links in the build tree
     foreach (I CoreData Data)
-        create_symlink (../../Bin/${I} ${CMAKE_SOURCE_DIR}/Android/assets/${I})
+        create_symlink (../../Bin/${I} ${CMAKE_SOURCE_DIR}/Android/assets/${I} FALLBACK_TO_COPY)
     endforeach ()
     foreach (I AndroidManifest.xml build.xml src res assets jni)
-        if (EXISTS ${CMAKE_SOURCE_DIR}/Android/${I})
-            create_symlink (${CMAKE_SOURCE_DIR}/Android/${I} ${CMAKE_BINARY_DIR}/${I})
+        if (EXISTS ${CMAKE_SOURCE_DIR}/Android/${I} AND NOT EXISTS ${CMAKE_BINARY_DIR}/${I})    # No-ops when 'Android' is used as build tree
+            create_symlink (${CMAKE_SOURCE_DIR}/Android/${I} ${CMAKE_BINARY_DIR}/${I} FALLBACK_TO_COPY)
         endif ()
     endforeach ()
 endif ()
@@ -854,7 +869,7 @@ endmacro ()
 #  PCH - Enable precompiled header on the defined source files
 #  PARENT_SCOPE - Glob source files in current directory but set the result in parent-scope's variable ${DIR}_CPP_FILES and ${DIR}_H_FILES instead
 macro (define_source_files)
-    # Parse extra arguments
+    # Parse the arguments
     cmake_parse_arguments (ARG "PCH;PARENT_SCOPE" "GROUP" "EXTRA_CPP_FILES;EXTRA_H_FILES;GLOB_CPP_PATTERNS;GLOB_H_PATTERNS" ${ARGN})
 
     # Source files are defined by globbing source files in current source directory and also by including the extra source files if provided
@@ -886,3 +901,69 @@ macro (define_source_files)
         source_group ("Header Files\\${ARG_GROUP}" FILES ${H_FILES})
     endif ()
 endmacro ()
+
+# Macro for setting up header files installation for the SDK and the build tree (only support subset of install command arguments)
+# FILES <list> - File list to be installed
+# DIRECTORY <list> - Directory list to be installed
+# FILES_MATCHING - Option to perform file pattern matching on DIRECTORY list
+# USE_FILE_SYMLINK - Option to use file symlinks on the matched files found in the DIRECTORY list
+# PATTERN <list> - Pattern list to be used in file pattern matching option
+# DESTINATION <value> - Destination to be installed to
+macro (install_header_files)
+    # Parse the arguments for the underlying install command
+    cmake_parse_arguments (ARG "FILES_MATCHING;USE_FILE_SYMLINK" "DESTINATION" "FILES;DIRECTORY;PATTERN" ${ARGN})
+    unset (INSTALL_MATCHING)
+    if (ARG_FILES)
+        set (INSTALL_TYPE FILES)
+        set (INSTALL_SOURCES ${ARG_FILES})
+        unset (INSTALL_PERMISSIONS)
+    elseif (ARG_DIRECTORY)
+        set (INSTALL_TYPE DIRECTORY)
+        set (INSTALL_SOURCES ${ARG_DIRECTORY})
+        set (INSTALL_PERMISSIONS ${DEST_PERMISSIONS})
+        if (ARG_FILES_MATCHING)
+            set (INSTALL_MATCHING FILES_MATCHING)
+            foreach (PATTERN ${ARG_PATTERN})
+                list (APPEND INSTALL_MATCHING PATTERN ${PATTERN})
+            endforeach ()
+        endif ()
+    else ()
+        message (FATAL_ERROR "Couldn't setup install command because the install type is not specified.")
+    endif ()
+    if (NOT ARG_DESTINATION)
+        message (FATAL_ERROR "Couldn't setup install command because the install destination is not specified.")
+    endif ()
+    install (${INSTALL_TYPE} ${INSTALL_SOURCES} DESTINATION ${ARG_DESTINATION} ${INSTALL_PERMISSIONS} ${INSTALL_MATCHING})
+
+    # Reparse the arguments for the create_symlink macro to "install" the header files in the build tree
+    foreach (INSTALL_SOURCE ${INSTALL_SOURCES})
+        if (NOT IS_ABSOLUTE ${INSTALL_SOURCE})
+            set (INSTALL_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/${INSTALL_SOURCE})
+        endif ()
+        if (INSTALL_SOURCE MATCHES /$)
+            if (ARG_USE_FILE_SYMLINK)
+                if (ARG_FILES_MATCHING)
+                    set (GLOBBING_EXPRESSION RELATIVE ${INSTALL_SOURCE})
+                    foreach (PATTERN ${ARG_PATTERN})
+                        list (APPEND GLOBBING_EXPRESSION ${INSTALL_SOURCE}${PATTERN})
+                    endforeach ()
+                else ()
+                    set (GLOBBING_EXPRESSION ${INSTALL_SOURCE}*)
+                endif ()
+                file (GLOB_RECURSE NAMES ${GLOBBING_EXPRESSION})
+                foreach (NAME ${NAMES})
+                    get_filename_component (PATH ${NAME} PATH)
+                    if (PATH AND NOT EXISTS ${ARG_DESTINATION}/${PATH})
+                        file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${ARG_DESTINATION}/${PATH})
+                    endif ()
+                    create_symlink (${INSTALL_SOURCE}${NAME} ${ARG_DESTINATION}/${NAME} FALLBACK_TO_COPY)
+                endforeach ()
+            else ()
+                create_symlink (${INSTALL_SOURCE} ${ARG_DESTINATION} FALLBACK_TO_COPY)
+            endif ()
+        else ()
+            get_filename_component (NAME ${INSTALL_SOURCE} NAME)
+            create_symlink (${INSTALL_SOURCE} ${ARG_DESTINATION}/${NAME} FALLBACK_TO_COPY)
+        endif ()
+    endforeach ()
+endmacro ()

+ 3 - 2
CMakeLists.txt

@@ -56,8 +56,8 @@ if (NOT CMAKE_HOST_WIN32)
     # CMake already automatically appends "Urho3D" to CMAKE_INSTALL_PREFIX on Windows platform
     set (PATH_SUFFIX /Urho3D)
     if (URHO3D_64BIT)
-        if (NOT CMAKE_CROSSCOMPILING AND EXISTS /usr/lib64)
-            # Probably target system is a RedHat-based distro
+        if (EXISTS /usr/lib64)
+            # Probably host system is a RedHat-based distro
             set (LIB_SUFFIX 64)
         endif ()
     endif ()
@@ -67,6 +67,7 @@ if (NOT CMAKE_HOST_WIN32)
     endif ()
 endif ()
 set (DEST_INCLUDE_DIR include${PATH_SUFFIX})
+file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DEST_INCLUDE_DIR})
 set (DEST_SHARE_DIR share${PATH_SUFFIX})
 set (DEST_RUNTIME_DIR ${DEST_SHARE_DIR}/Bin)
 # Note: ${PATH_SUFFIX} for library could be removed if the extra path is not desirable, but if so then the RPATH setting below needs to be adjusted accordingly

+ 2 - 4
Source/ThirdParty/AngelScript/CMakeLists.txt

@@ -29,13 +29,11 @@ endif ()
 
 set (SOURCE_FILES ${CPP_FILES} ${ASM_FILES} ${H_FILES})
 
-# Install dependency for Engine/Script/APITemplates.h
-install (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/AngelScript ${DEST_PERMISSIONS} FILES_MATCHING PATTERN *.h)     # Note: the trailing slash is significant
-set (INSTALL_INCLUDE_DIRS ${INSTALL_INCLUDE_DIRS} AngelScript PARENT_SCOPE)
-
 # Define dependency libs
 set (INCLUDE_DIRS_ONLY include)
 
 # Setup target
 setup_library ()
 
+# Install dependency for Engine/Script/APITemplates.h
+install_header_files (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/AngelScript FILES_MATCHING PATTERN *.h)     # Note: the trailing slash is significant

+ 3 - 3
Source/ThirdParty/Box2D/CMakeLists.txt

@@ -157,11 +157,11 @@ source_group(Dynamics\\Joints FILES ${BOX2D_Joints_SRCS} ${BOX2D_Joints_HDRS})
 source_group(Include FILES ${BOX2D_General_HDRS})
 source_group(Rope FILES ${BOX2D_Rope_SRCS} ${BOX2D_Rope_HDRS})
 
-# Install dependency for Engine/Urho2D/PhysicsWorld2D.h and Engine/Urho2D/RigidBody2D.h
-install (DIRECTORY Box2D DESTINATION ${DEST_INCLUDE_DIR} ${DEST_PERMISSIONS} FILES_MATCHING PATTERN *.h)
-
 # Define dependency libs
 set (INCLUDE_DIRS_ONLY .)
 
 # Setup target
 setup_library ()
+
+# Install dependency for Engine/Urho2D/PhysicsWorld2D.h and Engine/Urho2D/RigidBody2D.h
+install_header_files (DIRECTORY Box2D DESTINATION ${DEST_INCLUDE_DIR} FILES_MATCHING PATTERN *.h)

+ 3 - 3
Source/ThirdParty/Bullet/CMakeLists.txt

@@ -17,12 +17,12 @@ file (GLOB H_FILES *.h src/BulletCollision/BroadphaseCollision/*.h
     src/BulletDynamics/Featherstone/*.h src/BulletDynamics/MLCPSolvers/*.h
     src/LinearMath/*.h)
 set (SOURCE_FILES ${CPP_FILES} ${H_FILES})
-# Install dependency for Engine/Physics/PhysicsWorld.h and Engine/Physics/RigidBody.h
-install (DIRECTORY src/LinearMath DESTINATION ${DEST_INCLUDE_DIR}/Bullet ${DEST_PERMISSIONS} FILES_MATCHING PATTERN *.h)
-set (INSTALL_INCLUDE_DIRS ${INSTALL_INCLUDE_DIRS} Bullet PARENT_SCOPE)
 
 # Define dependency libs
 set (INCLUDE_DIRS_ONLY src)
 
 # Setup target
 setup_library ()
+
+# Install dependency for Engine/Physics/PhysicsWorld.h and Engine/Physics/RigidBody.h
+install_header_files (DIRECTORY src/ DESTINATION ${DEST_INCLUDE_DIR}/Bullet FILES_MATCHING PATTERN *.h)  # Note: the trailing slash is significant

+ 4 - 4
Source/ThirdParty/SDL/CMakeLists.txt

@@ -112,13 +112,13 @@ file (GLOB H_FILES include/*.h)
 set_source_files_properties (${C_FILES} PROPERTIES LANGUAGE C)
 set_source_files_properties (${SYS_C_FILES} PROPERTIES LANGUAGE C)
 set (SOURCE_FILES ${C_FILES} ${SYS_C_FILES} ${H_FILES})
-# Install dependency for SDL_android_main.c, D3D9GraphicsImpl.h, OGLGraphicsImpl.h, InputEvents.h, File.h, and Cursor.h
-install (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/SDL ${DEST_PERMISSIONS} FILES_MATCHING PATTERN *.h)     # Note: the trailing slash is significant
-set (INSTALL_INCLUDE_DIRS ${INSTALL_INCLUDE_DIRS} SDL PARENT_SCOPE)
-install (FILES src/main/android/SDL_android_main.c DESTINATION ${DEST_INCLUDE_DIR})
 
 # Define dependency libs
 set (INCLUDE_DIRS_ONLY include)
 
 # Setup target
 setup_library ()
+
+# Install dependency for SDL_android_main.c, D3D9GraphicsImpl.h, OGLGraphicsImpl.h, InputEvents.h, File.h, and Cursor.h
+install_header_files (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/SDL FILES_MATCHING PATTERN *.h)     # Note: the trailing slash is significant
+install_header_files (FILES src/main/android/SDL_android_main.c DESTINATION ${DEST_INCLUDE_DIR})    # Intentionally install this C file in include dir

+ 3 - 3
Source/ThirdParty/kNet/CMakeLists.txt

@@ -58,12 +58,12 @@ endif ()
 
 # Define source files
 set (SOURCE_FILES ${kNetSourceFiles} ${kNetHeaderFiles})
-# Install dependency for Engine/Network/Connection.h and Engine/Network/Network.h
-install (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/kNet ${DEST_PERMISSIONS} FILES_MATCHING PATTERN *.h PATTERN *.inl)     # Note: the trailing slash is significant
-set (INSTALL_INCLUDE_DIRS ${INSTALL_INCLUDE_DIRS} kNet PARENT_SCOPE)
 
 # Define dependency libs
 set (INCLUDE_DIRS_ONLY include)
 
 # Setup target
 setup_library ()
+
+# Install dependency for Engine/Network/Connection.h and Engine/Network/Network.h
+install_header_files (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/kNet FILES_MATCHING PATTERN *.h *.inl)     # Note: the trailing slash is significant

+ 10 - 6
Source/Urho3D/CMakeLists.txt

@@ -85,14 +85,12 @@ endif ()
 
 foreach (SOURCE ${SOURCES})
     add_subdirectory (${SOURCE})
-    install (DIRECTORY ${SOURCE}/ DESTINATION ${DEST_INCLUDE_DIR} ${DEST_PERMISSIONS} FILES_MATCHING PATTERN *.h)    # Note: the trailing slash is significant
     source_group ("Source Files\\${SOURCE}" FILES ${${SOURCE}_CPP_FILES})
     source_group ("Header Files\\${SOURCE}" FILES ${${SOURCE}_H_FILES})
     list (APPEND ENGINE_SOURCE_FILES ${${SOURCE}_CPP_FILES} ${${SOURCE}_H_FILES})
     list (APPEND ENGINE_INCLUDE_DIRS_ONLY ${SOURCE})
 endforeach ()
 define_source_files (EXTRA_CPP_FILES ${ENGINE_SOURCE_FILES} EXTRA_H_FILES ${CMAKE_CURRENT_BINARY_DIR}/librevision.h PCH)
-install (FILES ${H_FILES} DESTINATION ${DEST_INCLUDE_DIR})
 list (APPEND SOURCE_FILES ${ALL_OBJ_FILES})
 set_source_files_properties (${ALL_OBJ_FILES} PROPERTIES GENERATED TRUE)
 
@@ -107,7 +105,7 @@ list (APPEND INCLUDE_DIRS_ONLY ${CMAKE_CURRENT_BINARY_DIR} ../ThirdParty/SDL/inc
 if (ANDROID)
     set (OUTPUT_PATH ${ANDROID_LIBRARY_OUTPUT_PATH})
 else ()
-    set (OUTPUT_PATH ${CMAKE_BINARY_DIR}/Lib)
+    set (OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
 endif ()
 set_output_directories (${OUTPUT_PATH} ARCHIVE LIBRARY)
  
@@ -214,7 +212,13 @@ if (NOT URHO3D_LIB_TYPE STREQUAL URHO3D_EXPORTS_LIB_TYPE OR ${CMAKE_CURRENT_SOUR
     file (READ ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h EXPORT_DEFINE)
     configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Urho3D.h.in ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h)
 endif ()
-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h DESTINATION ${DEST_INCLUDE_DIR})
+
+# Install dependency for Engine
+foreach (SOURCE ${SOURCES})
+    install_header_files (DIRECTORY ${SOURCE}/ DESTINATION ${DEST_INCLUDE_DIR} FILES_MATCHING PATTERN *.h USE_FILE_SYMLINK)    # Note: the trailing slash is significant
+endforeach ()
+install_header_files (FILES ${H_FILES} DESTINATION ${DEST_INCLUDE_DIR})
+install_header_files (FILES ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h DESTINATION ${DEST_INCLUDE_DIR})
 
 # Generate platform specific pkg-config file for the benefit of Urho3D library users via SDK without CMake
 if (NOT IOS)
@@ -234,7 +238,7 @@ if (NOT IOS)
         endif ()
     endif ()
     if (MSVC)
-        # todo: Add a post build command to adjust the LIB_NAME when in Debug configuration
+        # todo: Add a post build command to adjust the LIB_NAME when in Debug configuration (CMake/VS generator is multi-config)
         set (DASH /)
         set (LIB_DIR "/LIBPATH:\"\${libdir}\"")
         string (REPLACE ";" ".lib\" \"" URHO3D_LIBS "\"${LIB_NAME};${LINK_LIBS_ONLY}.lib\"")
@@ -249,7 +253,7 @@ if (NOT IOS)
         string (REPLACE ";" "\" ${DASH}I\"" GLOBAL_INCLUDE_DIRS "${DASH}I\"${GLOBAL_INCLUDE_DIRS}\"")
         string (REPLACE "${SYSROOT}" "" GLOBAL_INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS})
     endif ()
-    string (REPLACE ";" "\" ${DASH}I\"\${includedir}/" ENGINE_INCLUDE_DIRS "${DASH}I\"\${includedir};${INSTALL_INCLUDE_DIRS}\"")
+    set (ENGINE_INCLUDE_DIRS "${DASH}I\"\${includedir}${PATH_SUFFIX}\" ${DASH}I\"\${includedir}\"")
     configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Urho3D.pc.in ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.pc @ONLY)
     if (ANDROID)
         set (RENAME RENAME Urho3D-${ANDROID_NDK_ABI_NAME}.pc)

+ 3 - 1
Source/Urho3D/LuaScript/CMakeLists.txt

@@ -84,7 +84,6 @@ endforeach ()
 
 # Define source files
 define_source_files (EXTRA_CPP_FILES ${GEN_CPP_FILES})
-install (FILES ${H_FILES} DESTINATION ${DEST_INCLUDE_DIR})
 
 # Define dependency libs
 set (LIBS ../../ThirdParty/Lua${JIT}/src)
@@ -110,3 +109,6 @@ endif ()
 
 # Setup target
 setup_library ()
+
+# Install dependency for Engine
+install_header_files (FILES ${H_FILES} DESTINATION ${DEST_INCLUDE_DIR})

+ 1 - 1
Source/Urho3D/Urho3D.pc.in

@@ -23,7 +23,7 @@
 prefix=@DEST_INSTALL_PREFIX@
 exec_prefix=${prefix}
 libdir=${exec_prefix}/@DEST_LIBRARY_DIR@
-includedir=${prefix}/@DEST_INCLUDE_DIR@
+includedir=${prefix}/include
 
 # Additional Cflags for various build configurations, which can be accessed as normal pkg-config variable using '--variable' option
 CFLAGS_DEBUG=@CMAKE_CXX_FLAGS_DEBUG@