summaryrefslogtreecommitdiff
path: root/gr-trellis/src/lib/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'gr-trellis/src/lib/CMakeLists.txt')
-rw-r--r--gr-trellis/src/lib/CMakeLists.txt94
1 files changed, 47 insertions, 47 deletions
diff --git a/gr-trellis/src/lib/CMakeLists.txt b/gr-trellis/src/lib/CMakeLists.txt
index 3e449bcf8..da41f1469 100644
--- a/gr-trellis/src/lib/CMakeLists.txt
+++ b/gr-trellis/src/lib/CMakeLists.txt
@@ -20,19 +20,19 @@
########################################################################
# Setup the include and linker paths
########################################################################
-INCLUDE_DIRECTORIES(
+include_directories(
${GNURADIO_CORE_INCLUDE_DIRS}
${GR_TRELLIS_INCLUDE_DIRS}
${GR_DIGITAL_INCLUDE_DIRS}
)
-INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
-LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
+include_directories(${Boost_INCLUDE_DIRS})
+link_directories(${Boost_LIBRARY_DIRS})
########################################################################
# generate the python helper script which calls into the build utils
########################################################################
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
#!${PYTHON_EXECUTABLE}
import sys, os, re
@@ -54,37 +54,37 @@ if __name__ == '__main__':
########################################################################
# generation helper macro to generate various files from template
########################################################################
-MACRO(expand_h_cc_i root)
+macro(expand_h_cc_i root)
- FOREACH(ext h cc i)
+ foreach(ext h cc i)
#make a list of all the generated files
- UNSET(expanded_files_${ext})
- FOREACH(sig ${ARGN})
- STRING(REGEX REPLACE "X+" ${sig} name ${root})
- LIST(APPEND expanded_files_${ext} ${CMAKE_CURRENT_BINARY_DIR}/${name}.${ext})
- ENDFOREACH(sig)
+ unset(expanded_files_${ext})
+ foreach(sig ${ARGN})
+ string(REGEX REPLACE "X+" ${sig} name ${root})
+ list(APPEND expanded_files_${ext} ${CMAKE_CURRENT_BINARY_DIR}/${name}.${ext})
+ endforeach(sig)
#create a command to generate the files
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${expanded_files_${ext}}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.${ext}.t
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
${root} ${root}.${ext}.t ${ARGN}
)
- ENDFOREACH(ext)
+ endforeach(ext)
#make source files depends on headers to force generation
- SET_SOURCE_FILES_PROPERTIES(${expanded_files_cc}
+ set_source_files_properties(${expanded_files_cc}
PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
)
#install rules for the generated cc, h, and i files
- LIST(APPEND generated_trellis_sources ${expanded_files_cc})
- LIST(APPEND generated_trellis_includes ${expanded_files_h})
- LIST(APPEND generated_trellis_swigs ${expanded_files_i})
+ list(APPEND generated_trellis_sources ${expanded_files_cc})
+ list(APPEND generated_trellis_includes ${expanded_files_h})
+ list(APPEND generated_trellis_swigs ${expanded_files_i})
-ENDMACRO(expand_h_cc_i)
+endmacro(expand_h_cc_i)
########################################################################
# Invoke macro to generate various sources
@@ -100,7 +100,7 @@ expand_h_cc_i(trellis_sccc_decoder_combined_XX fb fs fi cb cs ci)
expand_h_cc_i(trellis_pccc_decoder_X b s i)
expand_h_cc_i(trellis_pccc_decoder_combined_XX fb fs fi cb cs ci)
-ADD_CUSTOM_TARGET(trellis_generated DEPENDS
+add_custom_target(trellis_generated DEPENDS
${generated_trellis_includes}
${generated_trellis_swigs}
)
@@ -108,28 +108,28 @@ ADD_CUSTOM_TARGET(trellis_generated DEPENDS
########################################################################
# Create the master trellis swig include files
########################################################################
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "
//
// This file is machine generated. All edits will be overwritten
//
")
-FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%{\n")
-FOREACH(swig_file ${generated_trellis_swigs})
- GET_FILENAME_COMPONENT(name ${swig_file} NAME_WE)
- FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "#include<${name}.h>\n")
-ENDFOREACH(swig_file)
-FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%}\n")
+file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%{\n")
+foreach(swig_file ${generated_trellis_swigs})
+ get_filename_component(name ${swig_file} NAME_WE)
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "#include<${name}.h>\n")
+endforeach(swig_file)
+file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%}\n")
-FOREACH(swig_file ${generated_trellis_swigs})
- GET_FILENAME_COMPONENT(name ${swig_file} NAME)
- FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%include<${name}>\n")
-ENDFOREACH(swig_file)
+foreach(swig_file ${generated_trellis_swigs})
+ get_filename_component(name ${swig_file} NAME)
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%include<${name}>\n")
+endforeach(swig_file)
########################################################################
# Setup library
########################################################################
-LIST(APPEND gr_trellis_sources
+list(APPEND gr_trellis_sources
fsm.cc
quicksort_index.cc
base.cc
@@ -143,17 +143,17 @@ LIST(APPEND gr_trellis_sources
${generated_trellis_sources}
)
-LIST(APPEND trellis_libs
+list(APPEND trellis_libs
gnuradio-core
${Boost_LIBRARIES}
)
-ADD_LIBRARY(gnuradio-trellis SHARED ${gr_trellis_sources})
-TARGET_LINK_LIBRARIES(gnuradio-trellis ${trellis_libs})
-SET_TARGET_PROPERTIES(gnuradio-trellis PROPERTIES DEFINE_SYMBOL "gnuradio_trellis_EXPORTS")
-SET_TARGET_PROPERTIES(gnuradio-trellis PROPERTIES SOVERSION ${LIBVER})
+add_library(gnuradio-trellis SHARED ${gr_trellis_sources})
+target_link_libraries(gnuradio-trellis ${trellis_libs})
+set_target_properties(gnuradio-trellis PROPERTIES DEFINE_SYMBOL "gnuradio_trellis_EXPORTS")
+set_target_properties(gnuradio-trellis PROPERTIES SOVERSION ${LIBVER})
-INSTALL(TARGETS gnuradio-trellis
+install(TARGETS gnuradio-trellis
LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "trellis_runtime" # .so/.dylib file
ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "trellis_devel" # .lib file
RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "trellis_runtime" # .dll file
@@ -162,7 +162,7 @@ INSTALL(TARGETS gnuradio-trellis
########################################################################
# Handle the generated sources + a few non-generated ones
########################################################################
-INSTALL(FILES
+install(FILES
${generated_trellis_includes}
trellis_api.h
fsm.h
@@ -180,8 +180,8 @@ INSTALL(FILES
COMPONENT "trellis_devel"
)
-IF(ENABLE_PYTHON)
- INSTALL(FILES
+if(ENABLE_PYTHON)
+ install(FILES
${generated_trellis_swigs}
fsm.i
interleaver.i
@@ -197,16 +197,16 @@ IF(ENABLE_PYTHON)
########################################################################
# Setup swig generation
########################################################################
-INCLUDE(GrPython)
-INCLUDE(GrSwig)
+include(GrPython)
+include(GrSwig)
-SET(GR_SWIG_TARGET_DEPS gengen_generated trellis_generated)
-SET(GR_SWIG_INCLUDE_DIRS
+set(GR_SWIG_TARGET_DEPS gengen_generated trellis_generated)
+set(GR_SWIG_INCLUDE_DIRS
${GR_TRELLIS_INCLUDE_DIRS}
${GNURADIO_CORE_SWIG_INCLUDE_DIRS}
${GR_DIGITAL_SWIG_INCLUDE_DIRS}
)
-SET(GR_SWIG_LIBRARIES gnuradio-trellis)
+set(GR_SWIG_LIBRARIES gnuradio-trellis)
GR_SWIG_MAKE(trellis trellis.i)
GR_SWIG_INSTALL(
@@ -215,10 +215,10 @@ GR_SWIG_INSTALL(
COMPONENT "trellis_python"
)
-INSTALL(
+install(
FILES trellis.i
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
COMPONENT "trellis_swig"
)
-ENDIF(ENABLE_PYTHON)
+endif(ENABLE_PYTHON)