diff --git a/CMakeInstall.txt.tmpl b/CMakeInstall.txt.tmpl deleted file mode 100644 index c19b2b2..0000000 --- a/CMakeInstall.txt.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -# Install the library -pragma_install_lib("${CMAKE_CURRENT_BINARY_DIR}/modules/{{ tmplr.module_name }}/${PR_MODULE_INSTALL_SUBDIR}/${OS_LIB_BIN_PRE}{{ tmplr.module_name }}${OS_LIB_BIN_EXT}" "{{ tmplr.install_directory }}") diff --git a/CMakeLists.txt.tmpl b/CMakeLists.txt.tmpl index b88ccb2..d2bd325 100644 --- a/CMakeLists.txt.tmpl +++ b/CMakeLists.txt.tmpl @@ -1,10 +1,18 @@ -cmake_minimum_required(VERSION 3.12) - -include("./CMakeShared.txt") +include(${CMAKE_SOURCE_DIR}/cmake/pr_common.cmake) set(PROJ_NAME {{ tmplr.module_name }}) +set(MODULE_TYPE {{ tmplr.module_type }}) + +pr_add_library(${PROJ_NAME} SHARED) + +pr_add_dependency(${PROJ_NAME} shared TARGET PUBLIC) +if("${MODULE_TYPE}" STREQUAL "client") + pr_add_dependency(${PROJ_NAME} client TARGET PUBLIC) +elif("${MODULE_TYPE}" STREQUAL "server") + pr_add_dependency(${PROJ_NAME} server TARGET PUBLIC) +endif() -project(${PROJ_NAME} CXX) +pr_add_headers(${PROJ_NAME} "include/") +pr_add_sources(${PROJ_NAME} "src/") -link_generic_module_libraries() -register_pragma_module(${PROJ_NAME}) +pr_finalize(${PROJ_NAME}) diff --git a/Install.cmake.tmpl b/Install.cmake.tmpl new file mode 100644 index 0000000..26c65af --- /dev/null +++ b/Install.cmake.tmpl @@ -0,0 +1,2 @@ +# Install the library +pr_install_targets({{ tmplr.module_name }} INSTALL_DIR "{{ tmplr.install_directory }}") diff --git a/template_pragma_module.json b/template_pragma_module.json index 4a79409..6a2866e 100644 --- a/template_pragma_module.json +++ b/template_pragma_module.json @@ -1,6 +1,7 @@ { "name": "Project Name", "module_name": "pr_module", + "module_type": "shared", "install_directory": "modules/", "release_directory": "" }