]> git.cworth.org Git - vogl/commitdiff
Move generation of files to cmake
authorSirAnthony <anthony@adsorbtion.org>
Fri, 21 Mar 2014 06:23:10 +0000 (12:23 +0600)
committerCarl Worth <cworth@cworth.org>
Tue, 1 Apr 2014 19:37:31 +0000 (12:37 -0700)
src/voglbench/CMakeLists.txt
src/voglcommon/CMakeLists.txt
src/vogleditor/CMakeLists.txt
src/voglgen/CMakeLists.txt
src/voglreplay/CMakeLists.txt
src/voglsyms/CMakeLists.txt
src/vogltrace/CMakeLists.txt

index 52f9e62d26a6928deb026f40637bfe9a536bf4e7..5be403daa982a05d4e49baa642d6643b683a9850 100644 (file)
@@ -7,9 +7,9 @@ find_package(X11 REQUIRED)
 include_directories(
     ${CMAKE_CURRENT_BINARY_DIR}
     ${SRC_DIR}/voglcore
-    ${SRC_DIR}/voglinc
+    ${CMAKE_BINARY_DIR}/voglinc
     ${SRC_DIR}/voglcommon
-       ${SRC_DIR}/libtelemetry
+    ${SRC_DIR}/libtelemetry
     ${SRC_DIR}/extlib/loki/include/loki
     )
 
@@ -18,6 +18,7 @@ set(SRC_LIST
 )
 
 add_executable(${PROJECT_NAME} ${SRC_LIST})
+add_dependencies(${PROJECT_NAME} voglgen_make_inc)
 
 target_link_libraries(${PROJECT_NAME}
     ${TELEMETRY_LIBRARY}
index 222bf53e947171e31d4d7f1eae35c53be4b33e4f..960e8544e1d7640a15b3f95987be9e87cd28676f 100644 (file)
@@ -6,7 +6,7 @@ include("${SRC_DIR}/build_options.cmake")
 include_directories(
     ${SRC_DIR}/extlib/loki/include/loki
     ${SRC_DIR}/voglcommon
-    ${SRC_DIR}/voglinc
+    ${CMAKE_BINARY_DIR}/voglinc
     ${SRC_DIR}/voglcore
     ${SRC_DIR}/libtelemetry
     ${SRC_DIR}/libbacktrace
@@ -69,6 +69,7 @@ endif()
 add_compiler_flag("-fPIC")
 
 add_library(${PROJECT_NAME} ${SRC_LIST})
+add_dependencies(${PROJECT_NAME} voglgen_make_inc)
 target_link_libraries(${PROJECT_NAME} backtrace)
 
 build_options_finalize()
index 75f5d077a9e7d75fff94731385c22c13522bcfba..3ff364caf9179685faddcdb03b060cf18ab5545c 100644 (file)
@@ -15,7 +15,7 @@ include_directories(
     ${SRC_DIR}
     ${SRC_DIR}/voglcore
     ${SRC_DIR}/voglcommon
-    ${SRC_DIR}/voglinc
+    ${CMAKE_BINARY_DIR}/voglinc
     ${SRC_DIR}/extlib/loki/include/loki
     ${SRC_DIR}/libtelemetry
     ${CMAKE_CURRENT_BINARY_DIR}
@@ -151,6 +151,8 @@ add_executable(${PROJECT_NAME} ${SRC_LIST} ${HEADER_LIST}
         ${QT_GEN_RESOURCE_RCC_LIST}
    )
 
+add_dependencies(${PROJECT_NAME} voglgen_make_inc)
+
 target_link_libraries(${PROJECT_NAME}
        ${QT_QTMAIN_LIBRARY} 
        ${QT_QTCORE_LIBRARY} 
index 908a195db018316ebc3509a7233a4b903e2e14bf..3d006eef8fbec96cf181c0626cab03fd26b35038 100644 (file)
@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 2.8)
 include("${SRC_DIR}/build_options.cmake")
 
 set(SRC_LIST voglgen.cpp)
+set(SPEC_DIR "${CMAKE_SOURCE_DIR}/../glspec")
 
 add_definitions(-DTIXML_USE_STL)
 
@@ -19,5 +20,13 @@ target_link_libraries(${PROJECT_NAME}
     ${TinyXML_LIBRARIES}
     )
 
+# Generate stuff and copy it. Generator must handle copying internally in the future.
+add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
+                   COMMAND ${PROJECT_NAME} --specdir ${SPEC_DIR}
+                   COMMAND mkdir -p "${CMAKE_BINARY_DIR}/voglinc/"
+                   COMMAND mv "${SPEC_DIR}/*.inc" "${CMAKE_BINARY_DIR}/voglinc/"
+                   COMMAND mv "${SPEC_DIR}/libvogltrace_linker_script.txt" "${CMAKE_SOURCE_DIR}/vogltrace/")
+add_custom_target(voglgen_make_inc DEPENDS ${PROJECT_NAME})
+
 build_options_finalize()
 
index be7ed8948a642df0bfd88db0b3f117f05ca589d1..a9c632413323dd5d7b27b32fa3fd69be47460752 100644 (file)
@@ -16,7 +16,7 @@ include_directories(
 
 include_directories(
     ${SRC_DIR}/voglcore
-    ${SRC_DIR}/voglinc
+    ${CMAKE_BINARY_DIR}/voglinc
     ${SRC_DIR}/voglcommon
        ${SRC_DIR}/libtelemetry
        ${SRC_DIR}/extlib/loki/include/loki
@@ -32,6 +32,7 @@ set(SRC_LIST
 # add_compiler_flag("-DVOGL_REMOTING")
 
 add_executable(${PROJECT_NAME} ${SRC_LIST})
+add_dependencies(${PROJECT_NAME} voglgen_make_inc)
 
 target_link_libraries(${PROJECT_NAME}
     ${TELEMETRY_LIBRARY}
index 0792eabbdac865b87db99979b7357e90ddf576cb..2ba8a2bd59eb624ffc3fd2e19b281407725bdbaa 100644 (file)
@@ -6,10 +6,10 @@ include("${SRC_DIR}/build_options.cmake")
 include_directories(
     ${CMAKE_CURRENT_BINARY_DIR}
     ${SRC_DIR}/voglcore
-    ${SRC_DIR}/voglinc
+    ${CMAKE_BINARY_DIR}/voglinc
     ${SRC_DIR}/voglcommon
-       ${SRC_DIR}/libtelemetry
-       ${SRC_DIR}/libbacktrace
+    ${SRC_DIR}/libtelemetry
+    ${SRC_DIR}/libbacktrace
     ${SRC_DIR}/extlib/loki/include/loki
     )
 
@@ -18,6 +18,7 @@ set(SRC_LIST
 )
 
 add_executable(${PROJECT_NAME} ${SRC_LIST})
+add_dependencies(${PROJECT_NAME} voglgen_make_inc)
 
 target_link_libraries(${PROJECT_NAME}
     backtrace
index 6320b4eef8024f46eace95e91a11f3fee0216204..66566a91d166e41acf128179c839e96f8b505972 100644 (file)
@@ -37,7 +37,7 @@ include_directories(
     ${SRC_DIR}/libbacktrace
     ${SRC_DIR}/extlib/loki/include/loki
     ${SRC_DIR}/voglcommon
-    ${SRC_DIR}/voglinc
+    ${CMAKE_BINARY_DIR}/voglinc
     ${SRC_DIR}/voglcore
     ${SRC_DIR}/libtelemetry
     )
@@ -47,6 +47,7 @@ add_shared_linker_flag("-Wl,-Bsymbolic")
 add_shared_linker_flag("-Wl,--version-script=${PROJECT_SOURCE_DIR}/libvogltrace_linker_script.txt")
 
 add_library(${PROJECT_NAME} SHARED ${SRC_LIST})
+add_dependencies(${PROJECT_NAME} voglgen_make_inc)
 
 target_link_libraries(${PROJECT_NAME}
     ${TELEMETRY_LIBRARY}