-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-added CMake helper functions located in hypertextcpp.cmake;
-added unnamed namespace usage to shared lib renderer; -cleaned up codebase; -updated readme; -set version to v1.2.0;
- Loading branch information
1 parent
8e36030
commit 465fc96
Showing
17 changed files
with
175 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
function(hypertextcpp_GenerateHeader) | ||
cmake_parse_arguments( | ||
ARG | ||
"" | ||
"NAME" | ||
"FILE;CLASS_NAME;OUTPUT_DIR" | ||
${ARGN} | ||
) | ||
if (NOT ARG_NAME) | ||
message(FATAL_ERROR "[hypertextcpp_GenerateHeader] Argument 'NAME' is missing") | ||
endif() | ||
if (ARG_UNPARSED_ARGUMENTS) | ||
message(FATAL_ERROR "[hypertextcpp_GenerateHeader] Unsupported argument: ${ARG_UNPARSED_ARGUMENTS}") | ||
endif() | ||
|
||
if (ARG_FILE) | ||
set(TEMPLATE_FILE ${ARG_FILE}) | ||
else() | ||
set(TEMPLATE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${ARG_NAME}.htcpp) | ||
endif() | ||
|
||
if (ARG_OUTPUT_DIR) | ||
set(OUTPUT_DIR ${ARG_OUTPUT_DIR}) | ||
else() | ||
set(OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
endif() | ||
|
||
if (ARG_CLASS_NAME) | ||
add_custom_command( | ||
OUTPUT ${ARG_NAME}.h | ||
COMMAND hypertextcpp ${TEMPLATE_FILE} -o ${OUTPUT_DIR}/${ARG_NAME}.h -c ${ARG_CLASS_NAME} | ||
DEPENDS ${TEMPLATE_FILE} | ||
VERBATIM | ||
) | ||
else() | ||
add_custom_command( | ||
OUTPUT ${ARG_NAME}.h | ||
COMMAND hypertextcpp ${TEMPLATE_FILE} -o ${OUTPUT_DIR}/${ARG_NAME}.h | ||
DEPENDS ${TEMPLATE_FILE} | ||
VERBATIM | ||
) | ||
endif() | ||
endfunction() | ||
|
||
function(hypertextcpp_BuildSharedLibrary) | ||
cmake_parse_arguments( | ||
ARG | ||
"" | ||
"NAME" | ||
"FILE;OUTPUT_DIR" | ||
${ARGN} | ||
) | ||
if (NOT ARG_NAME) | ||
message(FATAL_ERROR "[hypertextcpp_BuildSharedLibrary] Argument 'NAME' is missing") | ||
endif() | ||
if (ARG_UNPARSED_ARGUMENTS) | ||
message(FATAL_ERROR "[hypertextcpp_BuildSharedLibrary] Unsupported argument: ${ARG_UNPARSED_ARGUMENTS}") | ||
endif() | ||
|
||
if (ARG_FILE) | ||
set(TEMPLATE_FILE ${ARG_FILE}) | ||
else() | ||
set(TEMPLATE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${ARG_NAME}.htcpp) | ||
endif() | ||
|
||
add_custom_command( | ||
OUTPUT ${ARG_NAME}.cpp | ||
COMMAND hypertextcpp ${TEMPLATE_FILE} -o ${CMAKE_CURRENT_BINARY_DIR}/${ARG_NAME}.cpp -s | ||
DEPENDS ${TEMPLATE_FILE} | ||
VERBATIM | ||
) | ||
|
||
add_library(${ARG_NAME} SHARED ${CMAKE_CURRENT_BINARY_DIR}/${ARG_NAME}.cpp) | ||
target_compile_features(${ARG_NAME} PUBLIC cxx_std_11) | ||
target_compile_definitions(${ARG_NAME} PUBLIC "HYPERTEXTCPP_EXPORT") | ||
set_target_properties(${ARG_NAME} PROPERTIES CXX_EXTENSIONS OFF) | ||
if (ARG_OUTPUT_DIR) | ||
set_target_properties(${ARG_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ARG_OUTPUT_DIR}) | ||
endif() | ||
endfunction() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
#include "errors.h" | ||
#include "utils.h" | ||
#include <utility> | ||
#include <gsl/gsl> | ||
|
||
namespace htcpp{ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.