[example/CMakeLists.txt] Use `glfw` as target name for `glfw3` found package; [src/CMakeLists.txt] Fix `fix_comments` implementation; improve whitespace consistency with Python implementation

This commit is contained in:
Samuel Marks 2022-05-25 10:30:05 -04:00
parent 0761cfc6c1
commit ac7e89a2e6
No known key found for this signature in database
GPG Key ID: 43FD8EDE42E1A799
2 changed files with 6 additions and 7 deletions

View File

@ -8,7 +8,7 @@ find_package(OpenGL REQUIRED)
include("${CMAKE_SOURCE_DIR}/cmake/modules/CMakeFindM.cmake")
set(deps "glfw3" "GLEW::GLEW" "OpenGL::GL" "${M_LIBRARIES}")
set(deps "glfw" "GLEW::GLEW" "OpenGL::GL" "${M_LIBRARIES}")
if (APPLE)
#SET(GUI_TYPE MACOSX_BUNDLE)
#INCLUDE_DIRECTORIES ( /Developer/Headers/FlatCarbon )

View File

@ -65,8 +65,7 @@ function (omit_includes new_file_contents file_contents blacklist)
endfunction (omit_includes new_file_contents file_contents blacklist)
function (fix_comments new_contents contents)
# TODO: Fix this `fix_comments` implementation
string(REGEX REPLACE "^//\(.*\)" "/*\\1 */" _contents "${contents}")
string(REGEX REPLACE "//(.*)" "/*1 */" _contents "${contents}")
set(${new_contents} "${_contents}" PARENT_SCOPE)
endfunction (fix_comments new_contents contents)
@ -95,7 +94,7 @@ if (BUILD_HEADER_ONLY)
foreach (filename ${priv1})
file(READ "${filename}" file_contents)
omit_includes(new_file_contents
"${file_contents}"
"\n${file_contents}"
"${priv_blacklist}")
string(APPEND amalgam_contents "${new_file_contents}")
endforeach (filename ${priv1})
@ -112,7 +111,7 @@ if (BUILD_HEADER_ONLY)
"${file_contents}"
"${priv_blacklist}")
string(APPEND amalgam_contents "${new_file_contents}")
endforeach (filename ${priv1})
endforeach (filename ${priv2})
set(outro_contents "")
foreach (filename ${outro})
@ -130,8 +129,8 @@ if (BUILD_HEADER_ONLY)
"#ifndef ${macro}_SINGLE_HEADER\n"
" #define ${macro}_SINGLE_HEADER\n"
"#endif\n\n"
"${pub_contents}\n"
"#endif /* ${macro}_SINGLE_HEADER */\n\n"
"${pub_contents}"
#"#endif /* ${macro}_SINGLE_HEADER */\n\n"
"#ifdef ${macro}_IMPLEMENTATION\n"
"${amalgam_contents}"