diff options
author | Chris Robinson <[email protected]> | 2017-08-28 10:31:23 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-08-28 10:31:23 -0700 |
commit | 2916efee213d0d0c6fe67669bf666141e6149f27 (patch) | |
tree | b00720de5977bcc8d7ba6c2d51697014ac5606db /native-tools/CMakeLists.txt | |
parent | 6c367cad6e358a0ea4fd71fc94120dd7e036c621 (diff) |
Automatically generate the bsinc table when building
This makes bsincgen a native tool like bin2h, so it can run automatically when
compiling.
Diffstat (limited to 'native-tools/CMakeLists.txt')
-rw-r--r-- | native-tools/CMakeLists.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/native-tools/CMakeLists.txt b/native-tools/CMakeLists.txt index bb8c677e..3c66c8bc 100644 --- a/native-tools/CMakeLists.txt +++ b/native-tools/CMakeLists.txt @@ -2,9 +2,24 @@ cmake_minimum_required(VERSION 3.0.2) project(native-tools) +include(CheckLibraryExists) + +check_library_exists(m pow "" HAVE_LIBM) + add_executable(bin2h bin2h.c) # Enforce no dressing for executable names, so the main script can find it set_target_properties(bin2h PROPERTIES OUTPUT_NAME bin2h) # Avoid configuration-dependent subdirectories while building with Visual Studio set_target_properties(bin2h PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}") set_target_properties(bin2h PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}") + +add_executable(bsincgen bsincgen.c) +set_target_properties(bsincgen PROPERTIES OUTPUT_NAME bsincgen) +set_target_properties(bsincgen PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}") +set_target_properties(bsincgen PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}") +if(HAVE_LIBM) + target_link_libraries(bsincgen m) +endif(HAVE_LIBM) +if(WIN32 AND CMAKE_COMPILER_IS_GNUCC) + set_property(TARGET bsincgen APPEND_STRING PROPERTY LINK_FLAGS " -municode") +endif(WIN32 AND CMAKE_COMPILER_IS_GNUCC) |